Commit 9263beb0 by s_guodong

动态面板

parent 34123856
......@@ -245,14 +245,6 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
if (cifno.length() > 10) {
return "客户号cifno不能超过10";
}
String id = requestBaseVo.getId();
if (StringUtils.isBlank(id)) {
return "业务主键id不能为空";
}
baseVO.setId(id);
if (id.length() > 8) {
return "业务主键id不能超过8";
}
String userid = requestBaseVo.getUserid();
if (StringUtils.isBlank(userid)) {
return "用户userid不能为空";
......
......@@ -18,10 +18,6 @@ import java.io.Serializable;
@Data
public class RequestBaseVo implements Serializable {
@Length(max = 8, message = "长度最大8")
@Need
private String id;
@Length(max = 10, message = "长度最大10")
@Need
private String cifno;
......
package com.brilliance.mda.runtime.mda.snapshot;
import com.brilliance.mda.runtime.mda.IModule;
import com.brilliance.mda.runtime.mda.IPanel;
import com.brilliance.mda.runtime.mda.impl.ModuleList;
import com.brilliance.mda.runtime.mda.snapshot.bo.ValueVo;
import com.brilliance.mda.runtime.mda.snapshot.bo.pack.*;
......@@ -74,6 +75,7 @@ public class SnapshotServiceImpl implements SnapshotService {
List<TextboxBo> xdecimalboxList;
List<CheckboxBo> checkboxList;
List<ListboxBo> listboxList;
List<IncludeBo> includeBoList;
BorderlayoutBo borderlayoutBo = documentBo.getBorderlayoutBo();
if (borderlayoutBo != null) {
CenterBo centerBo = borderlayoutBo.getCenterBo();
......@@ -85,6 +87,7 @@ public class SnapshotServiceImpl implements SnapshotService {
xdecimalboxList = divBo.getXdecimalboxList();
checkboxList = divBo.getCheckboxList();
listboxList = divBo.getListboxBoList();
includeBoList = divBo.getIncludeBoList();
} else {
textboxList = documentBo.getTextboxList();
labelList = documentBo.getLabelList();
......@@ -93,6 +96,7 @@ public class SnapshotServiceImpl implements SnapshotService {
xdecimalboxList = documentBo.getXdecimalboxList();
checkboxList = documentBo.getCheckboxList();
listboxList = documentBo.getListboxBoList();
includeBoList = documentBo.getIncludeBoList();
}
PackDivBo packDivBo = new PackDivBo();
......@@ -117,6 +121,9 @@ public class SnapshotServiceImpl implements SnapshotService {
// listboxList
packDivBo.setListboxBoList(handleListboxList(listboxList, parent));
// includeList
packDivBo.setWindowBoList(handleIncludeList(includeBoList, parent));
// 组成xml需要的实体
PackBorderlayoutBo packBorderlayoutBo = new PackBorderlayoutBo();
PackCenterBo packCenterBo = new PackCenterBo();
......@@ -501,6 +508,119 @@ public class SnapshotServiceImpl implements SnapshotService {
/**
* 处理include标签
*
* @param includeBoList
* @param parent
* @return
*/
private List<PackWindowBo> handleIncludeList(List<IncludeBo> includeBoList, IModule parent) {
List<PackWindowBo> list = new ArrayList<>();
if (includeBoList == null) {
return list;
}
for (IncludeBo includeBo : includeBoList) {
List<CustomAttributes> customAttributes = includeBo.getCustomAttributes();
CustomAttributes attributeValue = getAttributeValue(customAttributes);
String fieldUrl = attributeValue.getFieldUrl();
// 通过路径获取面板 解析面板
DocumentBo documentBo = unpackSubTemplate(fieldUrl, parent);
// 打包
PackWindowBo data = packSubTemplate(documentBo, parent);
data.setStyle(includeBo.getStyle());
list.add(data);
}
return list;
}
/**
* 打包子面板
*
* @param documentBo
* @param parent
* @return
*/
private PackWindowBo packSubTemplate(DocumentBo documentBo, IModule parent) {
List<TextboxBo> textboxList;
List<LabelBo> labelList;
List<TextboxBo> xcomboboxList;
List<TextboxBo> xdateboxList;
List<TextboxBo> xdecimalboxList;
List<CheckboxBo> checkboxList;
List<ListboxBo> listboxList;
List<IncludeBo> includeBoList;
BorderlayoutBo borderlayoutBo = documentBo.getBorderlayoutBo();
if (borderlayoutBo != null) {
CenterBo centerBo = borderlayoutBo.getCenterBo();
DivBo divBo = centerBo.getDivBo();
textboxList = divBo.getTextboxList();
labelList = divBo.getLabelList();
xcomboboxList = divBo.getXcomboboxList();
xdateboxList = divBo.getXdateboxList();
xdecimalboxList = divBo.getXdecimalboxList();
checkboxList = divBo.getCheckboxList();
listboxList = divBo.getListboxBoList();
includeBoList = divBo.getIncludeBoList();
} else {
textboxList = documentBo.getTextboxList();
labelList = documentBo.getLabelList();
xcomboboxList = documentBo.getXcomboboxList();
xdateboxList = documentBo.getXdateboxList();
xdecimalboxList = documentBo.getXdecimalboxList();
checkboxList = documentBo.getCheckboxList();
listboxList = documentBo.getListboxBoList();
includeBoList = documentBo.getIncludeBoList();
}
PackWindowBo packWindowBo = new PackWindowBo();
// textbox
packWindowBo.setTextboxBoList(handleTextbox(textboxList));
// labelList
packWindowBo.setLabelBoList(handleLabelList(labelList));
// xComboboxList
packWindowBo.setComboboxBoList(handlexComboboxList(xcomboboxList));
// xdateboxList
packWindowBo.setDateboxBoList(handleXdateboxList(xdateboxList));
// xdecimalboxList
packWindowBo.setDecimalboxBoList(handleXdecimalboxList(xdecimalboxList));
// checkboxList
packWindowBo.setCheckboxBoList(handleCheckboxList(checkboxList));
// listboxList
packWindowBo.setListboxBoList(handleListboxList(listboxList, parent));
// includeList
packWindowBo.setWindowBoList(handleIncludeList(includeBoList, parent));
return packWindowBo;
}
/**
* 解析子面板
*
* @param fieldUrl
* @param parent
* @return
*/
private DocumentBo unpackSubTemplate(String fieldUrl, IModule parent) {
Set<ValueVo> set = new HashSet<>();
set.add(new ValueVo(fieldUrl));
Map<String, Object> valueMap = getValueMap(set, parent);
if (valueMap.get(fieldUrl) instanceof IPanel) {
IPanel panel = (IPanel) valueMap.get(fieldUrl);
return unpackTemplate(panel.getPath());
}
log.warn("找不到子面板:{}", parent.getName() + "." + fieldUrl);
return new DocumentBo();
}
/**
* 获取列表中的值
*
* @param fieldUrl
......
......@@ -39,5 +39,6 @@ public class PackDivBo {
@XmlElement(name = "listbox")
private List<PackListboxBo> listboxBoList;
@XmlElement(name = "window")
private List<PackWindowBo> windowBoList;
}
package com.brilliance.mda.runtime.mda.snapshot.bo.pack;
import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/16
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "window")
@Data
public class PackWindowBo {
@XmlAttribute(name = "style")
private String style;
@XmlElement(name = "label")
private List<PackLabelBo> labelBoList;
@XmlElement(name = "textbox")
private List<PackTextboxBo> textboxBoList;
@XmlElement(name = "decimalbox")
private List<PackDecimalboxBo> decimalboxBoList;
@XmlElement(name = "combobox")
private List<PackComboboxBo> comboboxBoList;
@XmlElement(name = "datebox")
private List<PackDateboxBo> dateboxBoList;
@XmlElement(name = "checkbox")
private List<PackCheckboxBo> checkboxBoList;
@XmlElement(name = "listbox")
private List<PackListboxBo> listboxBoList;
@XmlElement(name = "window")
private List<PackWindowBo> windowBoList;
}
......@@ -39,4 +39,7 @@ public class DivBo {
@XmlElement(name = "listbox")
private List<ListboxBo> listboxBoList;
@XmlElement(name = "include")
private List<IncludeBo> includeBoList;
}
......@@ -39,6 +39,9 @@ public class DocumentBo {
@XmlElement(name = "listbox")
private List<ListboxBo> listboxBoList;
@XmlElement(name = "include")
private List<IncludeBo> includeBoList;
@XmlElement(name = "borderlayout")
private BorderlayoutBo borderlayoutBo;
}
package com.brilliance.mda.runtime.mda.snapshot.bo.unpack;
import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/16
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "include")
@Data
public class IncludeBo {
@XmlElement(name = "custom-attributes")
private List<CustomAttributes> customAttributes;
@XmlAttribute(name = "style")
private String style;
}
......@@ -10,7 +10,6 @@ public class BaseVO {
protected String src;
protected String transid;
protected String userid;
protected String id;
protected String cifno;
protected String pageId;
public Long total;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment