处理表单标准选择类型

This commit is contained in:
liyawei
2022-04-02 20:32:59 +08:00
parent 3942ed2bb9
commit 1cb6207016
@@ -223,7 +223,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if ("TEXT".equals(valEO.getType())) {
valContent = "<p>" + valEO.getItemContent() + "</p>";
} else if ("IMG".equals(valEO.getType())) {
if(!valEO.getItemContent().contains("uploadPath")) {
if(!valEO.getItemContent().contains("<img")) {
String ossFileId = valEO.getItemContent();
OSSFile ossFile = ossFileService.getById(ossFileId);
String url = ossFile.getUrl();
@@ -321,12 +321,20 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
// 人员选择类型
List<OnlCgformField> onlFieldPersonList = fieldList.stream().filter(e -> FieldTypeEnum.PERSON.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
List<String> fieldPersonList = onlFieldPersonList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
// 标准选择类型
List<OnlCgformField> onlFieldStanList = fieldList.stream().filter(e -> FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
List<String> fieldStanList = onlFieldStanList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
List<String> fieldPersonIdList = new ArrayList<>();
fieldPersonList.forEach(item->{
String fieldPersonId = item + "_id";
fieldPersonIdList.add(fieldPersonId);
});
List<String> standardIdList = new ArrayList<>();
fieldStanList.forEach(item->{
String fieldStanId = item + "_id";
standardIdList.add(fieldStanId);
});
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
@@ -360,8 +368,8 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else {
valuesBuilder.append("," + "'" + value + "'");
}
} else if(fieldPersonList.contains(key)){
// 人员选择类型
} else if(fieldPersonList.contains(key) || fieldStanList.contains(key)){
// 人员选择类型 标准选择类型
if(ObjectUtil.isNotNull(parameter.get(key+"_id"))) {
value = parameter.get(key + "_id");
}
@@ -668,7 +676,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
for (OnlCgformField onlCgformField : formFieldList){
String fieldType = onlCgformField.getFieldShowType();
String dbFieldName = onlCgformField.getDbFieldName();
if (FieldTypeEnum.FILE.getValue().equals(fieldType)) {
if (FieldTypeEnum.TREE.getValue().equals(fieldType)) {
if (StringUtils.isNotBlank(itemsMap.get(dbFieldName).toString())) {
String[] values = itemsMap.get(dbFieldName).toString().split(",");
itemsMap.put(dbFieldName, values);
@@ -2042,13 +2050,17 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
int count = 3;
if (pullSingleList.size() != 0) {
//单选
String pullSingle = StringUtils.join(pullSingleList, ",") + "字段单选属性,必须和系统中的对应字段选项相匹配\n";
String pullSingle = StringUtils.join(pullSingleList, ",") + "字段单选属性,必须和系统中的对应字段选项相匹配\n";
sbTwo.append(count++ + "." + pullSingle);
}
if (textNumberList.size() != 0) {
//单选
String textNumber = StringUtils.join(textNumberList, ",") + "字段仅能填写数字,负数,小数\n";
sbTwo.append(count++ + "." + textNumber);
}
if (pullMoreList.size() != 0) {
//多选
String pullMore = StringUtils.join(pullMoreList, ",") + "字段多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n";
String pullMore = StringUtils.join(pullMoreList, ",") + "字段多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n";
sbTwo.append(count++ + "." + pullMore);
}
if (dateSingleList.size() != 0) {
@@ -2056,6 +2068,11 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
String dateSingle = StringUtils.join(dateSingleList, ",") + "字段为日期,必须精确到日\n";
sbTwo.append(count++ + "." + dateSingle);
}
if (dateMoreList.size() != 0) {
//多选日期
String dateSingle = StringUtils.join(dateSingleList, ",") + "字段为日期,必须精确到日,可填写多个,填写多个时采用英文或中文逗号分割\n";
sbTwo.append(count++ + "." + dateSingle);
}
if (textStringList.size() != 0) {
//输入框
String textString = StringUtils.join(textStringList, ",") + "字段为文本,填写文本内容\n";