feat(REQ-5965) - 调整单选复现条件的存储模式
This commit is contained in:
parent
a7dc35862a
commit
34d4cdea1e
@ -118,7 +118,7 @@ public interface BpmnConstants {
|
||||
String CONFIG_FIELD_META = "field";
|
||||
String CONFIG_FIELD_PERMISSION = "fieldPermission";
|
||||
String CONFIG_CONDITION_PERMISSION = "conditionPermission";
|
||||
String CONFIG_FIELD_OPTION = "option";
|
||||
String CONFIG_FIELD_OPTIONS = "options";
|
||||
String CONFIG_NODE_TYPE = "nodeType";
|
||||
String CONFIG_BUTTON_TYPE_INITIATOR = "initiator";
|
||||
String CONFIG_BUTTON_TYPE_CURRENT = "current";
|
||||
|
||||
@ -27,7 +27,7 @@ public class BpmnFieldOptionConf implements Serializable {
|
||||
* 选项的值
|
||||
*/
|
||||
@ApiModelProperty(value = "选项的值", example = "1")
|
||||
private String value;
|
||||
private Object value;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
@ -37,11 +37,11 @@ public class BpmnFieldOptionConf implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
public void setValue(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_BUTTON_TYPE_
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_BUTTON_TYPE_INITIATOR;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_META;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTIONS;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_NOTICE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_SIGN;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_SIGN_TYPE;
|
||||
@ -346,22 +346,10 @@ public final class BpmnJsonConverterUtil {
|
||||
field.addAttribute(fieldCode);
|
||||
|
||||
if (!CollectionUtils.isEmpty(i.getOptions())) {
|
||||
i.getOptions().forEach(j -> {
|
||||
ExtensionElement option = new ExtensionElement();
|
||||
option.setName(CONFIG_FIELD_OPTION);
|
||||
|
||||
ExtensionAttribute optionName = new ExtensionAttribute();
|
||||
optionName.setName(ELEMENT_ATTRIBUTE_NAME);
|
||||
optionName.setValue(j.getName());
|
||||
option.addAttribute(optionName);
|
||||
|
||||
ExtensionAttribute optionValue = new ExtensionAttribute();
|
||||
optionValue.setName(ELEMENT_ATTRIBUTE_VALUE);
|
||||
optionValue.setValue(j.getValue());
|
||||
option.addAttribute(optionValue);
|
||||
|
||||
field.addChildElement(option);
|
||||
});
|
||||
ExtensionAttribute fieldOptions = new ExtensionAttribute();
|
||||
fieldCode.setName(CONFIG_FIELD_OPTIONS);
|
||||
fieldCode.setValue(JSON.toJSONString(i.getOptions()));
|
||||
field.addAttribute(fieldOptions);
|
||||
}
|
||||
fieldConfigElement.addChildElement(field);
|
||||
});
|
||||
|
||||
@ -86,7 +86,7 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_CARBON_COPY_
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_CONDITION_PERMISSION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_META;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTIONS;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_PERMISSION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_INITIATOR_LEADER_RANGE_UNIT;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_INITIATOR_SPECIFIED_EXCLUDE_COOPERATE_TYPES;
|
||||
@ -433,15 +433,9 @@ public final class BpmnMetaParserHelper {
|
||||
conf.setName(i.getAttributeValue(null, ELEMENT_ATTRIBUTE_NAME));
|
||||
conf.setCode(i.getAttributeValue(null, ELEMENT_ATTRIBUTE_CODE));
|
||||
|
||||
List<BpmnFieldOptionConf> options = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(i.getChildElements())) {
|
||||
i.getChildElements().get(CONFIG_FIELD_OPTION).forEach(j -> {
|
||||
BpmnFieldOptionConf option = new BpmnFieldOptionConf();
|
||||
option.setName(j.getAttributeValue(null, ELEMENT_ATTRIBUTE_NAME));
|
||||
option.setValue(j.getAttributeValue(null, ELEMENT_ATTRIBUTE_VALUE));
|
||||
options.add(option);
|
||||
});
|
||||
conf.setOptions(options);
|
||||
String fieldOptionsJsonStr = i.getAttributeValue(null, CONFIG_FIELD_OPTIONS);
|
||||
if (StringUtils.hasText(fieldOptionsJsonStr)) {
|
||||
conf.setOptions(JSON.parseArray(fieldOptionsJsonStr, BpmnFieldOptionConf.class));
|
||||
}
|
||||
|
||||
fields.add(conf);
|
||||
@ -703,6 +697,7 @@ public final class BpmnMetaParserHelper {
|
||||
return defaultValid(flowElement, CONFIG_CONDITION_PERMISSION).map(element -> JSON.parseObject(element.getElementText(), new TypeReference<List<ConditionPermissionMetaInfo>>() {
|
||||
}.getType()));
|
||||
}
|
||||
|
||||
public static Optional<ImmutableTable<String, String, Integer>> getFormFieldPermissionForCalc(FlowElement flowElement) {
|
||||
List<FormPermissionMetaInfo> fieldMetaInfos = getFormFieldPermissionConf(flowElement).orElse(new ArrayList<>());
|
||||
return getFormFieldPermissionForModel(fieldMetaInfos);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user