新增任务修改

duhanyu
dongdingding 5 days ago
parent 5b46c29c38
commit 61b7102a3c

@ -17,13 +17,14 @@ import java.util.List;
public interface AssetBasicNetWorkCpMapper extends BaseMapper<AssetBasicNetworkCpPo> {
/**
* idid
* idid
*
* @param taskId id
* @param id id
* @return
*/
@Select("select a.* from asset_basic_network a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId} ")
List<AssetBasicNetworkCpPo> findByassetId(String taskId);
// @Select("select a.* from asset_basic_network a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId} ")
@Select("select * from asset_basic_network where asset_id=#{id} ")
List<AssetBasicNetworkCpPo> findByassetId(@Param("id") Long id);

@ -23,8 +23,9 @@ public interface AssetBusinessFormCpMapper extends BaseMapper<AssetBusinessFormC
* @param taskId id
* @return
*/
@Select("select a.* from asset_business_form a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId} ")
List<AssetBusinessFormCpPo> findByassetId(String taskId);
// @Select("select a.* from asset_business_form a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId} ")
@Select("select * from asset_business_form where asset_id =#{id}")
List<AssetBusinessFormCpPo> findByassetId(@Param("id") Long id);

@ -18,13 +18,14 @@ public interface AssetSupplyChainCpMapper extends BaseMapper<AssetSupplyChainCpP
/**
* idid
* idid
*
* @param taskId id
* @param id id
* @return
*/
@Select("select a.* from asset_supply_chain a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId}")
List<AssetSupplyChainCpPo> findByassetId(String taskId);
// @Select("select a.* from asset_supply_chain a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId}")
@Select("select * from asset_supply_chain where asset_id=#{id}")
List<AssetSupplyChainCpPo> findByassetId(@Param("id") Long id);

@ -17,13 +17,14 @@ public interface UnitOtherConcatCpMapper extends BaseMapper<UnitOtherConcatCpPo>
/**
* idid
* idid
*
* @param taskId id
* @param id id
* @return
*/
@Select("select a.* from unit_other_contact a left join asset_current_cp b on a.asset_id =b.id where b.task_id =#{taskId}")
List<UnitOtherConcatCpPo> findByassetId( String taskId);
//@Select("select a.* from unit_other_contact a left join asset_current_cp b on a.asset_id =b.id where b.task_id =#{taskId}")
@Select("select * from unit_other_contact where asset_id=#{id}")
List<UnitOtherConcatCpPo> findByassetId(@Param("id") Long id);
/**
@ -51,5 +52,5 @@ public interface UnitOtherConcatCpMapper extends BaseMapper<UnitOtherConcatCpPo>
* @return
*/
@Select("select * from unit_other_contact_cp where asset_id=#{assetId} and task_id =#{taskId}")
List<UnitOtherConcatCpPo> findByTaskId(@Param("assetId") int assetId, @Param("taskId")int taskId);
List<UnitOtherConcatCpPo> findByTaskId(@Param("assetId") int assetId, @Param("taskId") int taskId);
}

@ -14,12 +14,12 @@ import java.util.List;
public interface AssetBasicNetworkCpService extends IService<AssetBasicNetworkCpPo> {
/**
* idid
* idid
*
* @param taskId id
* @param id id
* @return
*/
List<AssetBasicNetworkCpPo> findByassetId(String taskId);
List<AssetBasicNetworkCpPo> findByassetId(Long id);
/**

@ -14,12 +14,12 @@ import java.util.List;
public interface AssetBusinessFormCpService extends IService<AssetBusinessFormCpPo> {
/**
* idid
* idid
*
* @param taskId id
* @param id id
* @return
*/
List<AssetBusinessFormCpPo> findByassetId(String taskId);
List<AssetBusinessFormCpPo> findByassetId(Long id);
/**

@ -14,12 +14,12 @@ import java.util.List;
public interface AssetSupplyChainCpService extends IService<AssetSupplyChainCpPo> {
/**
* idid
* idid
*
* @param taskId id
* @param id id
* @return
*/
List<AssetSupplyChainCpPo> findByassetId(String taskId);
List<AssetSupplyChainCpPo> findByassetId(Long id);
/**

@ -16,10 +16,10 @@ public interface UnitOtherConcatCpService extends IService<UnitOtherConcatCpPo>
/**
* idid
*
* @param taskId id
* @param id id
* @return
*/
List<UnitOtherConcatCpPo> findByassetId(String taskId);
List<UnitOtherConcatCpPo> findByassetId(Long id);
/**

@ -22,8 +22,8 @@ public class AssetBasicNetworkCpServiceImpl extends ServiceImpl<AssetBasicNetWor
private AssetBasicNetWorkCpMapper assetBasicNetWorkCpMapper;
@Override
public List<AssetBasicNetworkCpPo> findByassetId(String taskId) {
return assetBasicNetWorkCpMapper.findByassetId(taskId);
public List<AssetBasicNetworkCpPo> findByassetId(Long id) {
return assetBasicNetWorkCpMapper.findByassetId(id);
}
@Override

@ -22,8 +22,8 @@ public class AssetBusinessFormCpServiceImpl extends ServiceImpl<AssetBusinessFor
private AssetBusinessFormCpMapper assetBusinessFormCpMapper;
@Override
public List<AssetBusinessFormCpPo> findByassetId(String taskId) {
return assetBusinessFormCpMapper.findByassetId(taskId);
public List<AssetBusinessFormCpPo> findByassetId(Long id) {
return assetBusinessFormCpMapper.findByassetId(id);
}
@Override

@ -22,8 +22,8 @@ public class AssetSupplyChainCpServiceImpl extends ServiceImpl<AssetSupplyChainC
@Resource
private AssetSupplyChainCpMapper assetSupplyChainCpMapper;
@Override
public List<AssetSupplyChainCpPo> findByassetId(String taskId) {
return assetSupplyChainCpMapper.findByassetId(taskId);
public List<AssetSupplyChainCpPo> findByassetId(Long id) {
return assetSupplyChainCpMapper.findByassetId(id);
}
@Override

@ -192,7 +192,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
List<AssetCurrentCpPo> list = assetTaskDao.findByDwmcAssetCurrent(part);
list.forEach(assetCurrentResponse -> {
assetCurrentResponse.setTaskId(id);
if (assetCurrentResponse.getXtzt()!=null && assetCurrentResponse.getXtzt().equals("5")) {
if (assetCurrentResponse.getXtzt() != null && assetCurrentResponse.getXtzt().equals("5")) {
assetCurrentResponse.setStatus(5);
assetCurrentResponse.setBfyy(null);
assetCurrentResponse.setBtgyy(null);
@ -203,21 +203,43 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetCurrentResponse.setBtgyy(null);
assetCurrentResponse.setUpdateTime(null);
}
//新增新监管业务形态
List<AssetBusinessFormCpPo> bussList = assetBusinessFormCpService.findByassetId(assetCurrentResponse.getId());
bussList.stream()
.forEach(assetBusinessFormCp -> {
assetBusinessFormCp.setBusinessId(null);
assetBusinessFormCp.setTaskId(id);
});
assetBusinessFormCpService.saveBatch(bussList);
//新增供应
List<AssetSupplyChainCpPo> supplyChainList = assetSupplyChainCpService.findByassetId(assetCurrentResponse.getId());
supplyChainList.stream()
.forEach(assetSupplyChainCpPo ->{
assetSupplyChainCpPo.setSupplyId(null);
assetSupplyChainCpPo.setTaskId(id);
} );
assetSupplyChainCpService.saveBatch(supplyChainList);
//新增基础网络
List<AssetBasicNetworkCpPo> BasicNetworkCpList = assetBasicNetworkCpService.findByassetId(assetCurrentResponse.getId());
BasicNetworkCpList.stream()
.forEach(assetBasicNetworkCpPo -> {
assetBasicNetworkCpPo.setNetworkId(null);
assetBasicNetworkCpPo.setTaskId(id);
});
assetBasicNetworkCpService.saveBatch(BasicNetworkCpList);
//新增其他联系人
List<UnitOtherConcatCpPo> unitOtherConcatList = unitOtherConcatCpService.findByassetId(assetCurrentResponse.getId());
unitOtherConcatList.stream()
.forEach(unitOtherConcatCpPo -> {
unitOtherConcatCpPo.setConcatId(null);
unitOtherConcatCpPo.setTaskId(id);
});
unitOtherConcatCpService.saveBatch(unitOtherConcatList);
});
assetCurrentCpService.saveBatch(list);
//新增新监管业务形态
List<AssetBusinessFormCpPo> bussList = assetBusinessFormCpService.findByassetId(assetTask.getTaskId());
assetBusinessFormCpService.saveBatch(bussList);
//新增供应
List<AssetSupplyChainCpPo> supplyChainList = assetSupplyChainCpService.findByassetId(assetTask.getTaskId());
assetSupplyChainCpService.saveBatch(supplyChainList);
//新增基础网络
List<AssetBasicNetworkCpPo> BasicNetworkCpList = assetBasicNetworkCpService.findByassetId(assetTask.getTaskId());
assetBasicNetworkCpService.saveBatch(BasicNetworkCpList);
//新增其他联系人
List<UnitOtherConcatCpPo> unitOtherConcatList = unitOtherConcatCpService.findByassetId(assetTask.getTaskId());
unitOtherConcatCpService.saveBatch(unitOtherConcatList);
}
} else if (assetPart.equals("1")) {
//遍历小程序资产单位
@ -234,7 +256,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetMiniProgramsCpPo.setAssetId(cpPo.getId());
BeanUtils.copyProperties(cpPo, assetMiniProgramsCpPo); // 复制属性
// 根据 xtzt 设置 status
if (cpPo.getState()!=null && cpPo.getState().equals("7")) {
if (cpPo.getState() != null && cpPo.getState().equals("7")) {
assetMiniProgramsCpPo.setStatus(5);
assetMiniProgramsCpPo.setBfyy(null);
assetMiniProgramsCpPo.setBtgyy(null);
@ -265,7 +287,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetOfficialAccountCpPo.setAssetId(cpPo.getId());
BeanUtils.copyProperties(cpPo, assetOfficialAccountCpPo); // 复制属性
// 根据 xtzt 设置 status
if (cpPo.getGzhzt()!=null && cpPo.getGzhzt().equals("7")) {
if (cpPo.getGzhzt() != null && cpPo.getGzhzt().equals("7")) {
assetOfficialAccountCpPo.setStatus(5);
assetOfficialAccountCpPo.setBfyy(null);
assetOfficialAccountCpPo.setBtgyy(null);
@ -297,7 +319,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
emailCpPo.setAssetId(cpPo.getId());
BeanUtils.copyProperties(cpPo, emailCpPo); // 复制属性
// 根据 xtzt 设置 status
if (cpPo.getYjxtzc()!=null && cpPo.getYjxtzc().equals("2")) {
if (cpPo.getYjxtzc() != null && cpPo.getYjxtzc().equals("2")) {
emailCpPo.setStatus(5);
emailCpPo.setBfyy(null);
emailCpPo.setBtgyy(null);
@ -328,7 +350,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
BeanUtils.copyProperties(cpPo, appCpPo); // 复制属性
// 根据 xtzt 设置 status
if (cpPo.getAppState()!=null && cpPo.getAppState().equals("7")) {
if (cpPo.getAppState() != null && cpPo.getAppState().equals("7")) {
appCpPo.setStatus(5);
appCpPo.setBfyy(null);
appCpPo.setBtgyy(null);
@ -389,17 +411,20 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
byId.setGlymList(a1);
}
List<Acomma> a2 = new ArrayList<>();
if(byId.getGlIp()!=null&& !byId.getGlIp().isEmpty()){
if (byId.getGlIp() != null && !byId.getGlIp().isEmpty()) {
for (Object o : JSONArray.parseArray(byId.getGlIp())) {
Acomma acomma = new Acomma();
JSONObject jsonObject = JSONObject.parseObject(o.toString());
acomma.setKey(jsonObject.get("key").toString());
acomma.setIpType(jsonObject.get("ipType").toString());
acomma.setPort(jsonObject.get("port").toString());
Object portValue = jsonObject.get("port");
if (portValue != null && !portValue.toString().isEmpty()) {
acomma.setPort(portValue.toString());
}
a2.add(acomma);
}
byId.setGlIpList(a2);
}else {
} else {
byId.setGlIpList(new ArrayList<>());
}
@ -765,7 +790,7 @@ 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());
StringBuilder a = new StringBuilder();
StringBuilder a = new StringBuilder();
if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlymList())) {
req.getAssetCurrentCpPo().getGlymList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
@ -778,7 +803,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
StringBuilder b = new StringBuilder();
if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlIpList())) {
req.getAssetCurrentCpPo().setGlIp(req.getAssetCurrentCpPo().getGlIpList().toString());
}else{
} else {
req.getAssetCurrentCpPo().setGlIp("");
}
req.getAssetCurrentCpPo().setStatus(req.getStatus());
@ -839,7 +864,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
StringBuilder d = new StringBuilder();
if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlIpList())) {
req.getAssetCurrentCpPo().setGlIp(req.getAssetCurrentCpPo().getGlIpList().toString());
}else{
} else {
req.getAssetCurrentCpPo().setGlIp("");
}
@ -914,7 +939,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
private void syb(AssetCurrentShRequest req) {
if (req.getType() == 1) {
//小程序
AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByTaskId(req.getAssetId(),req.getTaskId());
AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByTaskId(req.getAssetId(), req.getTaskId());
//删除原有数据
if (assetMiniProgramsCpPo != null) {
assetMiniProgramsService.deleteIdList(Collections.singletonList(assetMiniProgramsCpPo.getAssetId()));
@ -928,7 +953,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
}
if (req.getType() == 2) {
//公众号资产
AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByTaskId(req.getAssetId(),req.getTaskId());
AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByTaskId(req.getAssetId(), req.getTaskId());
//删除原有数据
if (assetOfficialAccountCpPo != null) {
assetOfficialAccountService.deleteIdList(Collections.singletonList(assetOfficialAccountCpPo.getAssetId()));
@ -944,7 +969,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
if (req.getType() == 3) {
//电子邮件资产
//根据assetId查询查询数据
AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByTaskId(req.getAssetId(),req.getTaskId());
AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByTaskId(req.getAssetId(), req.getTaskId());
//删除原有数据
if (assetEmailCpPo != null) {
assetEmailService.deleteIdList(Collections.singletonList(assetEmailCpPo.getAssetId()));
@ -958,7 +983,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
if (req.getType() == 4) {
//移动应用程序资产
//根据资产id查询
AssetAppCpPo assetAppCpPo = assetAppCpService.findByTaskId(req.getAssetId(),req.getTaskId());
AssetAppCpPo assetAppCpPo = assetAppCpService.findByTaskId(req.getAssetId(), req.getTaskId());
//删除原有数据
if (assetAppCpPo != null) {
assetAppService.deleteIdList(Collections.singletonList(assetAppCpPo.getAssetId()));
@ -1038,14 +1063,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//AssetBusinessFormCpPo
AssetBusinessFormCpPo businessFormCpPo = assetBusinessFormCpService.findByTaskId(req.getAssetId(), req.getTaskId());
//删除原有数据
if (businessFormCpPo!=null) {
if (businessFormCpPo != null) {
assetBusinessFormService.deleteIdList(Collections.singletonList(businessFormCpPo.getAssetId()));
//将子表数据复制到主表中
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
BeanUtils.copyProperties(businessFormCpPo, assetBusinessForm); // 复制属性
assetBusinessForm.setId(null);
assetBusinessFormService.save(assetBusinessForm);
}else{
} else {
//将子表数据复制到主表中
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
BeanUtils.copyProperties(businessFormCpPo, assetBusinessForm); // 复制属性
@ -1068,7 +1093,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
}).collect(Collectors.toList());
assetBasicNetworkService.saveBatch(networksCpPoList);
}else{
} else {
List<AssetBasicNetwork> networksCpPoList = req.getAssetCurrentCpPo().getJcwlList().stream().map(cpPo -> {
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性

@ -21,8 +21,8 @@ public class UnitOtherConcatCpServiceImpl extends ServiceImpl<UnitOtherConcatCpM
private UnitOtherConcatCpMapper unitOtherConcatCpMapper;
@Override
public List<UnitOtherConcatCpPo> findByassetId(String taskId) {
return unitOtherConcatCpMapper.findByassetId(taskId);
public List<UnitOtherConcatCpPo> findByassetId(Long id) {
return unitOtherConcatCpMapper.findByassetId(id);
}
@Override

Loading…
Cancel
Save