|
|
|
@ -30,6 +30,7 @@ import java.io.Serializable;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 现有资产表(AssetCurrent)表控制层
|
|
|
|
@ -89,7 +90,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
private AssetBusinessFormJyService assetBusinessFormJyService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private AssetSupplyChainJyService assetSupplyChainJyService ;
|
|
|
|
|
private AssetSupplyChainJyService assetSupplyChainJyService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private UnitOtherConcatJyservice unitOtherConcatJyservice;
|
|
|
|
@ -146,16 +147,20 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
a.append(x.getKey());
|
|
|
|
|
a.append(",");
|
|
|
|
|
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
|
|
|
|
|
a.append(x.getKey());
|
|
|
|
|
a.append(",");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
assetCurrent.setGlym(a.toString());
|
|
|
|
|
StringBuilder b = new StringBuilder();
|
|
|
|
|
if (assetCurrent.getGlIpList() != null) {
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
b.append(x.getKey());
|
|
|
|
|
b.append(",");
|
|
|
|
|
assetCurrent.getGlIpList().forEach(x -> {
|
|
|
|
|
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
|
|
|
|
|
b.append(x.getKey());
|
|
|
|
|
b.append(",");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
assetCurrent.setGlIp(b.toString());
|
|
|
|
@ -186,11 +191,12 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
//新增其他联系人
|
|
|
|
|
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 单位有进行中的任务时,管理端新增该单位下的资产则需同步至当前进行中的任务中。
|
|
|
|
|
//获取新增资产id
|
|
|
|
|
Long id = assetCurrent.getId();
|
|
|
|
|
Integer i = unitService.selectTaskId(assetCurrent.getDwmc(), "0");
|
|
|
|
|
if(i!=null){
|
|
|
|
|
if (i != null) {
|
|
|
|
|
//新增资产复制主表
|
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
|
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
|
|
|
|
@ -228,9 +234,13 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return success();
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
success();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//=================================================
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单位自编辑进行校验
|
|
|
|
|
*/
|
|
|
|
@ -347,12 +357,12 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
@GetMapping("/lookInfo/{id}")
|
|
|
|
|
public AjaxResult lookInfo(@PathVariable Long id) {
|
|
|
|
|
AssetCurrentCpPo byId = assetCurrentCpService.getById(id);
|
|
|
|
|
byId.setGylxxList(assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpPo::getAssetId ,byId.getId()).isNull(AssetSupplyChainCpPo::getTaskId).list());
|
|
|
|
|
byId.setGylxxList(assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpPo::getAssetId, byId.getId()).isNull(AssetSupplyChainCpPo::getTaskId).list());
|
|
|
|
|
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.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpPo::getAssetId, byId.getId()).isNull(UnitOtherConcatCpPo::getTaskId).list());
|
|
|
|
|
List<Acomma> a1 = new ArrayList<>();
|
|
|
|
|
if(byId.getGlym()!=null){
|
|
|
|
|
if (byId.getGlym() != null) {
|
|
|
|
|
Arrays.asList(byId.getGlym().split(",")).forEach(x -> {
|
|
|
|
|
Acomma acomma = new Acomma();
|
|
|
|
|
acomma.setKey(x);
|
|
|
|
@ -361,7 +371,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
byId.setGlymList(a1);
|
|
|
|
|
}
|
|
|
|
|
List<Acomma> a2 = new ArrayList<>();
|
|
|
|
|
if(byId.getGlIp()!=null){
|
|
|
|
|
if (byId.getGlIp() != null) {
|
|
|
|
|
Arrays.asList(byId.getGlIp().split(",")).forEach(x -> {
|
|
|
|
|
Acomma acomma = new Acomma();
|
|
|
|
|
acomma.setKey(x);
|
|
|
|
@ -444,16 +454,20 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
a.append(x.getKey());
|
|
|
|
|
a.append(",");
|
|
|
|
|
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
|
|
|
|
|
a.append(x.getKey());
|
|
|
|
|
a.append(",");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
assetCurrent.setGlym(a.toString());
|
|
|
|
|
StringBuilder b = new StringBuilder();
|
|
|
|
|
if (assetCurrent.getGlIpList() != null) {
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
b.append(x.getKey());
|
|
|
|
|
b.append(",");
|
|
|
|
|
assetCurrent.getGlIpList().forEach(x -> {
|
|
|
|
|
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
|
|
|
|
|
b.append(x.getKey());
|
|
|
|
|
b.append(",");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
assetCurrent.setGlIp(b.toString());
|
|
|
|
@ -704,8 +718,9 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
|
BeanUtil.copyProperties(as, assetCurrentCpPo);
|
|
|
|
|
assetCurrentCpPo.setTaskId(i);
|
|
|
|
|
assetCurrentCpPo.setStatus(0);
|
|
|
|
|
AssetCurrentCpPo two = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getXtmc, as.getXtmc())
|
|
|
|
|
.eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).one();
|
|
|
|
|
.eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).isNotNull(AssetCurrentCpPo::getTaskId).one();
|
|
|
|
|
if (two != null) {
|
|
|
|
|
assetCurrentCpPo.setId(two.getId());
|
|
|
|
|
assetCurrentCpService.updateById(assetCurrentCpPo);
|
|
|
|
|