|
|
|
@ -442,6 +442,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
//如果有任务也修改任务这边
|
|
|
|
|
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery()
|
|
|
|
|
.isNotNull(AssetCurrentCpPo::getTaskId)
|
|
|
|
|
.eq(AssetCurrentCpPo::getStatus,"1")
|
|
|
|
|
.eq(AssetCurrentCpPo::getId, byId.getId()).one();
|
|
|
|
|
if(one!=null){
|
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
@ -453,22 +454,20 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
one.setAuditYy(null);
|
|
|
|
|
assetCurrentCpService.updateById(one);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper2.eq("asset_id", one.getId());
|
|
|
|
|
queryWrapper2.isNull("task_id");
|
|
|
|
|
queryWrapper2.eq("task_id",taskId);
|
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper3.eq("asset_id", one.getId());
|
|
|
|
|
queryWrapper3.isNull("task_id");
|
|
|
|
|
queryWrapper3.eq("task_id",taskId);
|
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper4.eq("asset_id", one.getId());
|
|
|
|
|
queryWrapper4.isNull("task_id");
|
|
|
|
|
queryWrapper4.eq("task_id",taskId);
|
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper5.isNull("task_id");
|
|
|
|
|
queryWrapper5.eq("task_id",taskId);
|
|
|
|
|
queryWrapper5.eq("asset_id", one.getId());
|
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
|
list.forEach(x -> {
|
|
|
|
@ -560,64 +559,69 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
//================================
|
|
|
|
|
|
|
|
|
|
QueryWrapper<AssetCurrentCpPo> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper1.eq("id", assetCurrent.getId());
|
|
|
|
|
assetCurrentCpService.remove(queryWrapper1);
|
|
|
|
|
|
|
|
|
|
Integer i = unitService.selectTaskId(assetCurrent.getDwmc(), "0");
|
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
|
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
|
|
|
|
|
assetCurrentCpPo.setTaskId(i);
|
|
|
|
|
assetCurrentCpService.save(assetCurrentCpPo);
|
|
|
|
|
if(i!=null){
|
|
|
|
|
|
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper2.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
queryWrapper2.isNotNull("task_id");
|
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper3.isNotNull("task_id");
|
|
|
|
|
queryWrapper3.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper4.isNotNull("task_id");
|
|
|
|
|
queryWrapper4.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper5.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
queryWrapper5.isNotNull("task_id");
|
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
|
QueryWrapper<AssetCurrentCpPo> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper1.eq("id", assetCurrent.getId());
|
|
|
|
|
queryWrapper1.eq("status","1");
|
|
|
|
|
queryWrapper1.eq("task_id",i);
|
|
|
|
|
assetCurrentCpService.remove(queryWrapper1);
|
|
|
|
|
|
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
|
assetCurrentCpPo.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
|
assetCurrentCpPo.getXjgywxt().setTaskId(i);
|
|
|
|
|
assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt());
|
|
|
|
|
}
|
|
|
|
|
if (assetCurrent.getGylxxList() != null) {
|
|
|
|
|
for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setTaskId(i);
|
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
|
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
|
|
|
|
|
assetCurrentCpPo.setTaskId(i);
|
|
|
|
|
assetCurrentCpPo.setStatus(1);
|
|
|
|
|
assetCurrentCpService.save(assetCurrentCpPo);
|
|
|
|
|
|
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper2.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
queryWrapper2.eq("task_id",i);
|
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper3.eq("task_id",i);
|
|
|
|
|
queryWrapper3.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper4.eq("task_id",i);
|
|
|
|
|
queryWrapper4.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
|
queryWrapper5.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
queryWrapper5.eq("task_id",i);
|
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
|
|
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
|
assetCurrentCpPo.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
|
assetCurrentCpPo.getXjgywxt().setTaskId(i);
|
|
|
|
|
assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt());
|
|
|
|
|
}
|
|
|
|
|
//新增供应链
|
|
|
|
|
assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList());
|
|
|
|
|
}
|
|
|
|
|
if (assetCurrent.getJcwlList() != null) {
|
|
|
|
|
for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setTaskId(i);
|
|
|
|
|
if (assetCurrent.getGylxxList() != null) {
|
|
|
|
|
for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setTaskId(i);
|
|
|
|
|
}
|
|
|
|
|
//新增供应链
|
|
|
|
|
assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList());
|
|
|
|
|
}
|
|
|
|
|
//新增基础网络
|
|
|
|
|
assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList());
|
|
|
|
|
}
|
|
|
|
|
if (assetCurrent.getOtherConcat() != null) {
|
|
|
|
|
for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setTaskId(i);
|
|
|
|
|
if (assetCurrent.getJcwlList() != null) {
|
|
|
|
|
for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setTaskId(i);
|
|
|
|
|
}
|
|
|
|
|
//新增基础网络
|
|
|
|
|
assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList());
|
|
|
|
|
}
|
|
|
|
|
if (assetCurrent.getOtherConcat() != null) {
|
|
|
|
|
for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setTaskId(i);
|
|
|
|
|
}
|
|
|
|
|
//新增其他联系人
|
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
|
}
|
|
|
|
|
//新增其他联系人
|
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|