|
|
|
@ -125,7 +125,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
if (bussList != null) {
|
|
|
|
|
for (AssetBusinessFormCpPo assetBusinessFormCpResponse : bussList) {
|
|
|
|
|
if (assetCurrentResponse.getXjgywxt() != null) {
|
|
|
|
|
assetCurrentResponse.getXjgywxt().setAssetId(assetBusinessFormCpResponse.getId());
|
|
|
|
|
assetCurrentResponse.getXjgywxt().setAssetId(assetBusinessFormCpResponse.getAssetId());
|
|
|
|
|
assetCurrentResponse.getXjgywxt().setTaskId(id);
|
|
|
|
|
assetBusinessFormCpResponseList.add(assetCurrentResponse.getXjgywxt());
|
|
|
|
|
}
|
|
|
|
@ -137,7 +137,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
if (supplyChainList != null) {
|
|
|
|
|
for (AssetSupplyChainCpPo items : supplyChainList) {
|
|
|
|
|
items.setAssetId(assetCurrentResponse.getId());
|
|
|
|
|
// items.setSupplyId(items.getSupplyId());
|
|
|
|
|
items.setSupplyId(items.getSupplyId());
|
|
|
|
|
items.setTaskId(id);
|
|
|
|
|
//新增供应链
|
|
|
|
|
}
|
|
|
|
@ -148,7 +148,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
for (AssetBasicNetworkCpPo items : BasicNetworkCpList) {
|
|
|
|
|
//根据资产id查询基础网络主表id
|
|
|
|
|
items.setAssetId(assetCurrentResponse.getId());
|
|
|
|
|
// items.setNetworkId(items.getNetworkId());
|
|
|
|
|
items.setNetworkId(items.getNetworkId());
|
|
|
|
|
items.setTaskId(id);
|
|
|
|
|
//新增基础网络
|
|
|
|
|
}
|
|
|
|
@ -159,7 +159,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
for (UnitOtherConcatCpPo items : unitOtherConcatList) {
|
|
|
|
|
//根据资产id查询其他联系人主表id
|
|
|
|
|
items.setAssetId(assetCurrentResponse.getId());
|
|
|
|
|
// items.setConcatId(items.getConcatId());
|
|
|
|
|
items.setConcatId(items.getConcatId());
|
|
|
|
|
items.setTaskId(id);
|
|
|
|
|
//新增其他联系人
|
|
|
|
|
}
|
|
|
|
@ -220,7 +220,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
@Override
|
|
|
|
|
public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest) {
|
|
|
|
|
assetTask.setOptimizeCountSql(false);
|
|
|
|
|
return assetTaskDao.zcHc(assetTask, pageRequest);
|
|
|
|
|
Page<AssestTaskXqresponse> result = assetTaskDao.zcHc(assetTask, pageRequest);
|
|
|
|
|
// 确保 records 不为 null
|
|
|
|
|
if (result.getRecords() == null) {
|
|
|
|
|
result.setRecords(new ArrayList<>()); // 设置为空数组
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -247,6 +252,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
boolean allApproved = list.stream().allMatch(item -> item.getStatus() == 3);
|
|
|
|
|
boolean hasExpired = list.stream().anyMatch(item -> item.getDeadstatus() == 6);
|
|
|
|
|
boolean hasRejected = list.stream().anyMatch(item -> item.getStatus() == 4);
|
|
|
|
|
boolean hased = list.stream().anyMatch(item -> item.getStatus() == 5);
|
|
|
|
|
LocalDateTime finishTime = null;
|
|
|
|
|
if (hasPendingApproval) {
|
|
|
|
|
// 资产状态存在待审批,任务状态为进行中
|
|
|
|
@ -263,7 +269,18 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
taskSaveOrDelete(req);
|
|
|
|
|
} else if (hasRejected) {
|
|
|
|
|
// 审核不通过
|
|
|
|
|
taskStatus = 4;
|
|
|
|
|
taskStatus = 1;
|
|
|
|
|
} else if (hased && !hasRejected && !hasExpired) {
|
|
|
|
|
//存在已报废并且其他都已完成 且未超期
|
|
|
|
|
taskStatus = 2;
|
|
|
|
|
finishTime = LocalDateTime.now();
|
|
|
|
|
taskSaveOrDelete(req);
|
|
|
|
|
}
|
|
|
|
|
else if(hased && !hasRejected && hasExpired){
|
|
|
|
|
//存在已报废并且其他都已完成 且未超期
|
|
|
|
|
taskStatus = 3;
|
|
|
|
|
finishTime = LocalDateTime.now();
|
|
|
|
|
taskSaveOrDelete(req);
|
|
|
|
|
}
|
|
|
|
|
//修改主表任务状态
|
|
|
|
|
assetTaskDao.updateByTaskId(taskStatus, req.getTaskId(), finishTime);
|
|
|
|
|