文档库--分页判空
This commit is contained in:
+1
-1
@@ -220,7 +220,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
|||||||
@AutoLog(value = "新增数据")
|
@AutoLog(value = "新增数据")
|
||||||
@ApiOperation(value="新增数据", notes="新增数据")
|
@ApiOperation(value="新增数据", notes="新增数据")
|
||||||
@PostMapping(value = "/addInfo")
|
@PostMapping(value = "/addInfo")
|
||||||
public Result<?> addInfo(Map<String,Object> map) {
|
public Result<?> addInfo(@RequestBody Map<String,Object> map) {
|
||||||
try {
|
try {
|
||||||
bussDocumentLibraryEOService.addInfo(map);
|
bussDocumentLibraryEOService.addInfo(map);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
+31
-6
@@ -335,6 +335,22 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
valuesBuilder.append(value + ",");
|
valuesBuilder.append(value + ",");
|
||||||
} else {
|
} else {
|
||||||
|
//处理文件类型
|
||||||
|
List<OnlCgformField> fieldFile = fieldFileList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
|
||||||
|
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
|
||||||
|
|
||||||
|
String valueTemp = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
iOSSFileService.updateFileInfo(oSSFileList);
|
||||||
|
}
|
||||||
valuesBuilder.append("'" + value + "'" + ",");
|
valuesBuilder.append("'" + value + "'" + ",");
|
||||||
}
|
}
|
||||||
fieldsBuilder.append(key + ",");
|
fieldsBuilder.append(key + ",");
|
||||||
@@ -352,6 +368,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
String insertValue = valuesBuilder.substring(0, valuesBuilder.length() - 1);
|
String insertValue = valuesBuilder.substring(0, valuesBuilder.length() - 1);
|
||||||
//先删除在新增.
|
//先删除在新增.
|
||||||
// bussDocumentLibraryEOMapper.deleteById((String)dateList.get(0).get("id"));
|
// bussDocumentLibraryEOMapper.deleteById((String)dateList.get(0).get("id"));
|
||||||
|
//删除文件
|
||||||
|
|
||||||
|
//删除文档库数据
|
||||||
bussDocumentLibraryEOMapper.deleteById((String) map.get("id"));
|
bussDocumentLibraryEOMapper.deleteById((String) map.get("id"));
|
||||||
bussDocumentLibraryEOMapper.insertInfo(insertField, insertValue);
|
bussDocumentLibraryEOMapper.insertInfo(insertField, insertValue);
|
||||||
|
|
||||||
@@ -367,8 +386,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IPage getInfoPage(Map<String, Object> parameter) {
|
public IPage getInfoPage(Map<String, Object> parameter) {
|
||||||
//过滤查询条件字段类型使用
|
|
||||||
List<Map<String, Object>> mapList = queryCondition("1");
|
|
||||||
|
|
||||||
|
|
||||||
//需要查询的字段
|
//需要查询的字段
|
||||||
@@ -380,18 +398,26 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
List<String> fieldListTemp = fieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
List<String> fieldListTemp = fieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||||
List<String> fieldListNew = new ArrayList<>();
|
List<String> fieldListNew = new ArrayList<>();
|
||||||
fieldListNew.add("id");
|
fieldListNew.add("id");
|
||||||
//转时间格式
|
//转时间格式 case when region is null then "" else region end region
|
||||||
for (String field : fieldListTemp) {
|
for (String field : fieldListTemp) {
|
||||||
|
String fieldTemp = null;
|
||||||
if ("issue_time".equals(field) || "implement_time".equals(field)) {
|
if ("issue_time".equals(field) || "implement_time".equals(field)) {
|
||||||
fieldListNew.add("date_format(" + field + ", '%Y-%m-%d %H:%i:%s')");
|
String fieldNew = "date_format(" + field + ", '%Y-%m-%d %H:%i:%s')";
|
||||||
|
fieldTemp = "case when "+fieldNew+" is null then \"\" else "+fieldNew+" end "+ field;
|
||||||
|
fieldListNew.add(fieldTemp);
|
||||||
} else {
|
} else {
|
||||||
fieldListNew.add(field);
|
fieldTemp = "case when "+field+" is null then \"\" else "+field+" end "+ field;
|
||||||
|
fieldListNew.add(fieldTemp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询条件
|
//查询条件
|
||||||
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
||||||
|
|
||||||
|
//过滤查询条件字段类型使用
|
||||||
|
List<Map<String, Object>> mapList = queryCondition("1");
|
||||||
|
|
||||||
|
//查询条件处理
|
||||||
if (ObjectUtils.isNotEmpty(parameter)) {
|
if (ObjectUtils.isNotEmpty(parameter)) {
|
||||||
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
|
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
@@ -418,7 +444,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
conditionSb.append(" and " + key + " in(" + substring + ")");
|
conditionSb.append(" and " + key + " in(" + substring + ")");
|
||||||
|
|
||||||
} else if (FieldTypeEnum.DATE.getValue().equals(fieldType)) {
|
} else if (FieldTypeEnum.DATE.getValue().equals(fieldType)) {
|
||||||
value = "2022-01-24";
|
|
||||||
//日期(区分单日期还时间范围)
|
//日期(区分单日期还时间范围)
|
||||||
if (value.contains(",")) {
|
if (value.contains(",")) {
|
||||||
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
|
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
|
||||||
|
|||||||
Reference in New Issue
Block a user