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 = "每学期应听课次数")
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.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<KcTksfrzb> tksfSerachQw = new QueryWrapper<>();
tksfSerachQw.eq("kc_tksfrzb.ZWMC",evaluation.getTksf());
List<KcTksfrzb> tksfGhList = kcTksfrzbService.list(tksfSerachQw);
QueryWrapper<KcExportConfigTpkwcqkjzglx> tksfSerachQw = new QueryWrapper<>();
tksfSerachQw.eq("tklx",evaluation.getTksf());
List<KcExportConfigTpkwcqkjzglx> tksfGhList = kcExportConfigTpkwcqkjzglxService.list(tksfSerachQw);
if(tksfGhList != null && !tksfGhList.isEmpty()){
Set<String> ghSet = tksfGhList.stream().map(x -> x.getGh()).collect(Collectors.toSet());
queryWrapper.in("a.upuserid",ghSet);
@ -173,28 +184,35 @@ public class TingKeStatisticsController {
//---------------------补数据2------------------------------------------
//查询听课身份
QueryWrapper<KcTksfrzb> tksfQw = new QueryWrapper<>();
QueryWrapper<KcExportConfigTpkwcqkjzglx> tksfQw = new QueryWrapper<>();
tksfQw.in("gh",tjSet);
List<KcTksfrzb> tksfList = kcTksfrzbService.list(tksfQw);
Map<String, KcTksfrzb> tksfMap = Maps.newHashMap();
List<KcExportConfigTpkwcqkjzglx> tksfList = kcExportConfigTpkwcqkjzglxService.list(tksfQw);
Map<String, KcExportConfigTpkwcqkjzglx> 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<KcTksfrzb> tksfSerachQw = new QueryWrapper<>();
tksfSerachQw.eq("kc_tksfrzb.ZWMC",evaluation.getTksf());
List<KcTksfrzb> tksfGhList = kcTksfrzbService.list(tksfSerachQw);
QueryWrapper<KcExportConfigTpkwcqkjzglx> tksfSerachQw = new QueryWrapper<>();
tksfSerachQw.eq("tklx",evaluation.getTksf());
List<KcExportConfigTpkwcqkjzglx> tksfGhList = kcExportConfigTpkwcqkjzglxService.list(tksfSerachQw);
if(tksfGhList != null && !tksfGhList.isEmpty()){
Set<String> ghSet = tksfGhList.stream().map(x -> x.getGh()).collect(Collectors.toSet());
queryWrapper.in("a.upuserid",ghSet);
@ -320,28 +338,35 @@ public class TingKeStatisticsController {
//---------------------补数据2------------------------------------------
//查询听课身份
QueryWrapper<KcTksfrzb> tksfQw = new QueryWrapper<>();
QueryWrapper<KcExportConfigTpkwcqkjzglx> tksfQw = new QueryWrapper<>();
tksfQw.in("gh",tjSet);
List<KcTksfrzb> tksfList = kcTksfrzbService.list(tksfQw);
Map<String, KcTksfrzb> tksfMap = Maps.newHashMap();
List<KcExportConfigTpkwcqkjzglx> tksfList = kcExportConfigTpkwcqkjzglxService.list(tksfQw);
Map<String, KcExportConfigTpkwcqkjzglx> 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());