管理端审核代码修改

dongdingding
dongdingding 2 months ago
parent 2d325ce270
commit 83deb5dca7

@ -11,8 +11,12 @@ 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.AssetApp; import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetAppJyPo; import com.ruoyi.tc.entity.po.AssetAppJyPo;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
import com.ruoyi.tc.entity.request.AssetAppPageRequest; import com.ruoyi.tc.entity.request.AssetAppPageRequest;
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;
@ -169,8 +173,13 @@ public class AssetAppController extends BaseController {
AssetAppJyPo one = assetAppJyService.lambdaQuery() AssetAppJyPo one = assetAppJyService.lambdaQuery()
.isNotNull(AssetAppJyPo::getTaskId) .isNotNull(AssetAppJyPo::getTaskId)
.ne(AssetAppJyPo::getStatus, 5) .ne(AssetAppJyPo::getStatus, 5)
.eq(AssetAppJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetAppJyPo::getAssetId, byId.getAssetId())
.orderByDesc(AssetAppJyPo::getAppId)
.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 status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getAppId(); Long appId = one.getAppId();
@ -183,7 +192,10 @@ public class AssetAppController extends BaseController {
assetAppJyService.updateById(one); assetAppJyService.updateById(one);
} }
} else { }
}
else if("2".equals(as.getAuditState())) {
AssetAppZztbPo byId = assetAppZztbService.getById(as.getCurrentId()); AssetAppZztbPo byId = assetAppZztbService.getById(as.getCurrentId());
AssetApp aa = new AssetApp(); AssetApp aa = new AssetApp();
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
@ -192,18 +204,27 @@ public class AssetAppController extends BaseController {
AssetApp assetApp = assetAppService.lambdaQuery().eq(AssetApp::getAppName, byId.getAppName()).eq(AssetApp::getSsdw, byId.getSsdw()).one(); AssetApp assetApp = assetAppService.lambdaQuery().eq(AssetApp::getAppName, byId.getAppName()).eq(AssetApp::getSsdw, byId.getSsdw()).one();
if (assetApp != null) { if (assetApp != null) {
//修改主表 //修改主表
BeanUtil.copyProperties(aa,assetApp,"id"); if (assetApp.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetApp, "id");
assetApp.setXzType(0);
assetApp.setDelFlag("0");
assetAppService.updateById(assetApp); assetAppService.updateById(assetApp);
} else {
//新增主表
assetAppService.save(aa);
}
}else{
BeanUtil.copyProperties(aa, assetApp, "id");
assetAppService.updateById(assetApp);
}
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetAppJyPo one = assetAppJyService.lambdaQuery() AssetAppJyPo one = assetAppJyService.lambdaQuery()
.ne(AssetAppJyPo::getStatus, 5) .ne(AssetAppJyPo::getStatus, 5)
.eq(AssetAppJyPo::getAppName, byId.getAppName()).one(); .eq(AssetAppJyPo::getAppName, byId.getAppName())
.orderByDesc(AssetAppJyPo::getAppId)
.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 status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getAppId(); Long appId = one.getAppId();
@ -213,9 +234,48 @@ public class AssetAppController extends BaseController {
one.setAuditState(null); one.setAuditState(null);
one.setAuditYy(null); one.setAuditYy(null);
one.setStatus(status); one.setStatus(status);
assetAppJyService.updateById(one); assetAppJyService.updateById(one);
} }
}
} else {
//新增主表
assetAppService.save(aa);
//查询改单位下是否有进行中的任务
AssetTask task= assetTaskService.lambdaQuery().like(AssetTask::getDwmc,aa.getSsdw()).like(AssetTask::getType,"1").eq(AssetTask::getTaskStatus,1).one();
if (task!=null){
AssetAppCpPo bb = new AssetAppCpPo();
BeanUtil.copyProperties(byId, bb);
bb.setAssetId(aa.getId());
bb.setTaskId(task.getId());
bb.setAppId(null);
assetAppCpService.save(bb);
}
}
}
else if ("3".equals(as.getAuditState())){
AssetAppZztbPo byId = assetAppZztbService.getById(as.getCurrentId());
AssetApp aa = new AssetApp();
BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId());
//根据资产名称和所属单位查询主表是否有数据
AssetApp assetApp = assetAppService.lambdaQuery().eq(AssetApp::getAppName, byId.getAppName()).eq(AssetApp::getSsdw, byId.getSsdw()).one();
if (assetApp != null) {
//修改主表
if (assetApp.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetApp, "id");
assetApp.setXzType(0);
assetApp.setDelFlag("1");
assetAppService.updateById(assetApp);
} else {
BeanUtil.copyProperties(aa, assetApp, "id");
assetApp.setDelFlag("1");
assetAppService.updateById(assetApp);
}
}
} }
return success(); return success();
} }

