Merge remote-tracking branch 'origin/dev_20230831_problem' into dev_20230831_problem

This commit is contained in:
zyx.net
2023-09-07 09:08:22 +08:00
3 changed files with 61 additions and 8 deletions
@@ -6,6 +6,7 @@ package com.jero.modules.system.enums;
public enum DicCodeEnum {
REGION("适用地区","1493782108399820801","region"),
DUTY_TERRITORY("责任领域","1513417672023441409","duty_territory"),
PROBLEM_TYPE("问题类型","1697066042058821634","wen4_ti2_lei4_xing2"),
;
String name;
@@ -158,7 +158,7 @@
#{item}
</foreach>
) temp
<include refid="BaseQuerySql"/>
<!--<include refid="BaseQuerySql"/>-->
<if test="params.orderByField != null and params.orderByField != ''">
order by temp.${params.orderByField}
<if test="params.orderBy == 1">
@@ -10321,6 +10321,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
dataMap.put("lawsName",dataMap.get("serialNumber"));
//相关项目(旧数据的未符合项都是属于这一个项目的)
dataMap.put("projectName",params.get("projectName"));
dataMap.put("projectid",params.get("projectLibraryId"));
//创建时间
dataMap.put("createTime",dataMap.get("createTime"));
//更新时间
@@ -10398,13 +10399,25 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
}
}
//旧数据查询
result = dataParameter(params, result);
//新数据
List<Map<String, Object>> mapList = getNewData(params, cut);
if(ObjectUtils.isNotEmpty(mapList)){
result.addAll(mapList);
}
return result;
}
@NotNull
private List<Map<String, Object>> getNewData(Map<String, Object> params, String cut) {
//新数据
LambdaQueryWrapper<ProblemManagementEO> wrapper = new LambdaQueryWrapper<>();
wrapper.like(ProblemManagementEO::getProjectId,params.get("projectLibraryId"));
List<ProblemManagementEO> managementEOList = problemManagementEOService.list(wrapper);
//法规
List<String> lawsIdList = managementEOList.stream()
.filter(e->StringUtils.isNotBlank(e.getLawsId())).map(ProblemManagementEO::getLawsId).collect(Collectors.toList());
.filter(e-> StringUtils.isNotBlank(e.getLawsId())).map(ProblemManagementEO::getLawsId).collect(Collectors.toList());
//项目
List<String> projectIdList = managementEOList.stream()
.filter(e->StringUtils.isNotBlank(e.getProjectId())).map(ProblemManagementEO::getProjectId).collect(Collectors.toList());
@@ -10449,6 +10462,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
projectLibraryBaseList = problemManagementEOMapper.queryByIds(StringUtils.join(projectIdSet,","));
}
}
List<DictModel> problemTypeList = sysDictService.queryDictItemsByCode(DicCodeEnum.PROBLEM_TYPE.getCode());
List<NcrTrackVO> ncrTrackVOList = new ArrayList<>();
List<Map<String,Object>> mapList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -10464,7 +10479,19 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
map.put("createBy",problemManagementEO.getCreateBy());
map.put("createTime",sdf.format(problemManagementEO.getCreateTime()));
map.put("updateTime",sdf.format(problemManagementEO.getUpdateTime()));
map.put("flag",DataEnum.OLD.getValue());
map.put("uuid",problemManagementEO.getId());
map.put("id",problemManagementEO.getId());
map.put("flag",DataEnum.NEW.getValue());
List<DictModel> dictModelList = problemTypeList.stream().filter(e -> e.getValue().equals(problemManagementEO.getProblemType())).collect(Collectors.toList());
if(!dictModelList.isEmpty()){
if(CutEnum.CN.getValue().equals(cut)){
map.put("problemType_dictText",dictModelList.get(0).getText());
}else{
map.put("problemType_dictText",dictModelList.get(0).getTextEn());
}
}
//相关法规
if(StringUtils.isNotBlank(problemManagementEO.getLawsId())){
if(!documentLibraryEOList.isEmpty()){
@@ -10558,8 +10585,6 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
map.put("approvalEvidence",problemManagementEO.getApprovalEvidence());
}
map.put("uuid",problemManagementEO.getId());
map.put("flag",DataEnum.NEW.getValue());
mapList.add(map);
NcrTrackVO ncrTrackVOTemp = new NcrTrackVO();
BeanUtils.copyProperties(problemManagementEO,ncrTrackVOTemp);
@@ -10567,10 +10592,37 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
ncrTrackVOTemp.setFlag(DataEnum.NEW.getValue());
ncrTrackVOList.add(ncrTrackVOTemp);
}
if(ObjectUtils.isNotEmpty(mapList)){
result.addAll(mapList);
//查询条件
mapList = dataParameter(params, mapList);
return mapList;
}
private List<Map<String, Object>> dataParameter(Map<String, Object> params, List<Map<String, Object>> mapList) {
if(ObjectUtils.isNotEmpty(params.get("title"))){//标题
mapList = mapList.stream().filter(e->ObjectUtils.isNotEmpty(e.get("title"))
&& e.get("title").toString().contains(params.get("title").toString())).collect(Collectors.toList());
}
return result;
if(ObjectUtils.isNotEmpty(params.get("lawsName"))){//相关法规
mapList = mapList.stream().filter(e->ObjectUtils.isNotEmpty(e.get("lawsName"))
&& e.get("lawsName").toString().contains(params.get("lawsName").toString())).collect(Collectors.toList());
}
if(ObjectUtils.isNotEmpty(params.get("projectId"))){//相关项目
mapList = mapList.stream().filter(e->ObjectUtils.isNotEmpty(e.get("projectId"))
&& String.valueOf(e.get("projectId")).equals(String.valueOf(params.get("projectId")))).collect(Collectors.toList());
}
if(ObjectUtils.isNotEmpty(params.get("problemType"))){//问题类型
mapList = mapList.stream().filter(e->ObjectUtils.isNotEmpty(e.get("problemType"))
&& e.get("problemType").toString().equals(params.get("problemType").toString())).collect(Collectors.toList());
}
if(ObjectUtils.isNotEmpty(params.get("dutyTerritory"))){//责任领域
mapList = mapList.stream().filter(e->ObjectUtils.isNotEmpty(e.get("dutyTerritory"))
&& e.get("dutyTerritory").toString().contains(params.get("dutyTerritory").toString())).collect(Collectors.toList());
}
if(ObjectUtils.isNotEmpty(params.get("problemState"))){//问题状态
mapList = mapList.stream().filter(e->ObjectUtils.isNotEmpty(e.get("problemState"))
&& e.get("problemState").toString().contains(params.get("problemState").toString())).collect(Collectors.toList());
}
return mapList;
}
@Override