|
|
@ -17,9 +17,12 @@ 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.entity.zztb.*;
|
|
|
|
import com.ruoyi.tc.service.*;
|
|
|
|
import com.ruoyi.tc.service.*;
|
|
|
|
|
|
|
|
import com.ruoyi.tc.zztbService.*;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
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.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@ -33,6 +36,7 @@ import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 现有资产表(AssetCurrent)表控制层
|
|
|
|
* 现有资产表(AssetCurrent)表控制层
|
|
|
@ -102,6 +106,37 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
private AssetBasicNetworkJyService assetBasicNetworkJyService;
|
|
|
|
private AssetBasicNetworkJyService assetBasicNetworkJyService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetCurrentZztbService assetCurrentZztbService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetBasicNetworkZztbService assetBasicNetworkZztbService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetBusinessFormZztbService assetBusinessFormZztbService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetSupplyChainZztbService assetSupplyChainZztbService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private UnitOtherConcatZztbservice unitOtherConcatZztbservice;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetAssetSjCpService assetAssetSjCpService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetAssetSjZztbService assetAssetSjZztbService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetAssetSjService assetAssetSjService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 分页查询所有数据
|
|
|
|
* 分页查询所有数据
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -144,7 +179,6 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value = "新增数据")
|
|
|
|
@ApiOperation(value = "新增数据")
|
|
|
|
@PostMapping
|
|
|
|
@PostMapping
|
|
|
|
@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) {
|
|
|
|
|
|
|
|
|
|
|
@ -157,6 +191,8 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
throw new ServiceException("不允许新增重复资产!");
|
|
|
|
throw new ServiceException("不允许新增重复资产!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrent.getXzType() != 1) {
|
|
|
|
|
|
|
|
//管理端新增
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
@ -186,7 +222,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
Object portValue = jsonObject.get("port");
|
|
|
|
Object portValue = jsonObject.get("port");
|
|
|
|
if (portValue != null && !portValue.toString().isEmpty()) {
|
|
|
|
if (portValue != null && !portValue.toString().isEmpty()) {
|
|
|
|
acomma.setPort(portValue.toString());
|
|
|
|
acomma.setPort(portValue.toString());
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
acomma.setPort("");
|
|
|
|
acomma.setPort("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a2.add(acomma);
|
|
|
|
a2.add(acomma);
|
|
|
@ -225,7 +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();
|
|
|
@ -235,6 +277,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
|
|
|
|
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
|
|
|
|
assetCurrentCpPo.setTaskId(i);
|
|
|
|
assetCurrentCpPo.setTaskId(i);
|
|
|
|
|
|
|
|
assetCurrentCpPo.setXzType(1);
|
|
|
|
assetCurrentCpService.save(assetCurrentCpPo);
|
|
|
|
assetCurrentCpService.save(assetCurrentCpPo);
|
|
|
|
//新增新监管业务形态
|
|
|
|
//新增新监管业务形态
|
|
|
|
//根据资产id查询新监管业务形态主表id
|
|
|
|
//根据资产id查询新监管业务形态主表id
|
|
|
@ -267,7 +310,133 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
//新增其他联系人
|
|
|
|
//新增其他联系人
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrent.getSjzcList() != null) {
|
|
|
|
|
|
|
|
for (AssetSjCpPo items : assetCurrentCpPo.getSjzcList()) {
|
|
|
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
|
|
|
items.setTaskId(i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增数据资产
|
|
|
|
|
|
|
|
assetAssetSjCpService.saveBatch(assetCurrentCpPo.getSjzcList());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//单位端新增
|
|
|
|
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
|
|
|
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
|
|
|
|
|
|
|
|
a.append(x.getKey());
|
|
|
|
|
|
|
|
a.append(",");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
assetCurrent.setGlym(a.toString());
|
|
|
|
|
|
|
|
List<Acomma> a2 = new ArrayList<>();
|
|
|
|
|
|
|
|
if (assetCurrent.getGlIpList() != null) {
|
|
|
|
|
|
|
|
if (assetCurrent.getGlIp() != null && !assetCurrent.getGlIp().isEmpty()) {
|
|
|
|
|
|
|
|
for (Object o : JSONArray.parseArray(assetCurrent.getGlIp())) {
|
|
|
|
|
|
|
|
Acomma acomma = new Acomma();
|
|
|
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(o.toString());
|
|
|
|
|
|
|
|
if (BeanUtil.isNotEmpty(jsonObject.get("key"))) {
|
|
|
|
|
|
|
|
acomma.setKey(jsonObject.get("key").toString());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
acomma.setKey("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (BeanUtil.isNotEmpty(jsonObject.get("ipType"))) {
|
|
|
|
|
|
|
|
acomma.setIpType(jsonObject.get("ipType").toString());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
acomma.setIpType("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object portValue = jsonObject.get("port");
|
|
|
|
|
|
|
|
if (portValue != null && !portValue.toString().isEmpty()) {
|
|
|
|
|
|
|
|
acomma.setPort(portValue.toString());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
acomma.setPort("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
a2.add(acomma);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
assetCurrent.setGlIpList(a2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
assetCurrent.setGlIpList(new ArrayList<>());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
AssetCurrentZztbPo assetCurrentZztbPo = new AssetCurrentZztbPo();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(assetCurrent, assetCurrentZztbPo);
|
|
|
|
|
|
|
|
assetCurrentZztbPo.setAuditState("1");
|
|
|
|
|
|
|
|
assetCurrentZztbPo.setAuditYy(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assetCurrentZztbService.save(assetCurrentZztbPo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增新监管业务形态
|
|
|
|
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
|
|
|
|
AssetBusinessForm assetBusinessForm = assetCurrent.getXjgywxt();
|
|
|
|
|
|
|
|
AssetBusinessFormZztbPo assetBusinessFormZztbPo = new AssetBusinessFormZztbPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(assetBusinessForm, assetBusinessFormZztbPo);
|
|
|
|
|
|
|
|
assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId());
|
|
|
|
|
|
|
|
assetBusinessFormZztbService.save(assetBusinessFormZztbPo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (assetCurrent.getGylxxList() != null) {
|
|
|
|
|
|
|
|
List<AssetSupplyChainZztbPo> supplyChainZztbPos = assetCurrent.getGylxxList().stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSupplyChainZztbPo assetBasicNetworkZztbPo = new AssetSupplyChainZztbPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetworkZztbPo); // 复制属性
|
|
|
|
|
|
|
|
assetBasicNetworkZztbPo.setSupplyId(null);
|
|
|
|
|
|
|
|
assetBasicNetworkZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId());
|
|
|
|
|
|
|
|
return assetBasicNetworkZztbPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增供应链
|
|
|
|
|
|
|
|
boolean savedSuccessfully = assetSupplyChainZztbService.saveBatch(supplyChainZztbPos);
|
|
|
|
|
|
|
|
if (!savedSuccessfully) {
|
|
|
|
|
|
|
|
// 处理保存失败的情况
|
|
|
|
|
|
|
|
System.err.println("保存供应链数据失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (assetCurrent.getJcwlList() != null) {
|
|
|
|
|
|
|
|
List<AssetBasicNetworkZztbPo> networksCpPoList = assetCurrent.getJcwlList().stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBasicNetworkZztbPo assetBasicNetworkZztbPo = new AssetBasicNetworkZztbPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetworkZztbPo); // 复制属性
|
|
|
|
|
|
|
|
assetBasicNetworkZztbPo.setNetworkId(null);
|
|
|
|
|
|
|
|
assetBasicNetworkZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId());
|
|
|
|
|
|
|
|
return assetBasicNetworkZztbPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增基础网络
|
|
|
|
|
|
|
|
assetBasicNetworkZztbService.saveBatch(networksCpPoList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (assetCurrent.getOtherConcat() != null) {
|
|
|
|
|
|
|
|
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPos = assetCurrent.getOtherConcat().stream().map(cpPo -> {
|
|
|
|
|
|
|
|
UnitOtherConcatZztbPo unitOtherConcatZztbPo = new UnitOtherConcatZztbPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcatZztbPo); // 复制属性
|
|
|
|
|
|
|
|
unitOtherConcatZztbPo.setUnitId(null);
|
|
|
|
|
|
|
|
unitOtherConcatZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId());
|
|
|
|
|
|
|
|
return unitOtherConcatZztbPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增其他联系人
|
|
|
|
|
|
|
|
unitOtherConcatZztbservice.saveBatch(unitOtherConcatZztbPos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrent.getSjzcList() != null) {
|
|
|
|
|
|
|
|
List<AssetSjZztbPo> assetSjZztbPoList = assetCurrent.getSjzcList().stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSjZztbPo assetSjZztbPo = new AssetSjZztbPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSjZztbPo); // 复制属性
|
|
|
|
|
|
|
|
assetSjZztbPo.setSjId(null);
|
|
|
|
|
|
|
|
assetSjZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId());
|
|
|
|
|
|
|
|
return assetSjZztbPo; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增数据资产
|
|
|
|
|
|
|
|
assetAssetSjZztbService.saveBatch(assetSjZztbPoList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return success();
|
|
|
|
return success();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -279,89 +448,119 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
@ApiOperation(value = "单位自编辑进行校验")
|
|
|
|
@ApiOperation(value = "单位自编辑进行校验")
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('unit')")
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('unit')")
|
|
|
|
@PostMapping("/unitEdit")
|
|
|
|
@PostMapping("/unitEdit")
|
|
|
|
public AjaxResult unitEdit(@RequestBody @Valid AssetCurrentJyPo assetCurrentJyPo) {
|
|
|
|
public AjaxResult unitEdit(@RequestBody @Valid AssetCurrentZztbPo assetCurrentZztbPo) {
|
|
|
|
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrentJyPo.getDwmc()).eq(Unit::getDelFlag, 0).list();
|
|
|
|
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrentZztbPo.getDwmc()).eq(Unit::getDelFlag, 0).list();
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
throw new ServiceException("请选择已有单位!");
|
|
|
|
throw new ServiceException("请选择已有单位!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AssetCurrentJyPo one = assetCurrentJyService.lambdaQuery().eq(AssetCurrentJyPo::getXtmc, assetCurrentJyPo.getXtmc()).eq(AssetCurrentJyPo::getDwmc, assetCurrentJyPo.getDwmc()).isNull(AssetCurrentJyPo::getTaskId).one();
|
|
|
|
AssetCurrentZztbPo one = assetCurrentZztbService.lambdaQuery().eq(AssetCurrentZztbPo::getXtmc, assetCurrentZztbPo.getXtmc()).eq(AssetCurrentZztbPo::getDwmc, assetCurrentZztbPo.getDwmc()).isNull(AssetCurrentZztbPo::getTaskId).one();
|
|
|
|
assetCurrentJyPo.setAuditState("1");
|
|
|
|
assetCurrentZztbPo.setAuditState("1");
|
|
|
|
assetCurrentJyPo.setAuditYy(null);
|
|
|
|
assetCurrentZztbPo.setAuditYy(null);
|
|
|
|
if (one != null) {
|
|
|
|
if (one != null) {
|
|
|
|
assetCurrentJyPo.setCurrentId(one.getCurrentId());
|
|
|
|
//编辑
|
|
|
|
assetCurrentJyService.updateById(assetCurrentJyPo);
|
|
|
|
assetCurrentZztbPo.setCurrentId(one.getCurrentId());
|
|
|
|
|
|
|
|
assetCurrentZztbService.updateById(assetCurrentZztbPo);
|
|
|
|
QueryWrapper<AssetSupplyChainJyPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<AssetSupplyChainZztbPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
queryWrapper2.eq("asset_id", assetCurrentJyPo.getId());
|
|
|
|
queryWrapper2.eq("asset_id", assetCurrentZztbPo.getId());
|
|
|
|
queryWrapper2.isNull("task_id");
|
|
|
|
queryWrapper2.isNull("task_id");
|
|
|
|
assetSupplyChainJyService.remove(queryWrapper2);
|
|
|
|
assetSupplyChainZztbService.remove(queryWrapper2);
|
|
|
|
QueryWrapper<AssetBasicNetworkJyPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper3.eq("asset_id", assetCurrentJyPo.getId());
|
|
|
|
QueryWrapper<AssetBasicNetworkZztbPo> queryWrapper3 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper3.eq("asset_id", assetCurrentZztbPo.getId());
|
|
|
|
queryWrapper3.isNull("task_id");
|
|
|
|
queryWrapper3.isNull("task_id");
|
|
|
|
assetBasicNetworkJyService.remove(queryWrapper3);
|
|
|
|
assetBasicNetworkZztbService.remove(queryWrapper3);
|
|
|
|
QueryWrapper<AssetBusinessFormJyPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper4.eq("asset_id", assetCurrentJyPo.getId());
|
|
|
|
QueryWrapper<AssetBusinessFormZztbPo> queryWrapper4 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper4.eq("asset_id", assetCurrentZztbPo.getId());
|
|
|
|
queryWrapper4.isNull("task_id");
|
|
|
|
queryWrapper4.isNull("task_id");
|
|
|
|
assetBusinessFormJyService.remove(queryWrapper4);
|
|
|
|
assetBusinessFormZztbService.remove(queryWrapper4);
|
|
|
|
QueryWrapper<UnitOtherConcatJyPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<UnitOtherConcatZztbPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
queryWrapper5.isNull("task_id");
|
|
|
|
queryWrapper5.isNull("task_id");
|
|
|
|
queryWrapper5.eq("asset_id", assetCurrentJyPo.getId());
|
|
|
|
queryWrapper5.eq("asset_id", assetCurrentZztbPo.getId());
|
|
|
|
unitOtherConcatJyservice.remove(queryWrapper5);
|
|
|
|
unitOtherConcatZztbservice.remove(queryWrapper5);
|
|
|
|
if (assetCurrentJyPo.getXjgywxt() != null) {
|
|
|
|
QueryWrapper<AssetSjZztbPo> queryWrapper6 = new QueryWrapper<>();
|
|
|
|
assetCurrentJyPo.getXjgywxt().setAssetId(assetCurrentJyPo.getId());
|
|
|
|
queryWrapper6.isNull("task_id");
|
|
|
|
assetBusinessFormJyService.save(assetCurrentJyPo.getXjgywxt());
|
|
|
|
queryWrapper6.eq("asset_id", assetCurrentZztbPo.getId());
|
|
|
|
|
|
|
|
assetAssetSjZztbService.remove(queryWrapper6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrentZztbPo.getXjgywxt() != null) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AssetBusinessForm assetBusinessForm = assetCurrentZztbPo.getXjgywxt();
|
|
|
|
|
|
|
|
AssetBusinessFormZztbPo assetBusinessFormZztbPo = new AssetBusinessFormZztbPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(assetBusinessForm, assetBusinessFormZztbPo);
|
|
|
|
|
|
|
|
assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
|
|
|
|
assetBusinessFormZztbService.save(assetBusinessFormZztbPo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (assetCurrentJyPo.getGylxxList() != null) {
|
|
|
|
if (assetCurrentZztbPo.getGylxxList() != null) {
|
|
|
|
for (AssetSupplyChainJyPo items : assetCurrentJyPo.getGylxxList()) {
|
|
|
|
for (AssetSupplyChainZztbPo items : assetCurrentZztbPo.getGylxxList()) {
|
|
|
|
items.setAssetId(assetCurrentJyPo.getId());
|
|
|
|
items.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增供应链
|
|
|
|
//新增供应链
|
|
|
|
assetSupplyChainJyService.saveBatch(assetCurrentJyPo.getGylxxList());
|
|
|
|
assetSupplyChainZztbService.saveBatch(assetCurrentZztbPo.getGylxxList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (assetCurrentJyPo.getJcwlList() != null) {
|
|
|
|
if (assetCurrentZztbPo.getJcwlList() != null) {
|
|
|
|
for (AssetBasicNetworkJyPo items : assetCurrentJyPo.getJcwlList()) {
|
|
|
|
for (AssetBasicNetworkZztbPo items : assetCurrentZztbPo.getJcwlList()) {
|
|
|
|
items.setAssetId(assetCurrentJyPo.getId());
|
|
|
|
items.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增基础网络
|
|
|
|
//新增基础网络
|
|
|
|
assetBasicNetworkJyService.saveBatch(assetCurrentJyPo.getJcwlList());
|
|
|
|
assetBasicNetworkZztbService.saveBatch(assetCurrentZztbPo.getJcwlList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (assetCurrentJyPo.getOtherConcat() != null) {
|
|
|
|
if (assetCurrentZztbPo.getOtherConcat() != null) {
|
|
|
|
for (UnitOtherConcatJyPo items : assetCurrentJyPo.getOtherConcat()) {
|
|
|
|
for (UnitOtherConcatZztbPo items : assetCurrentZztbPo.getOtherConcat()) {
|
|
|
|
items.setAssetId(assetCurrentJyPo.getId());
|
|
|
|
items.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增其他联系人
|
|
|
|
//新增其他联系人
|
|
|
|
unitOtherConcatJyservice.saveBatch(assetCurrentJyPo.getOtherConcat());
|
|
|
|
unitOtherConcatZztbservice.saveBatch(assetCurrentZztbPo.getOtherConcat());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrentZztbPo.getSjzcList() != null) {
|
|
|
|
|
|
|
|
for (AssetSjZztbPo items : assetCurrentZztbPo.getSjzcList()) {
|
|
|
|
|
|
|
|
items.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增数据资产
|
|
|
|
|
|
|
|
assetAssetSjZztbService.saveBatch(assetCurrentZztbPo.getSjzcList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AssetCurrentCpPo acc = new AssetCurrentCpPo();
|
|
|
|
//新增
|
|
|
|
BeanUtil.copyProperties(assetCurrentJyPo, acc);
|
|
|
|
assetCurrentZztbService.save(assetCurrentZztbPo);
|
|
|
|
assetCurrentCpService.save(acc);
|
|
|
|
if (assetCurrentZztbPo.getXjgywxt() != null) {
|
|
|
|
if (acc.getXjgywxt() != null) {
|
|
|
|
|
|
|
|
acc.getXjgywxt().setAssetId(acc.getId());
|
|
|
|
AssetBusinessForm assetBusinessForm = assetCurrentZztbPo.getXjgywxt();
|
|
|
|
assetBusinessFormCpService.save(acc.getXjgywxt());
|
|
|
|
AssetBusinessFormZztbPo assetBusinessFormZztbPo = new AssetBusinessFormZztbPo();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(assetBusinessForm, assetBusinessFormZztbPo);
|
|
|
|
|
|
|
|
assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId());
|
|
|
|
|
|
|
|
assetBusinessFormZztbService.save(assetBusinessFormZztbPo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (acc.getGylxxList() != null) {
|
|
|
|
if (assetCurrentZztbPo.getGylxxList() != null) {
|
|
|
|
for (AssetSupplyChainCpPo items : acc.getGylxxList()) {
|
|
|
|
for (AssetSupplyChainZztbPo items : assetCurrentZztbPo.getGylxxList()) {
|
|
|
|
items.setAssetId(acc.getId());
|
|
|
|
items.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增供应链
|
|
|
|
//新增供应链
|
|
|
|
assetSupplyChainCpService.saveBatch(acc.getGylxxList());
|
|
|
|
assetSupplyChainZztbService.saveBatch(assetCurrentZztbPo.getGylxxList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (acc.getJcwlList() != null) {
|
|
|
|
if (assetCurrentZztbPo.getJcwlList() != null) {
|
|
|
|
for (AssetBasicNetworkCpPo items : acc.getJcwlList()) {
|
|
|
|
for (AssetBasicNetworkZztbPo items : assetCurrentZztbPo.getJcwlList()) {
|
|
|
|
items.setAssetId(acc.getId());
|
|
|
|
items.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增基础网络
|
|
|
|
//新增基础网络
|
|
|
|
assetBasicNetworkCpService.saveBatch(acc.getJcwlList());
|
|
|
|
assetBasicNetworkZztbService.saveBatch(assetCurrentZztbPo.getJcwlList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (acc.getOtherConcat() != null) {
|
|
|
|
if (assetCurrentZztbPo.getOtherConcat() != null) {
|
|
|
|
for (UnitOtherConcatCpPo items : acc.getOtherConcat()) {
|
|
|
|
for (UnitOtherConcatZztbPo items : assetCurrentZztbPo.getOtherConcat()) {
|
|
|
|
items.setAssetId(acc.getId());
|
|
|
|
items.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增其他联系人
|
|
|
|
//新增其他联系人
|
|
|
|
unitOtherConcatCpService.saveBatch(acc.getOtherConcat());
|
|
|
|
unitOtherConcatZztbservice.saveBatch(assetCurrentZztbPo.getOtherConcat());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrentZztbPo.getSjzcList() != null) {
|
|
|
|
|
|
|
|
for (AssetSjZztbPo items : assetCurrentZztbPo.getSjzcList()) {
|
|
|
|
|
|
|
|
items.setAssetId(assetCurrentZztbPo.getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增数据资产
|
|
|
|
|
|
|
|
assetAssetSjZztbService.saveBatch(assetCurrentZztbPo.getSjzcList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -374,10 +573,10 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
* @param as 查询实体
|
|
|
|
* @param as 查询实体
|
|
|
|
* @return 所有数据
|
|
|
|
* @return 所有数据
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value = "分页查询管理端或者单位端审核列表", response = AssetCurrentCpPo.class)
|
|
|
|
@ApiOperation(value = "分页查询管理端或者单位端审核列表", response = AssetCurrentZztbPo.class)
|
|
|
|
@GetMapping("/getAuditList")
|
|
|
|
@GetMapping("/getAuditList")
|
|
|
|
public AjaxResult getAuditList(AssetAuditPageRequest as) {
|
|
|
|
public AjaxResult getAuditList(AssetAuditPageRequest as) {
|
|
|
|
Page<AssetCurrentJyPo> page = new Page<>();
|
|
|
|
Page<AssetCurrentZztbPo> page = new Page<>();
|
|
|
|
page.setSize(as.getSize());
|
|
|
|
page.setSize(as.getSize());
|
|
|
|
page.setCurrent(as.getCurrent());
|
|
|
|
page.setCurrent(as.getCurrent());
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -387,20 +586,48 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new ServiceException("获取用户信息异常");
|
|
|
|
throw new ServiceException("获取用户信息异常");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return success(assetCurrentJyService.getAuditList(page, as));
|
|
|
|
return success(assetCurrentZztbService.getAuditList(page, as));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查看中间数据详情
|
|
|
|
* 查看中间数据详情
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value = "单位端查看中间数据详情", response = AssetCurrentCpPo.class)
|
|
|
|
@ApiOperation(value = "单位端查看中间数据详情", response = AssetCurrentZztbPo.class)
|
|
|
|
@GetMapping("/lookInfo/{id}")
|
|
|
|
@GetMapping("/lookInfo/{id}")
|
|
|
|
public AjaxResult lookInfo(@PathVariable Long id) {
|
|
|
|
public AjaxResult lookInfo(@PathVariable Long id) {
|
|
|
|
AssetCurrentCpPo byId = assetCurrentCpService.getById(id);
|
|
|
|
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(id);
|
|
|
|
byId.setGylxxList(assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpPo::getAssetId, byId.getId()).isNull(AssetSupplyChainCpPo::getTaskId).list());
|
|
|
|
if (byId.getId() == null) {
|
|
|
|
byId.setJcwlList(assetBasicNetworkCpService.lambdaQuery().eq(AssetBasicNetworkCpPo::getAssetId, byId.getId()).isNull(AssetBasicNetworkCpPo::getTaskId).list());
|
|
|
|
//单位段新增查看
|
|
|
|
byId.setXjgywxt(assetBusinessFormCpService.lambdaQuery().eq(AssetBusinessFormCpPo::getAssetId, byId.getId()).isNull(AssetBusinessFormCpPo::getTaskId).one());
|
|
|
|
byId.setGylxxList(assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list());
|
|
|
|
byId.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpPo::getAssetId, byId.getId()).isNull(UnitOtherConcatCpPo::getTaskId).list());
|
|
|
|
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();
|
|
|
|
|
|
|
|
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.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
byId.setSjzcList(assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//管理端新增查看
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<Acomma> a1 = new ArrayList<>();
|
|
|
|
List<Acomma> a1 = new ArrayList<>();
|
|
|
|
if (byId.getGlym() != null) {
|
|
|
|
if (byId.getGlym() != null) {
|
|
|
|
Arrays.asList(byId.getGlym().split(",")).forEach(x -> {
|
|
|
|
Arrays.asList(byId.getGlym().split(",")).forEach(x -> {
|
|
|
@ -413,7 +640,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
byId.setGlymList(new ArrayList<>());
|
|
|
|
byId.setGlymList(new ArrayList<>());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<Acomma> a2 = new ArrayList<>();
|
|
|
|
List<Acomma> a2 = new ArrayList<>();
|
|
|
|
if(byId.getGlIp()!=null&& !byId.getGlIp().isEmpty()){
|
|
|
|
if (byId.getGlIp() != null && !byId.getGlIp().isEmpty()) {
|
|
|
|
for (Object o : JSONArray.parseArray(byId.getGlIp())) {
|
|
|
|
for (Object o : JSONArray.parseArray(byId.getGlIp())) {
|
|
|
|
Acomma acomma = new Acomma();
|
|
|
|
Acomma acomma = new Acomma();
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(o.toString());
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(o.toString());
|
|
|
@ -430,13 +657,13 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
Object portValue = jsonObject.get("port");
|
|
|
|
Object portValue = jsonObject.get("port");
|
|
|
|
if (portValue != null && !portValue.toString().isEmpty()) {
|
|
|
|
if (portValue != null && !portValue.toString().isEmpty()) {
|
|
|
|
acomma.setPort(portValue.toString());
|
|
|
|
acomma.setPort(portValue.toString());
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
acomma.setPort("");
|
|
|
|
acomma.setPort("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a2.add(acomma);
|
|
|
|
a2.add(acomma);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
byId.setGlIpList(a2);
|
|
|
|
byId.setGlIpList(a2);
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
byId.setGlIpList(new ArrayList<>());
|
|
|
|
byId.setGlIpList(new ArrayList<>());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -453,22 +680,23 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
@ApiOperation(value = "管理端审核")
|
|
|
|
@ApiOperation(value = "管理端审核")
|
|
|
|
@PostMapping("/audit")
|
|
|
|
@PostMapping("/audit")
|
|
|
|
public AjaxResult audit(@Valid @RequestBody AssetAuditRequest as) {
|
|
|
|
public AjaxResult audit(@Valid @RequestBody AssetAuditRequest as) {
|
|
|
|
AssetCurrentCpPo ass = new AssetCurrentCpPo();
|
|
|
|
AssetCurrentZztbPo ass = new AssetCurrentZztbPo();
|
|
|
|
BeanUtil.copyProperties(as, ass);
|
|
|
|
BeanUtil.copyProperties(as, ass);
|
|
|
|
assetCurrentCpService.updateById(ass);
|
|
|
|
assetCurrentZztbService.updateById(ass);
|
|
|
|
//通过数据同步
|
|
|
|
//通过数据同步
|
|
|
|
if ("2".equals(as.getAuditState())) {
|
|
|
|
if ("2".equals(as.getAuditState()) && as.getXzType() != 1) {
|
|
|
|
AssetCurrentCpPo byId = assetCurrentCpService.getById(as.getCurrentId());
|
|
|
|
AssetCurrentCpPo byId = assetCurrentCpService.getById(as.getCurrentId());
|
|
|
|
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());
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
|
|
|
|
assetAssetSjService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
List<AssetSupplyChainCpPo> list = assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpPo::getAssetId, byId.getId()).isNull(AssetSupplyChainCpPo::getTaskId).list();
|
|
|
|
List<AssetSupplyChainCpPo> list = assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpPo::getAssetId, byId.getId()).isNull(AssetSupplyChainCpPo::getTaskId).list();
|
|
|
|
list.forEach(x -> {
|
|
|
|
list.forEach(x -> {
|
|
|
|
AssetSupplyChain a1 = new AssetSupplyChain();
|
|
|
|
AssetSupplyChain a1 = new AssetSupplyChain();
|
|
|
@ -497,8 +725,14 @@ 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) {
|
|
|
|
|
|
|
|
//根据任务id查询任务是否关闭
|
|
|
|
|
|
|
|
AssetTask two = assetTaskService.lambdaQuery().eq(AssetTask::getId, one.getTaskId()).eq(AssetTask::getTaskStatus, 0).one();
|
|
|
|
|
|
|
|
if (two == null) {
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
Long appId = one.getCurrentId();
|
|
|
|
Long appId = one.getCurrentId();
|
|
|
|
Integer status = one.getStatus();
|
|
|
|
Integer status = one.getStatus();
|
|
|
@ -543,10 +777,330 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
unitOtherConcatCpService.save(x);
|
|
|
|
unitOtherConcatCpService.save(x);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if ("2".equals(as.getAuditState())) {
|
|
|
|
|
|
|
|
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(as.getCurrentId());
|
|
|
|
|
|
|
|
AssetCurrent aa = new AssetCurrent();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(byId, aa);
|
|
|
|
|
|
|
|
//根据资产名称和所属单位查询主表是否有数据
|
|
|
|
|
|
|
|
AssetCurrent assetCurrent = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, byId.getXtmc()).eq(AssetCurrent::getDwmc, byId.getDwmc()).one();
|
|
|
|
|
|
|
|
if (assetCurrent != null) {
|
|
|
|
|
|
|
|
//修改主表
|
|
|
|
|
|
|
|
if (assetCurrent.getXzType() == 0) {
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
|
|
|
|
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
|
|
|
|
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
|
|
|
|
assetAssetSjService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
|
|
|
|
//供应链
|
|
|
|
|
|
|
|
List<AssetSupplyChainZztbPo> supplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<AssetSupplyChain> assetSupplyChainList = supplyChainZztbPoList.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
|
|
|
|
|
|
|
|
assetSupplyChain.setId(null);
|
|
|
|
|
|
|
|
assetSupplyChain.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetSupplyChain; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetSupplyChainService.saveBatch(assetSupplyChainList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//newtwork
|
|
|
|
|
|
|
|
List<AssetBasicNetworkZztbPo> networkZztbPoList = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<AssetBasicNetwork> networkList = networkZztbPoList.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
|
|
|
|
|
|
|
|
assetBasicNetwork.setId(null);
|
|
|
|
|
|
|
|
assetBasicNetwork.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetBasicNetwork; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetBasicNetworkService.saveBatch(networkList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//business
|
|
|
|
|
|
|
|
List<AssetBusinessFormZztbPo> businessFormZztbPoList = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<AssetBusinessForm> businessFormList = businessFormZztbPoList.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
|
|
|
|
|
|
|
|
assetBusinessForm.setId(null);
|
|
|
|
|
|
|
|
assetBusinessForm.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetBusinessForm; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetBusinessFormService.saveBatch(businessFormList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//unitother
|
|
|
|
|
|
|
|
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<UnitOtherConcat> unitOtherConcatList = unitOtherConcatZztbPoList.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
|
|
|
|
|
|
|
|
unitOtherConcat.setConcatId(null);
|
|
|
|
|
|
|
|
unitOtherConcat.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return unitOtherConcat; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
unitOtherConcatService.saveBatch(unitOtherConcatList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//数据资产
|
|
|
|
|
|
|
|
List<AssetSjZztbPo> assetSjZztbPoList = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getId()).isNull(AssetSjZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<AssetSj> assetSjList = assetSjZztbPoList.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSj assetSj = new AssetSj();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSj); // 复制属性
|
|
|
|
|
|
|
|
assetSj.setId(null);
|
|
|
|
|
|
|
|
assetSj.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetSj; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
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 {
|
|
|
|
|
|
|
|
//新增主表
|
|
|
|
|
|
|
|
assetCurrentService.save(aa);
|
|
|
|
|
|
|
|
//供应链
|
|
|
|
|
|
|
|
List<AssetSupplyChainZztbPo> assetSupplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<AssetSupplyChain> assetSupplyChainList1 = assetSupplyChainZztbPoList.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
|
|
|
|
|
|
|
|
assetSupplyChain.setId(null);
|
|
|
|
|
|
|
|
assetSupplyChain.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetSupplyChain; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetSupplyChainService.saveBatch(assetSupplyChainList1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//newtwork
|
|
|
|
|
|
|
|
List<AssetBasicNetworkZztbPo> networkZztbPoList1 = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<AssetBasicNetwork> networkList1 = networkZztbPoList1.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
|
|
|
|
|
|
|
|
assetBasicNetwork.setId(null);
|
|
|
|
|
|
|
|
assetBasicNetwork.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetBasicNetwork; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetBasicNetworkService.saveBatch(networkList1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//business
|
|
|
|
|
|
|
|
List<AssetBusinessFormZztbPo> businessFormZztbPoList1 = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<AssetBusinessForm> businessFormList1 = businessFormZztbPoList1.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
|
|
|
|
|
|
|
|
assetBusinessForm.setId(null);
|
|
|
|
|
|
|
|
assetBusinessForm.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetBusinessForm; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetBusinessFormService.saveBatch(businessFormList1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//unitother
|
|
|
|
|
|
|
|
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList1 = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<UnitOtherConcat> unitOtherConcatList1 = unitOtherConcatZztbPoList1.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
|
|
|
|
|
|
|
|
unitOtherConcat.setConcatId(null);
|
|
|
|
|
|
|
|
unitOtherConcat.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return unitOtherConcat; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
unitOtherConcatService.saveBatch(unitOtherConcatList1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//数据资产
|
|
|
|
|
|
|
|
List<AssetSjZztbPo> assetSjZztbPoList1 = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list();
|
|
|
|
|
|
|
|
List<AssetSj> assetSjList1 = assetSjZztbPoList1.stream().map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSj assetSj = new AssetSj();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSj); // 复制属性
|
|
|
|
|
|
|
|
assetSj.setId(null);
|
|
|
|
|
|
|
|
assetSj.setAssetId(aa.getId());
|
|
|
|
|
|
|
|
return assetSj; // 返回新对象
|
|
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if ("3".equals(as.getAuditState())) {
|
|
|
|
|
|
|
|
//审核不通过
|
|
|
|
|
|
|
|
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(as.getCurrentId());
|
|
|
|
|
|
|
|
AssetCurrent aa = new AssetCurrent();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(byId, aa);
|
|
|
|
|
|
|
|
//根据资产名称和所属单位查询主表是否有数据
|
|
|
|
|
|
|
|
AssetCurrent assetCurrent = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, byId.getXtmc()).eq(AssetCurrent::getDwmc, byId.getDwmc()).one();
|
|
|
|
|
|
|
|
if (assetCurrent != null) {
|
|
|
|
|
|
|
|
//修改主表
|
|
|
|
|
|
|
|
if (assetCurrent.getXzType() == 0) {
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(aa, assetCurrent, "id");
|
|
|
|
|
|
|
|
assetCurrent.setXzType(0);
|
|
|
|
|
|
|
|
assetCurrent.setDelFlag("1");
|
|
|
|
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(aa, assetCurrent, "id");
|
|
|
|
|
|
|
|
assetCurrent.setDelFlag("1");
|
|
|
|
|
|
|
|
assetCurrentService.updateById(assetCurrent);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return success();
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//=================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -595,7 +1149,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
Object portValue = jsonObject.get("port");
|
|
|
|
Object portValue = jsonObject.get("port");
|
|
|
|
if (portValue != null && !portValue.toString().isEmpty()) {
|
|
|
|
if (portValue != null && !portValue.toString().isEmpty()) {
|
|
|
|
acomma.setPort(portValue.toString());
|
|
|
|
acomma.setPort(portValue.toString());
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
acomma.setPort("");
|
|
|
|
acomma.setPort("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a2.add(acomma);
|
|
|
|
a2.add(acomma);
|
|
|
@ -617,7 +1171,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
|
|
|
|
assetAssetSjService.deleteByAssetIds(assetCurrent.getId());
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
assetCurrent.getXjgywxt().setId(null);
|
|
|
|
assetCurrent.getXjgywxt().setId(null);
|
|
|
@ -648,6 +1202,16 @@ 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());
|
|
|
|
|
|
|
|
items.setId(null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增数据资产
|
|
|
|
|
|
|
|
assetAssetSjService.saveBatch(assetCurrent.getSjzcList());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//================================
|
|
|
|
//================================
|
|
|
|
|
|
|
|
|
|
|
|
//根据未修改之前的单位名称去寻找正在进行中的任务,报废的任务,单位自编辑的任务
|
|
|
|
//根据未修改之前的单位名称去寻找正在进行中的任务,报废的任务,单位自编辑的任务
|
|
|
@ -700,6 +1264,16 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<AssetSjCpPo> queryWrapper6 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper5.eq("asset_id", assetCurrent.getId());
|
|
|
|
|
|
|
|
if (taskId == null) {
|
|
|
|
|
|
|
|
queryWrapper5.isNull("task_id");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
queryWrapper5.eq("task_id", taskId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
assetAssetSjCpService.remove(queryWrapper6);
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
if (assetCurrent.getXjgywxt() != null) {
|
|
|
|
assetCurrentCpPo.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
assetCurrentCpPo.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
assetCurrentCpPo.getXjgywxt().setTaskId(taskId);
|
|
|
|
assetCurrentCpPo.getXjgywxt().setTaskId(taskId);
|
|
|
@ -729,6 +1303,15 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
//新增其他联系人
|
|
|
|
//新增其他联系人
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (assetCurrent.getSjzcList() != null) {
|
|
|
|
|
|
|
|
for (AssetSjCpPo items : assetCurrentCpPo.getSjzcList()) {
|
|
|
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
|
|
|
items.setTaskId(taskId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增其他联系人
|
|
|
|
|
|
|
|
assetAssetSjCpService.saveBatch(assetCurrentCpPo.getSjzcList());
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态
|
|
|
|
//根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态
|
|
|
|
List<AssetCurrentCpPo> currentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId());
|
|
|
|
List<AssetCurrentCpPo> currentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId());
|
|
|
@ -781,7 +1364,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
assetBusinessFormService.deleteByAssetIds(id);
|
|
|
|
assetBusinessFormService.deleteByAssetIds(id);
|
|
|
|
unitOtherConcatService.deleteByAssetIds(id);
|
|
|
|
unitOtherConcatService.deleteByAssetIds(id);
|
|
|
|
assetCurrentService.deleteByUnitIds(id);
|
|
|
|
assetCurrentService.deleteByUnitIds(id);
|
|
|
|
|
|
|
|
assetAssetSjService.deleteByAssetIds(id);
|
|
|
|
QueryWrapper<AssetCurrentCpPo> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<AssetCurrentCpPo> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
queryWrapper1.eq("id", id);
|
|
|
|
queryWrapper1.eq("id", id);
|
|
|
|
assetCurrentCpService.remove(queryWrapper1);
|
|
|
|
assetCurrentCpService.remove(queryWrapper1);
|
|
|
@ -797,7 +1380,9 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
|
|
|
|
queryWrapper5.eq("asset_id", id);
|
|
|
|
queryWrapper5.eq("asset_id", id);
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
unitOtherConcatCpService.remove(queryWrapper5);
|
|
|
|
|
|
|
|
QueryWrapper<AssetSjCpPo> queryWrapper6 = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper6.eq("asset_id", id);
|
|
|
|
|
|
|
|
assetAssetSjCpService.remove(queryWrapper6);
|
|
|
|
|
|
|
|
|
|
|
|
return success();
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|