管理端审核代码修改

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.poi.ExcelUtil;
import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.AssetTask;
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.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
import com.ruoyi.tc.entity.request.AssetAppPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest;
@ -169,21 +173,29 @@ public class AssetAppController extends BaseController {
AssetAppJyPo one = assetAppJyService.lambdaQuery()
.isNotNull(AssetAppJyPo::getTaskId)
.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) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAppId();
BeanUtil.copyProperties(byId, one);
one.setAppId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetAppJyService.updateById(one);
//根据任务id查询任务是否关闭
AssetTask two = assetTaskService.lambdaQuery().eq(AssetTask::getId, one.getTaskId()).eq(AssetTask::getTaskStatus, 0).one();
if (two == null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAppId();
BeanUtil.copyProperties(byId, one);
one.setAppId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetAppJyService.updateById(one);
}
}
} else {
}
else if("2".equals(as.getAuditState())) {
AssetAppZztbPo byId = assetAppZztbService.getById(as.getCurrentId());
AssetApp aa = new AssetApp();
BeanUtil.copyProperties(byId, aa);
@ -192,29 +204,77 @@ public class AssetAppController extends BaseController {
AssetApp assetApp = assetAppService.lambdaQuery().eq(AssetApp::getAppName, byId.getAppName()).eq(AssetApp::getSsdw, byId.getSsdw()).one();
if (assetApp != null) {
//修改主表
BeanUtil.copyProperties(aa,assetApp,"id");
assetAppService.updateById(assetApp);
if (assetApp.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetApp, "id");
assetApp.setXzType(0);
assetApp.setDelFlag("0");
assetAppService.updateById(assetApp);
}else{
BeanUtil.copyProperties(aa, assetApp, "id");
assetAppService.updateById(assetApp);
}
//如果有任务也修改任务这边
AssetAppJyPo one = assetAppJyService.lambdaQuery()
.ne(AssetAppJyPo::getStatus, 5)
.eq(AssetAppJyPo::getAppName, byId.getAppName())
.orderByDesc(AssetAppJyPo::getAppId)
.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 status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAppId();
BeanUtil.copyProperties(byId, one);
one.setAppId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
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);
}
}
//如果有任务也修改任务这边
AssetAppJyPo one = assetAppJyService.lambdaQuery()
.ne(AssetAppJyPo::getStatus, 5)
.eq(AssetAppJyPo::getAppName, byId.getAppName()).one();
if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAppId();
BeanUtil.copyProperties(byId, one);
one.setAppId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetAppJyService.updateById(one);
}
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();

@ -261,6 +261,13 @@ public class AssetCurrentController extends BaseController {
//新增其他联系人
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
}
if (assetCurrent.getSjzcList() != null) {
for (AssetSj items : assetCurrent.getSjzcList()) {
items.setAssetId(assetCurrent.getId());
}
//新增数据资产
assetAssetSjService.saveBatch(assetCurrent.getSjzcList());
}
// 单位有进行中的任务时,管理端新增该单位下的资产则需同步至当前进行中的任务中。
//获取新增资产id
Long id = assetCurrent.getId();
@ -482,7 +489,7 @@ public class AssetCurrentController extends BaseController {
AssetBusinessForm assetBusinessForm = assetCurrentZztbPo.getXjgywxt();
AssetBusinessFormZztbPo assetBusinessFormZztbPo = new AssetBusinessFormZztbPo();
BeanUtils.copyProperties(assetBusinessForm, assetBusinessFormZztbPo);
assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getCurrentId());
assetBusinessFormZztbPo.setAssetId(assetCurrentZztbPo.getId());
assetBusinessFormZztbService.save(assetBusinessFormZztbPo);
}
if (assetCurrentZztbPo.getGylxxList() != null) {
@ -589,18 +596,37 @@ public class AssetCurrentController extends BaseController {
@GetMapping("/lookInfo/{id}")
public AjaxResult lookInfo(@PathVariable Long id) {
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(id);
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());
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);
if (byId.getId() == null) {
//单位段新增查看
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());
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.setXjgywxt(null);
//管理端新增查看
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());
}
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());
List<Acomma> a1 = new ArrayList<>();
if (byId.getGlym() != null) {
@ -663,6 +689,7 @@ public class AssetCurrentController extends BaseController {
AssetCurrent assetCurrent = new AssetCurrent();
BeanUtil.copyProperties(byId, assetCurrent);
//修改主表
assetCurrent.setDelFlag("0");
assetCurrentService.updateById(assetCurrent);
//删除副表数据然后再添加
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
@ -698,54 +725,61 @@ public class AssetCurrentController extends BaseController {
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) {
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);
list.forEach(x -> {
x.setTaskId(taskId);
assetSupplyChainCpService.save(x);
});
list1.forEach(x -> {
x.setTaskId(taskId);
assetBasicNetworkCpService.save(x);
});
list2.forEach(x -> {
x.setTaskId(taskId);
assetBusinessFormCpService.save(x);
});
list3.forEach(x -> {
x.setTaskId(taskId);
unitOtherConcatCpService.save(x);
});
//根据任务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);
list.forEach(x -> {
x.setTaskId(taskId);
assetSupplyChainCpService.save(x);
});
list1.forEach(x -> {
x.setTaskId(taskId);
assetBasicNetworkCpService.save(x);
});
list2.forEach(x -> {
x.setTaskId(taskId);
assetBusinessFormCpService.save(x);
});
list3.forEach(x -> {
x.setTaskId(taskId);
unitOtherConcatCpService.save(x);
});
}
}
}
else {
} else if ("2".equals(as.getAuditState())) {
AssetCurrentZztbPo byId = assetCurrentZztbService.getById(as.getCurrentId());
AssetCurrent aa = new AssetCurrent();
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();
if (assetCurrent != null) {
//修改主表
BeanUtil.copyProperties(aa, assetCurrent, "id");
assetCurrentService.updateById(assetCurrent);
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());
@ -762,7 +807,7 @@ public class AssetCurrentController extends BaseController {
unitOtherConcatService.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 -> {
AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
@ -773,7 +818,7 @@ public class AssetCurrentController extends BaseController {
assetSupplyChainService.saveBatch(assetSupplyChainList);
//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 -> {
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
@ -784,7 +829,7 @@ public class AssetCurrentController extends BaseController {
assetBasicNetworkService.saveBatch(networkList);
//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 -> {
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
@ -796,7 +841,7 @@ public class AssetCurrentController extends BaseController {
//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 -> {
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
@ -807,7 +852,7 @@ public class AssetCurrentController extends BaseController {
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 -> {
AssetSj assetSj = new AssetSj();
BeanUtils.copyProperties(cpPo, assetSj); // 复制属性
@ -816,149 +861,246 @@ public class AssetCurrentController extends BaseController {
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> supplyChainZztbPoList = assetSupplyChainZztbService.lambdaQuery().eq(AssetSupplyChainZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSupplyChainZztbPo::getTaskId).list();
List<AssetSupplyChain> assetSupplyChainList = supplyChainZztbPoList.stream().map(cpPo -> {
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(assetSupplyChainList);
assetSupplyChainService.saveBatch(assetSupplyChainList1);
//newtwork
List<AssetBasicNetworkZztbPo> networkZztbPoList = assetBasicNetworkZztbService.lambdaQuery().eq(AssetBasicNetworkZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBasicNetworkZztbPo::getTaskId).list();
List<AssetBasicNetwork> networkList = networkZztbPoList.stream().map(cpPo -> {
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(networkList);
assetBasicNetworkService.saveBatch(networkList1);
//business
List<AssetBusinessFormZztbPo> businessFormZztbPoList = assetBusinessFormZztbService.lambdaQuery().eq(AssetBusinessFormZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetBusinessFormZztbPo::getTaskId).list();
List<AssetBusinessForm> businessFormList = businessFormZztbPoList.stream().map(cpPo -> {
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(businessFormList);
assetBusinessFormService.saveBatch(businessFormList1);
//unitother
List<UnitOtherConcatZztbPo> unitOtherConcatZztbPoList = unitOtherConcatZztbservice.lambdaQuery().eq(UnitOtherConcatZztbPo::getAssetId, byId.getCurrentId()).isNull(UnitOtherConcatZztbPo::getTaskId).list();
List<UnitOtherConcat> unitOtherConcatList = unitOtherConcatZztbPoList.stream().map(cpPo -> {
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(unitOtherConcatList);
unitOtherConcatService.saveBatch(unitOtherConcatList1);
//数据资产
List<AssetSjZztbPo> assetSjZztbPoList = assetAssetSjZztbService.lambdaQuery().eq(AssetSjZztbPo::getAssetId, byId.getCurrentId()).isNull(AssetSjZztbPo::getTaskId).list();
List<AssetSj> assetSjList = assetSjZztbPoList.stream().map(cpPo -> {
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(assetSjList);
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);
}
}
//如果有任务也修改任务这边
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery().isNotNull(AssetCurrentCpPo::getTaskId).ne(AssetCurrentCpPo::getStatus, 5).eq(AssetCurrentCpPo::getId, byId.getId()).one();
if (one != 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);
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);
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);
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);
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);
assetAssetSjCpService.save(a5);
});
} 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();
}
//=================================================
/**

@ -14,10 +14,7 @@ import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppJyPo;
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.po.*;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest;
import com.ruoyi.tc.entity.request.AssetEmailPageRequest;
@ -178,25 +175,34 @@ public class AssetEmailController extends BaseController {
BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId());
//修改主表
aa.setDelFlag("0");
assetEmailService.updateById(aa);
//如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.isNotNull(AssetEmailJyPo::getTaskId)
.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) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getEmailId();
BeanUtil.copyProperties(byId, one);
one.setEmailId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetEmailJyService.updateById(one);
//根据任务id查询任务是否关闭
AssetTask two = assetTaskService.lambdaQuery().eq(AssetTask::getId, one.getTaskId()).eq(AssetTask::getTaskStatus, 0).one();
if (two == null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getEmailId();
BeanUtil.copyProperties(byId, one);
one.setEmailId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetEmailJyService.updateById(one);
}
}
}else {
}
else if("2".equals(as.getAuditState()) ){
AssetEmailZztbPo byId = assetEmailZztbService.getById(as.getCurrentId());
AssetEmail aa = new AssetEmail();
BeanUtil.copyProperties(byId, aa);
@ -205,28 +211,79 @@ public class AssetEmailController extends BaseController {
AssetEmail assetEmail = assetEmailService.lambdaQuery().eq(AssetEmail::getDzyxhz, byId.getDzyxhz()).eq(AssetEmail::getSsdw, byId.getSsdw()).one();
if (assetEmail != null) {
//修改主表
BeanUtil.copyProperties(aa, assetEmail, "id");
assetEmailService.updateById(assetEmail);
if (assetEmail.getXzType() == 0) {
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);
}
//如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.ne(AssetEmailJyPo::getStatus, 5)
.eq(AssetEmailJyPo::getDzyxhz, byId.getDzyxhz())
.orderByDesc(AssetEmailJyPo::getEmailId)
.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 status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getEmailId();
BeanUtil.copyProperties(byId, one);
one.setEmailId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
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);
}
}
//如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.ne(AssetEmailJyPo::getStatus, 5)
.eq(AssetEmailJyPo::getDzyxhz, byId.getDzyxhz()).one();
if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getEmailId();
BeanUtil.copyProperties(byId, one);
one.setEmailId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetEmailJyService.updateById(one);
}
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();
}

@ -10,17 +10,14 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.AssetMiniPrograms;
import com.ruoyi.tc.entity.AssetTask;
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.AssetMiniProgramsJyPo;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest;
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.service.*;
import com.ruoyi.tc.zztbService.AssetMiniProgramsZztbService;
@ -174,25 +171,34 @@ public class AssetMiniProgramsController extends BaseController {
BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId());
//修改主表
aa.setDelFlag("0");
assetMiniProgramsService.updateById(aa);
//如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.isNotNull(AssetMiniProgramsJyPo::getTaskId)
.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) {
Integer taskId = one.getTaskId();
Long appId = one.getMiniId();
Integer status = one.getStatus();
BeanUtil.copyProperties(byId, one);
one.setMiniId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetMiniProgramsJyService.updateById(one);
//根据任务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.getMiniId();
Integer status = one.getStatus();
BeanUtil.copyProperties(byId, one);
one.setMiniId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetMiniProgramsJyService.updateById(one);
}
}
}else{
}
else if("2".equals(as.getAuditState())){
AssetMiniProgramsZztbPo byId = assetMiniProgramsZztbService.getById(as.getCurrentId());
AssetMiniPrograms aa = new AssetMiniPrograms();
BeanUtil.copyProperties(byId, aa);
@ -201,27 +207,77 @@ public class AssetMiniProgramsController extends BaseController {
AssetMiniPrograms assetMiniPrograms = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getXcxmc, byId.getXcxmc()).eq(AssetMiniPrograms::getSsdw, byId.getSsdw()).one();
if (assetMiniPrograms != null) {
//修改主表
BeanUtil.copyProperties(aa, assetMiniPrograms, "id");
assetMiniProgramsService.updateById(assetMiniPrograms);
if (assetMiniPrograms.getXzType()==0){
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);
}
//如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.ne(AssetMiniProgramsJyPo::getStatus, 5)
.eq(AssetMiniProgramsJyPo::getXcxmc, byId.getXcxmc())
.orderByDesc(AssetMiniProgramsJyPo::getMiniId)
.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 status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getMiniId();
BeanUtil.copyProperties(byId, one);
one.setMiniId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
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);
}
}
//如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.ne(AssetMiniProgramsJyPo::getStatus, 5)
.eq(AssetMiniProgramsJyPo::getXcxmc, byId.getXcxmc()).one();
if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getMiniId();
BeanUtil.copyProperties(byId, one);
one.setMiniId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetMiniProgramsJyService.updateById(one);
}
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();

@ -9,18 +9,15 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.AssetOfficialAccount;
import com.ruoyi.tc.entity.AssetTask;
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.AssetOfficialAccountJyPo;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest;
import com.ruoyi.tc.entity.request.AssetOfficialAccountMenu;
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.service.*;
import com.ruoyi.tc.zztbService.AssetOfficialAccountZztbService;
@ -246,25 +243,34 @@ public class AssetOfficialAccountController {
BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId());
//修改主表
aa.setDelFlag("0");
assetOfficialAccountService.updateById(aa);
//如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.isNotNull(AssetOfficialAccountJyPo::getTaskId)
.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) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAccountId();
BeanUtil.copyProperties(byId, one);
one.setAccountId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetOfficialAccountJyService.updateById(one);
//根据任务id查询任务是否关闭
AssetTask two = assetTaskService.lambdaQuery().eq(AssetTask::getId, one.getTaskId()).eq(AssetTask::getTaskStatus, 0).one();
if (two == null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAccountId();
BeanUtil.copyProperties(byId, one);
one.setAccountId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetOfficialAccountJyService.updateById(one);
}
}
}else{
}
else if("2".equals(as.getAuditState()) ) {
AssetOfficialAccountZztbPo byId = assetOfficialAccountZztbService.getById(as.getCurrentId());
AssetOfficialAccount aa = new AssetOfficialAccount();
BeanUtil.copyProperties(byId, aa);
@ -273,28 +279,80 @@ public class AssetOfficialAccountController {
AssetOfficialAccount assetOfficialAccount = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getGzhmc, byId.getGzhmc()).eq(AssetOfficialAccount::getSsdw, byId.getSsdw()).one();
if (assetOfficialAccount != null) {
//修改主表
BeanUtil.copyProperties(aa, assetOfficialAccount, "id");
assetOfficialAccountService.updateById(assetOfficialAccount);
if (assetOfficialAccount.getXzType() == 0) {
BeanUtil.copyProperties(aa, assetOfficialAccount, "id");
assetOfficialAccount.setXzType(0);
assetOfficialAccount.setDelFlag("0");
assetOfficialAccountService.updateById(assetOfficialAccount);
} else {
BeanUtil.copyProperties(aa, assetOfficialAccount, "id");
assetOfficialAccount.setDelFlag("0");
assetOfficialAccountService.updateById(assetOfficialAccount);
}
//如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.ne(AssetOfficialAccountJyPo::getStatus, 5)
.eq(AssetOfficialAccountJyPo::getGzhmc, byId.getGzhmc())
.orderByDesc(AssetOfficialAccountJyPo::getAccountId)
.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 status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAccountId();
BeanUtil.copyProperties(byId, one);
one.setAccountId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
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);
}
}
//如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.ne(AssetOfficialAccountJyPo::getStatus, 5)
.eq(AssetOfficialAccountJyPo::getGzhmc, byId.getGzhmc()).one();
if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAccountId();
BeanUtil.copyProperties(byId, one);
one.setAccountId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetOfficialAccountJyService.updateById(one);
}
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();

@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -158,8 +157,13 @@ public class AssetTaskController extends BaseController {
@Resource
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());
unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetAssetSjCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
//根据taskid获取当前任务的count数量
AssetTask assetTask = assetTaskDao.getByTaskId(assetCurrent.getTaskId());
int ygt = Optional.ofNullable(assetTask.getYgt()).orElse(0);
@ -403,7 +408,7 @@ public class AssetTaskController extends BaseController {
Object portValue = jsonObject.get("port");
if (portValue != null && !portValue.toString().isEmpty()) {
acomma.setPort(portValue.toString());
}else{
} else {
acomma.setPort("");
}
a2.add(acomma);
@ -451,6 +456,16 @@ public class AssetTaskController extends BaseController {
//新增其他联系人
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();
// 转换为 Date
@ -568,6 +583,8 @@ public class AssetTaskController extends BaseController {
assetSupplyChainCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetAssetSjCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
//新增流程节点时间
AssetLc assetLc = new AssetLc();
assetLc.setTaskId(assetCurrent.getTaskId());
@ -610,7 +627,7 @@ public class AssetTaskController extends BaseController {
Object portValue = jsonObject.get("port");
if (portValue != null && !portValue.toString().isEmpty()) {
acomma.setPort(portValue.toString());
}else{
} else {
acomma.setPort("");
}
a2.add(acomma);
@ -662,6 +679,14 @@ public class AssetTaskController extends BaseController {
//新增其他联系人
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();
// 转换为 Date
@ -1036,11 +1061,11 @@ public class AssetTaskController extends BaseController {
}
assetMiniProgramsJyService.save(assetMiniProgramsJyPo);
//新增历史记录表
AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory();
BeanUtils.copyProperties(assetMiniProgramsJyPo, assetMiniProgramsHistory);
assetMiniProgramsHistory.setMiniId(null);
assetMiniProgramsHistoryService.save(assetMiniProgramsHistory);
//新增历史记录表
AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory();
BeanUtils.copyProperties(assetMiniProgramsJyPo, assetMiniProgramsHistory);
assetMiniProgramsHistory.setMiniId(null);
assetMiniProgramsHistoryService.save(assetMiniProgramsHistory);
return success();
@ -1163,10 +1188,10 @@ public class AssetTaskController extends BaseController {
assetAppJyService.save(assetAppJyPo);
//新增历史记录表
AssetAppHistory assetAppHistory = new AssetAppHistory();
BeanUtils.copyProperties(assetAppJyPo, assetAppHistory);
assetAppHistory.setAppId(null);
assetAppHistoryService.save(assetAppHistory);
AssetAppHistory assetAppHistory = new AssetAppHistory();
BeanUtils.copyProperties(assetAppJyPo, assetAppHistory);
assetAppHistory.setAppId(null);
assetAppHistoryService.save(assetAppHistory);
return success();

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

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

@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.tc.baseClass.BaseClass;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
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.po.*;
import com.ruoyi.tc.entity.request.Acomma;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -728,6 +725,11 @@ public class AssetCurrentHistory extends BaseClass implements Serializable {
@ApiModelProperty("供应链信息列表")
@TableField(exist = false)
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单位端")
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.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.tc.baseClass.BaseClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* @author dong

@ -22,5 +22,17 @@ public interface AssetAssetSjCpMapper extends BaseMapper<AssetSjCpPo> {
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 org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* (asset_sjzc_cp)
*
@ -15,5 +17,12 @@ import org.springframework.stereotype.Service;
@Service("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.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.setSjzcList(assetAssetSjCpService.lambdaQuery().eq(AssetSjCpPo::getAssetId, byId.getId()).eq(AssetSjCpPo::getDelFlag, "0").eq(AssetSjCpPo::getTaskId, byId.getTaskId()).list());
List<Acomma> a1 = new ArrayList<>();
if (byId.getGlym() != null) {
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());
unitOtherConcatCpService.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();
if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlymList())) {
req.getAssetCurrentCpPo().getGlymList().forEach(x -> {
@ -887,6 +892,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//新增其他联系人
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);
}

Loading…
Cancel
Save