|
|
@ -261,6 +261,13 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
//新增其他联系人
|
|
|
|
//新增其他联系人
|
|
|
|
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
|
|
|
|
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (assetCurrent.getSjzcList() != null) {
|
|
|
|
|
|
|
|
for (AssetSj items : assetCurrent.getSjzcList()) {
|
|
|
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增数据资产
|
|
|
|
|
|
|
|
assetAssetSjService.saveBatch(assetCurrent.getSjzcList());
|
|
|
|
|
|
|
|
}
|
|
|
|
// 单位有进行中的任务时,管理端新增该单位下的资产则需同步至当前进行中的任务中。
|
|
|
|
// 单位有进行中的任务时,管理端新增该单位下的资产则需同步至当前进行中的任务中。
|
|
|
|
//获取新增资产id
|
|
|
|
//获取新增资产id
|
|
|
|
Long id = assetCurrent.getId();
|
|
|
|
Long id = assetCurrent.getId();
|
|
|
@ -482,7 +489,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
AssetBusinessForm assetBusinessForm = assetCurrentZztbPo.getXjgywxt();
|
|
|
|
AssetBusinessForm assetBusinessForm = assetCurrentZztbPo.getXjgywxt();
|
|
|
|
AssetBusinessFormZztbPo assetBusinessFormZztbPo = new AssetBusinessFormZztbPo();
|
|
|
|
AssetBusinessFormZztbPo assetBusinessFormZztbPo = new AssetBusinessFormZztbPo();
|
|
|
|
BeanUtils.copyProperties(assetBusinessForm, assetBusinessFormZztbPo);
|
|
|
|
BeanUtils.copyProperties(assetBusinessForm, assetBusinessFormZztbPo);
|
|
|
|
assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId());
|
|
|
|
assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
assetBusinessFormZztbService.save(assetBusinessFormZztbPo);
|
|
|
|
assetBusinessFormZztbService.save(assetBusinessFormZztbPo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (assetCurrentZztbPo.getGylxxList() != null) {
|
|
|
|
if (assetCurrentZztbPo.getGylxxList() != null) {
|
|
|
@ -589,18 +596,37 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
@GetMapping("/lookInfo/{id}")
|
|
|
|
@GetMapping("/lookInfo/{id}")
|
|
|
|
public AjaxResult lookInfo(@PathVariable Long id) {
|
|
|
|
public AjaxResult lookInfo(@PathVariable Long id) {
|
|
|
|
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(id);
|
|
|
|
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(id);
|
|
|
|
byId.setGylxxList(assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list());
|
|
|
|
if (byId.getId() == null) {
|
|
|
|
byId.setJcwlList(assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list());
|
|
|
|
//单位段新增查看
|
|
|
|
AssetBusinessFormZztbPo assetBusinessFormZztbPo = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).one();
|
|
|
|
byId.setGylxxList(assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list());
|
|
|
|
if (assetBusinessFormZztbPo != null) {
|
|
|
|
byId.setJcwlList(assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list());
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
AssetBusinessFormZztbPo assetBusinessFormZztbPo = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).one();
|
|
|
|
BeanUtils.copyProperties(assetBusinessFormZztbPo, assetBusinessForm);
|
|
|
|
if (assetBusinessFormZztbPo != null) {
|
|
|
|
byId.setXjgywxt(assetBusinessForm);
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(assetBusinessFormZztbPo, assetBusinessForm);
|
|
|
|
|
|
|
|
byId.setXjgywxt(assetBusinessForm);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
byId.setXjgywxt(null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
byId.setOtherConcat(unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
byId.setSjzcList(assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
byId.setXjgywxt(null);
|
|
|
|
//管理端新增查看
|
|
|
|
|
|
|
|
byId.setGylxxList(assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getId()).isNull(AssetSupplyChainZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
byId.setJcwlList(assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
AssetBusinessFormZztbPo assetBusinessFormZztbPo = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getId()).isNull(AssetBusinessFormZztbPo::getTaskId).one();
|
|
|
|
|
|
|
|
if (assetBusinessFormZztbPo != null) {
|
|
|
|
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(assetBusinessFormZztbPo, assetBusinessForm);
|
|
|
|
|
|
|
|
byId.setXjgywxt(assetBusinessForm);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
byId.setXjgywxt(null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
byId.setOtherConcat(unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getId()).isNull(UnitOtherConcatZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
byId.setSjzcList(assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getId()).isNull(AssetSjZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
byId.setOtherConcat(unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
byId.setSjzcList(assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Acomma> a1 = new ArrayList<>();
|
|
|
|
List<Acomma> a1 = new ArrayList<>();
|
|
|
|
if (byId.getGlym() != null) {
|
|
|
|
if (byId.getGlym() != null) {
|
|
|
@ -663,6 +689,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
AssetCurrent assetCurrent = new AssetCurrent();
|
|
|
|
AssetCurrent assetCurrent = new AssetCurrent();
|
|
|
|
BeanUtil.copyProperties(byId, assetCurrent);
|
|
|
|
BeanUtil.copyProperties(byId, assetCurrent);
|
|
|
|
//修改主表
|
|
|
|
//修改主表
|
|
|
|
|
|
|
|
assetCurrent.setDelFlag("0");
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
//删除副表数据然后再添加
|
|
|
|
//删除副表数据然后再添加
|
|
|
|
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
|
|
|
@ -698,54 +725,61 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
unitOtherConcatService.save(a4);
|
|
|
|
unitOtherConcatService.save(a4);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//如果有任务也修改任务这边
|
|
|
|
//如果有任务也修改任务这边
|
|
|
|
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery().isNotNull(AssetCurrentCpPo::getTaskId).ne(AssetCurrentCpPo::getStatus, 5).eq(AssetCurrentCpPo::getId, byId.getId()).one();
|
|
|
|
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery().isNotNull(AssetCurrentCpPo::getTaskId).ne(AssetCurrentCpPo::getStatus, 5).
|
|
|
|
|
|
|
|
eq(AssetCurrentCpPo::getId, byId.getId())
|
|
|
|
|
|
|
|
.orderByDesc(AssetCurrentCpPo::getCurrentId)
|
|
|
|
|
|
|
|
.last("LIMIT 1").one();
|
|
|
|
if (one != null) {
|
|
|
|
if (one != null) {
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
//根据任务id查询任务是否关闭
|
|
|
|
Long appId = one.getCurrentId();
|
|
|
|
AssetTask two = assetTaskService.lambdaQuery().eq(AssetTask::getId, one.getTaskId()).eq(AssetTask::getTaskStatus, 0).one();
|
|
|
|
Integer status = one.getStatus();
|
|
|
|
if (two == null) {
|
|
|
|
BeanUtil.copyProperties(byId, one);
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
one.setCurrentId(appId);
|
|
|
|
Long appId = one.getCurrentId();
|
|
|
|
one.setTaskId(taskId);
|
|
|
|
Integer status = one.getStatus();
|
|
|
|
one.setAuditState(null);
|
|
|
|
BeanUtil.copyProperties(byId, one);
|
|
|
|
one.setAuditYy(null);
|
|
|
|
one.setCurrentId(appId);
|
|
|
|
one.setStatus(status);
|
|
|
|
one.setTaskId(taskId);
|
|
|
|
assetCurrentCpService.updateById(one);
|
|
|
|
one.setAuditState(null);
|
|
|
|
|
|
|
|
one.setAuditYy(null);
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
one.setStatus(status);
|
|
|
|
queryWrapper2.eq("asset_id", one.getId());
|
|
|
|
assetCurrentCpService.updateById(one);
|
|
|
|
queryWrapper2.eq("task_id", taskId);
|
|
|
|
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
queryWrapper2.eq("asset_id", one.getId());
|
|
|
|
queryWrapper3.eq("asset_id", one.getId());
|
|
|
|
queryWrapper2.eq("task_id", taskId);
|
|
|
|
queryWrapper3.eq("task_id", taskId);
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
queryWrapper3.eq("asset_id", one.getId());
|
|
|
|
queryWrapper4.eq("asset_id", one.getId());
|
|
|
|
queryWrapper3.eq("task_id", taskId);
|
|
|
|
queryWrapper4.eq("task_id", taskId);
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
queryWrapper4.eq("asset_id", one.getId());
|
|
|
|
queryWrapper5.eq("task_id", taskId);
|
|
|
|
queryWrapper4.eq("task_id", taskId);
|
|
|
|
queryWrapper5.eq("asset_id", one.getId());
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
list.forEach(x -> {
|
|
|
|
queryWrapper5.eq("task_id", taskId);
|
|
|
|
x.setTaskId(taskId);
|
|
|
|
queryWrapper5.eq("asset_id", one.getId());
|
|
|
|
assetSupplyChainCpService.save(x);
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
});
|
|
|
|
list.forEach(x -> {
|
|
|
|
list1.forEach(x -> {
|
|
|
|
x.setTaskId(taskId);
|
|
|
|
x.setTaskId(taskId);
|
|
|
|
assetSupplyChainCpService.save(x);
|
|
|
|
assetBasicNetworkCpService.save(x);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
list1.forEach(x -> {
|
|
|
|
list2.forEach(x -> {
|
|
|
|
x.setTaskId(taskId);
|
|
|
|
x.setTaskId(taskId);
|
|
|
|
assetBasicNetworkCpService.save(x);
|
|
|
|
assetBusinessFormCpService.save(x);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
list2.forEach(x -> {
|
|
|
|
list3.forEach(x -> {
|
|
|
|
x.setTaskId(taskId);
|
|
|
|
x.setTaskId(taskId);
|
|
|
|
assetBusinessFormCpService.save(x);
|
|
|
|
unitOtherConcatCpService.save(x);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
list3.forEach(x -> {
|
|
|
|
|
|
|
|
x.setTaskId(taskId);
|
|
|
|
|
|
|
|
unitOtherConcatCpService.save(x);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if ("2".equals(as.getAuditState())) {
|
|
|
|
else {
|
|
|
|
|
|
|
|
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(as.getCurrentId());
|
|
|
|
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(as.getCurrentId());
|
|
|
|
AssetCurrent aa = new AssetCurrent();
|
|
|
|
AssetCurrent aa = new AssetCurrent();
|
|
|
|
BeanUtil.copyProperties(byId, aa);
|
|
|
|
BeanUtil.copyProperties(byId, aa);
|
|
|
@ -753,8 +787,19 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
AssetCurrent assetCurrent = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, byId.getXtmc()).eq(AssetCurrent::getDwmc, byId.getDwmc()).one();
|
|
|
|
AssetCurrent assetCurrent = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, byId.getXtmc()).eq(AssetCurrent::getDwmc, byId.getDwmc()).one();
|
|
|
|
if (assetCurrent != null) {
|
|
|
|
if (assetCurrent != null) {
|
|
|
|
//修改主表
|
|
|
|
//修改主表
|
|
|
|
BeanUtil.copyProperties(aa, assetCurrent, "id");
|
|
|
|
if (assetCurrent.getXzType() == 0) {
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
BeanUtil.copyProperties(aa, assetCurrent, "id");
|
|
|
|
|
|
|
|
assetCurrent.setXzType(0);
|
|
|
|
|
|
|
|
assetCurrent.setDelFlag("0");
|
|
|
|
|
|
|
|
assetCurrent.setBtgyy(null);
|
|
|
|
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(aa, assetCurrent, "id");
|
|
|
|
|
|
|
|
assetCurrent.setDelFlag("0");
|
|
|
|
|
|
|
|
assetCurrent.setBtgyy(null);
|
|
|
|
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//删除子表数据
|
|
|
|
//删除子表数据
|
|
|
|
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
@ -762,7 +807,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetAssetSjService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetAssetSjService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
//供应链
|
|
|
|
//供应链
|
|
|
|
List<AssetSupplyChainZztbPo> supplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
|
|
|
|
List<AssetSupplyChainZztbPo> supplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
|
|
|
|
List<AssetSupplyChain> assetSupplyChainList = supplyChainZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<AssetSupplyChain> assetSupplyChainList = supplyChainZztbPoList.stream().map(cpPo -> {
|
|
|
|
AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
|
|
|
|
AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
|
|
|
@ -773,7 +818,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
assetSupplyChainService.saveBatch(assetSupplyChainList);
|
|
|
|
assetSupplyChainService.saveBatch(assetSupplyChainList);
|
|
|
|
|
|
|
|
|
|
|
|
//newtwork
|
|
|
|
//newtwork
|
|
|
|
List<AssetBasicNetworkZztbPo> networkZztbPoList = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
|
|
|
|
List<AssetBasicNetworkZztbPo> networkZztbPoList = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
|
|
|
|
List<AssetBasicNetwork> networkList = networkZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<AssetBasicNetwork> networkList = networkZztbPoList.stream().map(cpPo -> {
|
|
|
|
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
|
|
|
|
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
|
|
|
@ -784,7 +829,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
assetBasicNetworkService.saveBatch(networkList);
|
|
|
|
assetBasicNetworkService.saveBatch(networkList);
|
|
|
|
|
|
|
|
|
|
|
|
//business
|
|
|
|
//business
|
|
|
|
List<AssetBusinessFormZztbPo> businessFormZztbPoList = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
|
|
|
|
List<AssetBusinessFormZztbPo> businessFormZztbPoList = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
|
|
|
|
List<AssetBusinessForm> businessFormList = businessFormZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<AssetBusinessForm> businessFormList = businessFormZztbPoList.stream().map(cpPo -> {
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
|
|
|
@ -796,7 +841,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//unitother
|
|
|
|
//unitother
|
|
|
|
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
|
|
|
|
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
|
|
|
|
List<UnitOtherConcat> unitOtherConcatList = unitOtherConcatZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<UnitOtherConcat> unitOtherConcatList = unitOtherConcatZztbPoList.stream().map(cpPo -> {
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
|
|
|
@ -807,7 +852,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
unitOtherConcatService.saveBatch(unitOtherConcatList);
|
|
|
|
unitOtherConcatService.saveBatch(unitOtherConcatList);
|
|
|
|
|
|
|
|
|
|
|
|
//数据资产
|
|
|
|
//数据资产
|
|
|
|
List<AssetSjZztbPo> assetSjZztbPoList = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list();
|
|
|
|
List<AssetSjZztbPo> assetSjZztbPoList = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getId()).isNull(AssetSjZztbPo::getTaskId).list();
|
|
|
|
List<AssetSj> assetSjList = assetSjZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<AssetSj> assetSjList = assetSjZztbPoList.stream().map(cpPo -> {
|
|
|
|
AssetSj assetSj = new AssetSj();
|
|
|
|
AssetSj assetSj = new AssetSj();
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSj); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSj); // 复制属性
|
|
|
@ -816,149 +861,246 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
return assetSj; // 返回新对象
|
|
|
|
return assetSj; // 返回新对象
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
assetAssetSjService.saveBatch(assetSjList);
|
|
|
|
assetAssetSjService.saveBatch(assetSjList);
|
|
|
|
|
|
|
|
//如果有任务也修改任务这边
|
|
|
|
|
|
|
|
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery()
|
|
|
|
|
|
|
|
.isNotNull(AssetCurrentCpPo::getTaskId)
|
|
|
|
|
|
|
|
.ne(AssetCurrentCpPo::getStatus, 5)
|
|
|
|
|
|
|
|
.eq(AssetCurrentCpPo::getId, byId.getId())
|
|
|
|
|
|
|
|
.orderByDesc(AssetCurrentCpPo::getCurrentId)
|
|
|
|
|
|
|
|
.last("LIMIT 1")
|
|
|
|
|
|
|
|
.one();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (one != null) {
|
|
|
|
|
|
|
|
//根据任务id查询任务是否关闭
|
|
|
|
|
|
|
|
AssetTask two = assetTaskService.lambdaQuery().eq(AssetTask::getId, one.getTaskId()).eq(AssetTask::getTaskStatus, 0).one();
|
|
|
|
|
|
|
|
if (two == null) {
|
|
|
|
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
|
|
|
|
Long appId = one.getCurrentId();
|
|
|
|
|
|
|
|
Integer status = one.getStatus();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(byId, one);
|
|
|
|
|
|
|
|
one.setCurrentId(appId);
|
|
|
|
|
|
|
|
one.setTaskId(taskId);
|
|
|
|
|
|
|
|
one.setAuditState(null);
|
|
|
|
|
|
|
|
one.setAuditYy(null);
|
|
|
|
|
|
|
|
one.setStatus(status);
|
|
|
|
|
|
|
|
assetCurrentCpService.updateById(one);
|
|
|
|
|
|
|
|
//删除子表数据
|
|
|
|
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper2.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
queryWrapper2.eq("task_id", taskId);
|
|
|
|
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper3.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
queryWrapper3.eq("task_id", taskId);
|
|
|
|
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper4.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
queryWrapper4.eq("task_id", taskId);
|
|
|
|
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper5.eq("task_id", taskId);
|
|
|
|
|
|
|
|
queryWrapper5.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
|
|
|
|
QueryWrapper<AssetSjCpPo> queryWrapper6 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper6.eq("task_id", taskId);
|
|
|
|
|
|
|
|
queryWrapper6.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
assetAssetSjCpService.remove(queryWrapper6);
|
|
|
|
|
|
|
|
List<AssetSupplyChainZztbPo> list = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
list.forEach(x -> {
|
|
|
|
|
|
|
|
AssetSupplyChainCpPo a1 = new AssetSupplyChainCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(x, a1);
|
|
|
|
|
|
|
|
a1.setTaskId(taskId);
|
|
|
|
|
|
|
|
a1.setSupplyId(null);
|
|
|
|
|
|
|
|
assetSupplyChainCpService.save(a1);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AssetBasicNetworkZztbPo> list1 = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
list1.forEach(x -> {
|
|
|
|
|
|
|
|
AssetBasicNetworkCpPo a2 = new AssetBasicNetworkCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(x, a2);
|
|
|
|
|
|
|
|
a2.setTaskId(taskId);
|
|
|
|
|
|
|
|
a2.setNetworkId(null);
|
|
|
|
|
|
|
|
assetBasicNetworkCpService.save(a2);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AssetBusinessFormZztbPo> list2 = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
list2.forEach(x -> {
|
|
|
|
|
|
|
|
AssetBusinessFormCpPo a3 = new AssetBusinessFormCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(x, a3);
|
|
|
|
|
|
|
|
a3.setTaskId(taskId);
|
|
|
|
|
|
|
|
a3.setBusinessId(null);
|
|
|
|
|
|
|
|
assetBusinessFormCpService.save(a3);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<UnitOtherConcatZztbPo> list3 = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
list3.forEach(x -> {
|
|
|
|
|
|
|
|
UnitOtherConcatCpPo a4 = new UnitOtherConcatCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(x, a4);
|
|
|
|
|
|
|
|
a4.setTaskId(taskId);
|
|
|
|
|
|
|
|
a4.setConcatId(null);
|
|
|
|
|
|
|
|
unitOtherConcatCpService.save(a4);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
List<AssetSjZztbPo> list4 = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getId()).isNull(AssetSjZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
list4.forEach(x -> {
|
|
|
|
|
|
|
|
AssetSjCpPo a5 = new AssetSjCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(x, a5);
|
|
|
|
|
|
|
|
a5.setTaskId(taskId);
|
|
|
|
|
|
|
|
a5.setSjId(null);
|
|
|
|
|
|
|
|
assetAssetSjCpService.save(a5);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//新增主表
|
|
|
|
//新增主表
|
|
|
|
assetCurrentService.save(aa);
|
|
|
|
assetCurrentService.save(aa);
|
|
|
|
//供应链
|
|
|
|
//供应链
|
|
|
|
List<AssetSupplyChainZztbPo> supplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
|
|
|
|
List<AssetSupplyChainZztbPo> assetSupplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
|
|
|
|
List<AssetSupplyChain> assetSupplyChainList = supplyChainZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<AssetSupplyChain> assetSupplyChainList1 = assetSupplyChainZztbPoList.stream().map(cpPo -> {
|
|
|
|
AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
|
|
|
|
AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
|
|
|
|
assetSupplyChain.setId(null);
|
|
|
|
assetSupplyChain.setId(null);
|
|
|
|
assetSupplyChain.setAssetId(aa.getId());
|
|
|
|
assetSupplyChain.setAssetId(aa.getId());
|
|
|
|
return assetSupplyChain; // 返回新对象
|
|
|
|
return assetSupplyChain; // 返回新对象
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
assetSupplyChainService.saveBatch(assetSupplyChainList);
|
|
|
|
assetSupplyChainService.saveBatch(assetSupplyChainList1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//newtwork
|
|
|
|
//newtwork
|
|
|
|
List<AssetBasicNetworkZztbPo> networkZztbPoList = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
|
|
|
|
List<AssetBasicNetworkZztbPo> networkZztbPoList1 = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
|
|
|
|
List<AssetBasicNetwork> networkList = networkZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<AssetBasicNetwork> networkList1 = networkZztbPoList1.stream().map(cpPo -> {
|
|
|
|
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
|
|
|
|
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
|
|
|
|
assetBasicNetwork.setId(null);
|
|
|
|
assetBasicNetwork.setId(null);
|
|
|
|
assetBasicNetwork.setAssetId(aa.getId());
|
|
|
|
assetBasicNetwork.setAssetId(aa.getId());
|
|
|
|
return assetBasicNetwork; // 返回新对象
|
|
|
|
return assetBasicNetwork; // 返回新对象
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
assetBasicNetworkService.saveBatch(networkList);
|
|
|
|
assetBasicNetworkService.saveBatch(networkList1);
|
|
|
|
|
|
|
|
|
|
|
|
//business
|
|
|
|
//business
|
|
|
|
List<AssetBusinessFormZztbPo> businessFormZztbPoList = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
|
|
|
|
List<AssetBusinessFormZztbPo> businessFormZztbPoList1 = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
|
|
|
|
List<AssetBusinessForm> businessFormList = businessFormZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<AssetBusinessForm> businessFormList1 = businessFormZztbPoList1.stream().map(cpPo -> {
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
|
|
|
|
assetBusinessForm.setId(null);
|
|
|
|
assetBusinessForm.setId(null);
|
|
|
|
assetBusinessForm.setAssetId(aa.getId());
|
|
|
|
assetBusinessForm.setAssetId(aa.getId());
|
|
|
|
return assetBusinessForm; // 返回新对象
|
|
|
|
return assetBusinessForm; // 返回新对象
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
assetBusinessFormService.saveBatch(businessFormList);
|
|
|
|
assetBusinessFormService.saveBatch(businessFormList1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//unitother
|
|
|
|
//unitother
|
|
|
|
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
|
|
|
|
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList1 = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
|
|
|
|
List<UnitOtherConcat> unitOtherConcatList = unitOtherConcatZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<UnitOtherConcat> unitOtherConcatList1 = unitOtherConcatZztbPoList1.stream().map(cpPo -> {
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
|
|
|
|
unitOtherConcat.setConcatId(null);
|
|
|
|
unitOtherConcat.setConcatId(null);
|
|
|
|
unitOtherConcat.setAssetId(aa.getId());
|
|
|
|
unitOtherConcat.setAssetId(aa.getId());
|
|
|
|
return unitOtherConcat; // 返回新对象
|
|
|
|
return unitOtherConcat; // 返回新对象
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
unitOtherConcatService.saveBatch(unitOtherConcatList);
|
|
|
|
unitOtherConcatService.saveBatch(unitOtherConcatList1);
|
|
|
|
|
|
|
|
|
|
|
|
//数据资产
|
|
|
|
//数据资产
|
|
|
|
List<AssetSjZztbPo> assetSjZztbPoList = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list();
|
|
|
|
List<AssetSjZztbPo> assetSjZztbPoList1 = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list();
|
|
|
|
List<AssetSj> assetSjList = assetSjZztbPoList.stream().map(cpPo -> {
|
|
|
|
List<AssetSj> assetSjList1 = assetSjZztbPoList1.stream().map(cpPo -> {
|
|
|
|
AssetSj assetSj = new AssetSj();
|
|
|
|
AssetSj assetSj = new AssetSj();
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSj); // 复制属性
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSj); // 复制属性
|
|
|
|
assetSj.setId(null);
|
|
|
|
assetSj.setId(null);
|
|
|
|
assetSj.setAssetId(aa.getId());
|
|
|
|
assetSj.setAssetId(aa.getId());
|
|
|
|
return assetSj; // 返回新对象
|
|
|
|
return assetSj; // 返回新对象
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
assetAssetSjService.saveBatch(assetSjList);
|
|
|
|
assetAssetSjService.saveBatch(assetSjList1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询改单位下是否有进行中的任务
|
|
|
|
|
|
|
|
AssetTask task = assetTaskService.lambdaQuery().like(AssetTask::getDwmc, aa.getDwmc()).like(AssetTask::getType, "1").eq(AssetTask::getTaskStatus, 1).one();
|
|
|
|
|
|
|
|
if (task != null) {
|
|
|
|
|
|
|
|
AssetCurrentCpPo bb = new AssetCurrentCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(byId, bb);
|
|
|
|
|
|
|
|
bb.setId(aa.getId());
|
|
|
|
|
|
|
|
bb.setTaskId(task.getId());
|
|
|
|
|
|
|
|
bb.setCurrentId(null);
|
|
|
|
|
|
|
|
assetCurrentCpService.save(bb);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//供应链
|
|
|
|
|
|
|
|
List<AssetSupplyChainCpPo> assetSupplyChainCpPos = assetSupplyChainZztbPoList.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSupplyChainCpPo assetSupplyChainCpPo = new AssetSupplyChainCpPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSupplyChainCpPo); // 复制属性
|
|
|
|
|
|
|
|
assetSupplyChainCpPo.setSupplyId(null);
|
|
|
|
|
|
|
|
assetSupplyChainCpPo.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
assetSupplyChainCpPo.setTaskId(task.getId());
|
|
|
|
|
|
|
|
return assetSupplyChainCpPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetSupplyChainCpService.saveBatch(assetSupplyChainCpPos);
|
|
|
|
|
|
|
|
//netWork
|
|
|
|
|
|
|
|
List<AssetBasicNetworkCpPo> networkCpPos = networkZztbPoList1.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBasicNetworkCpPo assetBasicNetworkCpPo = new AssetBasicNetworkCpPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetworkCpPo); // 复制属性
|
|
|
|
|
|
|
|
assetBasicNetworkCpPo.setNetworkId(null);
|
|
|
|
|
|
|
|
assetBasicNetworkCpPo.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
assetBasicNetworkCpPo.setTaskId(task.getId());
|
|
|
|
|
|
|
|
return assetBasicNetworkCpPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetBasicNetworkCpService.saveBatch(networkCpPos);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//bussiness
|
|
|
|
|
|
|
|
List<AssetBusinessFormCpPo> businessFormCpPos = businessFormZztbPoList1.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBusinessFormCpPo assetBusinessFormCpPo = new AssetBusinessFormCpPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBusinessFormCpPo); // 复制属性
|
|
|
|
|
|
|
|
assetBusinessFormCpPo.setBusinessId(null);
|
|
|
|
|
|
|
|
assetBusinessFormCpPo.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
assetBusinessFormCpPo.setTaskId(task.getId());
|
|
|
|
|
|
|
|
return assetBusinessFormCpPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetBusinessFormCpService.saveBatch(businessFormCpPos);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//unitother
|
|
|
|
|
|
|
|
List<UnitOtherConcatCpPo> unitOtherConcatCpPos = unitOtherConcatZztbPoList1.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
UnitOtherConcatCpPo unitOtherConcatCpPo = new UnitOtherConcatCpPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcatCpPo); // 复制属性
|
|
|
|
|
|
|
|
unitOtherConcatCpPo.setConcatId(null);
|
|
|
|
|
|
|
|
unitOtherConcatCpPo.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
unitOtherConcatCpPo.setTaskId(task.getId());
|
|
|
|
|
|
|
|
return unitOtherConcatCpPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
unitOtherConcatCpService.saveBatch(unitOtherConcatCpPos);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//数据资产
|
|
|
|
|
|
|
|
List<AssetSjCpPo> assetSjCpPos = assetSjZztbPoList1.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSjCpPo assetSjCpPo = new AssetSjCpPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSjCpPo); // 复制属性
|
|
|
|
|
|
|
|
assetSjCpPo.setSjId(null);
|
|
|
|
|
|
|
|
assetSjCpPo.setTaskId(task.getId());
|
|
|
|
|
|
|
|
assetSjCpPo.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetSjCpPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetAssetSjCpService.saveBatch(assetSjCpPos);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//如果有任务也修改任务这边
|
|
|
|
|
|
|
|
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery().isNotNull(AssetCurrentCpPo::getTaskId).ne(AssetCurrentCpPo::getStatus, 5).eq(AssetCurrentCpPo::getId, byId.getId()).one();
|
|
|
|
|
|
|
|
if (one != null) {
|
|
|
|
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
|
|
|
|
Long appId = one.getCurrentId();
|
|
|
|
|
|
|
|
Integer status = one.getStatus();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(byId, one);
|
|
|
|
|
|
|
|
one.setCurrentId(appId);
|
|
|
|
|
|
|
|
one.setTaskId(taskId);
|
|
|
|
|
|
|
|
one.setAuditState(null);
|
|
|
|
|
|
|
|
one.setAuditYy(null);
|
|
|
|
|
|
|
|
one.setStatus(status);
|
|
|
|
|
|
|
|
assetCurrentCpService.updateById(one);
|
|
|
|
|
|
|
|
//删除子表数据
|
|
|
|
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper2.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
queryWrapper2.eq("task_id", taskId);
|
|
|
|
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper3.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
queryWrapper3.eq("task_id", taskId);
|
|
|
|
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper4.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
queryWrapper4.eq("task_id", taskId);
|
|
|
|
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper5.eq("task_id", taskId);
|
|
|
|
|
|
|
|
queryWrapper5.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
|
|
|
|
QueryWrapper<AssetSjCpPo> queryWrapper6 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper6.eq("task_id", taskId);
|
|
|
|
|
|
|
|
queryWrapper6.eq("asset_id", one.getId());
|
|
|
|
|
|
|
|
assetAssetSjCpService.remove(queryWrapper6);
|
|
|
|
|
|
|
|
List<AssetSupplyChainZztbPo> list = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
list.forEach(x -> {
|
|
|
|
|
|
|
|
AssetSupplyChainCpPo a1 = new AssetSupplyChainCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(x, a1);
|
|
|
|
|
|
|
|
a1.setTaskId(taskId);
|
|
|
|
|
|
|
|
assetSupplyChainCpService.save(a1);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AssetBasicNetworkZztbPo> list1 = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
list1.forEach(x -> {
|
|
|
|
|
|
|
|
AssetBasicNetworkCpPo a2 = new AssetBasicNetworkCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(x, a2);
|
|
|
|
|
|
|
|
a2.setTaskId(taskId);
|
|
|
|
|
|
|
|
assetBasicNetworkCpService.save(a2);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AssetBusinessFormZztbPo> list2 = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
list2.forEach(x -> {
|
|
|
|
|
|
|
|
AssetBusinessFormCpPo a3 = new AssetBusinessFormCpPo();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(x, a3);
|
|
|
|
|
|
|
|
a3.setTaskId(taskId);
|
|
|
|
|
|
|
|
assetBusinessFormCpService.save(a3);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<UnitOtherConcatZztbPo> list3 = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
|
|
|
|
} else if ("3".equals(as.getAuditState())) {
|
|
|
|
list3.forEach(x -> {
|
|
|
|
//审核不通过
|
|
|
|
UnitOtherConcatCpPo a4 = new UnitOtherConcatCpPo();
|
|
|
|
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(as.getCurrentId());
|
|
|
|
BeanUtil.copyProperties(x, a4);
|
|
|
|
AssetCurrent aa = new AssetCurrent();
|
|
|
|
a4.setTaskId(taskId);
|
|
|
|
BeanUtil.copyProperties(byId, aa);
|
|
|
|
unitOtherConcatCpService.save(a4);
|
|
|
|
//根据资产名称和所属单位查询主表是否有数据
|
|
|
|
});
|
|
|
|
AssetCurrent assetCurrent = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, byId.getXtmc()).eq(AssetCurrent::getDwmc, byId.getDwmc()).one();
|
|
|
|
List<AssetSjZztbPo> list4 = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getId()).isNull(AssetSjZztbPo::getTaskId).list();
|
|
|
|
if (assetCurrent != null) {
|
|
|
|
list4.forEach(x -> {
|
|
|
|
//修改主表
|
|
|
|
AssetSjCpPo a5 = new AssetSjCpPo();
|
|
|
|
if (assetCurrent.getXzType() == 0) {
|
|
|
|
BeanUtil.copyProperties(x, a5);
|
|
|
|
BeanUtil.copyProperties(aa, assetCurrent, "id");
|
|
|
|
a5.setTaskId(taskId);
|
|
|
|
assetCurrent.setXzType(0);
|
|
|
|
assetAssetSjCpService.save(a5);
|
|
|
|
assetCurrent.setDelFlag("1");
|
|
|
|
});
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(aa, assetCurrent, "id");
|
|
|
|
|
|
|
|
assetCurrent.setDelFlag("1");
|
|
|
|
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return success();
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//=================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|