修改业务逻辑
This commit is contained in:
parent
8405d8e8ac
commit
52a9fa8c9d
|
@ -2,6 +2,7 @@ package org.jeecg.modules.demo.sync;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
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.jeecg.modules.demo.xxhbjwxtjxrw.entity.JwxtJxrw;
|
import org.jeecg.modules.demo.xxhbjwxtjxrw.entity.JwxtJxrw;
|
||||||
|
@ -61,13 +62,6 @@ public class SyncJwxt extends BaseSync {
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
public void run(Map<String, Object> param){
|
public void run(Map<String, Object> param){
|
||||||
//查询数据
|
|
||||||
List<JwxtJxrw> inDataList = expJxrwService.list();
|
|
||||||
List<Xxhbjwxtjxrw> outDataList = Lists.newArrayList();
|
|
||||||
|
|
||||||
System.out.println("---------------------------------------------------------------------------");
|
|
||||||
System.out.println("--------------查询第1个"+inDataList.size()+"--------------------");
|
|
||||||
System.out.println("---------------------------------------------------------------------------");
|
|
||||||
|
|
||||||
//查询数据
|
//查询数据
|
||||||
List<JwxtScwjxx> in1DataList = expScwjxxService.list();
|
List<JwxtScwjxx> in1DataList = expScwjxxService.list();
|
||||||
|
@ -77,44 +71,58 @@ public class SyncJwxt extends BaseSync {
|
||||||
System.out.println("--------------查询第2个"+in1DataList.size()+"--------------------");
|
System.out.println("--------------查询第2个"+in1DataList.size()+"--------------------");
|
||||||
System.out.println("---------------------------------------------------------------------------");
|
System.out.println("---------------------------------------------------------------------------");
|
||||||
//查询数据
|
//查询数据
|
||||||
// List<JwxtXsmd> in2DataList = expXsmdService.list();
|
|
||||||
// List<Xxhbjwxtxsmd> out2DataList = Lists.newArrayList();
|
|
||||||
// System.out.println("---------------------------------------------------------------------------");
|
|
||||||
// System.out.println("--------------第3个"+in2DataList.size()+"--------------------");
|
|
||||||
// System.out.println("---------------------------------------------------------------------------");
|
|
||||||
|
|
||||||
//清洗数据
|
|
||||||
inDataList.forEach(x -> outDataList.add(BeanUtil.toBean(x, Xxhbjwxtjxrw.class)));
|
|
||||||
in1DataList.forEach(x -> out1DataList.add(BeanUtil.toBean(x, Xxhbjwxtscwjxx.class)));
|
in1DataList.forEach(x -> out1DataList.add(BeanUtil.toBean(x, Xxhbjwxtscwjxx.class)));
|
||||||
// in2DataList.forEach(x -> out2DataList.add(BeanUtil.toBean(x, Xxhbjwxtxsmd.class)));
|
|
||||||
|
|
||||||
//删除数据
|
//删除数据
|
||||||
QueryWrapper dqw = new QueryWrapper();
|
// QueryWrapper dqw = new QueryWrapper();
|
||||||
impJxrwService.remove(dqw);
|
// impJxrwService.remove(dqw);
|
||||||
QueryWrapper dqw1 = new QueryWrapper();
|
QueryWrapper dqw1 = new QueryWrapper();
|
||||||
impScwjxxService.remove(dqw1);
|
impScwjxxService.remove(dqw1);
|
||||||
//保存到胃
|
//保存到胃
|
||||||
try {
|
try {
|
||||||
System.out.println("---------------------------------------------------------------------------");
|
|
||||||
System.out.println("--------------插入第一个"+outDataList.size()+"--------------------");
|
|
||||||
System.out.println("---------------------------------------------------------------------------");
|
|
||||||
impJxrwService.syncList(outDataList);
|
|
||||||
|
|
||||||
System.out.println("---------------------------------------------------------------------------");
|
System.out.println("---------------------------------------------------------------------------");
|
||||||
System.out.println("--------------插入第二个"+out1DataList.size()+"--------------------");
|
System.out.println("--------------插入第二个"+out1DataList.size()+"--------------------");
|
||||||
System.out.println("---------------------------------------------------------------------------");
|
System.out.println("---------------------------------------------------------------------------");
|
||||||
impScwjxxService.syncList(out1DataList);
|
impScwjxxService.syncList(out1DataList);
|
||||||
|
|
||||||
// System.out.println("---------------------------------------------------------------------------");
|
|
||||||
// System.out.println("--------------第三个"+outDataList.size()+"--------------------");
|
|
||||||
// System.out.println("---------------------------------------------------------------------------");
|
|
||||||
// QueryWrapper dqw2 = new QueryWrapper();
|
|
||||||
// impXsmdService.remove(dqw2);
|
|
||||||
// impXsmdService.syncList(out2DataList);
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//查询数据
|
||||||
|
QueryWrapper<JwxtJxrw> jxrwQueryWrapper = new QueryWrapper<>();
|
||||||
|
jxrwQueryWrapper.eq("file_shztmc","审核通过");
|
||||||
|
List<JwxtJxrw> inDataList = expJxrwService.list(jxrwQueryWrapper);
|
||||||
|
List<Xxhbjwxtjxrw> outDataList = Lists.newArrayList();
|
||||||
|
|
||||||
|
System.out.println("---------------------------------------------------------------------------");
|
||||||
|
System.out.println("--------------查询第1个"+inDataList.size()+"--------------------");
|
||||||
|
System.out.println("---------------------------------------------------------------------------");
|
||||||
|
|
||||||
|
//清洗数据
|
||||||
|
inDataList.forEach(x -> outDataList.add(BeanUtil.toBean(x, Xxhbjwxtjxrw.class)));
|
||||||
|
|
||||||
|
try {
|
||||||
|
System.out.println("---------------------------------------------------------------------------");
|
||||||
|
System.out.println("--------------插入第一个"+outDataList.size()+"--------------------");
|
||||||
|
System.out.println("---------------------------------------------------------------------------");
|
||||||
|
for(Xxhbjwxtjxrw par : outDataList){
|
||||||
|
|
||||||
|
UpdateWrapper<Xxhbjwxtjxrw> xxhbjwxtjxrwUpdateWrapper = new UpdateWrapper<>();
|
||||||
|
xxhbjwxtjxrwUpdateWrapper.set("file_shztmc","审核通过");
|
||||||
|
xxhbjwxtjxrwUpdateWrapper.eq("kcrwdm",par.getKcrwdm());
|
||||||
|
impJxrwService.update(xxhbjwxtjxrwUpdateWrapper);
|
||||||
|
}
|
||||||
|
// impJxrwService.syncList(outDataList);
|
||||||
|
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue