|
|
|
@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -77,9 +78,6 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
private UnitOtherConcatCpService unitOtherConcatCpService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询所有数据
|
|
|
|
|
*
|
|
|
|
@ -146,7 +144,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public AjaxResult insert(@RequestBody @Valid AssetCurrent assetCurrent) {
|
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
|
if (!assetCurrent.getGlymList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
a.append(x.getKey());
|
|
|
|
|
a.append(",");
|
|
|
|
@ -154,7 +152,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
assetCurrent.setGlym(a.toString());
|
|
|
|
|
StringBuilder b = new StringBuilder();
|
|
|
|
|
if (!assetCurrent.getGlIpList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getGlIpList() != null) {
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
b.append(x.getKey());
|
|
|
|
|
b.append(",");
|
|
|
|
@ -167,21 +165,21 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId());
|
|
|
|
|
assetBusinessFormService.save(assetCurrent.getXjgywxt());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getGylxxList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getGylxxList() != null) {
|
|
|
|
|
for (AssetSupplyChain items : assetCurrent.getGylxxList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
}
|
|
|
|
|
//新增供应链
|
|
|
|
|
assetSupplyChainService.saveBatch(assetCurrent.getGylxxList());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getJcwlList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getJcwlList() != null) {
|
|
|
|
|
for (AssetBasicNetwork items : assetCurrent.getJcwlList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
}
|
|
|
|
|
//新增基础网络
|
|
|
|
|
assetBasicNetworkService.saveBatch(assetCurrent.getJcwlList());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getOtherConcat().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getOtherConcat() != null) {
|
|
|
|
|
for (UnitOtherConcat items : assetCurrent.getOtherConcat()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
}
|
|
|
|
@ -206,7 +204,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
assetCurrentCpPo.getXjgywxt().setTaskId(assetTask.getId());
|
|
|
|
|
assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getGylxxList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getGylxxList() != null) {
|
|
|
|
|
for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) {
|
|
|
|
|
items.setAssetId(id);
|
|
|
|
|
items.setTaskId(assetTask.getId());
|
|
|
|
@ -214,7 +212,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
//新增供应链
|
|
|
|
|
assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getJcwlList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getJcwlList() != null) {
|
|
|
|
|
for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setTaskId(assetTask.getId());
|
|
|
|
@ -222,7 +220,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
//新增基础网络
|
|
|
|
|
assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getOtherConcat().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getOtherConcat() != null) {
|
|
|
|
|
for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setTaskId(assetTask.getId());
|
|
|
|
@ -247,7 +245,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
@PutMapping
|
|
|
|
|
public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) {
|
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
|
if (!assetCurrent.getGlymList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getGlymList() != null) {
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
a.append(x.getKey());
|
|
|
|
|
a.append(",");
|
|
|
|
@ -255,7 +253,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
assetCurrent.setGlym(a.toString());
|
|
|
|
|
StringBuilder b = new StringBuilder();
|
|
|
|
|
if (!assetCurrent.getGlIpList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getGlIpList() != null) {
|
|
|
|
|
assetCurrent.getGlymList().forEach(x -> {
|
|
|
|
|
b.append(x.getKey());
|
|
|
|
|
b.append(",");
|
|
|
|
@ -272,7 +270,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
assetCurrent.getXjgywxt().setId(null);
|
|
|
|
|
assetBusinessFormService.save(assetCurrent.getXjgywxt());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getGylxxList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getGylxxList() != null) {
|
|
|
|
|
for (AssetSupplyChain items : assetCurrent.getGylxxList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setId(null);
|
|
|
|
@ -280,7 +278,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
//新增供应链
|
|
|
|
|
assetSupplyChainService.saveBatch(assetCurrent.getGylxxList());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getJcwlList().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getJcwlList() != null) {
|
|
|
|
|
for (AssetBasicNetwork items : assetCurrent.getJcwlList()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setId(null);
|
|
|
|
@ -288,7 +286,7 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
//新增基础网络
|
|
|
|
|
assetBasicNetworkService.saveBatch(assetCurrent.getJcwlList());
|
|
|
|
|
}
|
|
|
|
|
if (!assetCurrent.getOtherConcat().isEmpty()) {
|
|
|
|
|
if (assetCurrent.getOtherConcat() != null) {
|
|
|
|
|
for (UnitOtherConcat items : assetCurrent.getOtherConcat()) {
|
|
|
|
|
items.setAssetId(assetCurrent.getId());
|
|
|
|
|
items.setConcatId(null);
|
|
|
|
@ -361,7 +359,19 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
AssetCurrent as = new AssetCurrent();
|
|
|
|
|
//copy新增到新的现有资产表里面
|
|
|
|
|
BeanUtil.copyProperties(items, as);
|
|
|
|
|
assetCurrentService.save(as);
|
|
|
|
|
AssetCurrent one = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, as.getXtmc())
|
|
|
|
|
.eq(AssetCurrent::getDwmc, as.getDwmc()).one();
|
|
|
|
|
if (one != null) {
|
|
|
|
|
as.setId(one.getId());
|
|
|
|
|
assetCurrentService.updateById(as);
|
|
|
|
|
List<Long> a1 = new ArrayList<>();
|
|
|
|
|
a1.add(one.getId());
|
|
|
|
|
assetSupplyChainService.deleteIdList(a1);
|
|
|
|
|
assetBasicNetworkService.deleteIdList(a1);
|
|
|
|
|
} else {
|
|
|
|
|
assetCurrentService.save(as);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//新增系统建设单位
|
|
|
|
|
AssetSupplyChain s1 = new AssetSupplyChain();
|
|
|
|
|
BeanUtil.copyProperties(items, s1);
|
|
|
|
@ -416,8 +426,16 @@ public class AssetCurrentController extends BaseController {
|
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
|
|
|
|
|
BeanUtil.copyProperties(as, assetCurrentCpPo);
|
|
|
|
|
assetCurrentCpPo.setTaskId(assetTask.getId());
|
|
|
|
|
assetCurrentCpService.save(assetCurrentCpPo);
|
|
|
|
|
|
|
|
|
|
AssetCurrentCpPo two = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getXtmc, as.getXtmc())
|
|
|
|
|
.eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).one();
|
|
|
|
|
if (two != null) {
|
|
|
|
|
assetCurrentCpPo.setId(two.getId());
|
|
|
|
|
assetCurrentCpService.updateById(assetCurrentCpPo);
|
|
|
|
|
assetSupplyChainCpService.deletByAssetIdandTaskId(id,assetTask.getId());
|
|
|
|
|
assetBasicNetworkCpService.deletByAssetIdandTaskId(id,assetTask.getId());
|
|
|
|
|
} else {
|
|
|
|
|
assetCurrentCpService.save(assetCurrentCpPo);
|
|
|
|
|
}
|
|
|
|
|
//新增系统建设单位
|
|
|
|
|
AssetSupplyChainCpPo co1 = new AssetSupplyChainCpPo();
|
|
|
|
|
BeanUtil.copyProperties(items, co1);
|
|
|
|
|