diff --git a/src/main/java/neatlogic/module/framework/form/attribute/handler/CheckboxHandler.java b/src/main/java/neatlogic/module/framework/form/attribute/handler/CheckboxHandler.java index b8b2bb94bee2bb8a7070e5036b151e8361c9df0f..9c4357aac183cd107a7a9fa848a4d1b1c149d12c 100644 --- a/src/main/java/neatlogic/module/framework/form/attribute/handler/CheckboxHandler.java +++ b/src/main/java/neatlogic/module/framework/form/attribute/handler/CheckboxHandler.java @@ -19,7 +19,6 @@ package neatlogic.module.framework.form.attribute.handler; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import neatlogic.framework.common.constvalue.ParamType; -import neatlogic.framework.common.dto.ValueTextVo; import neatlogic.framework.form.attribute.core.FormHandlerBase; import neatlogic.framework.form.constvalue.FormConditionModel; import neatlogic.framework.form.constvalue.FormHandler; @@ -92,7 +91,7 @@ public class CheckboxHandler extends FormHandlerBase { @Override public Object textConversionValue(Object text, JSONObject config) { - List list = formService.textConversionValueForSelectHandler(text, config); + JSONArray list = formService.textConversionValueForSelectHandler(text, config); if (CollectionUtils.isEmpty(list)) { return null; } diff --git a/src/main/java/neatlogic/module/framework/form/attribute/handler/RadioHandler.java b/src/main/java/neatlogic/module/framework/form/attribute/handler/RadioHandler.java index f5db49074c7bf1e54320ff4c5e538bd0fb999efe..c30d0b8c45960754de3fbc951ac01636e78aa931 100644 --- a/src/main/java/neatlogic/module/framework/form/attribute/handler/RadioHandler.java +++ b/src/main/java/neatlogic/module/framework/form/attribute/handler/RadioHandler.java @@ -19,7 +19,6 @@ package neatlogic.module.framework.form.attribute.handler; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import neatlogic.framework.common.constvalue.ParamType; -import neatlogic.framework.common.dto.ValueTextVo; import neatlogic.framework.form.attribute.core.FormHandlerBase; import neatlogic.framework.form.constvalue.FormConditionModel; import neatlogic.framework.form.constvalue.FormHandler; @@ -109,7 +108,7 @@ public class RadioHandler extends FormHandlerBase { @Override public Object textConversionValue(Object text, JSONObject config) { - List list = formService.textConversionValueForSelectHandler(text, config); + JSONArray list = formService.textConversionValueForSelectHandler(text, config); if (CollectionUtils.isNotEmpty(list)) { return list.get(0); } diff --git a/src/main/java/neatlogic/module/framework/form/attribute/handler/SelectHandler.java b/src/main/java/neatlogic/module/framework/form/attribute/handler/SelectHandler.java index a04abdf67d83cfa9a710b8d848a03869de8436b5..a8776431e5c019510767f0e9a4da1b27a0799694 100644 --- a/src/main/java/neatlogic/module/framework/form/attribute/handler/SelectHandler.java +++ b/src/main/java/neatlogic/module/framework/form/attribute/handler/SelectHandler.java @@ -19,7 +19,6 @@ package neatlogic.module.framework.form.attribute.handler; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import neatlogic.framework.common.constvalue.ParamType; -import neatlogic.framework.common.dto.ValueTextVo; import neatlogic.framework.form.attribute.core.FormHandlerBase; import neatlogic.framework.form.constvalue.FormConditionModel; import neatlogic.framework.form.constvalue.FormHandler; @@ -203,7 +202,7 @@ public class SelectHandler extends FormHandlerBase { @Override public Object textConversionValue(Object text, JSONObject config) { - List list = formService.textConversionValueForSelectHandler(text, config); + JSONArray list = formService.textConversionValueForSelectHandler(text, config); if (CollectionUtils.isEmpty(list)) { return null; } diff --git a/src/main/java/neatlogic/module/framework/form/service/FormService.java b/src/main/java/neatlogic/module/framework/form/service/FormService.java index cc44a615e97fb1c38143d3027c1dc36af3b9823f..577c97ef0dc8a26dc68708e12ae7dd21ec85f123 100644 --- a/src/main/java/neatlogic/module/framework/form/service/FormService.java +++ b/src/main/java/neatlogic/module/framework/form/service/FormService.java @@ -18,7 +18,6 @@ package neatlogic.module.framework.form.service; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import neatlogic.framework.common.dto.ValueTextVo; import neatlogic.framework.form.dto.AttributeDataVo; import neatlogic.framework.form.dto.FormAttributeVo; import neatlogic.framework.form.dto.FormVersionVo; @@ -45,7 +44,7 @@ public interface FormService { */ JSONArray staticListPasswordEncrypt(JSONArray data, JSONObject config); - List textConversionValueForSelectHandler(Object text, JSONObject config); + JSONArray textConversionValueForSelectHandler(Object text, JSONObject config); /** * 校验表单数据有效性,并针对特殊组件数据进行相应处理,如密码类型组件对数据进行加密处理 diff --git a/src/main/java/neatlogic/module/framework/form/service/FormServiceImpl.java b/src/main/java/neatlogic/module/framework/form/service/FormServiceImpl.java index ac4146ab12448a6237b4587357bea2c7d2170926..8bfcd46a344119b6e64984f1607171a6ff6161a3 100644 --- a/src/main/java/neatlogic/module/framework/form/service/FormServiceImpl.java +++ b/src/main/java/neatlogic/module/framework/form/service/FormServiceImpl.java @@ -333,8 +333,8 @@ public class FormServiceImpl implements FormService, IFormCrossoverService { } @Override - public List textConversionValueForSelectHandler(Object text, JSONObject config) { - List valueList = new ArrayList<>(); + public JSONArray textConversionValueForSelectHandler(Object text, JSONObject config) { + JSONArray valueList = new JSONArray(); if (text == null) { return valueList; } @@ -350,7 +350,10 @@ public class FormServiceImpl implements FormService, IFormCrossoverService { String textStr = (String) text; Object value = valueTextMap.get(textStr); if (value != null) { - valueList.add(new ValueTextVo(value, textStr)); + JSONObject jsonObj = new JSONObject(); + jsonObj.put("value", value); + jsonObj.put("text", textStr); + valueList.add(jsonObj); } return valueList; } else if (text instanceof List) { @@ -361,7 +364,10 @@ public class FormServiceImpl implements FormService, IFormCrossoverService { for (String textStr : textList) { Object value = valueTextMap.get(textStr); if (value != null) { - valueList.add(new ValueTextVo(value, textStr)); + JSONObject jsonObj = new JSONObject(); + jsonObj.put("value", value); + jsonObj.put("text", textStr); + valueList.add(jsonObj); } } return valueList; @@ -379,12 +385,18 @@ public class FormServiceImpl implements FormService, IFormCrossoverService { if (text instanceof String) { String textStr = (String) text; if (Objects.equals(mapping.getText(), mapping.getValue())) { - valueList.add(new ValueTextVo(textStr, textStr)); + JSONObject jsonObj = new JSONObject(); + jsonObj.put("value", textStr); + jsonObj.put("text", textStr); + valueList.add(jsonObj); return valueList; } String value = getValue(matrixUuid, mapping, textStr); if (value != null) { - valueList.add(new ValueTextVo(value, textStr)); + JSONObject jsonObj = new JSONObject(); + jsonObj.put("value", value); + jsonObj.put("text", textStr); + valueList.add(jsonObj); } return valueList; } else if (text instanceof List) { @@ -394,11 +406,17 @@ public class FormServiceImpl implements FormService, IFormCrossoverService { } for (String textStr : textList) { if (Objects.equals(mapping.getText(), mapping.getValue())) { - valueList.add(new ValueTextVo(textStr, textStr)); + JSONObject jsonObj = new JSONObject(); + jsonObj.put("value", textStr); + jsonObj.put("text", textStr); + valueList.add(jsonObj); } else { String value = getValue(matrixUuid, mapping, textStr); if (value != null) { - valueList.add(new ValueTextVo(value, textStr)); + JSONObject jsonObj = new JSONObject(); + jsonObj.put("value", value); + jsonObj.put("text", textStr); + valueList.add(jsonObj); } } }