【修改】处理详情页面,id不存在时的报错
【修改】处理新增时,数字输入框不填写导致的bug
This commit is contained in:
+46
-36
@@ -721,13 +721,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
public List<Map<String, Object>> getInfoById(String id, String cut) {
|
||||
//通过id查询数据
|
||||
List<Map<String, Object>> dataList = bussDocumentLibraryEOMapper.selectMapsAll(id);
|
||||
|
||||
List<Map<String, Object>> result = new ArrayList<>(); // 要返回的结果
|
||||
if (dataList.isEmpty()){
|
||||
// 取不到数据,直接返回空结果
|
||||
return result;
|
||||
}
|
||||
|
||||
//查询所有
|
||||
List<Map<String, Object>> mapList = bussDocumentLibraryEOMapper.selectMapsAll(null);
|
||||
|
||||
//原始对应标准,代替标准,被代替标准(原始数据存的是iD)
|
||||
String correspondingStandardId = "";
|
||||
String replaceStandardId = "";//代替标准
|
||||
if (dataList.size() != 0) {
|
||||
if (!dataList.isEmpty()) {
|
||||
correspondingStandardId = (String) dataList.get(0).get("corresponding_standard");//对应标准
|
||||
replaceStandardId = (String) dataList.get(0).get("replace_standard");//代替标准
|
||||
}
|
||||
@@ -886,7 +893,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//过滤出表单字段(is_show_form-->表单是否显示0否 1是)
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
|
||||
}
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
|
||||
for (OnlCgformArea onlCgformAreaTemp : areaList) {
|
||||
String areaName = "";
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
@@ -1138,44 +1145,47 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//es全文新增数据(数据转换)
|
||||
esFullText(cut, fieldList, categoryList, dictItemList, mapList, sbCn,sbEn, entry);
|
||||
|
||||
//处理日期格式
|
||||
if (fieldDateList.contains(key)) {
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
value = "str_to_date('" + value + "','%Y-%m-%d %H:%i:%s')";
|
||||
} else {
|
||||
value = null;
|
||||
}
|
||||
valuesBuilder.append("," + value);
|
||||
} else {
|
||||
//处理文件类型
|
||||
List<OnlCgformField> fieldFile = null;
|
||||
try {
|
||||
fieldFile = fieldFileList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
|
||||
String valueTemp = UUID.randomUUID().toString().replace("-", "");
|
||||
stringObjectMap.put(key,valueTemp);
|
||||
// value = valueTemp;
|
||||
//修改文件表关联信息connect_id
|
||||
List<OSSFile> oSSFileList = new ArrayList<>();
|
||||
for (String fileId : value.toString().split(",")) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setId(fileId);
|
||||
ossFile.setConnectId(valueTemp);
|
||||
oSSFileList.add(ossFile);
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
//处理日期格式
|
||||
if (fieldDateList.contains(key)) {
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
value = "str_to_date('" + value + "','%Y-%m-%d %H:%i:%s')";
|
||||
} else {
|
||||
value = null;
|
||||
}
|
||||
if (oSSFileList.size() != 0) {
|
||||
oSSFileAll.addAll(oSSFileList);
|
||||
}
|
||||
iOSSFileService.updateFileInfo(oSSFileList);
|
||||
valuesBuilder.append("," + "'" + valueTemp + "'");
|
||||
valuesBuilder.append("," + value);
|
||||
} else {
|
||||
valuesBuilder.append("," + "'" + value + "'");
|
||||
//处理文件类型
|
||||
List<OnlCgformField> fieldFile = null;
|
||||
try {
|
||||
fieldFile = fieldFileList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
|
||||
String valueTemp = UUID.randomUUID().toString().replace("-", "");
|
||||
stringObjectMap.put(key,valueTemp);
|
||||
// value = valueTemp;
|
||||
//修改文件表关联信息connect_id
|
||||
List<OSSFile> oSSFileList = new ArrayList<>();
|
||||
for (String fileId : value.toString().split(",")) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setId(fileId);
|
||||
ossFile.setConnectId(valueTemp);
|
||||
oSSFileList.add(ossFile);
|
||||
}
|
||||
if (oSSFileList.size() != 0) {
|
||||
oSSFileAll.addAll(oSSFileList);
|
||||
}
|
||||
iOSSFileService.updateFileInfo(oSSFileList);
|
||||
|
||||
valuesBuilder.append("," + "'" + valueTemp + "'");
|
||||
} else {
|
||||
valuesBuilder.append("," + "'" + value + "'");
|
||||
}
|
||||
}
|
||||
fieldsBuilder.append("," + key);
|
||||
}
|
||||
fieldsBuilder.append("," + key);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user