|
|
@ -9,57 +9,18 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.tc.entity.AssetBasicNetwork;
|
|
|
|
import com.ruoyi.tc.entity.*;
|
|
|
|
import com.ruoyi.tc.entity.AssetBusinessForm;
|
|
|
|
import com.ruoyi.tc.entity.po.*;
|
|
|
|
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.Acomma;
|
|
|
|
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
|
|
|
|
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
|
|
|
|
import com.ruoyi.tc.entity.request.AssetAuditRequest;
|
|
|
|
import com.ruoyi.tc.entity.request.AssetAuditRequest;
|
|
|
|
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
|
|
|
|
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
|
|
|
|
import com.ruoyi.tc.service.AssetBasicNetworkCpService;
|
|
|
|
import com.ruoyi.tc.service.*;
|
|
|
|
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.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
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 org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
@ -183,8 +144,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public AjaxResult insert(@RequestBody @Valid AssetCurrent assetCurrent) {
|
|
|
|
public AjaxResult insert(@RequestBody @Valid AssetCurrent assetCurrent) {
|
|
|
|
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc())
|
|
|
|
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc()).eq(Unit::getDelFlag, 0).list();
|
|
|
|
.eq(Unit::getDelFlag, 0).list();
|
|
|
|
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
throw new ServiceException("请选择已有单位!");
|
|
|
|
throw new ServiceException("请选择已有单位!");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -292,8 +252,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('unit')")
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('unit')")
|
|
|
|
@PostMapping("/unitEdit")
|
|
|
|
@PostMapping("/unitEdit")
|
|
|
|
public AjaxResult unitEdit(@RequestBody @Valid AssetCurrentJyPo assetCurrentJyPo) {
|
|
|
|
public AjaxResult unitEdit(@RequestBody @Valid AssetCurrentJyPo assetCurrentJyPo) {
|
|
|
|
AssetCurrentJyPo one = assetCurrentJyService.lambdaQuery().eq(AssetCurrentJyPo::getXtmc, assetCurrentJyPo.getXtmc())
|
|
|
|
AssetCurrentJyPo one = assetCurrentJyService.lambdaQuery().eq(AssetCurrentJyPo::getXtmc, assetCurrentJyPo.getXtmc()).eq(AssetCurrentJyPo::getDwmc, assetCurrentJyPo.getDwmc()).isNull(AssetCurrentJyPo::getTaskId).one();
|
|
|
|
.eq(AssetCurrentJyPo::getDwmc, assetCurrentJyPo.getDwmc()).isNull(AssetCurrentJyPo::getTaskId).one();
|
|
|
|
|
|
|
|
assetCurrentJyPo.setAuditState("1");
|
|
|
|
assetCurrentJyPo.setAuditState("1");
|
|
|
|
assetCurrentJyPo.setAuditYy(null);
|
|
|
|
assetCurrentJyPo.setAuditYy(null);
|
|
|
|
if (one != null) {
|
|
|
|
if (one != null) {
|
|
|
@ -484,10 +443,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
unitOtherConcatService.save(a4);
|
|
|
|
unitOtherConcatService.save(a4);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//如果有任务也修改任务这边
|
|
|
|
//如果有任务也修改任务这边
|
|
|
|
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery()
|
|
|
|
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery().isNotNull(AssetCurrentCpPo::getTaskId).ne(AssetCurrentCpPo::getStatus, 5).eq(AssetCurrentCpPo::getId, byId.getId()).one();
|
|
|
|
.isNotNull(AssetCurrentCpPo::getTaskId)
|
|
|
|
|
|
|
|
.ne(AssetCurrentCpPo::getStatus, 5)
|
|
|
|
|
|
|
|
.eq(AssetCurrentCpPo::getId, byId.getId()).one();
|
|
|
|
|
|
|
|
if (one != null) {
|
|
|
|
if (one != null) {
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
Long appId = one.getCurrentId();
|
|
|
|
Long appId = one.getCurrentId();
|
|
|
@ -549,6 +505,8 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
|
|
|
|
@PutMapping
|
|
|
|
@PutMapping
|
|
|
|
public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) {
|
|
|
|
public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) {
|
|
|
|
|
|
|
|
//保存未修改之前的单位名称
|
|
|
|
|
|
|
|
AssetCurrent byId = assetCurrentService.getById(assetCurrent.getId());
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
@ -569,7 +527,13 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assetCurrent.setGlIp(b.toString());
|
|
|
|
assetCurrent.setGlIp(b.toString());
|
|
|
|
|
|
|
|
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc()).eq(Unit::getDelFlag, 0).list();
|
|
|
|
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
|
|
|
|
throw new ServiceException("请选择已有单位!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
|
|
|
|
|
|
|
|
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
|
|
|
@ -603,50 +567,67 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
//新增其他联系人
|
|
|
|
//新增其他联系人
|
|
|
|
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
|
|
|
|
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer i = unitService.selectTaskId(assetCurrent.getDwmc(), "0");
|
|
|
|
//================================
|
|
|
|
if (i != null) {
|
|
|
|
//根据未修改之前的单位名称去寻找正在进行中的任务,报废的任务,单位自编辑的任务
|
|
|
|
QueryWrapper<AssetCurrentCpPo> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
List<AssetCurrentCpPo> list1 = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getId, assetCurrent.getId()).list();
|
|
|
|
queryWrapper1.eq("id", assetCurrent.getId());
|
|
|
|
list1.forEach(x -> {
|
|
|
|
queryWrapper1.eq("task_id", i);
|
|
|
|
Integer taskId = x.getTaskId();
|
|
|
|
queryWrapper1.ne("status", 5);
|
|
|
|
|
|
|
|
AssetCurrentCpPo x = assetCurrentCpService.getOne(queryWrapper1);
|
|
|
|
|
|
|
|
if (BeanUtil.isEmpty(x)) {
|
|
|
|
|
|
|
|
Integer status = x.getStatus();
|
|
|
|
|
|
|
|
Long currentId = x.getCurrentId();
|
|
|
|
Long currentId = x.getCurrentId();
|
|
|
|
|
|
|
|
Integer status = x.getStatus();
|
|
|
|
|
|
|
|
String auditState = x.getAuditState();
|
|
|
|
|
|
|
|
String auditYy = x.getAuditYy();
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
|
|
|
|
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
|
|
|
|
assetCurrentCpPo.setTaskId(i);
|
|
|
|
assetCurrentCpPo.setTaskId(taskId);
|
|
|
|
assetCurrentCpPo.setCurrentId(currentId);
|
|
|
|
assetCurrentCpPo.setCurrentId(currentId);
|
|
|
|
assetCurrentCpPo.setStatus(status);
|
|
|
|
assetCurrentCpPo.setStatus(status);
|
|
|
|
|
|
|
|
assetCurrentCpPo.setAuditState(auditState);
|
|
|
|
|
|
|
|
assetCurrentCpPo.setAuditYy(auditYy);
|
|
|
|
assetCurrentCpService.updateById(assetCurrentCpPo);
|
|
|
|
assetCurrentCpService.updateById(assetCurrentCpPo);
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
queryWrapper2.eq("asset_id", assetCurrent.getId());
|
|
|
|
queryWrapper2.eq("asset_id", assetCurrent.getId());
|
|
|
|
queryWrapper2.eq("task_id", i);
|
|
|
|
if (taskId == null) {
|
|
|
|
|
|
|
|
queryWrapper2.isNull("task_id");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
queryWrapper2.eq("task_id", taskId);
|
|
|
|
|
|
|
|
}
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
assetSupplyChainCpService.remove(queryWrapper2);
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
queryWrapper3.eq("task_id", i);
|
|
|
|
if (taskId == null) {
|
|
|
|
|
|
|
|
queryWrapper3.isNull("task_id");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
queryWrapper3.eq("task_id", taskId);
|
|
|
|
|
|
|
|
}
|
|
|
|
queryWrapper3.eq("asset_id", assetCurrent.getId());
|
|
|
|
queryWrapper3.eq("asset_id", assetCurrent.getId());
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
assetBasicNetworkCpService.remove(queryWrapper3);
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
queryWrapper4.eq("task_id", i);
|
|
|
|
if (taskId == null) {
|
|
|
|
|
|
|
|
queryWrapper4.isNull("task_id");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
queryWrapper4.eq("task_id", taskId);
|
|
|
|
|
|
|
|
}
|
|
|
|
queryWrapper4.eq("asset_id", assetCurrent.getId());
|
|
|
|
queryWrapper4.eq("asset_id", assetCurrent.getId());
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
assetBusinessFormCpService.remove(queryWrapper4);
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
queryWrapper5.eq("asset_id", assetCurrent.getId());
|
|
|
|
queryWrapper5.eq("asset_id", assetCurrent.getId());
|
|
|
|
queryWrapper5.eq("task_id", i);
|
|
|
|
if (taskId == null) {
|
|
|
|
|
|
|
|
queryWrapper5.isNull("task_id");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
queryWrapper5.eq("task_id", taskId);
|
|
|
|
|
|
|
|
}
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
assetCurrentCpPo.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
assetCurrentCpPo.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
assetCurrentCpPo.getXjgywxt().setTaskId(i);
|
|
|
|
assetCurrentCpPo.getXjgywxt().setTaskId(taskId);
|
|
|
|
assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt());
|
|
|
|
assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (assetCurrent.getGylxxList() != null) {
|
|
|
|
if (assetCurrent.getGylxxList() != null) {
|
|
|
|
for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) {
|
|
|
|
for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) {
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
items.setTaskId(i);
|
|
|
|
items.setTaskId(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增供应链
|
|
|
|
//新增供应链
|
|
|
|
assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList());
|
|
|
|
assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList());
|
|
|
@ -654,7 +635,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
if (assetCurrent.getJcwlList() != null) {
|
|
|
|
if (assetCurrent.getJcwlList() != null) {
|
|
|
|
for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) {
|
|
|
|
for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) {
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
items.setTaskId(i);
|
|
|
|
items.setTaskId(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增基础网络
|
|
|
|
//新增基础网络
|
|
|
|
assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList());
|
|
|
|
assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList());
|
|
|
@ -662,13 +643,12 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
if (assetCurrent.getOtherConcat() != null) {
|
|
|
|
if (assetCurrent.getOtherConcat() != null) {
|
|
|
|
for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) {
|
|
|
|
for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) {
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
items.setTaskId(i);
|
|
|
|
items.setTaskId(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增其他联系人
|
|
|
|
//新增其他联系人
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return success();
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -754,8 +734,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
AssetCurrent as = new AssetCurrent();
|
|
|
|
AssetCurrent as = new AssetCurrent();
|
|
|
|
//copy新增到新的现有资产表里面
|
|
|
|
//copy新增到新的现有资产表里面
|
|
|
|
BeanUtil.copyProperties(items, as);
|
|
|
|
BeanUtil.copyProperties(items, as);
|
|
|
|
AssetCurrent one = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, as.getXtmc())
|
|
|
|
AssetCurrent one = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, as.getXtmc()).eq(AssetCurrent::getDwmc, as.getDwmc()).one();
|
|
|
|
.eq(AssetCurrent::getDwmc, as.getDwmc()).one();
|
|
|
|
|
|
|
|
if (one != null) {
|
|
|
|
if (one != null) {
|
|
|
|
as.setId(one.getId());
|
|
|
|
as.setId(one.getId());
|
|
|
|
assetCurrentService.updateById(as);
|
|
|
|
assetCurrentService.updateById(as);
|
|
|
@ -764,8 +743,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
assetSupplyChainService.deleteIdList(a1);
|
|
|
|
assetSupplyChainService.deleteIdList(a1);
|
|
|
|
assetBasicNetworkService.deleteIdList(a1);
|
|
|
|
assetBasicNetworkService.deleteIdList(a1);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, items.getDwmc())
|
|
|
|
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, items.getDwmc()).eq(Unit::getDelFlag, 0).list();
|
|
|
|
.eq(Unit::getDelFlag, 0).list();
|
|
|
|
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
throw new ServiceException(j + "行单位未入库!");
|
|
|
|
throw new ServiceException(j + "行单位未入库!");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -834,8 +812,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
BeanUtil.copyProperties(as, assetCurrentCpPo);
|
|
|
|
BeanUtil.copyProperties(as, assetCurrentCpPo);
|
|
|
|
assetCurrentCpPo.setTaskId(i);
|
|
|
|
assetCurrentCpPo.setTaskId(i);
|
|
|
|
assetCurrentCpPo.setStatus(0);
|
|
|
|
assetCurrentCpPo.setStatus(0);
|
|
|
|
AssetCurrentCpPo two = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getXtmc, as.getXtmc())
|
|
|
|
AssetCurrentCpPo two = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getXtmc, as.getXtmc()).eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).isNotNull(AssetCurrentCpPo::getTaskId).one();
|
|
|
|
.eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).isNotNull(AssetCurrentCpPo::getTaskId).one();
|
|
|
|
|
|
|
|
if (two != null) {
|
|
|
|
if (two != null) {
|
|
|
|
assetCurrentCpPo.setId(two.getId());
|
|
|
|
assetCurrentCpPo.setId(two.getId());
|
|
|
|
assetCurrentCpService.updateById(assetCurrentCpPo);
|
|
|
|
assetCurrentCpService.updateById(assetCurrentCpPo);
|
|
|
|