@ -261,6 +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();
@ -482,7 +489,7 @@ public class AssetCurrentController extends BaseController {
AssetBusinessForm assetBusinessForm = assetCurrentZztbPo.getXjgywxt(); AssetBusinessForm assetBusinessForm = assetCurrentZztbPo.getXjgywxt();
AssetBusinessFormZztbPo assetBusinessFormZztbPo = new AssetBusinessFormZztbPo(); AssetBusinessFormZztbPo assetBusinessFormZztbPo = new AssetBusinessFormZztbPo();
BeanUtils.copyProperties(assetBusinessForm, assetBusinessFormZztbPo); BeanUtils.copyProperties(assetBusinessForm, assetBusinessFormZztbPo);
assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId()); assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getId());
assetBusinessFormZztbService.save(assetBusinessFormZztbPo); assetBusinessFormZztbService.save(assetBusinessFormZztbPo);
} }
if (assetCurrentZztbPo.getGylxxList() != null) { if (assetCurrentZztbPo.getGylxxList() != null) {
@ -589,6 +596,8 @@ public class AssetCurrentController extends BaseController {
@GetMapping("/lookInfo/{id}") @GetMapping("/lookInfo/{id}")
public AjaxResult lookInfo(@PathVariable Long id) { public AjaxResult lookInfo(@PathVariable Long id) {
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(id); AssetCurrentZztbPo byId = assetCurrentZztbService.getById(id);
if (byId.getId() == null) {
//单位段新增查看
byId.setGylxxList(assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list()); byId.setGylxxList(assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list());
byId.setJcwlList(assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::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(); AssetBusinessFormZztbPo assetBusinessFormZztbPo = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).one();
@ -602,6 +611,23 @@ public class AssetCurrentController extends BaseController {
byId.setOtherConcat(unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list()); 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()); 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 -> {
@ -663,6 +689,7 @@ public class AssetCurrentController extends BaseController {
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());
@ -698,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();
@ -744,8 +777,9 @@ public class AssetCurrentController extends BaseController {
unitOtherConcatCpService.save(x); unitOtherConcatCpService.save(x);
}); });
} }
} }
else { } else if ("2".equals(as.getAuditState())) {
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(as.getCurrentId()); AssetCurrentZztbPo byId = assetCurrentZztbService.getById(as.getCurrentId());
AssetCurrent aa = new AssetCurrent(); AssetCurrent aa = new AssetCurrent();
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
@ -753,8 +787,19 @@ public class AssetCurrentController extends BaseController {
AssetCurrent assetCurrent = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, byId.getXtmc()).eq(AssetCurrent::getDwmc, byId.getDwmc()).one(); AssetCurrent assetCurrent = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, byId.getXtmc()).eq(AssetCurrent::getDwmc, byId.getDwmc()).one();
if (assetCurrent != null) { 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"); BeanUtil.copyProperties(aa, assetCurrent, "id");
assetCurrent.setDelFlag("0");
assetCurrent.setBtgyy(null);
assetCurrentService.updateById(assetCurrent); assetCurrentService.updateById(assetCurrent);
}
//删除子表数据 //删除子表数据
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId()); assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId()); assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
@ -762,7 +807,7 @@ public class AssetCurrentController extends BaseController {
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId()); unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
assetAssetSjService.deleteByAssetIds(assetCurrent.getId()); assetAssetSjService.deleteByAssetIds(assetCurrent.getId());
//供应链 //供应链
List<AssetSupplyChainZztbPo> supplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list(); List<AssetSupplyChainZztbPo> supplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
List<AssetSupplyChain> assetSupplyChainList = supplyChainZztbPoList.stream().map(cpPo -> { List<AssetSupplyChain> assetSupplyChainList = supplyChainZztbPoList.stream().map(cpPo -> {
AssetSupplyChain assetSupplyChain = new AssetSupplyChain(); AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性 BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
@ -773,7 +818,7 @@ public class AssetCurrentController extends BaseController {
assetSupplyChainService.saveBatch(assetSupplyChainList); assetSupplyChainService.saveBatch(assetSupplyChainList);
//newtwork //newtwork
List<AssetBasicNetworkZztbPo> networkZztbPoList = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list(); List<AssetBasicNetworkZztbPo> networkZztbPoList = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
List<AssetBasicNetwork> networkList = networkZztbPoList.stream().map(cpPo -> { List<AssetBasicNetwork> networkList = networkZztbPoList.stream().map(cpPo -> {
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork(); AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性 BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
@ -784,7 +829,7 @@ public class AssetCurrentController extends BaseController {
assetBasicNetworkService.saveBatch(networkList); assetBasicNetworkService.saveBatch(networkList);
//business //business
List<AssetBusinessFormZztbPo> businessFormZztbPoList = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).list(); List<AssetBusinessFormZztbPo> businessFormZztbPoList = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
List<AssetBusinessForm> businessFormList = businessFormZztbPoList.stream().map(cpPo -> { List<AssetBusinessForm> businessFormList = businessFormZztbPoList.stream().map(cpPo -> {
AssetBusinessForm assetBusinessForm = new AssetBusinessForm(); AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性 BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
@ -796,7 +841,7 @@ public class AssetCurrentController extends BaseController {
//unitother //unitother
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list(); List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
List<UnitOtherConcat> unitOtherConcatList = unitOtherConcatZztbPoList.stream().map(cpPo -> { List<UnitOtherConcat> unitOtherConcatList = unitOtherConcatZztbPoList.stream().map(cpPo -> {
UnitOtherConcat unitOtherConcat = new UnitOtherConcat(); UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性 BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
@ -807,7 +852,7 @@ public class AssetCurrentController extends BaseController {
unitOtherConcatService.saveBatch(unitOtherConcatList); unitOtherConcatService.saveBatch(unitOtherConcatList);
//数据资产 //数据资产
List<AssetSjZztbPo> assetSjZztbPoList = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list(); List<AssetSjZztbPo> assetSjZztbPoList = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getId()).isNull(AssetSjZztbPo::getTaskId).list();
List<AssetSj> assetSjList = assetSjZztbPoList.stream().map(cpPo -> { List<AssetSj> assetSjList = assetSjZztbPoList.stream().map(cpPo -> {
AssetSj assetSj = new AssetSj(); AssetSj assetSj = new AssetSj();
BeanUtils.copyProperties(cpPo, assetSj); // 复制属性 BeanUtils.copyProperties(cpPo, assetSj); // 复制属性
@ -816,75 +861,19 @@ public class AssetCurrentController extends BaseController {
return assetSj; // 返回新对象 return assetSj; // 返回新对象
}).collect(Collectors.toList()); }).collect(Collectors.toList());
assetAssetSjService.saveBatch(assetSjList); assetAssetSjService.saveBatch(assetSjList);
} else {
//新增主表
assetCurrentService.save(aa);
//供应链
List<AssetSupplyChainZztbPo> supplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).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.getCurrentId()).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.getCurrentId()).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.getCurrentId()).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.getCurrentId()).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()).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();
@ -921,6 +910,7 @@ public class AssetCurrentController extends BaseController {
AssetSupplyChainCpPo a1 = new AssetSupplyChainCpPo(); AssetSupplyChainCpPo a1 = new AssetSupplyChainCpPo();
BeanUtil.copyProperties(x, a1); BeanUtil.copyProperties(x, a1);
a1.setTaskId(taskId); a1.setTaskId(taskId);
a1.setSupplyId(null);
assetSupplyChainCpService.save(a1); assetSupplyChainCpService.save(a1);
}); });
@ -929,6 +919,7 @@ public class AssetCurrentController extends BaseController {
AssetBasicNetworkCpPo a2 = new AssetBasicNetworkCpPo(); AssetBasicNetworkCpPo a2 = new AssetBasicNetworkCpPo();
BeanUtil.copyProperties(x, a2); BeanUtil.copyProperties(x, a2);
a2.setTaskId(taskId); a2.setTaskId(taskId);
a2.setNetworkId(null);
assetBasicNetworkCpService.save(a2); assetBasicNetworkCpService.save(a2);
}); });
@ -937,6 +928,7 @@ public class AssetCurrentController extends BaseController {
AssetBusinessFormCpPo a3 = new AssetBusinessFormCpPo(); AssetBusinessFormCpPo a3 = new AssetBusinessFormCpPo();
BeanUtil.copyProperties(x, a3); BeanUtil.copyProperties(x, a3);
a3.setTaskId(taskId); a3.setTaskId(taskId);
a3.setBusinessId(null);
assetBusinessFormCpService.save(a3); assetBusinessFormCpService.save(a3);
}); });
@ -945,6 +937,7 @@ public class AssetCurrentController extends BaseController {
UnitOtherConcatCpPo a4 = new UnitOtherConcatCpPo(); UnitOtherConcatCpPo a4 = new UnitOtherConcatCpPo();
BeanUtil.copyProperties(x, a4); BeanUtil.copyProperties(x, a4);
a4.setTaskId(taskId); a4.setTaskId(taskId);
a4.setConcatId(null);
unitOtherConcatCpService.save(a4); unitOtherConcatCpService.save(a4);
}); });
List<AssetSjZztbPo> list4 = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getId()).isNull(AssetSjZztbPo::getTaskId).list(); List<AssetSjZztbPo> list4 = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getId()).isNull(AssetSjZztbPo::getTaskId).list();
@ -952,13 +945,162 @@ public class AssetCurrentController extends BaseController {
AssetSjCpPo a5 = new AssetSjCpPo(); AssetSjCpPo a5 = new AssetSjCpPo();
BeanUtil.copyProperties(x, a5); BeanUtil.copyProperties(x, a5);
a5.setTaskId(taskId); a5.setTaskId(taskId);
a5.setSjId(null);
assetAssetSjCpService.save(a5); 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();
} }
//=================================================
/** /**

@ -14,10 +14,7 @@ import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.AssetEmail; import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppJyPo; import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.po.AssetEmailCpPo;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
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.AssetEmailPageRequest; import com.ruoyi.tc.entity.request.AssetEmailPageRequest;
@ -178,13 +175,19 @@ public class AssetEmailController extends BaseController {
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId()); aa.setId(byId.getAssetId());
//修改主表 //修改主表
aa.setDelFlag("0");
assetEmailService.updateById(aa); assetEmailService.updateById(aa);
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery() AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.isNotNull(AssetEmailJyPo::getTaskId) .isNotNull(AssetEmailJyPo::getTaskId)
.ne(AssetEmailJyPo::getStatus, 5) .ne(AssetEmailJyPo::getStatus, 5)
.eq(AssetEmailJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetEmailJyPo::getAssetId, byId.getAssetId())
.orderByDesc(AssetEmailJyPo::getEmailId)
.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 status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getEmailId(); Long appId = one.getEmailId();
@ -196,7 +199,10 @@ public class AssetEmailController extends BaseController {
one.setStatus(status); one.setStatus(status);
assetEmailJyService.updateById(one); assetEmailJyService.updateById(one);
} }
}else {
}
}
else if("2".equals(as.getAuditState()) ){
AssetEmailZztbPo byId = assetEmailZztbService.getById(as.getCurrentId()); AssetEmailZztbPo byId = assetEmailZztbService.getById(as.getCurrentId());
AssetEmail aa = new AssetEmail(); AssetEmail aa = new AssetEmail();
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
@ -205,17 +211,28 @@ public class AssetEmailController extends BaseController {
AssetEmail assetEmail = assetEmailService.lambdaQuery().eq(AssetEmail::getDzyxhz, byId.getDzyxhz()).eq(AssetEmail::getSsdw, byId.getSsdw()).one(); AssetEmail assetEmail = assetEmailService.lambdaQuery().eq(AssetEmail::getDzyxhz, byId.getDzyxhz()).eq(AssetEmail::getSsdw, byId.getSsdw()).one();
if (assetEmail != null) { if (assetEmail != null) {
//修改主表 //修改主表
if (assetEmail.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetEmail, "id"); BeanUtil.copyProperties(aa, assetEmail, "id");
assetEmail.setXzType(0);
assetEmail.setDelFlag("0");
assetEmailService.updateById(assetEmail);
}else{
BeanUtil.copyProperties(aa, assetEmail, "id");
assetEmail.setDelFlag("0");
assetEmailService.updateById(assetEmail); assetEmailService.updateById(assetEmail);
} else {
//新增主表
assetEmailService.save(aa);
} }
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery() AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.ne(AssetEmailJyPo::getStatus, 5) .ne(AssetEmailJyPo::getStatus, 5)
.eq(AssetEmailJyPo::getDzyxhz, byId.getDzyxhz()).one(); .eq(AssetEmailJyPo::getDzyxhz, byId.getDzyxhz())
.orderByDesc(AssetEmailJyPo::getEmailId)
.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 status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getEmailId(); Long appId = one.getEmailId();
@ -227,6 +244,46 @@ public class AssetEmailController extends BaseController {
one.setStatus(status); one.setStatus(status);
assetEmailJyService.updateById(one); assetEmailJyService.updateById(one);
} }
}
} else {
//新增主表
assetEmailService.save(aa);
//查询改单位下是否有进行中的任务
AssetTask task= assetTaskService.lambdaQuery().like(AssetTask::getDwmc,aa.getSsdw()).like(AssetTask::getType,"1").eq(AssetTask::getTaskStatus,1).one();
if (task!=null){
AssetEmailCpPo bb = new AssetEmailCpPo();
BeanUtil.copyProperties(byId, bb);
bb.setAssetId(aa.getId());
bb.setEmailId(null);
bb.setTaskId(task.getId());
assetEmailCpService.save(bb);
}
}
}
else if("3".equals(as.getAuditState()) ){
AssetEmailZztbPo byId = assetEmailZztbService.getById(as.getCurrentId());
AssetEmail aa = new AssetEmail();
BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId());
//根据资产名称和所属单位查询主表是否有数据
AssetEmail assetEmail = assetEmailService.lambdaQuery().eq(AssetEmail::getDzyxhz, byId.getDzyxhz()).eq(AssetEmail::getSsdw, byId.getSsdw()).one();
if (assetEmail != null) {
//修改主表
if (assetEmail.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetEmail, "id");
assetEmail.setXzType(0);
assetEmail.setDelFlag("1");
assetEmailService.updateById(assetEmail);
} else {
BeanUtil.copyProperties(aa, assetEmail, "id");
assetEmail.setDelFlag("1");
assetEmailService.updateById(assetEmail);
}
}
} }
return success(); return success();
} }

@ -10,17 +10,14 @@ import com.ruoyi.common.enums.BusinessType;
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.AssetEmail;
import com.ruoyi.tc.entity.AssetMiniPrograms; import com.ruoyi.tc.entity.AssetMiniPrograms;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo; import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo; import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo;
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.AssetMiniProgramsPageRequest; import com.ruoyi.tc.entity.request.AssetMiniProgramsPageRequest;
import com.ruoyi.tc.entity.zztb.AssetEmailZztbPo;
import com.ruoyi.tc.entity.zztb.AssetMiniProgramsZztbPo; import com.ruoyi.tc.entity.zztb.AssetMiniProgramsZztbPo;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.*;
import com.ruoyi.tc.zztbService.AssetMiniProgramsZztbService; import com.ruoyi.tc.zztbService.AssetMiniProgramsZztbService;
@ -174,13 +171,19 @@ public class AssetMiniProgramsController extends BaseController {
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId()); aa.setId(byId.getAssetId());
//修改主表 //修改主表
aa.setDelFlag("0");
assetMiniProgramsService.updateById(aa); assetMiniProgramsService.updateById(aa);
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery() AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.isNotNull(AssetMiniProgramsJyPo::getTaskId) .isNotNull(AssetMiniProgramsJyPo::getTaskId)
.ne(AssetMiniProgramsJyPo::getStatus, 5) .ne(AssetMiniProgramsJyPo::getStatus, 5)
.eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId())
.orderByDesc(AssetMiniProgramsJyPo::getMiniId)
.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.getMiniId(); Long appId = one.getMiniId();
Integer status = one.getStatus(); Integer status = one.getStatus();
@ -192,7 +195,10 @@ public class AssetMiniProgramsController extends BaseController {
one.setStatus(status); one.setStatus(status);
assetMiniProgramsJyService.updateById(one); assetMiniProgramsJyService.updateById(one);
} }
}else{
}
}
else if("2".equals(as.getAuditState())){
AssetMiniProgramsZztbPo byId = assetMiniProgramsZztbService.getById(as.getCurrentId()); AssetMiniProgramsZztbPo byId = assetMiniProgramsZztbService.getById(as.getCurrentId());
AssetMiniPrograms aa = new AssetMiniPrograms(); AssetMiniPrograms aa = new AssetMiniPrograms();
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
@ -201,17 +207,27 @@ public class AssetMiniProgramsController extends BaseController {
AssetMiniPrograms assetMiniPrograms = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getXcxmc, byId.getXcxmc()).eq(AssetMiniPrograms::getSsdw, byId.getSsdw()).one(); AssetMiniPrograms assetMiniPrograms = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getXcxmc, byId.getXcxmc()).eq(AssetMiniPrograms::getSsdw, byId.getSsdw()).one();
if (assetMiniPrograms != null) { if (assetMiniPrograms != null) {
//修改主表 //修改主表
if (assetMiniPrograms.getXzType()==0){
BeanUtil.copyProperties(aa, assetMiniPrograms, "id"); BeanUtil.copyProperties(aa, assetMiniPrograms, "id");
//区分数据是管理端新增还是单位端新增
assetMiniPrograms.setXzType(0);
assetMiniPrograms.setDelFlag("0");
assetMiniProgramsService.updateById(assetMiniPrograms);
}else{
BeanUtil.copyProperties(aa, assetMiniPrograms, "id");
assetMiniPrograms.setDelFlag("0");
assetMiniProgramsService.updateById(assetMiniPrograms); assetMiniProgramsService.updateById(assetMiniPrograms);
} else {
//新增主表
assetMiniProgramsService.save(aa);
} }
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery() AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.ne(AssetMiniProgramsJyPo::getStatus, 5) .ne(AssetMiniProgramsJyPo::getStatus, 5)
.eq(AssetMiniProgramsJyPo::getXcxmc, byId.getXcxmc()).one(); .eq(AssetMiniProgramsJyPo::getXcxmc, byId.getXcxmc())
.orderByDesc(AssetMiniProgramsJyPo::getMiniId)
.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 status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getMiniId(); Long appId = one.getMiniId();
@ -223,6 +239,46 @@ public class AssetMiniProgramsController extends BaseController {
one.setStatus(status); one.setStatus(status);
assetMiniProgramsJyService.updateById(one); assetMiniProgramsJyService.updateById(one);
} }
}
} else {
//新增主表
assetMiniProgramsService.save(aa);
//查询改单位下是否有进行中的任务
AssetTask task= assetTaskService.lambdaQuery().like(AssetTask::getDwmc,aa.getSsdw()).like(AssetTask::getType,"1").eq(AssetTask::getTaskStatus,1).one();
if (task!=null){
AssetMiniProgramsCpPo bb = new AssetMiniProgramsCpPo();
BeanUtil.copyProperties(byId, bb);
bb.setAssetId(aa.getId());
bb.setMiniId(null);
bb.setTaskId(task.getId());
assetMiniProgramsCpService.save(bb);
}
}
}
else if("3".equals(as.getAuditState())){
AssetMiniProgramsZztbPo byId = assetMiniProgramsZztbService.getById(as.getCurrentId());
AssetMiniPrograms aa = new AssetMiniPrograms();
BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId());
//根据资产名称和所属单位查询主表是否有数据
AssetMiniPrograms assetMiniPrograms = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getXcxmc, byId.getXcxmc()).eq(AssetMiniPrograms::getSsdw, byId.getSsdw()).one();
if (assetMiniPrograms != null) {
//修改主表
if (assetMiniPrograms.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetMiniPrograms, "id");
//区分数据是管理端新增还是单位端新增
assetMiniPrograms.setXzType(0);
assetMiniPrograms.setDelFlag("1");
assetMiniProgramsService.updateById(assetMiniPrograms);
} else {
BeanUtil.copyProperties(aa, assetMiniPrograms, "id");
assetMiniPrograms.setDelFlag("1");
assetMiniProgramsService.updateById(assetMiniPrograms);
}
}
} }
return success(); return success();
} }

@ -9,18 +9,15 @@ import com.ruoyi.common.enums.BusinessType;
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.AssetEmail;
import com.ruoyi.tc.entity.AssetOfficialAccount; import com.ruoyi.tc.entity.AssetOfficialAccount;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo; import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountJyPo; import com.ruoyi.tc.entity.po.AssetOfficialAccountJyPo;
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.AssetOfficialAccountMenu; import com.ruoyi.tc.entity.request.AssetOfficialAccountMenu;
import com.ruoyi.tc.entity.request.AssetOfficialAccountPageRequest; import com.ruoyi.tc.entity.request.AssetOfficialAccountPageRequest;
import com.ruoyi.tc.entity.zztb.AssetEmailZztbPo;
import com.ruoyi.tc.entity.zztb.AssetOfficialAccountZztbPo; import com.ruoyi.tc.entity.zztb.AssetOfficialAccountZztbPo;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.*;
import com.ruoyi.tc.zztbService.AssetOfficialAccountZztbService; import com.ruoyi.tc.zztbService.AssetOfficialAccountZztbService;
@ -246,13 +243,19 @@ public class AssetOfficialAccountController {
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId()); aa.setId(byId.getAssetId());
//修改主表 //修改主表
aa.setDelFlag("0");
assetOfficialAccountService.updateById(aa); assetOfficialAccountService.updateById(aa);
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery() AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.isNotNull(AssetOfficialAccountJyPo::getTaskId) .isNotNull(AssetOfficialAccountJyPo::getTaskId)
.ne(AssetOfficialAccountJyPo::getStatus, 5) .ne(AssetOfficialAccountJyPo::getStatus, 5)
.eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId())
.orderByDesc(AssetOfficialAccountJyPo::getAccountId)
.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 status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getAccountId(); Long appId = one.getAccountId();
@ -264,7 +267,10 @@ public class AssetOfficialAccountController {
one.setStatus(status); one.setStatus(status);
assetOfficialAccountJyService.updateById(one); assetOfficialAccountJyService.updateById(one);
} }
}else{
}
}
else if("2".equals(as.getAuditState()) ) {
AssetOfficialAccountZztbPo byId = assetOfficialAccountZztbService.getById(as.getCurrentId()); AssetOfficialAccountZztbPo byId = assetOfficialAccountZztbService.getById(as.getCurrentId());
AssetOfficialAccount aa = new AssetOfficialAccount(); AssetOfficialAccount aa = new AssetOfficialAccount();
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
@ -273,18 +279,29 @@ public class AssetOfficialAccountController {
AssetOfficialAccount assetOfficialAccount = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getGzhmc, byId.getGzhmc()).eq(AssetOfficialAccount::getSsdw, byId.getSsdw()).one(); AssetOfficialAccount assetOfficialAccount = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getGzhmc, byId.getGzhmc()).eq(AssetOfficialAccount::getSsdw, byId.getSsdw()).one();
if (assetOfficialAccount != null) { if (assetOfficialAccount != null) {
//修改主表 //修改主表
if (assetOfficialAccount.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetOfficialAccount, "id"); BeanUtil.copyProperties(aa, assetOfficialAccount, "id");
assetOfficialAccount.setXzType(0);
assetOfficialAccount.setDelFlag("0");
assetOfficialAccountService.updateById(assetOfficialAccount); assetOfficialAccountService.updateById(assetOfficialAccount);
} else { } else {
//新增主表 BeanUtil.copyProperties(aa, assetOfficialAccount, "id");
assetOfficialAccountService.save(aa); assetOfficialAccount.setDelFlag("0");
assetOfficialAccountService.updateById(assetOfficialAccount);
} }
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery() AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.ne(AssetOfficialAccountJyPo::getStatus, 5) .ne(AssetOfficialAccountJyPo::getStatus, 5)
.eq(AssetOfficialAccountJyPo::getGzhmc, byId.getGzhmc()).one(); .eq(AssetOfficialAccountJyPo::getGzhmc, byId.getGzhmc())
.orderByDesc(AssetOfficialAccountJyPo::getAccountId)
.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 status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getAccountId(); Long appId = one.getAccountId();
@ -296,6 +313,47 @@ public class AssetOfficialAccountController {
one.setStatus(status); one.setStatus(status);
assetOfficialAccountJyService.updateById(one); assetOfficialAccountJyService.updateById(one);
} }
}
} else {
//新增主表
assetOfficialAccountService.save(aa);
//查询改单位下是否有进行中的任务
AssetTask task = assetTaskService.lambdaQuery().like(AssetTask::getDwmc, aa.getSsdw()).like(AssetTask::getType, "1").eq(AssetTask::getTaskStatus, 1).one();
if (task != null) {
AssetOfficialAccountCpPo bb = new AssetOfficialAccountCpPo();
BeanUtil.copyProperties(byId, bb);
bb.setAssetId(aa.getId());
bb.setTaskId(task.getId());
bb.setAccountId(null);
assetOfficialAccountCpService.save(bb);
}
}
}
else if("3".equals(as.getAuditState()) ){
AssetOfficialAccountZztbPo byId = assetOfficialAccountZztbService.getById(as.getCurrentId());
AssetOfficialAccount aa = new AssetOfficialAccount();
BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId());
//根据资产名称和所属单位查询主表是否有数据
AssetOfficialAccount assetOfficialAccount = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getGzhmc, byId.getGzhmc()).eq(AssetOfficialAccount::getSsdw, byId.getSsdw()).one();
if (assetOfficialAccount != null) {
//修改主表
if (assetOfficialAccount.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetOfficialAccount, "id");
assetOfficialAccount.setXzType(0);
assetOfficialAccount.setDelFlag("1");
assetOfficialAccountService.updateById(assetOfficialAccount);
} else {
BeanUtil.copyProperties(aa, assetOfficialAccount, "id");
assetOfficialAccount.setDelFlag("1");
assetOfficialAccountService.updateById(assetOfficialAccount);
}
}
} }
return success(); return success();
} }

@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -158,8 +157,13 @@ public class AssetTaskController extends BaseController {
@Resource @Resource
private UnitOtherConcatHistoryService unitOtherConcatHistoryService; private UnitOtherConcatHistoryService unitOtherConcatHistoryService;
@Resource
private AssetAssetSjCpService assetAssetSjCpService;
@Resource
private AssetAssetSjJyService assetAssetSjJyService;
/** /**
* *
* *
@ -357,6 +361,7 @@ public class AssetTaskController extends BaseController {
assetSupplyChainCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId()); assetSupplyChainCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId()); unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId()); assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetAssetSjCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
//根据taskid获取当前任务的count数量 //根据taskid获取当前任务的count数量
AssetTask assetTask = assetTaskDao.getByTaskId(assetCurrent.getTaskId()); AssetTask assetTask = assetTaskDao.getByTaskId(assetCurrent.getTaskId());
int ygt = Optional.ofNullable(assetTask.getYgt()).orElse(0); int ygt = Optional.ofNullable(assetTask.getYgt()).orElse(0);
@ -403,7 +408,7 @@ public class AssetTaskController 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);
@ -451,6 +456,16 @@ public class AssetTaskController extends BaseController {
//新增其他联系人 //新增其他联系人
unitOtherConcatCpService.saveBatch(assetCurrent.getOtherConcat()); unitOtherConcatCpService.saveBatch(assetCurrent.getOtherConcat());
} }
if (!assetCurrent.getSjzcList().isEmpty()) {
for (AssetSjCpPo items : assetCurrent.getSjzcList()) {
items.setAssetId(assetCurrent.getId());
items.setTaskId(assetCurrent.getTaskId());
}
//新增其他联系人
assetAssetSjCpService.saveBatch(assetCurrent.getSjzcList());
}
// 获取当前时间 // 获取当前时间
LocalDateTime localDateTime = LocalDateTime.now(); LocalDateTime localDateTime = LocalDateTime.now();
// 转换为 Date // 转换为 Date
@ -568,6 +583,8 @@ public class AssetTaskController extends BaseController {
assetSupplyChainCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId()); assetSupplyChainCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId()); unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId()); assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetAssetSjCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
//新增流程节点时间 //新增流程节点时间
AssetLc assetLc = new AssetLc(); AssetLc assetLc = new AssetLc();
assetLc.setTaskId(assetCurrent.getTaskId()); assetLc.setTaskId(assetCurrent.getTaskId());
@ -610,7 +627,7 @@ public class AssetTaskController 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);
@ -662,6 +679,14 @@ public class AssetTaskController extends BaseController {
//新增其他联系人 //新增其他联系人
unitOtherConcatJyservice.saveBatch(assetCurrent.getOtherConcat()); unitOtherConcatJyservice.saveBatch(assetCurrent.getOtherConcat());
} }
if (!assetCurrent.getSjzcList().isEmpty()) {
for (AssetSjJyPo items : assetCurrent.getSjzcList()) {
items.setAssetId(assetCurrent.getId());
items.setTaskId(assetCurrent.getTaskId());
}
//新增其他联系人
assetAssetSjJyService.saveBatch(assetCurrent.getSjzcList());
}
// 获取当前时间 // 获取当前时间
LocalDateTime localDateTime = LocalDateTime.now(); LocalDateTime localDateTime = LocalDateTime.now();
// 转换为 Date // 转换为 Date

@ -19,7 +19,7 @@ import java.io.Serializable;
@Data @Data
@ApiModel("数据资产") @ApiModel("数据资产")
@TableName(value = "asset_sjzc") @TableName(value = "asset_sjzc")
public class AssetSj extends BaseClass implements Serializable { public class AssetSj implements Serializable {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;

@ -1,5 +1,6 @@
package com.ruoyi.tc.entity; package com.ruoyi.tc.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -28,6 +29,7 @@ public class AssetTask implements Serializable {
* *
*/ */
@ApiModelProperty("任务编号") @ApiModelProperty("任务编号")
@TableField(exist = false)
private String taskId; private String taskId;
/** /**
* *

@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.tc.baseClass.BaseClass; import com.ruoyi.tc.baseClass.BaseClass;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo; import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.po.AssetBusinessFormCpPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import com.ruoyi.tc.entity.po.UnitOtherConcatCpPo;
import com.ruoyi.tc.entity.request.Acomma; import com.ruoyi.tc.entity.request.Acomma;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -728,6 +725,11 @@ public class AssetCurrentHistory extends BaseClass implements Serializable {
@ApiModelProperty("供应链信息列表") @ApiModelProperty("供应链信息列表")
@TableField(exist = false) @TableField(exist = false)
private List<AssetSupplyChainCpPo> gylxxList; private List<AssetSupplyChainCpPo> gylxxList;
@ApiModelProperty("数据资产")
@TableField(exist = false)
private List<AssetSjCpPo> sjzcList;
/** /**
* *
*/ */

