From d1718907321b4100e20abf3fd2ad629859797a20 Mon Sep 17 00:00:00 2001 From: bai <1643359946@qq.com> Date: Wed, 9 Aug 2023 00:40:57 +0800 Subject: [PATCH] =?UTF-8?q?2023=E5=B9=B48=E6=9C=889=E6=97=A5=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/KcExportConfigTpkwcqkjzglx.java | 3 + .../TingKeStatisticsController.java | 85 ++++++++++++------- 2 files changed, 58 insertions(+), 30 deletions(-) diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/config/entity/KcExportConfigTpkwcqkjzglx.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/config/entity/KcExportConfigTpkwcqkjzglx.java index 9253bea6..c6eca3cd 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/config/entity/KcExportConfigTpkwcqkjzglx.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/config/entity/KcExportConfigTpkwcqkjzglx.java @@ -85,4 +85,7 @@ public class KcExportConfigTpkwcqkjzglx implements Serializable { @ApiModelProperty(value = "每学期应听课次数") private java.lang.String ytkcs; + @TableField(exist = false) + private String zwmc; + } diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/statistics/TingKeStatisticsController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/statistics/TingKeStatisticsController.java index 289cabc9..93408962 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/statistics/TingKeStatisticsController.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/statistics/TingKeStatisticsController.java @@ -18,6 +18,8 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx; +import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService; import org.jeecg.modules.kc.grab.SynchronizationService.tools.ChangeTingKeTongJi; import org.jeecg.modules.kc.grab.imports.entity.Xxhbuser; import org.jeecg.modules.kc.grab.imports.service.IXxhbuserService; @@ -27,6 +29,9 @@ import org.jeecg.modules.kc.qa.entity.KcEvaluationans; import org.jeecg.modules.kc.qa.service.IKcEvaluationService; import org.jeecg.modules.kc.tksf.kctksfrzb.entity.KcTksfrzb; import org.jeecg.modules.kc.tksf.kctksfrzb.service.IKcTksfrzbService; +import org.jeecg.modules.kc.tksf.kctksfyq.entity.KcTksfyq; +import org.jeecg.modules.kc.tksf.kctksfyq.service.IKcTksfyqService; +import org.jeecg.modules.tools.DictUtils; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.enmus.ExcelType; @@ -58,6 +63,9 @@ public class TingKeStatisticsController { @Value("${jeecg.path.upload}") private String upLoadPath; + @Autowired + private DictUtils dictUtils; + @Autowired private IKcEvaluationService service; @@ -67,6 +75,9 @@ public class TingKeStatisticsController { @Autowired private IKcTksfrzbService kcTksfrzbService; + @Autowired + private IKcExportConfigTpkwcqkjzglxService kcExportConfigTpkwcqkjzglxService; + @Autowired private IKcXqxnHistoryService kcXqxnHistoryService; @@ -118,9 +129,9 @@ public class TingKeStatisticsController { //按听课身份查询 if(StringUtils.isNotBlank(evaluation.getTksf())){ - QueryWrapper tksfSerachQw = new QueryWrapper<>(); - tksfSerachQw.eq("kc_tksfrzb.ZWMC",evaluation.getTksf()); - List tksfGhList = kcTksfrzbService.list(tksfSerachQw); + QueryWrapper tksfSerachQw = new QueryWrapper<>(); + tksfSerachQw.eq("tklx",evaluation.getTksf()); + List tksfGhList = kcExportConfigTpkwcqkjzglxService.list(tksfSerachQw); if(tksfGhList != null && !tksfGhList.isEmpty()){ Set ghSet = tksfGhList.stream().map(x -> x.getGh()).collect(Collectors.toSet()); queryWrapper.in("a.upuserid",ghSet); @@ -173,28 +184,35 @@ public class TingKeStatisticsController { //---------------------补数据2------------------------------------------ //查询听课身份 - QueryWrapper tksfQw = new QueryWrapper<>(); + QueryWrapper tksfQw = new QueryWrapper<>(); tksfQw.in("gh",tjSet); - List tksfList = kcTksfrzbService.list(tksfQw); - Map tksfMap = Maps.newHashMap(); + List tksfList = kcExportConfigTpkwcqkjzglxService.list(tksfQw); + Map tksfMap = Maps.newHashMap(); tksfList.forEach(x -> { if(tksfMap.containsKey(x.getGh())){ //存在了,拼接职务名称,取最大的听课要求 - KcTksfrzb currentData = tksfMap.get(x.getGh()); + KcExportConfigTpkwcqkjzglx currentData = tksfMap.get(x.getGh()); + String currentTkyq = currentData.getYtkcs(); + String currentTklx = currentData.getTklx(); String currentZwmc = currentData.getZwmc(); - String currentTkyq = currentData.getTkyq(); if(StringUtils.isNotBlank(currentZwmc)){ int tkyq = Integer.parseInt(StringUtils.defaultString(currentTkyq,"0")); - int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTkyq(),"0")); - x.setZwmc(currentZwmc + "、" + x.getZwmc()); + int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTklx(),"0")); + String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx()); + currentData.setZwmc(currentZwmc + "、" + xZwmc); if(tkyq > xtkyq){ - x.setTkyq(String.valueOf(tkyq)); + currentData.setYtkcs(String.valueOf(tkyq)); }else{ - x.setTkyq(String.valueOf(xtkyq)); + currentData.setYtkcs(String.valueOf(xtkyq)); } + }else{ + String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx()); + currentData.setZwmc(xZwmc); } - tksfMap.put(x.getGh(),x); - }else { +// tksfMap.put(x.getGh(),x); + }else{ + String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx()); + x.setZwmc(xZwmc); tksfMap.put(x.getGh(),x); } }); @@ -207,7 +225,7 @@ public class TingKeStatisticsController { // x.setDwmc(currentData.getDwmc()); // } if(tksfMap.containsKey(xuserId)){ - KcTksfrzb currentData = tksfMap.get(xuserId); + KcExportConfigTpkwcqkjzglx currentData = tksfMap.get(xuserId); //tj.setJsxm(currentData.getXm()); x.setTksf(currentData.getZwmc()); //tj.setYskcs(currentData.getTkyq()); @@ -263,9 +281,9 @@ public class TingKeStatisticsController { } //按听课身份查询 if(StringUtils.isNotBlank(evaluation.getTksf())){ - QueryWrapper tksfSerachQw = new QueryWrapper<>(); - tksfSerachQw.eq("kc_tksfrzb.ZWMC",evaluation.getTksf()); - List tksfGhList = kcTksfrzbService.list(tksfSerachQw); + QueryWrapper tksfSerachQw = new QueryWrapper<>(); + tksfSerachQw.eq("tklx",evaluation.getTksf()); + List tksfGhList = kcExportConfigTpkwcqkjzglxService.list(tksfSerachQw); if(tksfGhList != null && !tksfGhList.isEmpty()){ Set ghSet = tksfGhList.stream().map(x -> x.getGh()).collect(Collectors.toSet()); queryWrapper.in("a.upuserid",ghSet); @@ -320,28 +338,35 @@ public class TingKeStatisticsController { //---------------------补数据2------------------------------------------ //查询听课身份 - QueryWrapper tksfQw = new QueryWrapper<>(); + QueryWrapper tksfQw = new QueryWrapper<>(); tksfQw.in("gh",tjSet); - List tksfList = kcTksfrzbService.list(tksfQw); - Map tksfMap = Maps.newHashMap(); + List tksfList = kcExportConfigTpkwcqkjzglxService.list(tksfQw); + Map tksfMap = Maps.newHashMap(); tksfList.forEach(x -> { if(tksfMap.containsKey(x.getGh())){ //存在了,拼接职务名称,取最大的听课要求 - KcTksfrzb currentData = tksfMap.get(x.getGh()); + KcExportConfigTpkwcqkjzglx currentData = tksfMap.get(x.getGh()); + String currentTkyq = currentData.getYtkcs(); + String currentTklx = currentData.getTklx(); String currentZwmc = currentData.getZwmc(); - String currentTkyq = currentData.getTkyq(); if(StringUtils.isNotBlank(currentZwmc)){ int tkyq = Integer.parseInt(StringUtils.defaultString(currentTkyq,"0")); - int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTkyq(),"0")); - x.setZwmc(currentZwmc + "、" + x.getZwmc()); + int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTklx(),"0")); + String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx()); + currentData.setZwmc(currentZwmc + "、" + xZwmc); if(tkyq > xtkyq){ - x.setTkyq(String.valueOf(tkyq)); + currentData.setYtkcs(String.valueOf(tkyq)); }else{ - x.setTkyq(String.valueOf(xtkyq)); + currentData.setYtkcs(String.valueOf(xtkyq)); } + }else{ + String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx()); + currentData.setZwmc(xZwmc); } - tksfMap.put(x.getGh(),x); - }else { +// tksfMap.put(x.getGh(),x); + }else{ + String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx()); + x.setZwmc(xZwmc); tksfMap.put(x.getGh(),x); } }); @@ -354,7 +379,7 @@ public class TingKeStatisticsController { // x.setDwmc(currentData.getDwmc()); // } if(tksfMap.containsKey(xuserId)){ - KcTksfrzb currentData = tksfMap.get(xuserId); + KcExportConfigTpkwcqkjzglx currentData = tksfMap.get(xuserId); //tj.setJsxm(currentData.getXm()); x.setTksf(currentData.getZwmc()); //tj.setYskcs(currentData.getTkyq());