修改课程信息表同步数据

This commit is contained in:
yangjun 2023-10-08 10:12:46 +08:00
parent 8b6103d001
commit 13de93bf7e
2 changed files with 88 additions and 87 deletions

View File

@ -71,98 +71,98 @@ public class SyncKcktStat extends BaseSync {
//-----------------修改课程表数据------------------------ //-----------------修改课程表数据------------------------
KcKechengbiao kcKechengbiao = new KcKechengbiao(); // KcKechengbiao kcKechengbiao = new KcKechengbiao();
kcKechengbiao.setXqxn(kcSysConfig.getFlag1()); // kcKechengbiao.setXqxn(kcSysConfig.getFlag1());
List<KcKechengbiao> kckblist = kcKechengbiaoService.getKechengbiaoList(kcKechengbiao); // List<KcKechengbiao> kckblist = kcKechengbiaoService.getKechengbiaoList(kcKechengbiao);
for(KcKechengbiao KcKechengbiaoPar:kckblist){ // for(KcKechengbiao KcKechengbiaoPar:kckblist){
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>(); // QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("kcbh",KcKechengbiaoPar.getKcbh()); // kcKechengbiaoQueryWrapper.eq("kcbh",KcKechengbiaoPar.getKcbh());
kcKechengbiaoQueryWrapper.eq("kcmc",KcKechengbiaoPar.getKcmc()); // kcKechengbiaoQueryWrapper.eq("kcmc",KcKechengbiaoPar.getKcmc());
kcKechengbiaoQueryWrapper.eq("jgh",KcKechengbiaoPar.getJgh()); // kcKechengbiaoQueryWrapper.eq("jgh",KcKechengbiaoPar.getJgh());
kcKechengbiaoQueryWrapper.eq("skjs",KcKechengbiaoPar.getSkjs()); // kcKechengbiaoQueryWrapper.eq("skjs",KcKechengbiaoPar.getSkjs());
kcKechengbiaoQueryWrapper.eq("zc",KcKechengbiaoPar.getZc()); // kcKechengbiaoQueryWrapper.eq("zc",KcKechengbiaoPar.getZc());
kcKechengbiaoQueryWrapper.eq("rwbh",KcKechengbiaoPar.getRwbh()); // kcKechengbiaoQueryWrapper.eq("rwbh",KcKechengbiaoPar.getRwbh());
kcKechengbiaoQueryWrapper.eq("kkdwid",KcKechengbiaoPar.getKkdwid()); // kcKechengbiaoQueryWrapper.eq("kkdwid",KcKechengbiaoPar.getKkdwid());
kcKechengbiaoQueryWrapper.eq("kcxz",KcKechengbiaoPar.getKcxz()); // kcKechengbiaoQueryWrapper.eq("kcxz",KcKechengbiaoPar.getKcxz());
kcKechengbiaoQueryWrapper.eq("jsbh",KcKechengbiaoPar.getJsbh()); // kcKechengbiaoQueryWrapper.eq("jsbh",KcKechengbiaoPar.getJsbh());
kcKechengbiaoQueryWrapper.eq("skdd",KcKechengbiaoPar.getSkdd()); // kcKechengbiaoQueryWrapper.eq("skdd",KcKechengbiaoPar.getSkdd());
kcKechengbiaoQueryWrapper.eq("sksj",KcKechengbiaoPar.getSksj()); // kcKechengbiaoQueryWrapper.eq("sksj",KcKechengbiaoPar.getSksj());
kcKechengbiaoQueryWrapper.eq("jkzc",KcKechengbiaoPar.getJkzc()); // kcKechengbiaoQueryWrapper.eq("jkzc",KcKechengbiaoPar.getJkzc());
kcKechengbiaoQueryWrapper.eq("xf",KcKechengbiaoPar.getXf()); // kcKechengbiaoQueryWrapper.eq("xf",KcKechengbiaoPar.getXf());
kcKechengbiaoQueryWrapper.eq("xnxq",KcKechengbiaoPar.getXnxq()); // kcKechengbiaoQueryWrapper.eq("xnxq",KcKechengbiaoPar.getXnxq());
kcKechengbiaoQueryWrapper.eq("kcdl",KcKechengbiaoPar.getKcdl()); // kcKechengbiaoQueryWrapper.eq("kcdl",KcKechengbiaoPar.getKcdl());
//
List<KcKechengbiao> KcKechengbiaoInsList = kcKechengbiaoService.list(kcKechengbiaoQueryWrapper); // List<KcKechengbiao> KcKechengbiaoInsList = kcKechengbiaoService.list(kcKechengbiaoQueryWrapper);
if(KcKechengbiaoInsList!=null&&KcKechengbiaoInsList.size()>0){ // if(KcKechengbiaoInsList!=null&&KcKechengbiaoInsList.size()>0){
for(KcKechengbiao KcKechengbiao : KcKechengbiaoInsList){ // for(KcKechengbiao KcKechengbiao : KcKechengbiaoInsList){
BeanUtils.copyProperties(KcKechengbiaoPar,KcKechengbiao); // BeanUtils.copyProperties(KcKechengbiaoPar,KcKechengbiao);
kcKechengbiaoService.updateById(KcKechengbiao); // kcKechengbiaoService.updateById(KcKechengbiao);
} // }
}else{ // }else{
kcKechengbiaoService.saveOne(KcKechengbiaoPar); // kcKechengbiaoService.saveOne(KcKechengbiaoPar);
} // }
} // }
//-----------------初始化数据------------------------ // //-----------------初始化数据------------------------
//
//-------------------删除本年的课程数据冰倩是当天及以后的---------------------- // //-------------------删除本年的课程数据冰倩是当天及以后的----------------------
QueryWrapper<KcKetangbiao> KcKetangbiaoQueryWrapper = new QueryWrapper<>(); // QueryWrapper<KcKetangbiao> KcKetangbiaoQueryWrapper = new QueryWrapper<>();
KcKetangbiaoQueryWrapper.eq("xnxq",kcSysConfig.getFlag1()); // KcKetangbiaoQueryWrapper.eq("xnxq",kcSysConfig.getFlag1());
KcKetangbiaoQueryWrapper.ge("skrq",DateUtils.formatDate(dateNow,"yyyy-MM-dd")); // KcKetangbiaoQueryWrapper.ge("skrq",DateUtils.formatDate(dateNow,"yyyy-MM-dd"));
kcKetangbiaoService.remove(KcKetangbiaoQueryWrapper); // kcKetangbiaoService.remove(KcKetangbiaoQueryWrapper);
//-------------------删除本年的课程数据冰倩是当天及以后的---------------------- // //-------------------删除本年的课程数据冰倩是当天及以后的----------------------
//
String bxqkssj = kcSysConfig.getBxqkssj(); // String bxqkssj = kcSysConfig.getBxqkssj();
//插入数据 // //插入数据
KcKetangbiao kcKetangbiao = new KcKetangbiao(); // KcKetangbiao kcKetangbiao = new KcKetangbiao();
kcKetangbiao.setXnxq(kcSysConfig.getFlag1()); // kcKetangbiao.setXnxq(kcSysConfig.getFlag1());
List<KcKetangbiao> list = kcKetangbiaoService.selectSyncList(kcKetangbiao); // List<KcKetangbiao> list = kcKetangbiaoService.selectSyncList(kcKetangbiao);
List<KcKetangbiao> arrayList = new ArrayList<>(); // List<KcKetangbiao> arrayList = new ArrayList<>();
for(int i=0;i<list.size();i++){ // for(int i=0;i<list.size();i++){
KcKetangbiao kcKetangbiaoOld = list.get(i); // KcKetangbiao kcKetangbiaoOld = list.get(i);
try { // try {
String jkzc[] = kcKetangbiaoOld.getJkzc().split(","); // String jkzc[] = kcKetangbiaoOld.getJkzc().split(",");
String week = kcKetangbiaoOld.getWeek(); // String week = kcKetangbiaoOld.getWeek();
for(int j=0;j<jkzc.length;j++){ // for(int j=0;j<jkzc.length;j++){
KcKetangbiao kcKetangbiaoAddNew = new KcKetangbiao(); // KcKetangbiao kcKetangbiaoAddNew = new KcKetangbiao();
int djz = Integer.parseInt(jkzc[j]); // int djz = Integer.parseInt(jkzc[j]);
BeanUtils.copyProperties(kcKetangbiaoOld,kcKetangbiaoAddNew); // BeanUtils.copyProperties(kcKetangbiaoOld,kcKetangbiaoAddNew);
kcKetangbiaoAddNew.setId(null); // kcKetangbiaoAddNew.setId(null);
//skrq 生成规则取本学开始时间kc_sys_config.bxqkssj+(jkzc-1)*7+week // //skrq 生成规则取本学开始时间kc_sys_config.bxqkssj+(jkzc-1)*7+week
int addSj = (djz -1 )*7+Integer.parseInt(week)-1; // int addSj = (djz -1 )*7+Integer.parseInt(week)-1;
Date date = DateUtils.parseDate(bxqkssj,"yyyy-MM-dd"); // Date date = DateUtils.parseDate(bxqkssj,"yyyy-MM-dd");
Calendar c = Calendar.getInstance(); // Calendar c = Calendar.getInstance();
c.setTime(date); // c.setTime(date);
c.add(Calendar.DAY_OF_MONTH, addSj); // c.add(Calendar.DAY_OF_MONTH, addSj);
String skrq = DateUtils.formatDate(c,"yyyy-MM-dd"); // String skrq = DateUtils.formatDate(c,"yyyy-MM-dd");
String dasj = DateUtils.formatDate(dateNow,"yyyy-MM-dd"); // String dasj = DateUtils.formatDate(dateNow,"yyyy-MM-dd");
//判断生成数据的skrq是否大于等于当前日期如果满足则进行新增否则不动 // //判断生成数据的skrq是否大于等于当前日期如果满足则进行新增否则不动
if(DateUtils.parseDate(skrq,"yyyy-MM-dd").getTime()>=DateUtils.parseDate(dasj,"yyyy-MM-dd").getTime()){ // if(DateUtils.parseDate(skrq,"yyyy-MM-dd").getTime()>=DateUtils.parseDate(dasj,"yyyy-MM-dd").getTime()){
kcKetangbiaoAddNew.setSkrq(skrq); // kcKetangbiaoAddNew.setSkrq(skrq);
kcKetangbiaoAddNew.setDijizhou(djz); // kcKetangbiaoAddNew.setDijizhou(djz);
kcKetangbiaoAddNew.setXnxq(kcSysConfig.getFlag1()); // kcKetangbiaoAddNew.setXnxq(kcSysConfig.getFlag1());
arrayList.add(kcKetangbiaoAddNew); // arrayList.add(kcKetangbiaoAddNew);
} // }
} // }
}catch (Exception e){ // }catch (Exception e){
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
kcKetangbiaoService.saveBatch(arrayList); // kcKetangbiaoService.saveBatch(arrayList);
//
//修改智慧教室关联的课堂表id-- 清洗智慧教室数据 // //修改智慧教室关联的课堂表id-- 清洗智慧教室数据
kcKetangbiaoService.updateJsbh(); // kcKetangbiaoService.updateJsbh();
//
//修改智慧教室关联的课堂表id-- 清洗智慧教室数据 // //修改智慧教室关联的课堂表id-- 清洗智慧教室数据
KcKetangbiao kcKetangbiaoup = new KcKetangbiao(); // KcKetangbiao kcKetangbiaoup = new KcKetangbiao();
kcKetangbiaoup.setSkxs(1); // kcKetangbiaoup.setSkxs(1);
kcKetangbiaoup.setXnxq(kcSysConfig.getFlag1()); // kcKetangbiaoup.setXnxq(kcSysConfig.getFlag1());
kcKetangbiaoService.updateSkxs(kcKetangbiaoup); // kcKetangbiaoService.updateSkxs(kcKetangbiaoup);
//修改调停课时间 //修改调停课时间
String dasj = DateUtils.formatDate(dateNow,"yyyy-MM-dd"); String dasj = DateUtils.formatDate(dateNow,"yyyy-MM-dd");
QueryWrapper<KcKetangbiaoSkrqLog> kcKetangbiaoSkrqLogQueryWrapper = new QueryWrapper<>(); QueryWrapper<KcKetangbiaoSkrqLog> kcKetangbiaoSkrqLogQueryWrapper = new QueryWrapper<>();
kcKetangbiaoSkrqLogQueryWrapper.ge("tzrq",dasj); kcKetangbiaoSkrqLogQueryWrapper.ge("jsrq",dasj);
List<KcKetangbiaoSkrqLog> list1 = kcKetangbiaoSkrqLogService.list(kcKetangbiaoSkrqLogQueryWrapper); List<KcKetangbiaoSkrqLog> list1 = kcKetangbiaoSkrqLogService.list(kcKetangbiaoSkrqLogQueryWrapper);
for(KcKetangbiaoSkrqLog KcKetangbiaoSkrqLog:list1){ for(KcKetangbiaoSkrqLog KcKetangbiaoSkrqLog:list1){
UpdateWrapper<KcKetangbiao> KcKetangbiaoUpdateWrapper = new UpdateWrapper<>(); UpdateWrapper<KcKetangbiao> KcKetangbiaoUpdateWrapper = new UpdateWrapper<>();

View File

@ -34,6 +34,7 @@ public class KcKetangbiaoSkrqLog implements Serializable {
private String skrq; private String skrq;
private String tzrq; private String tzrq;
private String jsrq;
} }