songwb 6 ヶ月 前
コミット
1f954c2060

+ 26 - 21
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationPortalServiceImpl.java

@@ -48,7 +48,7 @@ public class EvaluationPortalServiceImpl extends ServiceImpl<EvaluationPortalMap
 //	private EvaluationPortalMapper evaluationPortalMapper;
 
 	@Override
-	public Map<String, Object> getPortalData(String binSection, String year, String season,String newyear) {
+	public Map<String, Object> getPortalData(String binSection, String year, String season, String newyear) {
 		Map<String, Object> map = new HashMap<>();
 		Calendar date = Calendar.getInstance();
 		try {
@@ -77,7 +77,7 @@ public class EvaluationPortalServiceImpl extends ServiceImpl<EvaluationPortalMap
 	@Transactional
 	@Override
 	public boolean saveSeasonPerformanceRanking(EvaluationPortal portal, EvaluationPortalAttach attach) {
-		if("FD".equals(portal.getBinSection())){
+		if ("FD".equals(portal.getBinSection())) {
 			portal.setBinSection("XNYFG");
 		}
 		List<EvaluationPortal> portals = getEvaluationPortalList(portal.getYear(), portal.getSeason(), portal.getBinSection(), portal.getMemo1());
@@ -154,37 +154,42 @@ public class EvaluationPortalServiceImpl extends ServiceImpl<EvaluationPortalMap
 			LambdaQueryWrapper<OrganizationEvaluation> eq = lqw.eq(OrganizationEvaluation::getStage, "流程已结束");
 			List<OrganizationEvaluation> list = organizationEvaluationService.list(eq);
 			if (list == null || list.isEmpty()) {
-				hs.put("newyear","");
-				hs.put("year","");
-				hs.put("season","");
+				hs.put("newyear", "2022");
+				hs.put("year", "");
+				hs.put("season", "");
 				return hs;
 			}
 			Map<String, List<OrganizationEvaluation>> cc = list.stream().collect(Collectors.groupingBy(OrganizationEvaluation::getCheckCycle));
 			List<OrganizationEvaluation> jdkp = cc.get("JDKP");
 			List<OrganizationEvaluation> ndkp = cc.get("NDKP");
-			if ((jdkp == null || jdkp.isEmpty())&&(ndkp == null || ndkp.isEmpty())) {
-				hs.put("newyear","");
-				hs.put("year","");
-				hs.put("season","");
+			if ((jdkp == null || jdkp.isEmpty()) && (ndkp == null || ndkp.isEmpty())) {
+				hs.put("newyear", "2022");
+				hs.put("year", "");
+				hs.put("season", "");
 				return hs;
 			}
-			if (jdkp.size() == 1) {
-				hs.put("year",jdkp.get(0).getYear());
-				hs.put("season",jdkp.get(0).getMonth());
-			}else {
+			if (jdkp == null || jdkp.isEmpty()) {
+				hs.put("year", "");
+				hs.put("season", "");
+			} else if (jdkp.size() == 1) {
+				hs.put("year", jdkp.get(0).getYear());
+				hs.put("season", jdkp.get(0).getMonth());
+			} else {
 				Comparator<OrganizationEvaluation> comparator = Comparator.comparing(OrganizationEvaluation::getYear).thenComparing(OrganizationEvaluation::getMonth);
-				Collections.sort(jdkp,comparator.reversed());
+				Collections.sort(jdkp, comparator.reversed());
 				OrganizationEvaluation latestData = jdkp.get(0);
-				hs.put("year",latestData.getYear());
-				hs.put("season",latestData.getMonth());
+				hs.put("year", latestData.getYear());
+				hs.put("season", latestData.getMonth());
 			}
-			if (ndkp.size() == 1) {
-				hs.put("newyear",ndkp.get(0).getYear());
-			}else {
+			if (ndkp == null || ndkp.isEmpty()) {
+				hs.put("newyear", "2022");
+			} else if (ndkp.size() == 1) {
+				hs.put("newyear", ndkp.get(0).getYear());
+			} else {
 				Comparator<OrganizationEvaluation> comparator = Comparator.comparing(OrganizationEvaluation::getYear);
-				Collections.sort(ndkp,comparator.reversed());
+				Collections.sort(ndkp, comparator.reversed());
 				OrganizationEvaluation latestData = ndkp.get(0);
-				hs.put("newyear",latestData.getYear());
+				hs.put("newyear", latestData.getYear());
 			}
 
 //			homeSeason = evaluationPortalMapper.getHomeSeason();