diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/tools/ChangeTingKeTongJi.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/tools/ChangeTingKeTongJi.java index 6fd85636..9344205a 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/tools/ChangeTingKeTongJi.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/tools/ChangeTingKeTongJi.java @@ -10,6 +10,8 @@ import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang.StringUtils; +import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx; +import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService; import org.jeecg.modules.kc.grab.imports.entity.Xxhbuser; import org.jeecg.modules.kc.grab.imports.service.IXxhbuserService; import org.jeecg.modules.kc.kcCasusers.entity.KcCasusers; @@ -26,7 +28,9 @@ import org.jeecg.modules.kc.tksf.kctksfrzb.entity.KcTksfrzb; import org.jeecg.modules.kc.tksf.kctksfrzb.service.IKcTksfrzbService; import org.jeecg.modules.kc.tktj.entity.KcTingke; import org.jeecg.modules.kc.tktj.service.IKcTingkeService; +import org.jeecg.modules.tools.DictUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; import java.util.Date; @@ -55,6 +59,13 @@ public class ChangeTingKeTongJi { @Autowired private IKcTingkeService kcTingkeService; + @Autowired + private DictUtils dictUtils; + + @Autowired + @Lazy + private IKcExportConfigTpkwcqkjzglxService exportConfigTpkwcqkjzglxService; + public KcXqxnHistory getXqConfig(){ return getXqConfig(null); } @@ -160,27 +171,27 @@ public class ChangeTingKeTongJi { }); //查询听课身份 - QueryWrapper tksfQw = new QueryWrapper<>(); + QueryWrapper tksfQw = new QueryWrapper<>(); tksfQw.in("gh",tjSet); - List tksfList = kcTksfrzbService.list(tksfQw); - Map tksfMap = Maps.newHashMap(); + List tksfList = exportConfigTpkwcqkjzglxService.list(tksfQw); + Map tksfMap = Maps.newHashMap(); tksfList.forEach(x -> { if(tksfMap.containsKey(x.getGh())){ //存在了,拼接职务名称,取最大的听课要求 - KcTksfrzb currentData = tksfMap.get(x.getGh()); - String currentZwmc = currentData.getZwmc(); - String currentTkyq = currentData.getTkyq(); + KcExportConfigTpkwcqkjzglx currentData = tksfMap.get(x.getGh()); + String currentZwmc = dictUtils.translateDictValue("tpkwcqkjzglx",currentData.getTklx()); + String currentTkyq = currentData.getYtkcs(); if(StringUtils.isNotBlank(currentTkyq)){ int tkyq = Integer.parseInt(currentTkyq); - int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTkyq(),"0")); - x.setZwmc(currentZwmc + "、" + x.getZwmc()); + int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getYtkcs(),"0")); + x.setZwmc(currentZwmc + "、" + dictUtils.translateDictValue("tpkwcqkjzglx",x.getTklx())); if(tkyq > xtkyq){ - x.setTkyq(String.valueOf(tkyq)); + x.setYtkcs(String.valueOf(tkyq)); }else{ - x.setTkyq(String.valueOf(xtkyq)); + x.setYtkcs(String.valueOf(xtkyq)); } }else{ - x.setZwmc(currentZwmc + "、" + x.getZwmc()); + x.setZwmc(currentZwmc + "、" + dictUtils.translateDictValue("tpkwcqkjzglx",x.getTklx())); } tksfMap.put(x.getGh(),x); }else { @@ -226,10 +237,10 @@ public class ChangeTingKeTongJi { tj.setSsxy(currentData.getDwmc()); } if(tksfMap.containsKey(xuserId)){ - KcTksfrzb currentData = tksfMap.get(xuserId); + KcExportConfigTpkwcqkjzglx currentData = tksfMap.get(xuserId); tj.setJsxm(currentData.getXm()); - tj.setTksf(currentData.getZwmc()); - tj.setYskcs(currentData.getTkyq()); + tj.setTksf(StringUtils.defaultString(currentData.getZwmc(),dictUtils.translateDictValue("tpkwcqkjzglx",currentData.getTklx()))); + tj.setYskcs(currentData.getYtkcs()); } if(StringUtils.isBlank(tj.getJsxm())){//补充教师姓名 if(szdwMap.containsKey(xuserId)){ diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/tktj/controller/KcTingkeController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/tktj/controller/KcTingkeController.java index 0f1a78a5..5cf3575a 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/tktj/controller/KcTingkeController.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/tktj/controller/KcTingkeController.java @@ -495,6 +495,7 @@ public class KcTingkeController extends JeecgController evaQw = new QueryWrapper<>(); @@ -502,6 +503,7 @@ public class KcTingkeController extends JeecgController - select xb.gh as userid,xb.xm as username,tkyq.tkyq,count(tk.id) as sjtksl + select xb.gh as userid,xb.xm as username,tkyq.yskcs as tkyq,count(tk.id) as sjtksl from xxhbuser xb - LEFT JOIN kc_tksfrzb tksf on xb.gh = tksf.gh - LEFT JOIN kc_tksfyq tkyq on tksf.zwmc = tkyq.zwmc + LEFT JOIN kc_tkcstj tkyq on xb.gh = tkyq.jgh and xnxq = #{xnxq} LEFT JOIN kc_tingke tk on xb.gh = tk.userid where tk.tingketime >= #{startTime} and tk.tingketime <= concat(#{endTime},' 23:59:59') and tk.userid = #{userid} - ORDER BY tkyq.tkyq desc + ORDER BY tkyq.yskcs desc