2023年8月29日 修复听课相关问题
This commit is contained in:
parent
20bba074c1
commit
273ce5586c
|
@ -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<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 = exportConfigTpkwcqkjzglxService.list(tksfQw);
|
||||
Map<String, KcExportConfigTpkwcqkjzglx> 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)){
|
||||
|
|
|
@ -495,6 +495,7 @@ public class KcTingkeController extends JeecgController<KcTingke, IKcTingkeServi
|
|||
//清洗数据核心
|
||||
Date startSjDate = common.getStartTime();
|
||||
Date endSjDate = common.getEndTime();
|
||||
String xnxq = common.getTitle();
|
||||
String startSj = DateUtil.format(startSjDate, DatePattern.NORM_DATETIME_FORMAT);
|
||||
String endSj = DateUtil.format(endSjDate, DatePattern.NORM_DATETIME_FORMAT);
|
||||
QueryWrapper<KcTingke> evaQw = new QueryWrapper<>();
|
||||
|
@ -502,6 +503,7 @@ public class KcTingkeController extends JeecgController<KcTingke, IKcTingkeServi
|
|||
if("admin".equals(sysUser.getUsername())){
|
||||
sysUser.setUsername("2016900057");
|
||||
}
|
||||
kcTingke.setXnxq(xnxq);
|
||||
kcTingke.setUserid(sysUser.getUsername());
|
||||
kcTingke.setStartTime(startSj.substring(0,10));
|
||||
kcTingke.setEndTime(endSj.substring(0,10));
|
||||
|
|
|
@ -897,13 +897,12 @@
|
|||
|
||||
|
||||
<select id="getUserTingkeInfo" resultType="org.jeecg.modules.kc.tktj.entity.KcTingke">
|
||||
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
|
||||
</select>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue