main
吴顺杰 2 months ago
parent fe7c252bc1
commit ecfd4076ac

@ -2,15 +2,27 @@ package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.*; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest; import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
import com.ruoyi.tc.entity.request.AssetTaskPageRequest; import com.ruoyi.tc.entity.request.AssetTaskPageRequest;
import com.ruoyi.tc.entity.response.*; import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.response.AssetBasicNetworkCpResponse;
import com.ruoyi.tc.entity.response.AssetBusinessFormCpResponse;
import com.ruoyi.tc.entity.response.AssetCurrentResponse;
import com.ruoyi.tc.entity.response.AssetSupplyChainCpResponse;
import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.response.UnitOtherConcatCpResponse;
import com.ruoyi.tc.mapper.AssetTaskMapper; import com.ruoyi.tc.mapper.AssetTaskMapper;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.AssetBasicNetworkCpService;
import com.ruoyi.tc.service.AssetBusinessFormCpService;
import com.ruoyi.tc.service.AssetCurrentCpService;
import com.ruoyi.tc.service.AssetSupplyChainCpService;
import com.ruoyi.tc.service.AssetTaskService;
import com.ruoyi.tc.service.UnitOtherConcatCpService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -42,8 +54,6 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
private UnitOtherConcatCpService unitOtherConcatCpService; private UnitOtherConcatCpService unitOtherConcatCpService;
/** /**
* ID * ID
* *
@ -76,15 +86,16 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
@Override @Override
public void insert(AssetTask assetTask) { public void insert(AssetTask assetTask) {
//任务新增 //任务新增
int id= assetTaskDao.insert(assetTask); int id = assetTaskDao.insert(assetTask);
String[] parts = assetTask.getDwmc().split(","); String[] parts = assetTask.getDwmc().split(",");
for (String part : parts) { for (String part : parts) {
//根据单位名称查询资产 //根据单位名称查询资产
List<AssetCurrentResponse> list = assetTaskDao.findByDwmcAssetCurrent(part); List<AssetCurrentResponse> list = assetTaskDao.findByDwmcAssetCurrent(part);
for (AssetCurrentResponse assetCurrentResponse:list){ for (AssetCurrentResponse assetCurrentResponse : list) {
assetCurrentResponse.setTaskId(id); assetCurrentResponse.setTaskId(id);
} }
assetCurrentCpService.saveBatch(list); assetCurrentCpService.saveBatch(list);
List<AssetBusinessFormCpResponse> assetBusinessFormCpResponseList = new ArrayList<>();
for (AssetCurrentResponse assetCurrentResponse : list) { for (AssetCurrentResponse assetCurrentResponse : list) {
//新增新监管业务形态 //新增新监管业务形态
//根据资产id查询新监管业务形态主表id //根据资产id查询新监管业务形态主表id
@ -94,8 +105,9 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetCurrentResponse.getXjgywxt().setId(assetBusinessFormCpResponse.getId()); assetCurrentResponse.getXjgywxt().setId(assetBusinessFormCpResponse.getId());
assetCurrentResponse.getXjgywxt().setAssetId(assetCurrentResponse.getId()); assetCurrentResponse.getXjgywxt().setAssetId(assetCurrentResponse.getId());
assetCurrentResponse.getXjgywxt().setTaskId(id); assetCurrentResponse.getXjgywxt().setTaskId(id);
assetBusinessFormCpService.save(assetCurrentResponse.getXjgywxt()); assetBusinessFormCpResponseList.add(assetCurrentResponse.getXjgywxt());
} }
assetBusinessFormCpService.saveBatch(assetBusinessFormCpResponseList);
} }
//根据资产id查询供应链主表id- //根据资产id查询供应链主表id-
List<AssetSupplyChainCpResponse> supplyChainList = assetSupplyChainCpService.findByassetId(assetCurrentResponse.getId()); List<AssetSupplyChainCpResponse> supplyChainList = assetSupplyChainCpService.findByassetId(assetCurrentResponse.getId());
@ -105,8 +117,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
items.setId(items.getId()); items.setId(items.getId());
items.setTaskId(id); items.setTaskId(id);
//新增供应链 //新增供应链
assetSupplyChainCpService.save(items);
} }
assetSupplyChainCpService.saveBatch(supplyChainList);
} }
List<AssetBasicNetworkCpResponse> BasicNetworkCpList = assetBasicNetworkCpService.findByassetId(assetCurrentResponse.getId()); List<AssetBasicNetworkCpResponse> BasicNetworkCpList = assetBasicNetworkCpService.findByassetId(assetCurrentResponse.getId());
if (BasicNetworkCpList != null) { if (BasicNetworkCpList != null) {
@ -116,9 +128,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
items.setId(items.getId()); items.setId(items.getId());
items.setTaskId(id); items.setTaskId(id);
//新增基础网络 //新增基础网络
assetBasicNetworkCpService.save(items);
} }
assetBasicNetworkCpService.saveBatch(BasicNetworkCpList);
} }
List<UnitOtherConcatCpResponse> unitOtherConcatList = unitOtherConcatCpService.findByassetId(assetCurrentResponse.getId()); List<UnitOtherConcatCpResponse> unitOtherConcatList = unitOtherConcatCpService.findByassetId(assetCurrentResponse.getId());
if (unitOtherConcatList != null) { if (unitOtherConcatList != null) {
@ -128,9 +139,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
items.setConcatId(items.getConcatId()); items.setConcatId(items.getConcatId());
items.setTaskId(id); items.setTaskId(id);
//新增其他联系人 //新增其他联系人
unitOtherConcatCpService.save(items);
} }
unitOtherConcatCpService.saveBatch(unitOtherConcatList);
} }
} }
} }
@ -161,17 +171,17 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
@Override @Override
public AssetCurrentResponse taskSh(int taskId,int assetId) { public AssetCurrentResponse taskSh(int taskId, int assetId) {
AssetCurrentResponse byId = assetTaskDao.findBytaskIdandAssestId(taskId,assetId); AssetCurrentResponse byId = assetTaskDao.findBytaskIdandAssestId(taskId, assetId);
byId.setGylxxList(assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpResponse::getAssetId,assetId).eq(AssetSupplyChainCpResponse::getDelFlag,"0").eq(AssetSupplyChainCpResponse::getTaskId,taskId).list()); byId.setGylxxList(assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpResponse::getAssetId, assetId).eq(AssetSupplyChainCpResponse::getDelFlag, "0").eq(AssetSupplyChainCpResponse::getTaskId, taskId).list());
byId.setJcwlList(assetBasicNetworkCpService.lambdaQuery().eq(AssetBasicNetworkCpResponse::getAssetId,assetId).eq(AssetBasicNetworkCpResponse::getDelFlag,"0").eq(AssetBasicNetworkCpResponse::getTaskId,taskId).list()); byId.setJcwlList(assetBasicNetworkCpService.lambdaQuery().eq(AssetBasicNetworkCpResponse::getAssetId, assetId).eq(AssetBasicNetworkCpResponse::getDelFlag, "0").eq(AssetBasicNetworkCpResponse::getTaskId, taskId).list());
byId.setXjgywxt(assetBusinessFormCpService.lambdaQuery().eq(AssetBusinessFormCpResponse::getAssetId,assetId).eq(AssetBusinessFormCpResponse::getDelFlag,"0").eq(AssetBusinessFormCpResponse::getTaskId,taskId).one()); byId.setXjgywxt(assetBusinessFormCpService.lambdaQuery().eq(AssetBusinessFormCpResponse::getAssetId, assetId).eq(AssetBusinessFormCpResponse::getDelFlag, "0").eq(AssetBusinessFormCpResponse::getTaskId, taskId).one());
byId.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpResponse::getAssetId,assetId).eq(UnitOtherConcatCpResponse::getDelFlag,"0").eq(UnitOtherConcatCpResponse::getTaskId,taskId).list()); byId.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpResponse::getAssetId, assetId).eq(UnitOtherConcatCpResponse::getDelFlag, "0").eq(UnitOtherConcatCpResponse::getTaskId, taskId).list());
return byId; return byId;
} }
@Override @Override
public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest) { public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest) {
return assetTaskDao.zcHc(assetTask,pageRequest); return assetTaskDao.zcHc(assetTask, pageRequest);
} }
} }

Loading…
Cancel
Save