@ -965,4 +965,10 @@ public class AssetCurrentJyPo extends BaseClass implements Serializable {
@ApiModelProperty("类型0:管理端1单位端") @ApiModelProperty("类型0:管理端1单位端")
private Integer xzType=0; private Integer xzType=0;
@ApiModelProperty("数据资产")
@TableField(exist = false)
private List<AssetSjJyPo> sjzcList;
} }

@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.tc.baseClass.BaseClass;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.io.Serializable;
/** /**
* @author dong * @author dong

@ -22,5 +22,17 @@ public interface AssetAssetSjCpMapper extends BaseMapper<AssetSjCpPo> {
void deleteByAssetIds(Long id); void deleteByAssetIds(Long id);
/**
* idid
*
* @param assetId id
* @param taskId id
*/
@Delete("delete from asset_sjzc_cp where asset_id=#{assetId} and task_id =#{taskId} ")
void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") int taskId);
} }

@ -14,5 +14,13 @@ public interface AssetAssetSjCpService extends IService<AssetSjCpPo> {
/**
* idid
*
* @param assetId id
* @param taskId id
*/
void deletByAssetIdandTaskId(Long assetId, Integer taskId);
} }

@ -6,6 +6,8 @@ import com.ruoyi.tc.mapper.AssetAssetSjCpMapper;
import com.ruoyi.tc.service.AssetAssetSjCpService; import com.ruoyi.tc.service.AssetAssetSjCpService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/** /**
* (asset_sjzc_cp) * (asset_sjzc_cp)
* *
@ -15,5 +17,12 @@ import org.springframework.stereotype.Service;
@Service("assetAssetSjCpService") @Service("assetAssetSjCpService")
public class AssetAssetSjCpServiceImpl extends ServiceImpl<AssetAssetSjCpMapper, AssetSjCpPo> implements AssetAssetSjCpService { public class AssetAssetSjCpServiceImpl extends ServiceImpl<AssetAssetSjCpMapper, AssetSjCpPo> implements AssetAssetSjCpService {
@Resource
private AssetAssetSjCpMapper assetAssetSjCpMapper;
@Override
public void deletByAssetIdandTaskId(Long assetId, Integer taskId) {
assetAssetSjCpMapper.deletByAssetIdandTaskId(assetId, taskId);
}
} }

@ -484,6 +484,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
byId.setJcwlList(assetBasicNetworkCpService.lambdaQuery().eq(AssetBasicNetworkCpPo::getAssetId, byId.getId()).eq(AssetBasicNetworkCpPo::getDelFlag, "0").eq(AssetBasicNetworkCpPo::getTaskId, byId.getTaskId()).list()); byId.setJcwlList(assetBasicNetworkCpService.lambdaQuery().eq(AssetBasicNetworkCpPo::getAssetId, byId.getId()).eq(AssetBasicNetworkCpPo::getDelFlag, "0").eq(AssetBasicNetworkCpPo::getTaskId, byId.getTaskId()).list());
byId.setXjgywxt(assetBusinessFormCpService.lambdaQuery().eq(AssetBusinessFormCpPo::getAssetId, byId.getId()).eq(AssetBusinessFormCpPo::getDelFlag, "0").eq(AssetBusinessFormCpPo::getTaskId, byId.getTaskId()).one()); byId.setXjgywxt(assetBusinessFormCpService.lambdaQuery().eq(AssetBusinessFormCpPo::getAssetId, byId.getId()).eq(AssetBusinessFormCpPo::getDelFlag, "0").eq(AssetBusinessFormCpPo::getTaskId, byId.getTaskId()).one());
byId.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpPo::getAssetId, byId.getId()).eq(UnitOtherConcatCpPo::getDelFlag, "0").eq(UnitOtherConcatCpPo::getTaskId, byId.getTaskId()).list()); byId.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpPo::getAssetId, byId.getId()).eq(UnitOtherConcatCpPo::getDelFlag, "0").eq(UnitOtherConcatCpPo::getTaskId, byId.getTaskId()).list());
byId.setSjzcList(assetAssetSjCpService.lambdaQuery().eq(AssetSjCpPo::getAssetId, byId.getId()).eq(AssetSjCpPo::getDelFlag, "0").eq(AssetSjCpPo::getTaskId, byId.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 -> {
@ -832,6 +834,9 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetSupplyChainCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId()); assetSupplyChainCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
unitOtherConcatCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId()); unitOtherConcatCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
assetBasicNetworkCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId()); assetBasicNetworkCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
assetAssetSjCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
StringBuilder a = new StringBuilder(); StringBuilder a = new StringBuilder();
if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlymList())) { if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlymList())) {
req.getAssetCurrentCpPo().getGlymList().forEach(x -> { req.getAssetCurrentCpPo().getGlymList().forEach(x -> {
@ -887,6 +892,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//新增其他联系人 //新增其他联系人
unitOtherConcatCpService.saveBatch(req.getAssetCurrentCpPo().getOtherConcat()); unitOtherConcatCpService.saveBatch(req.getAssetCurrentCpPo().getOtherConcat());
} }
if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getSjzcList())) {
for (AssetSjCpPo items : req.getAssetCurrentCpPo().getSjzcList()) {
items.setAssetId(req.getAssetCurrentCpPo().getId());
items.setTaskId(req.getAssetCurrentCpPo().getTaskId());
}
//新增数据资产
assetAssetSjCpService.saveBatch(req.getAssetCurrentCpPo().getSjzcList());
}
//新增历史记录 //新增历史记录
// saveHistory(req, a, b, date, assetCurrentHistory); // saveHistory(req, a, b, date, assetCurrentHistory);
} }

Loading…
Cancel
Save