bugfix修改资产排除关停任务没有做非空校验

main
吴顺杰 6 days ago
parent 0a8be55162
commit f6d4009431

@ -9,18 +9,57 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.*;
import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.AssetBasicNetwork;
import com.ruoyi.tc.entity.AssetBusinessForm;
import com.ruoyi.tc.entity.AssetCurrent;
import com.ruoyi.tc.entity.AssetExport;
import com.ruoyi.tc.entity.AssetSupplyChain;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.UnitOtherConcat;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
import com.ruoyi.tc.entity.po.AssetBasicNetworkJyPo;
import com.ruoyi.tc.entity.po.AssetBusinessFormCpPo;
import com.ruoyi.tc.entity.po.AssetBusinessFormJyPo;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.po.AssetCurrentJyPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainJyPo;
import com.ruoyi.tc.entity.po.UnitOtherConcatCpPo;
import com.ruoyi.tc.entity.po.UnitOtherConcatJyPo;
import com.ruoyi.tc.entity.request.Acomma;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest;
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
import com.ruoyi.tc.service.*;
import com.ruoyi.tc.service.AssetBasicNetworkCpService;
import com.ruoyi.tc.service.AssetBasicNetworkJyService;
import com.ruoyi.tc.service.AssetBasicNetworkService;
import com.ruoyi.tc.service.AssetBusinessFormCpService;
import com.ruoyi.tc.service.AssetBusinessFormJyService;
import com.ruoyi.tc.service.AssetBusinessFormService;
import com.ruoyi.tc.service.AssetCurrentCpService;
import com.ruoyi.tc.service.AssetCurrentJyService;
import com.ruoyi.tc.service.AssetCurrentService;
import com.ruoyi.tc.service.AssetSupplyChainCpService;
import com.ruoyi.tc.service.AssetSupplyChainJyService;
import com.ruoyi.tc.service.AssetSupplyChainService;
import com.ruoyi.tc.service.AssetTaskService;
import com.ruoyi.tc.service.UnitOtherConcatCpService;
import com.ruoyi.tc.service.UnitOtherConcatJyservice;
import com.ruoyi.tc.service.UnitOtherConcatService;
import com.ruoyi.tc.service.UnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
@ -573,61 +612,61 @@ public class AssetCurrentController extends BaseController {
queryWrapper1.eq("task_id", i);
queryWrapper1.ne("status", 5);
AssetCurrentCpPo x = assetCurrentCpService.getOne(queryWrapper1);
if (BeanUtil.isEmpty(x)) {
Integer status = x.getStatus();
Long currentId = x.getCurrentId();
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
assetCurrentCpPo.setTaskId(i);
assetCurrentCpPo.setCurrentId(currentId);
assetCurrentCpPo.setStatus(status);
assetCurrentCpService.updateById(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);
Integer status = x.getStatus();
Long currentId = x.getCurrentId();
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
assetCurrentCpPo.setTaskId(i);
assetCurrentCpPo.setCurrentId(currentId);
assetCurrentCpPo.setStatus(status);
assetCurrentCpService.updateById(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());
}
if (assetCurrent.getGylxxList() != null) {
for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) {
items.setAssetId(assetCurrent.getId());
items.setTaskId(i);
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();

Loading…
Cancel
Save