2023年8月15日 为导入用户添加日志,以便查询错误,修复查询单位名称出处,添加错误处理

This commit is contained in:
bai 2023-08-15 00:49:03 +08:00
parent b7fb22cf7d
commit 73bf3889b0
4 changed files with 74 additions and 21 deletions

View File

@ -356,10 +356,16 @@ public class SyncOldEvaluation extends BaseSync {
.notIn("ans9","A", "B", "C", "D", "E");
List<KcOldEvaluationans> bedList = kcOldEvaluationansService.list(bedSaveQw);
bedList.forEach(x -> saveBedList.add(BeanUtil.toBean(x, KcOldEvaluationansBad.class)));
kcOldEvaluationansBadService.saveBatch(saveBedList);
if(bedList != null){
bedList.forEach(x -> saveBedList.add(BeanUtil.toBean(x, KcOldEvaluationansBad.class)));
}
if(saveBedList != null){
kcOldEvaluationansBadService.saveBatch(saveBedList);
}
kcOldEvaluationansGoodService.saveBatch(saveGoodList);
if(saveGoodList != null){
kcOldEvaluationansGoodService.saveBatch(saveGoodList);
}
changeTingKeTongJi.changeTingKeTongji();

View File

@ -23,6 +23,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Map;
/**
* 同步用户
*/
@Slf4j
public class SyncTJzgXskc extends BaseSync {
@ -107,7 +110,9 @@ public class SyncTJzgXskc extends BaseSync {
xxhbuserService.remove(xuQw);
//保存
xxhbuserService.saveBatch(outUserDataList);
if(outUserDataList != null){
xxhbuserService.saveBatch(outUserDataList);
}
//再同步清洗到kc_export_config_tpkwcqkjzglx表
//筛选
@ -130,7 +135,24 @@ public class SyncTJzgXskc extends BaseSync {
}
});
exportConfigTpkwcqkjzglxService.updateBatchById(updateList);
if(updateList != null){
try {
exportConfigTpkwcqkjzglxService.updateBatchById(updateList);
}catch (Exception e){
e.printStackTrace();
errorMessage = e.getMessage();
}
Xxhbsynclog updateLog = new Xxhbsynclog();
updateLog.setSyncRowNum(String.valueOf(outDataList.size()));
updateLog.setOratabname("T_JZG_XSKC-清洗至kc_export_config_tpkwcqkjzglx升级数据");//oracle表名
updateLog.setOratabnum(inDataList.size());//oracle表数量
updateLog.setTablenum(0);//mysql表数量
updateLog.setSyncnum(updateList.size());//本次同步数据量
updateLog.setSynctype("0");//同步类型 0全量 1增量
updateLog.setErrormessage(errorMessage);
saveLog(xxhbsynclog,Xxhbxskc.class);
}
outUserDataList.forEach(x -> {
if(!saveMap.containsKey(x.getGh())){
@ -138,7 +160,25 @@ public class SyncTJzgXskc extends BaseSync {
}
});
exportConfigTpkwcqkjzglxService.saveBatch(saveList);
if(saveList != null){
try {
exportConfigTpkwcqkjzglxService.saveBatch(saveList);
}catch (Exception e){
e.printStackTrace();
errorMessage = e.getMessage();
}
Xxhbsynclog updateLog = new Xxhbsynclog();
updateLog.setSyncRowNum(String.valueOf(outDataList.size()));
updateLog.setOratabname("T_JZG_XSKC-清洗至kc_export_config_tpkwcqkjzglx新增数据");//oracle表名
updateLog.setOratabnum(inDataList.size());//oracle表数量
updateLog.setTablenum(0);//mysql表数量
updateLog.setSyncnum(saveList.size());//本次同步数据量
updateLog.setSynctype("0");//同步类型 0全量 1增量
updateLog.setErrormessage(errorMessage);
saveLog(xxhbsynclog,Xxhbxskc.class);
}
}

View File

@ -443,14 +443,21 @@ public class SyncZwdtEvaluation extends BaseSync {
);
List<Xxhbbkjxtkpj> bedList = xxhbbkjxtkpjService.list(bedSaveQw);
bedList.forEach(x -> saveXxhbbkjxtkpjBadLogList.add(BeanUtil.toBean(x, XxhbbkjxtkpjBadLog.class)));
if(bedList != null){
bedList.forEach(x -> saveXxhbbkjxtkpjBadLogList.add(BeanUtil.toBean(x, XxhbbkjxtkpjBadLog.class)));
}
if(saveXxhbbkjxtkpjBadLogList != null){
xxhbbkjxtkpjBadLogService.saveBatch(saveXxhbbkjxtkpjBadLogList);
}
xxhbbkjxtkpjBadLogService.saveBatch(saveXxhbbkjxtkpjBadLogList);
xxhbbkjxtkpjGoodLogService.saveBatch(saveXxhbbkjxtkpjGoodLogList);
if(saveXxhbbkjxtkpjGoodLogList != null){
xxhbbkjxtkpjGoodLogService.saveBatch(saveXxhbbkjxtkpjGoodLogList);
}
//kcEvaluationService.saveBatch(saveMainList);
kcEvaluationsService.saveBatch(saveChildList);
if(saveChildList != null){
kcEvaluationsService.saveBatch(saveChildList);
}
// List<KcEvaluationque> saveList = Lists.newArrayList();
changeTingKeTongJi.changeTingKeTongji();

View File

@ -89,20 +89,20 @@ public class TingKeStatisticsController {
//查询当前用户的学院
if(evaluation.isFindByPkdwmc() || evaluation.isFindByBeiTkkdwmc()){
QueryWrapper<KcExportConfigTpkwcqkjzglx> uqw = new QueryWrapper<>();
QueryWrapper<Xxhbuser> uqw = new QueryWrapper<>();
//LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
uqw.eq("gh",evaluation.getFindGh());
uqw.last("limit 1");
KcExportConfigTpkwcqkjzglx exportConfigTpkwcqkjzglx = kcExportConfigTpkwcqkjzglxService.getOne(uqw);
if(exportConfigTpkwcqkjzglx == null) {
Xxhbuser xxhbUser = xxhbuserService.getOne(uqw);
if(xxhbUser == null) {
return new Page<>();
}
//queryWrapper.eq()
if(evaluation.isFindByPkdwmc()){
queryWrapper.eq("xu.DWMC",exportConfigTpkwcqkjzglx.getDwmc());
queryWrapper.eq("xu.DWMC",xxhbUser.getDwmc());
}
if(evaluation.isFindByBeiTkkdwmc()){
queryWrapper.eq("kt.kkdw ",exportConfigTpkwcqkjzglx.getDwmc());
queryWrapper.eq("kt.kkdw ",xxhbUser.getDwmc());
}
}
@ -274,20 +274,20 @@ public class TingKeStatisticsController {
public IPage<KcEvaluationVo2> loadPageData2(KcEvaluationVo2 evaluation,QueryWrapper<KcEvaluationVo2> queryWrapper,Page<KcEvaluationVo2> page){
//查询当前用户的学院
if(evaluation.isFindByPkdwmc() || evaluation.isFindByBeiTkkdwmc()){
QueryWrapper<KcExportConfigTpkwcqkjzglx> uqw = new QueryWrapper<>();
QueryWrapper<Xxhbuser> uqw = new QueryWrapper<>();
//LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
uqw.eq("gh",evaluation.getFindGh());
uqw.last("limit 1");
KcExportConfigTpkwcqkjzglx exportConfigTpkwcqkjzglx = kcExportConfigTpkwcqkjzglxService.getOne(uqw);
if(exportConfigTpkwcqkjzglx == null) {
Xxhbuser xxhbUser = xxhbuserService.getOne(uqw);
if(xxhbUser == null) {
return new Page<>();
}
//queryWrapper.eq()
if(evaluation.isFindByPkdwmc()){
queryWrapper.eq("xu.DWMC",exportConfigTpkwcqkjzglx.getDwmc());
queryWrapper.eq("xu.DWMC",xxhbUser.getDwmc());
}
if(evaluation.isFindByBeiTkkdwmc()){
queryWrapper.eq("kt.kkdw ",exportConfigTpkwcqkjzglx.getDwmc());
queryWrapper.eq("kt.kkdw ",xxhbUser.getDwmc());
}
}