|
|
@@ -1,7 +1,6 @@ |
|
|
|
package com.ningdatech.syndataapi.open.manage; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
|
import com.ningdatech.syndataapi.common.constant.BizConst; |
|
|
@@ -59,10 +58,16 @@ public class ProjectReceiveManage { |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
ProjectBaseInfo saveBase = BeanUtil.copyProperties(baseInfo,ProjectBaseInfo.class); |
|
|
|
if(Objects.isNull(oldBaseInfo)){ |
|
|
|
saveBase.setOp(BizConst.OP_INSERT); |
|
|
|
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update |
|
|
|
if(StringUtils.isNotBlank(baseInfo.getOp()) && BizConst.OP_UPDATE.equals(baseInfo.getOp())){ |
|
|
|
saveBase.setOp(BizConst.OP_UPDATE); |
|
|
|
}else{ |
|
|
|
saveBase.setOp(BizConst.OP_INSERT); |
|
|
|
} |
|
|
|
saveBase.setTongTime(LocalDateTime.now()); |
|
|
|
}else { |
|
|
|
saveBase.setOp(BizConst.OP_UPDATE); |
|
|
|
saveBase.setOp(BizConst.OP_INSERT); |
|
|
|
saveBase.setTongID(oldBaseInfo.getTongID()); |
|
|
|
} |
|
|
|
saveBase.setBizTime(LocalDateTime.now()); |
|
|
|
baseInfoService.saveOrUpdate(saveBase); |
|
|
@@ -77,11 +82,18 @@ public class ProjectReceiveManage { |
|
|
|
ProjectApply saveApply = BeanUtil.copyProperties(apply,ProjectApply.class); |
|
|
|
saveApply.setBaseProjId(baseProjId); |
|
|
|
if(Objects.isNull(oldApply)){ |
|
|
|
saveApply.setOp(BizConst.OP_INSERT); |
|
|
|
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update |
|
|
|
if(StringUtils.isNotBlank(apply.getOp()) && BizConst.OP_UPDATE.equals(apply.getOp())){ |
|
|
|
saveApply.setOp(BizConst.OP_UPDATE); |
|
|
|
}else{ |
|
|
|
saveApply.setOp(BizConst.OP_INSERT); |
|
|
|
} |
|
|
|
saveApply.setTongTime(LocalDateTime.now()); |
|
|
|
}else{ |
|
|
|
saveApply.setOp(BizConst.OP_UPDATE); |
|
|
|
saveApply.setOp(BizConst.OP_INSERT); |
|
|
|
saveApply.setTongID(oldApply.getTongID()); |
|
|
|
} |
|
|
|
|
|
|
|
saveApply.setBizTime(LocalDateTime.now()); |
|
|
|
applyService.saveOrUpdate(saveApply); |
|
|
|
|
|
|
@@ -95,10 +107,16 @@ public class ProjectReceiveManage { |
|
|
|
ProjectApprove saveApprove = BeanUtil.copyProperties(approve,ProjectApprove.class); |
|
|
|
saveApprove.setBaseProjId(baseProjId); |
|
|
|
if(Objects.isNull(oldApprove)){ |
|
|
|
saveApprove.setOp(BizConst.OP_INSERT); |
|
|
|
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update |
|
|
|
if(StringUtils.isNotBlank(approve.getOp()) && BizConst.OP_UPDATE.equals(approve.getOp())){ |
|
|
|
saveApprove.setOp(BizConst.OP_UPDATE); |
|
|
|
}else{ |
|
|
|
saveApprove.setOp(BizConst.OP_INSERT); |
|
|
|
} |
|
|
|
saveApprove.setTongTime(LocalDateTime.now()); |
|
|
|
}else{ |
|
|
|
saveApprove.setOp(BizConst.OP_UPDATE); |
|
|
|
saveApprove.setOp(BizConst.OP_INSERT); |
|
|
|
saveApprove.setTongID(oldApprove.getTongID()); |
|
|
|
} |
|
|
|
saveApprove.setBizTime(LocalDateTime.now()); |
|
|
|
approveService.saveOrUpdate(saveApprove); |
|
|
@@ -114,10 +132,16 @@ public class ProjectReceiveManage { |
|
|
|
ProjectCimplement saveCimplement = BeanUtil.copyProperties(cimplement,ProjectCimplement.class); |
|
|
|
saveCimplement.setBaseProjId(baseProjId); |
|
|
|
if(Objects.isNull(oldCimplement)){ |
|
|
|
saveCimplement.setOp(BizConst.OP_INSERT); |
|
|
|
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update |
|
|
|
if(StringUtils.isNotBlank(cimplement.getOp()) && BizConst.OP_UPDATE.equals(cimplement.getOp())){ |
|
|
|
saveCimplement.setOp(BizConst.OP_UPDATE); |
|
|
|
}else{ |
|
|
|
saveCimplement.setOp(BizConst.OP_INSERT); |
|
|
|
} |
|
|
|
saveCimplement.setTongTime(LocalDateTime.now()); |
|
|
|
}else{ |
|
|
|
saveCimplement.setOp(BizConst.OP_UPDATE); |
|
|
|
saveCimplement.setOp(BizConst.OP_INSERT); |
|
|
|
saveCimplement.setTongID(oldCimplement.getTongID()); |
|
|
|
} |
|
|
|
saveCimplement.setBizTime(LocalDateTime.now()); |
|
|
|
cimplementService.saveOrUpdate(saveCimplement); |
|
|
@@ -133,10 +157,16 @@ public class ProjectReceiveManage { |
|
|
|
ProjectMimplement saveMimplement = BeanUtil.copyProperties(mimplement,ProjectMimplement.class); |
|
|
|
saveMimplement.setBaseProjId(baseProjId); |
|
|
|
if(Objects.isNull(oldMimplement)){ |
|
|
|
saveMimplement.setOp(BizConst.OP_INSERT); |
|
|
|
//如果当前 数据不存在 但是我们平台操作是修改 说明之前数据被推送过了那么 可以置为修改update |
|
|
|
if(StringUtils.isNotBlank(mimplement.getOp()) && BizConst.OP_UPDATE.equals(mimplement.getOp())){ |
|
|
|
saveMimplement.setOp(BizConst.OP_UPDATE); |
|
|
|
}else{ |
|
|
|
saveMimplement.setOp(BizConst.OP_INSERT); |
|
|
|
} |
|
|
|
saveMimplement.setTongTime(LocalDateTime.now()); |
|
|
|
}else{ |
|
|
|
saveMimplement.setOp(BizConst.OP_UPDATE); |
|
|
|
saveMimplement.setOp(BizConst.OP_INSERT); |
|
|
|
saveMimplement.setTongID(oldMimplement.getTongID()); |
|
|
|
} |
|
|
|
saveMimplement.setBizTime(LocalDateTime.now()); |
|
|
|
mimplementService.saveOrUpdate(saveMimplement); |
|
|
@@ -191,4 +221,19 @@ public class ProjectReceiveManage { |
|
|
|
|
|
|
|
return BizConst.OP_SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除表里的所有数据 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public String deleteAll() { |
|
|
|
baseInfoService.remove(Wrappers.lambdaQuery(ProjectBaseInfo.class)); |
|
|
|
applyService.remove(Wrappers.lambdaQuery(ProjectApply.class)); |
|
|
|
approveService.remove(Wrappers.lambdaQuery(ProjectApprove.class)); |
|
|
|
cimplementService.remove(Wrappers.lambdaQuery(ProjectCimplement.class)); |
|
|
|
mimplementService.remove(Wrappers.lambdaQuery(ProjectMimplement.class)); |
|
|
|
procureService.remove(Wrappers.lambdaQuery(ProjectProcure.class)); |
|
|
|
log.info("删除所有前置表数据成功"); |
|
|
|
return BizConst.OP_SUCCESS; |
|
|
|
} |
|
|
|
} |