Browse Source

代码优化

wangchangsheng 1 year ago
parent
commit
12c67db738

+ 3 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/OrganizationEvaluationInfoController.java

@@ -81,16 +81,18 @@ public class OrganizationEvaluationInfoController {
 	/**
 	 * 获取考核指标的详情
 	 * @param organizationEvaluationId
+	 * @param organizationShortName
 	 * @param indicatorId
 	 * @return
 	 */
 	@GetMapping(value = "getEvaluationInfoList")
 	public R getEvaluationInfoList(
 		@RequestParam(value = "organizationEvaluationId", required = false) String organizationEvaluationId,
+		@RequestParam(value = "organizationShortName", required = false) String organizationShortName,
 		@RequestParam(value = "indicatorId", required = false) String indicatorId,
 		@RequestParam(value = "binSection", required = false) String binSection,
 		@RequestParam(value = "binStage", required = false) String binStage) {
-		Map list = organizationEvaluationInfoService.getEvaluationInfoList(organizationEvaluationId, indicatorId,binSection,binStage, request);
+		Map list = organizationEvaluationInfoService.getEvaluationInfoList(organizationEvaluationId,organizationShortName, indicatorId,binSection,binStage, request);
 		return R.ok().data(list);
 	}
 

+ 1 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/dao/OrganizationEvaluationInfoMapper.java

@@ -59,6 +59,7 @@ public interface OrganizationEvaluationInfoMapper extends BaseMapper<Organizatio
 
 
 	List<OrganizationEvaluationInfoResDTO> selectEvaluationInfoList(@Param("organizationEvaluationId") String organizationEvaluationId,
+											@Param("organizationShortName") String organizationShortName,
 											@Param("indicatorId") String indicatorId,
 											@Param("binSection") String binSection,
 											@Param("binStage") String binStage,

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IOrganizationEvaluationInfoService.java

@@ -37,7 +37,7 @@ public interface IOrganizationEvaluationInfoService extends IService<Organizatio
 
 	List<Map> getEvaluationIndicatorList(String organizationEvaluationId, String binSection, String binStage, HttpServletRequest request);
 
-	Map getEvaluationInfoList(String organizationEvaluationId, String indicatorId, String binSection, String binStage,HttpServletRequest request);
+	Map getEvaluationInfoList(String organizationEvaluationId, String organizationShortName,String indicatorId, String binSection, String binStage,HttpServletRequest request);
 
 	boolean updateEvaluationInfo(List<JSONObject> jsonObjects);
 

+ 6 - 6
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java

@@ -385,7 +385,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 	}
 
 	@Override
-	public Map getEvaluationInfoList(String organizationEvaluationId, String indicatorId, String binSection, String binStage, HttpServletRequest request) {
+	public Map getEvaluationInfoList(String organizationEvaluationId,String organizationShortName, String indicatorId, String binSection, String binStage, HttpServletRequest request) {
 
 		Map data = new HashMap();
 
@@ -412,7 +412,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 //		}
 
 		boolean titlemark = true;//标记生成标题
-		List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(organizationEvaluationId, indicatorId,binSection,binStage,"");
+		List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(organizationEvaluationId,organizationShortName, indicatorId,binSection,binStage,"");
 		List<IndicatorDictionary> dictionaryList = indicatorDictionaryService.list("", indicatorId, "", "");
 
 		//根据组织(公司)id分组
@@ -439,7 +439,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 					}
 					titlemap.put("key", d.getOptionName());//名称
 					titlemap.put("code",d.getChildCode()+"_"+d.getOptionCode());//名称
-					titlemap.put("flag", d.getIsQuantified());//是否量化
+					titlemap.put("flag", d.getIsQuantified()?"1":"2");//是否量化
 					titleArray.add(titlemap);
 
 				}
@@ -450,7 +450,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 			List<Map> titlestateArray = new ArrayList<>();
 			deptstateMap.put("key", "填报状态");//名称
 			deptstateMap.put("code","state");//名称
-			deptstateMap.put("flag", false);//是否编辑
+			deptstateMap.put("flag", "3");//是否编辑
 			titlestateArray.add(deptstateMap);
 			title.put("状态", titlestateArray);
 			titlemark = false;
@@ -521,7 +521,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 		Map<String ,List<Map<String,String>>> title = new LinkedHashMap();//标题
 		List<Map<String,String>> mapList = new ArrayList<>();//数据list
 		boolean titlemark = true;//标记生成标题
-		List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(organizationEvaluationId, indicatorId,binSection,binStage,"");
+		List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(organizationEvaluationId, "",indicatorId,binSection,binStage,"");
 		List<IndicatorDictionary> dictionaryList = indicatorDictionaryService.list("", indicatorId, "", "");
 
 		//根据组织(公司)id分组
@@ -896,7 +896,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 
 		for (AddEvaluationInfoDTO addEvaluationInfoDTO : addEvaluationInfoDTOs) {
 
-			List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(addEvaluationInfoDTO.getOrganizationEvaluationId(), addEvaluationInfoDTO.getIndicatorId(),addEvaluationInfoDTO.getBinSection(),addEvaluationInfoDTO.getBinStage(),addEvaluationInfoDTO.getOrganizationId());
+			List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(addEvaluationInfoDTO.getOrganizationEvaluationId(),"", addEvaluationInfoDTO.getIndicatorId(),addEvaluationInfoDTO.getBinSection(),addEvaluationInfoDTO.getBinStage(),addEvaluationInfoDTO.getOrganizationId());
 
 			if(null != infoResDTOList && infoResDTOList.size()>0){
 				throw new CustomException("该组织已存在当前指标");

+ 1 - 4
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationServiceImpl.java

@@ -163,14 +163,13 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
 		List<String> evaluationRuleIds = list.stream().map(OrganizationEvaluationRule::getId).collect(Collectors.toList());
 
 		StringBuilder responsibilityCode = new StringBuilder();
-		responsibilityCode.append(entity.getOrganizationType()).append("_");
 		responsibilityCode.append(entity.getCheckCycle()).append("_");
+		responsibilityCode.append(entity.getYear()).append("_");
 
 		//判断该是否存在目标责任书
 		List<OrganizationEvaluation> oriList = new ArrayList<>();
 		if ("NDKP".equals(entity.getCheckCycle())) {
 			oriList = list("", entity.getCheckCycle(), entity.getYear(), "");
-			responsibilityCode.append(entity.getYear()).append("_");
 			responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(oriList.size() + 1), 4, "l"));
 		}
 		if ("JDKP".equals(entity.getCheckCycle())) {
@@ -179,12 +178,10 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
 //			String month = String.valueOf(Integer.valueOf(entity.getMonth()) * Integer.valueOf(season));//季度考评
 			oriList = list("", entity.getCheckCycle(), entity.getYear(), entity.getMonth());
 			List<OrganizationEvaluation> count = list("", entity.getCheckCycle(), entity.getYear(), "");
-			responsibilityCode.append(entity.getYear()).append("_").append(entity.getMonth()).append("_");
 			responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(count.size() + 1), 4, "l"));
 		}
 		if ("YDKP".equals(entity.getCheckCycle())) {
 			oriList = list("", entity.getCheckCycle(), entity.getYear(), entity.getMonth());
-			responsibilityCode.append(entity.getYear()).append("_").append(entity.getMonth()).append("_");
 			List<OrganizationEvaluation> count = list("", entity.getCheckCycle(), entity.getYear(), "");
 			responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(count.size() + 1), 4, "l"));
 		}

+ 6 - 0
ims-service/ims-eval/src/main/resources/mappers/OrganizationEvaluationInfoMapper.xml

@@ -354,6 +354,12 @@
             </if>
 
 
+            <if test="organizationShortName !=null and organizationShortName !=''">
+                and  oer.organization_short_name  like   CONCAT('%',#{organizationShortName},'%')
+            </if>
+
+
+
 
             and id.option_code not in ('CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','LRGXKHMAX','LRGXKHMIN')
         </where>

+ 1 - 1
ims-service/ims-eval/src/main/resources/mappers/ResponsibilityIndicatorInfoMapper.xml

@@ -197,7 +197,7 @@
             </if>
 
             <if test="organizationShortName !=null and organizationShortName !=''">
-                and oer.organization_short_name like #{organizationShortName}
+                and  oer.organization_short_name  like   CONCAT('%',#{organizationShortName},'%')
             </if>
 
             <if test="binSection !=null and binSection !=''">