2023年6月20日 修复错误的统计
This commit is contained in:
parent
d20bd4e4b3
commit
f65ee31cd0
|
@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.compress.utils.Lists;
|
import org.apache.commons.compress.utils.Lists;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.modules.kc.grab.SynchronizationService.base.BaseSync;
|
import org.jeecg.modules.kc.grab.SynchronizationService.base.BaseSync;
|
||||||
import org.jeecg.modules.kc.grab.exports.entity.TFwdtShryxx;
|
import org.jeecg.modules.kc.grab.exports.entity.TFwdtShryxx;
|
||||||
import org.jeecg.modules.kc.grab.exports.service.ITFwdtShryxxService;
|
import org.jeecg.modules.kc.grab.exports.service.ITFwdtShryxxService;
|
||||||
|
@ -61,9 +62,9 @@ public class SyncTFwdtShryxx extends BaseSync {
|
||||||
outDataList.add(BeanUtil.toBean(x, Xxhbshryxx.class));
|
outDataList.add(BeanUtil.toBean(x, Xxhbshryxx.class));
|
||||||
if(whiteList.contains(x.getZwmc())){
|
if(whiteList.contains(x.getZwmc())){
|
||||||
KcTksfrzb y = new KcTksfrzb();
|
KcTksfrzb y = new KcTksfrzb();
|
||||||
y.setGh(x.getGh());
|
y.setGh(StringUtils.trim(x.getGh()));
|
||||||
y.setXm(x.getXm());
|
y.setXm(StringUtils.trim(x.getXm()));
|
||||||
y.setZwmc(x.getZwmc());
|
y.setZwmc(StringUtils.trim(x.getZwmc()));
|
||||||
y.setFlag("2");
|
y.setFlag("2");
|
||||||
saveList.add(y);
|
saveList.add(y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@ import org.apache.commons.compress.utils.Lists;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
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;
|
||||||
|
import org.jeecg.modules.kc.kcCasusers.entity.KcCasusers;
|
||||||
|
import org.jeecg.modules.kc.kcCasusers.service.IKcCasusersService;
|
||||||
import org.jeecg.modules.kc.kcSysConfig.entity.KcSysConfig;
|
import org.jeecg.modules.kc.kcSysConfig.entity.KcSysConfig;
|
||||||
import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
|
import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
|
||||||
import org.jeecg.modules.kc.kcXqxnHistory.entity.KcXqxnHistory;
|
import org.jeecg.modules.kc.kcXqxnHistory.entity.KcXqxnHistory;
|
||||||
|
@ -53,6 +55,9 @@ public class ChangeTingKeTongJi {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IKcTingkeService kcTingkeService;
|
private IKcTingkeService kcTingkeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IKcCasusersService kcCasusersService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public KcXqxnHistory getXqConfig(){
|
public KcXqxnHistory getXqConfig(){
|
||||||
|
@ -161,7 +166,7 @@ public class ChangeTingKeTongJi {
|
||||||
String currentTkyq = currentData.getTkyq();
|
String currentTkyq = currentData.getTkyq();
|
||||||
if(StringUtils.isNotBlank(currentTkyq)){
|
if(StringUtils.isNotBlank(currentTkyq)){
|
||||||
int tkyq = Integer.parseInt(currentTkyq);
|
int tkyq = Integer.parseInt(currentTkyq);
|
||||||
int xtkyq = Integer.parseInt(x.getTkyq());
|
int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTkyq(),"0"));
|
||||||
x.setZwmc(currentZwmc + "、" + x.getZwmc());
|
x.setZwmc(currentZwmc + "、" + x.getZwmc());
|
||||||
if(tkyq > xtkyq){
|
if(tkyq > xtkyq){
|
||||||
x.setTkyq(String.valueOf(tkyq));
|
x.setTkyq(String.valueOf(tkyq));
|
||||||
|
@ -177,6 +182,15 @@ public class ChangeTingKeTongJi {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//查询casUser
|
||||||
|
QueryWrapper<KcCasusers> casuserQw = new QueryWrapper<>();
|
||||||
|
//casuserQw.in("gh",tjSet);
|
||||||
|
List<KcCasusers> casuserList = kcCasusersService.list(casuserQw);
|
||||||
|
Map<String, KcCasusers> casuserMap = Maps.newHashMap();
|
||||||
|
casuserList.forEach(x -> {
|
||||||
|
casuserMap.put(x.getUser(),x);
|
||||||
|
});
|
||||||
|
|
||||||
//删除已有听课数据重新生成
|
//删除已有听课数据重新生成
|
||||||
QueryWrapper<KcTkcstj> tjQw = new QueryWrapper<>();
|
QueryWrapper<KcTkcstj> tjQw = new QueryWrapper<>();
|
||||||
tjQw.eq(StringUtils.isNotBlank(userId),"jgh",userId);
|
tjQw.eq(StringUtils.isNotBlank(userId),"jgh",userId);
|
||||||
|
@ -220,6 +234,14 @@ public class ChangeTingKeTongJi {
|
||||||
tj.setTksf(currentData.getZwmc());
|
tj.setTksf(currentData.getZwmc());
|
||||||
tj.setYskcs(currentData.getTkyq());
|
tj.setYskcs(currentData.getTkyq());
|
||||||
}
|
}
|
||||||
|
if(StringUtils.isBlank(tj.getJsxm())){//补充教师姓名
|
||||||
|
if(casuserMap.containsKey(xuserId)){
|
||||||
|
KcCasusers casuser = casuserMap.get(xuserId);
|
||||||
|
if(casuser != null) {
|
||||||
|
tj.setJsxm(casuser.getCn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
tj.setTkxttj(String.valueOf(x.getPkNum()));
|
tj.setTkxttj(String.valueOf(x.getPkNum()));
|
||||||
addTjList.add(tj);
|
addTjList.add(tj);
|
||||||
});
|
});
|
||||||
|
@ -305,13 +327,15 @@ public class ChangeTingKeTongJi {
|
||||||
String currentTkyq = currentData.getTkyq();
|
String currentTkyq = currentData.getTkyq();
|
||||||
if(StringUtils.isNotBlank(currentTkyq)){
|
if(StringUtils.isNotBlank(currentTkyq)){
|
||||||
int tkyq = Integer.parseInt(currentTkyq);
|
int tkyq = Integer.parseInt(currentTkyq);
|
||||||
int xtkyq = Integer.parseInt(x.getTkyq());
|
int xtkyq = Integer.parseInt(StringUtils.defaultString(x.getTkyq(),"0"));
|
||||||
x.setZwmc(currentZwmc + "、" + x.getZwmc());
|
x.setZwmc(currentZwmc + "、" + x.getZwmc());
|
||||||
if(tkyq > xtkyq){
|
if(tkyq > xtkyq){
|
||||||
x.setTkyq(String.valueOf(tkyq));
|
x.setTkyq(String.valueOf(tkyq));
|
||||||
}else{
|
}else{
|
||||||
x.setTkyq(String.valueOf(xtkyq));
|
x.setTkyq(String.valueOf(xtkyq));
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
x.setZwmc(currentZwmc + "、" + x.getZwmc());
|
||||||
}
|
}
|
||||||
tksfMap.put(x.getGh(),x);
|
tksfMap.put(x.getGh(),x);
|
||||||
}else {
|
}else {
|
||||||
|
@ -319,6 +343,15 @@ public class ChangeTingKeTongJi {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//查询casUser
|
||||||
|
QueryWrapper<KcCasusers> casuserQw = new QueryWrapper<>();
|
||||||
|
casuserQw.eq("user",userId);
|
||||||
|
List<KcCasusers> casuserList = kcCasusersService.list(casuserQw);
|
||||||
|
Map<String, KcCasusers> casuserMap = Maps.newHashMap();
|
||||||
|
casuserList.forEach(x -> {
|
||||||
|
casuserMap.put(x.getUser(),x);
|
||||||
|
});
|
||||||
|
|
||||||
//组合数据
|
//组合数据
|
||||||
KcTingke kcTingke = new KcTingke();
|
KcTingke kcTingke = new KcTingke();
|
||||||
kcTingke.setTingketime(DateUtil.format(tkSj, DatePattern.NORM_DATETIME_FORMAT));
|
kcTingke.setTingketime(DateUtil.format(tkSj, DatePattern.NORM_DATETIME_FORMAT));
|
||||||
|
@ -346,6 +379,15 @@ public class ChangeTingKeTongJi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(StringUtils.isBlank(kcTingke.getJsxm())){//补充教师姓名
|
||||||
|
if(casuserMap.containsKey(userId)){
|
||||||
|
KcCasusers casuser = casuserMap.get(userId);
|
||||||
|
if(casuser != null) {
|
||||||
|
kcTingke.setJsxm(casuser.getCn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
kcTingkeService.save(kcTingke);
|
kcTingkeService.save(kcTingke);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue