|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.ruoyi.tc.service.impl;
|
|
|
|
package com.ruoyi.tc.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
@ -13,11 +14,13 @@ import com.ruoyi.tc.entity.response.AssetdwHcResponse;
|
|
|
|
import com.ruoyi.tc.mapper.AssetTaskMapper;
|
|
|
|
import com.ruoyi.tc.mapper.AssetTaskMapper;
|
|
|
|
import com.ruoyi.tc.service.*;
|
|
|
|
import com.ruoyi.tc.service.*;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
@ -296,7 +299,10 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
.map(AssetCurrentCpPo::getId)
|
|
|
|
.map(AssetCurrentCpPo::getId)
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(idList)) {
|
|
|
|
assetCurrentService.deleteIdList(idList);
|
|
|
|
assetCurrentService.deleteIdList(idList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
List<AssetCurrent> currentNewList = currentList.stream()
|
|
|
|
List<AssetCurrent> currentNewList = currentList.stream()
|
|
|
|
.map(cpPo -> {
|
|
|
|
.map(cpPo -> {
|
|
|
@ -312,7 +318,10 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
.map(AssetBusinessFormCpPo::getAssetId)
|
|
|
|
.map(AssetBusinessFormCpPo::getAssetId)
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bussinessidList)) {
|
|
|
|
assetBusinessFormService.deleteIdList(bussinessidList);
|
|
|
|
assetBusinessFormService.deleteIdList(bussinessidList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
List<AssetBusinessForm> bussinessNewList = bussinessList.stream()
|
|
|
|
List<AssetBusinessForm> bussinessNewList = bussinessList.stream()
|
|
|
|
.map(cpPo -> {
|
|
|
|
.map(cpPo -> {
|
|
|
@ -328,7 +337,10 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
.map(AssetBasicNetworkCpPo::getAssetId)
|
|
|
|
.map(AssetBasicNetworkCpPo::getAssetId)
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(netWorkidList)) {
|
|
|
|
assetBasicNetworkService.deleteIdList(netWorkidList);
|
|
|
|
assetBasicNetworkService.deleteIdList(netWorkidList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
List<AssetBasicNetwork> netWorkNewList = netWorkList.stream()
|
|
|
|
List<AssetBasicNetwork> netWorkNewList = netWorkList.stream()
|
|
|
|
.map(cpPo -> {
|
|
|
|
.map(cpPo -> {
|
|
|
@ -344,7 +356,10 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
.map(AssetSupplyChainCpPo::getAssetId)
|
|
|
|
.map(AssetSupplyChainCpPo::getAssetId)
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(SupplyChainidList)) {
|
|
|
|
assetSupplyChainService.deleteIdList(SupplyChainidList);
|
|
|
|
assetSupplyChainService.deleteIdList(SupplyChainidList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<AssetSupplyChain> SupplyChainNewList = SupplyChainList.stream()
|
|
|
|
List<AssetSupplyChain> SupplyChainNewList = SupplyChainList.stream()
|
|
|
|
.map(cpPo -> {
|
|
|
|
.map(cpPo -> {
|
|
|
|
AssetSupplyChain supplyChain = new AssetSupplyChain();
|
|
|
|
AssetSupplyChain supplyChain = new AssetSupplyChain();
|
|
|
@ -360,7 +375,9 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
.map(UnitOtherConcatCpPo::getAssetId)
|
|
|
|
.map(UnitOtherConcatCpPo::getAssetId)
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(UnitOtherConcatidList)) {
|
|
|
|
unitOtherConcatService.deleteIdList(UnitOtherConcatidList);
|
|
|
|
unitOtherConcatService.deleteIdList(UnitOtherConcatidList);
|
|
|
|
|
|
|
|
}
|
|
|
|
List<UnitOtherConcat> UnitOtherConcatNewList = UnitOtherConcatList.stream()
|
|
|
|
List<UnitOtherConcat> UnitOtherConcatNewList = UnitOtherConcatList.stream()
|
|
|
|
.map(cpPo -> {
|
|
|
|
.map(cpPo -> {
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|