2023年8月9日 修复问题

This commit is contained in:
bai 2023-08-09 00:40:57 +08:00
parent 760b0ad15b
commit d171890732
2 changed files with 58 additions and 30 deletions

View File

@ -85,4 +85,7 @@ public class KcExportConfigTpkwcqkjzglx implements Serializable {
@ApiModelProperty(value = "每学期应听课次数") @ApiModelProperty(value = "每学期应听课次数")
private java.lang.String ytkcs; private java.lang.String ytkcs;
@TableField(exist = false)
private String zwmc;
} }

View File

@ -18,6 +18,8 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils; 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.SynchronizationService.tools.ChangeTingKeTongJi;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbuser; import org.jeecg.modules.kc.grab.imports.entity.Xxhbuser;
import org.jeecg.modules.kc.grab.imports.service.IXxhbuserService; 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.qa.service.IKcEvaluationService;
import org.jeecg.modules.kc.tksf.kctksfrzb.entity.KcTksfrzb; import org.jeecg.modules.kc.tksf.kctksfrzb.entity.KcTksfrzb;
import org.jeecg.modules.kc.tksf.kctksfrzb.service.IKcTksfrzbService; 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.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType; import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
@ -58,6 +63,9 @@ public class TingKeStatisticsController {
@Value("${jeecg.path.upload}") @Value("${jeecg.path.upload}")
private String upLoadPath; private String upLoadPath;
@Autowired
private DictUtils dictUtils;
@Autowired @Autowired
private IKcEvaluationService service; private IKcEvaluationService service;
@ -67,6 +75,9 @@ public class TingKeStatisticsController {
@Autowired @Autowired
private IKcTksfrzbService kcTksfrzbService; private IKcTksfrzbService kcTksfrzbService;
@Autowired
private IKcExportConfigTpkwcqkjzglxService kcExportConfigTpkwcqkjzglxService;
@Autowired @Autowired
private IKcXqxnHistoryService kcXqxnHistoryService; private IKcXqxnHistoryService kcXqxnHistoryService;
@ -118,9 +129,9 @@ public class TingKeStatisticsController {
//按听课身份查询 //按听课身份查询
if(StringUtils.isNotBlank(evaluation.getTksf())){ if(StringUtils.isNotBlank(evaluation.getTksf())){
QueryWrapper<KcTksfrzb> tksfSerachQw = new QueryWrapper<>(); QueryWrapper<KcExportConfigTpkwcqkjzglx> tksfSerachQw = new QueryWrapper<>();
tksfSerachQw.eq("kc_tksfrzb.ZWMC",evaluation.getTksf()); tksfSerachQw.eq("tklx",evaluation.getTksf());
List<KcTksfrzb> tksfGhList = kcTksfrzbService.list(tksfSerachQw); List<KcExportConfigTpkwcqkjzglx> tksfGhList = kcExportConfigTpkwcqkjzglxService.list(tksfSerachQw);
if(tksfGhList != null && !tksfGhList.isEmpty()){ if(tksfGhList != null && !tksfGhList.isEmpty()){
Set<String> ghSet = tksfGhList.stream().map(x -> x.getGh()).collect(Collectors.toSet()); Set<String> ghSet = tksfGhList.stream().map(x -> x.getGh()).collect(Collectors.toSet());
queryWrapper.in("a.upuserid",ghSet); queryWrapper.in("a.upuserid",ghSet);
@ -173,28 +184,35 @@ public class TingKeStatisticsController {
//---------------------补数据2------------------------------------------ //---------------------补数据2------------------------------------------
//查询听课身份 //查询听课身份
QueryWrapper<KcTksfrzb> tksfQw = new QueryWrapper<>(); QueryWrapper<KcExportConfigTpkwcqkjzglx> tksfQw = new QueryWrapper<>();
tksfQw.in("gh",tjSet); tksfQw.in("gh",tjSet);
List<KcTksfrzb> tksfList = kcTksfrzbService.list(tksfQw); List<KcExportConfigTpkwcqkjzglx> tksfList = kcExportConfigTpkwcqkjzglxService.list(tksfQw);
Map<String, KcTksfrzb> tksfMap = Maps.newHashMap(); Map<String, KcExportConfigTpkwcqkjzglx> tksfMap = Maps.newHashMap();
tksfList.forEach(x -> { tksfList.forEach(x -> {
if(tksfMap.containsKey(x.getGh())){ 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 currentZwmc = currentData.getZwmc();
String currentTkyq = currentData.getTkyq();
if(StringUtils.isNotBlank(currentZwmc)){ if(StringUtils.isNotBlank(currentZwmc)){
int tkyq = Integer.parseInt(StringUtils.defaultString(currentTkyq,"0")); int tkyq = Integer.parseInt(StringUtils.defaultString(currentTkyq,"0"));
int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTkyq(),"0")); int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTklx(),"0"));
x.setZwmc(currentZwmc + "" + x.getZwmc()); String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx());
currentData.setZwmc(currentZwmc + "" + xZwmc);
if(tkyq > xtkyq){ if(tkyq > xtkyq){
x.setTkyq(String.valueOf(tkyq)); currentData.setYtkcs(String.valueOf(tkyq));
}else{ }else{
x.setTkyq(String.valueOf(xtkyq)); currentData.setYtkcs(String.valueOf(xtkyq));
} }
}
tksfMap.put(x.getGh(),x);
}else{ }else{
String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx());
currentData.setZwmc(xZwmc);
}
// tksfMap.put(x.getGh(),x);
}else{
String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx());
x.setZwmc(xZwmc);
tksfMap.put(x.getGh(),x); tksfMap.put(x.getGh(),x);
} }
}); });
@ -207,7 +225,7 @@ public class TingKeStatisticsController {
// x.setDwmc(currentData.getDwmc()); // x.setDwmc(currentData.getDwmc());
// } // }
if(tksfMap.containsKey(xuserId)){ if(tksfMap.containsKey(xuserId)){
KcTksfrzb currentData = tksfMap.get(xuserId); KcExportConfigTpkwcqkjzglx currentData = tksfMap.get(xuserId);
//tj.setJsxm(currentData.getXm()); //tj.setJsxm(currentData.getXm());
x.setTksf(currentData.getZwmc()); x.setTksf(currentData.getZwmc());
//tj.setYskcs(currentData.getTkyq()); //tj.setYskcs(currentData.getTkyq());
@ -263,9 +281,9 @@ public class TingKeStatisticsController {
} }
//按听课身份查询 //按听课身份查询
if(StringUtils.isNotBlank(evaluation.getTksf())){ if(StringUtils.isNotBlank(evaluation.getTksf())){
QueryWrapper<KcTksfrzb> tksfSerachQw = new QueryWrapper<>(); QueryWrapper<KcExportConfigTpkwcqkjzglx> tksfSerachQw = new QueryWrapper<>();
tksfSerachQw.eq("kc_tksfrzb.ZWMC",evaluation.getTksf()); tksfSerachQw.eq("tklx",evaluation.getTksf());
List<KcTksfrzb> tksfGhList = kcTksfrzbService.list(tksfSerachQw); List<KcExportConfigTpkwcqkjzglx> tksfGhList = kcExportConfigTpkwcqkjzglxService.list(tksfSerachQw);
if(tksfGhList != null && !tksfGhList.isEmpty()){ if(tksfGhList != null && !tksfGhList.isEmpty()){
Set<String> ghSet = tksfGhList.stream().map(x -> x.getGh()).collect(Collectors.toSet()); Set<String> ghSet = tksfGhList.stream().map(x -> x.getGh()).collect(Collectors.toSet());
queryWrapper.in("a.upuserid",ghSet); queryWrapper.in("a.upuserid",ghSet);
@ -320,28 +338,35 @@ public class TingKeStatisticsController {
//---------------------补数据2------------------------------------------ //---------------------补数据2------------------------------------------
//查询听课身份 //查询听课身份
QueryWrapper<KcTksfrzb> tksfQw = new QueryWrapper<>(); QueryWrapper<KcExportConfigTpkwcqkjzglx> tksfQw = new QueryWrapper<>();
tksfQw.in("gh",tjSet); tksfQw.in("gh",tjSet);
List<KcTksfrzb> tksfList = kcTksfrzbService.list(tksfQw); List<KcExportConfigTpkwcqkjzglx> tksfList = kcExportConfigTpkwcqkjzglxService.list(tksfQw);
Map<String, KcTksfrzb> tksfMap = Maps.newHashMap(); Map<String, KcExportConfigTpkwcqkjzglx> tksfMap = Maps.newHashMap();
tksfList.forEach(x -> { tksfList.forEach(x -> {
if(tksfMap.containsKey(x.getGh())){ 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 currentZwmc = currentData.getZwmc();
String currentTkyq = currentData.getTkyq();
if(StringUtils.isNotBlank(currentZwmc)){ if(StringUtils.isNotBlank(currentZwmc)){
int tkyq = Integer.parseInt(StringUtils.defaultString(currentTkyq,"0")); int tkyq = Integer.parseInt(StringUtils.defaultString(currentTkyq,"0"));
int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTkyq(),"0")); int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTklx(),"0"));
x.setZwmc(currentZwmc + "" + x.getZwmc()); String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx());
currentData.setZwmc(currentZwmc + "" + xZwmc);
if(tkyq > xtkyq){ if(tkyq > xtkyq){
x.setTkyq(String.valueOf(tkyq)); currentData.setYtkcs(String.valueOf(tkyq));
}else{ }else{
x.setTkyq(String.valueOf(xtkyq)); currentData.setYtkcs(String.valueOf(xtkyq));
} }
}
tksfMap.put(x.getGh(),x);
}else{ }else{
String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx());
currentData.setZwmc(xZwmc);
}
// tksfMap.put(x.getGh(),x);
}else{
String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx());
x.setZwmc(xZwmc);
tksfMap.put(x.getGh(),x); tksfMap.put(x.getGh(),x);
} }
}); });
@ -354,7 +379,7 @@ public class TingKeStatisticsController {
// x.setDwmc(currentData.getDwmc()); // x.setDwmc(currentData.getDwmc());
// } // }
if(tksfMap.containsKey(xuserId)){ if(tksfMap.containsKey(xuserId)){
KcTksfrzb currentData = tksfMap.get(xuserId); KcExportConfigTpkwcqkjzglx currentData = tksfMap.get(xuserId);
//tj.setJsxm(currentData.getXm()); //tj.setJsxm(currentData.getXm());
x.setTksf(currentData.getZwmc()); x.setTksf(currentData.getZwmc());
//tj.setYskcs(currentData.getTkyq()); //tj.setYskcs(currentData.getTkyq());