dongdingding 2 months ago
commit 0088011cf4

@ -2,16 +2,28 @@ package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.AssetCurrentShRequest;
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.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 javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
@ -43,8 +55,6 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
private UnitOtherConcatCpService unitOtherConcatCpService;
/**
* ID
*
@ -77,15 +87,16 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
@Override
public void insert(AssetTask assetTask) {
//任务新增
int id= assetTaskDao.insert(assetTask);
int id = assetTaskDao.insert(assetTask);
String[] parts = assetTask.getDwmc().split(",");
for (String part : parts) {
//根据单位名称查询资产
List<AssetCurrentResponse> list = assetTaskDao.findByDwmcAssetCurrent(part);
for (AssetCurrentResponse assetCurrentResponse:list){
assetCurrentResponse.setTaskId(id);
}
for (AssetCurrentResponse assetCurrentResponse : list) {
assetCurrentResponse.setTaskId(id);
}
assetCurrentCpService.saveBatch(list);
List<AssetBusinessFormCpResponse> assetBusinessFormCpResponseList = new ArrayList<>();
for (AssetCurrentResponse assetCurrentResponse : list) {
//新增新监管业务形态
//根据资产id查询新监管业务形态主表id
@ -95,8 +106,9 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetCurrentResponse.getXjgywxt().setId(assetBusinessFormCpResponse.getId());
assetCurrentResponse.getXjgywxt().setAssetId(assetCurrentResponse.getId());
assetCurrentResponse.getXjgywxt().setTaskId(id);
assetBusinessFormCpService.save(assetCurrentResponse.getXjgywxt());
assetBusinessFormCpResponseList.add(assetCurrentResponse.getXjgywxt());
}
assetBusinessFormCpService.saveBatch(assetBusinessFormCpResponseList);
}
//根据资产id查询供应链主表id-
List<AssetSupplyChainCpResponse> supplyChainList = assetSupplyChainCpService.findByassetId(assetCurrentResponse.getId());
@ -106,8 +118,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
items.setId(items.getId());
items.setTaskId(id);
//新增供应链
assetSupplyChainCpService.save(items);
}
assetSupplyChainCpService.saveBatch(supplyChainList);
}
List<AssetBasicNetworkCpResponse> BasicNetworkCpList = assetBasicNetworkCpService.findByassetId(assetCurrentResponse.getId());
if (BasicNetworkCpList != null) {
@ -117,9 +129,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
items.setId(items.getId());
items.setTaskId(id);
//新增基础网络
assetBasicNetworkCpService.save(items);
}
assetBasicNetworkCpService.saveBatch(BasicNetworkCpList);
}
List<UnitOtherConcatCpResponse> unitOtherConcatList = unitOtherConcatCpService.findByassetId(assetCurrentResponse.getId());
if (unitOtherConcatList != null) {
@ -129,9 +140,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
items.setConcatId(items.getConcatId());
items.setTaskId(id);
//新增其他联系人
unitOtherConcatCpService.save(items);
}
unitOtherConcatCpService.saveBatch(unitOtherConcatList);
}
}
}
@ -162,18 +172,18 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
}
@Override
public AssetCurrentResponse taskSh(int taskId,int 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.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.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpResponse::getAssetId,assetId).eq(UnitOtherConcatCpResponse::getDelFlag,"0").eq(UnitOtherConcatCpResponse::getTaskId,taskId).list());
public AssetCurrentResponse taskSh(int taskId, int 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.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.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpResponse::getAssetId, assetId).eq(UnitOtherConcatCpResponse::getDelFlag, "0").eq(UnitOtherConcatCpResponse::getTaskId, taskId).list());
return byId;
}
@Override
public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest) {
return assetTaskDao.zcHc(assetTask,pageRequest);
return assetTaskDao.zcHc(assetTask, pageRequest);
}
@Override

Loading…
Cancel
Save