diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java index 3367725..a78caf9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java @@ -516,20 +516,23 @@ public class AssetCurrentController extends BaseController { @PutMapping public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) { //根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态 - AssetCurrentCpPo currentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId()); + List currentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId()); if (currentCpPo != null) { - //查询任务是否为进行中 - AssetTask assetTask = assetTaskService.findByTaskId(currentCpPo.getTaskId()); - if (assetTask.getTaskStatus().equals(1)){ - if (currentCpPo.getStatus()==5 ){ - //修改任务中资产状态 - currentCpPo.setStatus(0); - currentCpPo.setBtgyy(null); - assetTask.setTaskStatus(1); - assetTaskService.update(assetTask); - assetCurrentCpService.updateById(currentCpPo); + for (AssetCurrentCpPo s:currentCpPo) { + //查询任务是否为进行中 + AssetTask assetTask = assetTaskService.findByTaskId(s.getTaskId()); + if (assetTask.getTaskStatus().equals(1)){ + if (s.getStatus()==5 ){ + //修改任务中资产状态 + s.setStatus(0); + s.setBtgyy(null); + assetTask.setTaskStatus(1); + assetTaskService.update(assetTask); + assetCurrentCpService.updateById(s); + } } } + } List list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc()).eq(Unit::getDelFlag, 0).list(); if (list == null || list.isEmpty()) { @@ -683,13 +686,16 @@ public class AssetCurrentController extends BaseController { delete(assetCurrent); } else { //根据资产id查询旧资产 - AssetCurrentCpPo assetCurrentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId()); - if (assetCurrentCpPo!=null){ - assetCurrentCpPo.setDwmc(assetCurrent.getDwmc()); - assetCurrentCpPo.setTaskId(assetTask.getId()); - //修改 - assetCurrentCpService.updateById(assetCurrentCpPo); - } + List assetCurrentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId()); + for (AssetCurrentCpPo s:assetCurrentCpPo){ + if (s!=null){ + s.setDwmc(assetCurrent.getDwmc()); + s.setTaskId(assetTask.getId()); + //修改 + assetCurrentCpService.updateById(s); + } + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java index 1dfc045..8957c60 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java @@ -7,15 +7,11 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.tc.entity.*; +import com.ruoyi.tc.entity.history.*; import com.ruoyi.tc.entity.po.*; -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.request.AssetdwHcRequest; -import com.ruoyi.tc.entity.response.AssestTaskXqresponse; -import com.ruoyi.tc.entity.response.AssetTaskIdResponse; -import com.ruoyi.tc.entity.response.AssetdwHcBlResponse; -import com.ruoyi.tc.entity.response.AssetdwHcResponse; +import com.ruoyi.tc.entity.request.*; +import com.ruoyi.tc.entity.response.*; +import com.ruoyi.tc.historyService.*; import com.ruoyi.tc.mapper.AssetTaskMapper; import com.ruoyi.tc.service.*; import io.swagger.annotations.Api; @@ -28,9 +24,12 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; import java.util.List; import java.util.Objects; import java.util.Optional; +import java.util.stream.Collectors; /** * 任务主表(AssetTask)表控制层 @@ -125,6 +124,39 @@ public class AssetTaskController extends BaseController { @Resource private AssetTaskMapper assetTaskDao; + + @Resource + private AssetCurrentHistoryService assetCurrentHistoryService; + + + @Resource + private AssetAppHistoryService assetAppHistoryService; + + + @Resource + private AssetBasicNetworkHistoryService assetBasicNetworkHistoryService; + + @Resource + private AssetBusinessFormHistoryService assetBusinessFormHistoryService; + + @Resource + private AssetEmailHistoryService assetEmailHistoryService; + + + @Resource + private AssetMiniProgramsHistoryService assetMiniProgramsHistoryService; + + + @Resource + private AssetOfficialAccountHistoryService assetOfficialAccountHistoryService; + + @Resource + private AssetSupplyChainHistoryService assetSupplyChainHistoryService; + + @Resource + private UnitOtherConcatHistoryService unitOtherConcatHistoryService; + + /** * 分页查询 * @@ -364,6 +396,98 @@ public class AssetTaskController extends BaseController { //新增其他联系人 unitOtherConcatCpService.saveBatch(assetCurrent.getOtherConcat()); } + // 获取当前时间 + LocalDateTime localDateTime = LocalDateTime.now(); + // 转换为 Date + Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); + //新增历史记录 + StringBuilder c = new StringBuilder(); + if (!assetCurrent.getGlymList().isEmpty()) { + assetCurrent.getGlymList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + c.append(x.getKey()); + c.append(","); + } + }); + } + assetCurrent.setGlym(a.toString()); + StringBuilder d = new StringBuilder(); + if (!assetCurrent.getGlIpList().isEmpty()) { + assetCurrent.getGlIpList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + d.append(x.getKey()); + d.append(","); + } + }); + } + assetCurrent.setGlIp(b.toString()); + assetCurrent.setStatus(assetCurrent.getStatus()); + AssetCurrentHistory assetCurrentHistory = new AssetCurrentHistory(); + // 设置更新时间 + assetCurrent.setUpdateTime(date); + BeanUtils.copyProperties(assetCurrent, assetCurrentHistory); + assetCurrentHistoryService.save(assetCurrentHistory); + + //新增新监管业务形态历史表 + if (assetCurrent.getXjgywxt() != null) { + assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId()); + assetCurrent.getXjgywxt().setTaskId(assetCurrent.getTaskId()); + AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory(); + assetBusinessFormHistory.setCopyId(assetCurrent.getCurrentId()); + BeanUtils.copyProperties(assetCurrent.getXjgywxt(), assetBusinessFormHistory); + assetBusinessFormHistoryService.save(assetBusinessFormHistory); + + } + if (!assetCurrent.getGylxxList().isEmpty()) { + for (AssetSupplyChainCpPo items : assetCurrent.getGylxxList()) { + items.setAssetId(assetCurrent.getId()); + items.setTaskId(assetCurrent.getTaskId()); + + } + //新增供应链历史表 + List assetSupplyChainHistoryList = assetCurrent.getGylxxList().stream() + .map(cpPo -> { + AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory(); + assetSupplyChainHistory.setCopyId(assetCurrent.getCurrentId()); + BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性 + return assetSupplyChainHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + assetSupplyChainHistoryService.saveBatch(assetSupplyChainHistoryList); + } + if (!assetCurrent.getJcwlList().isEmpty()) { + for (AssetBasicNetworkCpPo items : assetCurrent.getJcwlList()) { + items.setAssetId(assetCurrent.getId()); + items.setTaskId(assetCurrent.getTaskId()); + + } + //新增基础网络历史表 + List assetSupplyChainHistoryList = assetCurrent.getJcwlList().stream() + .map(cpPo -> { + AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory(); + assetBasicNetworkHistory.setCopyId(assetCurrent.getCurrentId()); + BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性 + return assetBasicNetworkHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + assetBasicNetworkHistoryService.saveBatch(assetSupplyChainHistoryList); + } + if (!assetCurrent.getOtherConcat().isEmpty()) { + for (UnitOtherConcatCpPo items : assetCurrent.getOtherConcat()) { + items.setAssetId(assetCurrent.getId()); + items.setTaskId(assetCurrent.getTaskId()); + } + //新增其他联系人 + List unitOtherConcatHistoryList = assetCurrent.getOtherConcat().stream() + .map(cpPo -> { + UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory(); + unitOtherConcatHistory.setCopyId(assetCurrent.getCurrentId()); + BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性 + return unitOtherConcatHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + unitOtherConcatHistoryService.saveBatch(unitOtherConcatHistoryList); + } return success(); } @@ -376,7 +500,7 @@ public class AssetTaskController extends BaseController { @ApiOperation(value = "单位端校验提交") @PostMapping("/jyTj") @Transactional(rollbackFor = Exception.class) - public AjaxResult tj(@RequestBody @Validated AssetCurrentJyPo assetCurrent) { + public AjaxResult tj(@RequestBody @Validated AssetCurrentJyPo assetCurrent) { //根据资产id和任务id删除五张表数据 assetCurrentCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId()); assetBusinessFormCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId()); @@ -450,7 +574,98 @@ public class AssetTaskController extends BaseController { //新增其他联系人 unitOtherConcatJyservice.saveBatch(assetCurrent.getOtherConcat()); } + // 获取当前时间 + LocalDateTime localDateTime = LocalDateTime.now(); + // 转换为 Date + Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); + //新增历史记录 + StringBuilder c = new StringBuilder(); + if (!assetCurrent.getGlymList().isEmpty()) { + assetCurrent.getGlymList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + c.append(x.getKey()); + c.append(","); + } + }); + } + assetCurrent.setGlym(a.toString()); + StringBuilder d = new StringBuilder(); + if (!assetCurrent.getGlIpList().isEmpty()) { + assetCurrent.getGlIpList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + d.append(x.getKey()); + d.append(","); + } + }); + } + assetCurrent.setGlIp(b.toString()); + assetCurrent.setStatus(assetCurrent.getStatus()); + AssetCurrentHistory assetCurrentHistory = new AssetCurrentHistory(); + // 设置更新时间 + assetCurrent.setUpdateTime(date); + BeanUtils.copyProperties(assetCurrent, assetCurrentHistory); + assetCurrentHistoryService.save(assetCurrentHistory); + + //新增新监管业务形态历史表 + if (assetCurrent.getXjgywxt() != null) { + assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId()); + assetCurrent.getXjgywxt().setTaskId(assetCurrent.getTaskId()); + AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory(); + assetBusinessFormHistory.setCopyId(assetCurrent.getCurrentId()); + BeanUtils.copyProperties(assetCurrent.getXjgywxt(), assetBusinessFormHistory); + assetBusinessFormHistoryService.save(assetBusinessFormHistory); + } + if (!assetCurrent.getGylxxList().isEmpty()) { + for (AssetSupplyChainJyPo items : assetCurrent.getGylxxList()) { + items.setAssetId(assetCurrent.getId()); + items.setTaskId(assetCurrent.getTaskId()); + + } + //新增供应链历史表 + List assetSupplyChainHistoryList = assetCurrent.getGylxxList().stream() + .map(cpPo -> { + AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory(); + assetSupplyChainHistory.setCopyId(assetCurrent.getCurrentId()); + BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性 + return assetSupplyChainHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + assetSupplyChainHistoryService.saveBatch(assetSupplyChainHistoryList); + } + if (!assetCurrent.getJcwlList().isEmpty()) { + for (AssetBasicNetworkJyPo items : assetCurrent.getJcwlList()) { + items.setAssetId(assetCurrent.getId()); + items.setTaskId(assetCurrent.getTaskId()); + + } + //新增基础网络历史表 + List assetSupplyChainHistoryList = assetCurrent.getJcwlList().stream() + .map(cpPo -> { + AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory(); + assetBasicNetworkHistory.setCopyId(assetCurrent.getCurrentId()); + BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性 + return assetBasicNetworkHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + assetBasicNetworkHistoryService.saveBatch(assetSupplyChainHistoryList); + } + if (!assetCurrent.getOtherConcat().isEmpty()) { + for (UnitOtherConcatJyPo items : assetCurrent.getOtherConcat()) { + items.setAssetId(assetCurrent.getId()); + items.setTaskId(assetCurrent.getTaskId()); + } + //新增其他联系人 + List unitOtherConcatHistoryList = assetCurrent.getOtherConcat().stream() + .map(cpPo -> { + UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory(); + unitOtherConcatHistory.setCopyId(assetCurrent.getCurrentId()); + BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性 + return unitOtherConcatHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + unitOtherConcatHistoryService.saveBatch(unitOtherConcatHistoryList); + } return success(); } @@ -492,7 +707,7 @@ public class AssetTaskController extends BaseController { public void export(HttpServletResponse response, AssetdwHcRequest req) { List list = assetTaskService.export(req); list.forEach(x -> { - String formattedRatio = x.getCheckedRatio() + "%"; + String formattedRatio = x.getCheckedRatio() + "%"; x.setCheckedRatio(formattedRatio); }); ExcelUtil util = new ExcelUtil(AssetdwHcResponse.class); @@ -531,6 +746,10 @@ public class AssetTaskController extends BaseController { assetTaskService.updateYgtByTaskId(assetMiniProgramsCpPo.getTaskId(), ygt); } assetMiniProgramsCpService.save(assetMiniProgramsCpPo); + //新增历史记录表 + AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory(); + BeanUtils.copyProperties(assetMiniProgramsCpPo, assetMiniProgramsHistory); + assetMiniProgramsHistoryService.save(assetMiniProgramsHistory); return success(); } @@ -552,13 +771,13 @@ public class AssetTaskController extends BaseController { StringBuilder b = new StringBuilder(); StringBuilder c = new StringBuilder(); assetOfficialAccountCpPo.getCdList().forEach(x -> { - if(!Objects.equals(x.getCdmc(), "") &&x.getCdmc()!=null){ + if (!Objects.equals(x.getCdmc(), "") && x.getCdmc() != null) { a.append(x.getCdmc()).append("|"); } - if(!Objects.equals(x.getCdlj(), "") &&x.getCdlj()!=null){ + if (!Objects.equals(x.getCdlj(), "") && x.getCdlj() != null) { b.append(x.getCdlj()).append("|"); } - if(!Objects.equals(x.getCdlx(), "") &&x.getCdlx()!=null){ + if (!Objects.equals(x.getCdlx(), "") && x.getCdlx() != null) { c.append(x.getCdlx()).append("|"); } }); @@ -586,6 +805,10 @@ public class AssetTaskController extends BaseController { } assetOfficialAccountCpService.save(assetOfficialAccountCpPo); + //新增历史记录表 + AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory(); + BeanUtils.copyProperties(assetOfficialAccountCpPo, assetOfficialAccountHistory); + assetOfficialAccountHistoryService.save(assetOfficialAccountHistory); return success(); } @@ -622,6 +845,10 @@ public class AssetTaskController extends BaseController { } assetAppCpService.save(assetAppCpPo); + //新增历史记录表 + AssetAppHistory assetAppHistory = new AssetAppHistory(); + BeanUtils.copyProperties(assetAppCpPo, assetAppHistory); + assetAppHistoryService.save(assetAppHistory); return success(); } @@ -657,8 +884,11 @@ public class AssetTaskController extends BaseController { assetTaskService.updateYgtByTaskId(assetEmailCpPo.getTaskId(), ygt); } - assetEmailCpService.save(assetEmailCpPo); + //新增历史记录表 + AssetEmailHistory assetEmailHistory = new AssetEmailHistory(); + BeanUtils.copyProperties(assetEmailCpPo, assetEmailHistory); + assetEmailHistoryService.save(assetEmailHistory); return success(); } @@ -687,6 +917,10 @@ public class AssetTaskController extends BaseController { assetLcService.insert(assetLc); } assetMiniProgramsJyService.save(assetMiniProgramsJyPo); + //新增历史记录表 + AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory(); + BeanUtils.copyProperties(assetMiniProgramsJyPo, assetMiniProgramsHistory); + assetMiniProgramsHistoryService.save(assetMiniProgramsHistory); return success(); } @@ -700,20 +934,20 @@ public class AssetTaskController extends BaseController { @ApiOperation(value = "公众号单位端校验提交") @PostMapping("/gzhjyTj") @Transactional(rollbackFor = Exception.class) - public AjaxResult gzhjyTj(@RequestBody @Validated AssetOfficialAccountJyPo assetOfficialAccountJyPo) { + public AjaxResult gzhjyTj(@RequestBody @Validated AssetOfficialAccountJyPo assetOfficialAccountJyPo) { assetOfficialAccountCpService.deletByAssetIdandTaskId(assetOfficialAccountJyPo.getAssetId(), assetOfficialAccountJyPo.getTaskId()); if (assetOfficialAccountJyPo.getCdList() != null && !assetOfficialAccountJyPo.getCdList().isEmpty()) { StringBuilder a = new StringBuilder(); StringBuilder b = new StringBuilder(); StringBuilder c = new StringBuilder(); assetOfficialAccountJyPo.getCdList().forEach(x -> { - if(!Objects.equals(x.getCdmc(), "") &&x.getCdmc()!=null){ + if (!Objects.equals(x.getCdmc(), "") && x.getCdmc() != null) { a.append(x.getCdmc()).append("|"); } - if(!Objects.equals(x.getCdlj(), "") &&x.getCdlj()!=null){ + if (!Objects.equals(x.getCdlj(), "") && x.getCdlj() != null) { b.append(x.getCdlj()).append("|"); } - if(!Objects.equals(x.getCdlx(), "") &&x.getCdlx()!=null){ + if (!Objects.equals(x.getCdlx(), "") && x.getCdlx() != null) { c.append(x.getCdlx()).append("|"); } }); @@ -734,6 +968,10 @@ public class AssetTaskController extends BaseController { assetLcService.insert(assetLc); } assetOfficialAccountJyService.save(assetOfficialAccountJyPo); + //新增历史记录表 + AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory(); + BeanUtils.copyProperties(assetOfficialAccountJyPo, assetOfficialAccountHistory); + assetOfficialAccountHistoryService.save(assetOfficialAccountHistory); return success(); } @@ -747,7 +985,7 @@ public class AssetTaskController extends BaseController { @ApiOperation(value = "资产移动应用程序单位端校验提交") @PostMapping("/appjyTj") @Transactional(rollbackFor = Exception.class) - public AjaxResult appjyTj(@RequestBody @Validated AssetAppJyPo assetAppJyPo) { + public AjaxResult appjyTj(@RequestBody @Validated AssetAppJyPo assetAppJyPo) { //根据资产id和任务id删除数据 assetAppCpService.deletByAssetIdandTaskId(assetAppJyPo.getAssetId(), assetAppJyPo.getTaskId()); //新增流程节点时间 @@ -763,6 +1001,10 @@ public class AssetTaskController extends BaseController { assetLcService.insert(assetLc); } assetAppJyService.save(assetAppJyPo); + //新增历史记录表 + AssetAppHistory assetAppHistory = new AssetAppHistory(); + BeanUtils.copyProperties(assetAppJyPo, assetAppHistory); + assetAppHistoryService.save(assetAppHistory); return success(); } @@ -792,6 +1034,10 @@ public class AssetTaskController extends BaseController { assetLcService.insert(assetLc); } assetEmailJyService.save(assetEmailJyPo); + //新增历史记录表 + AssetEmailHistory assetEmailHistory = new AssetEmailHistory(); + BeanUtils.copyProperties(assetEmailJyPo, assetEmailHistory); + assetEmailHistoryService.save(assetEmailHistory); return success(); } @@ -828,5 +1074,39 @@ public class AssetTaskController extends BaseController { return AjaxResult.success(assetTaskService.dwHcBl(req)); } + /** + * 资产提交记录 + * + * @param req + * @return + */ + @ApiOperation(value = "资产提交记录", response = AssetzcTjResponse.class) + @PostMapping("/zcTj") + public AjaxResult zcTj(@RequestBody AssetzcTjRequest req) { + AssetzcTjResponse assetzcTjResponse = new AssetzcTjResponse(); + if (req.getType() == 0) { + //web + AssetCurrentHistory assetCurrentHistory = assetCurrentHistoryService.findByTaskIdandAssetId(req); + assetzcTjResponse.setAssetCurrentHistory(assetCurrentHistory); + } else if (req.getType() == 1) { + //小程序资产 + AssetMiniProgramsHistory assetMiniProgramsHistory = assetMiniProgramsHistoryService.findByTaskIdandAssetId(req); + assetzcTjResponse.setAssetMiniProgramsHistory(assetMiniProgramsHistory); + } else if (req.getType() == 2) { + //公众号资产 + AssetOfficialAccountHistory assetOfficialAccountHistory = assetOfficialAccountHistoryService.findByTaskIdandAssetId(req); + assetzcTjResponse.setAssetOfficialAccountHistory(assetOfficialAccountHistory); + } else if (req.getType() == 3) { + //电子邮件资产 + AssetEmailHistory assetEmailHistory = assetEmailHistoryService.findByTaskIdandAssetId(req); + assetzcTjResponse.setAssetEmailHistory(assetEmailHistory); + } else if (req.getType() == 4) { + //移动应用程序资产 + AssetAppHistory assetAppHistory = assetAppHistoryService.findByTaskIdandAssetId(req); + assetzcTjResponse.setAssetAppHistory(assetAppHistory); + } + return AjaxResult.success(assetzcTjResponse); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetBasicNetworkHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetBasicNetworkHistory.java index 167de34..218e80c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetBasicNetworkHistory.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetBasicNetworkHistory.java @@ -27,6 +27,8 @@ public class AssetBasicNetworkHistory extends BaseClass implements Serializable private Long networkId; + @ApiModelProperty("主表id") + private Long copyId; /** * 资源id diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetBusinessFormHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetBusinessFormHistory.java index 5060496..6115168 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetBusinessFormHistory.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetBusinessFormHistory.java @@ -408,4 +408,8 @@ public class AssetBusinessFormHistory extends BaseClass implements Serializable @ApiModelProperty("任务id") private Integer taskId; + + + @ApiModelProperty("主表id") + private Long copyId; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetSupplyChainHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetSupplyChainHistory.java index 7adfe67..22741d0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetSupplyChainHistory.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/AssetSupplyChainHistory.java @@ -28,6 +28,8 @@ public class AssetSupplyChainHistory extends BaseClass implements Serializable { + @ApiModelProperty("主表id") + private Long copyId; /** * 资产id diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/UnitOtherConcatHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/UnitOtherConcatHistory.java index d2041e4..c47024d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/UnitOtherConcatHistory.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/history/UnitOtherConcatHistory.java @@ -22,12 +22,13 @@ import java.io.Serializable; public class UnitOtherConcatHistory extends BaseClass implements Serializable { - - @ApiModelProperty("主表id") - @TableId(type = IdType.AUTO,value = "concat_id") + @TableId(type = IdType.AUTO, value = "concat_id") private Long concatId; + @ApiModelProperty("主表id") + private Long copyId; + @ApiModelProperty("单位id") private Long unitId; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/AssetzcTjRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/AssetzcTjRequest.java new file mode 100644 index 0000000..9f625ae --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/AssetzcTjRequest.java @@ -0,0 +1,36 @@ +package com.ruoyi.tc.entity.request; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author dong + * @since 2025/1/13 16:43 + */ +@Data +@Api("资产提交记录") +public class AssetzcTjRequest { + + /** + * 任务id + */ + @ApiModelProperty("任务id") + private Integer taskId; + + + /** + * 资产类型 + */ + @ApiModelProperty("0:web资产,1:小程序资产,2:公众号资产,3:电子邮件资产,4:移动应用程序资产") + private Integer type; + + + + /** + * 资产id + */ + @ApiModelProperty("资产id") + private Integer assetId; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/response/AssetzcTjResponse.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/response/AssetzcTjResponse.java new file mode 100644 index 0000000..86a6785 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/response/AssetzcTjResponse.java @@ -0,0 +1,29 @@ +package com.ruoyi.tc.entity.response; + +import com.ruoyi.tc.entity.history.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author dong + * @since 2025/1/13 16:49 + */ +@Data +@Api("资产提交响应类") +public class AssetzcTjResponse { + + @ApiModelProperty("web资产历史类") + private AssetCurrentHistory assetCurrentHistory; + + @ApiModelProperty("小程序资产历史类") + private AssetMiniProgramsHistory assetMiniProgramsHistory; + + @ApiModelProperty("公众号资产历史类") + private AssetOfficialAccountHistory assetOfficialAccountHistory; + + @ApiModelProperty("电子邮件资产历史类") + private AssetEmailHistory assetEmailHistory; + @ApiModelProperty("资产移动应用程序历史类") + private AssetAppHistory assetAppHistory; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetAppHistoryService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetAppHistoryService.java index 172bf05..c29e20e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetAppHistoryService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetAppHistoryService.java @@ -2,6 +2,8 @@ package com.ruoyi.tc.historyService; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.tc.entity.history.AssetAppHistory; +import com.ruoyi.tc.entity.history.AssetCurrentHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; /** * 资产移动应用程序表(asset_app_history)表服务接口 @@ -10,4 +12,14 @@ import com.ruoyi.tc.entity.history.AssetAppHistory; * @since 2024-11-28 17:13:07 */ public interface AssetAppHistoryService extends IService { + + + + /** + * 资产移动应用程序资产提交记录 + * + * @param req + * @return + */ + AssetAppHistory findByTaskIdandAssetId(AssetzcTjRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetCurrentHistoryService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetCurrentHistoryService.java index 569308c..bccfd1d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetCurrentHistoryService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetCurrentHistoryService.java @@ -2,9 +2,7 @@ package com.ruoyi.tc.historyService; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.tc.entity.history.AssetCurrentHistory; -import com.ruoyi.tc.entity.po.AssetCurrentCpPo; - -import java.util.List; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; /** * 现有资产复制表(asset_current_history)表服务接口 @@ -14,5 +12,13 @@ import java.util.List; */ public interface AssetCurrentHistoryService extends IService { + /** + * web资产提交记录 + * + * @param req + * @return + */ + AssetCurrentHistory findByTaskIdandAssetId(AssetzcTjRequest req); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetEmailHistoryService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetEmailHistoryService.java index 37d18e0..8079587 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetEmailHistoryService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetEmailHistoryService.java @@ -1,7 +1,9 @@ package com.ruoyi.tc.historyService; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.tc.entity.history.AssetCurrentHistory; import com.ruoyi.tc.entity.history.AssetEmailHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; /** * 电子邮件资产表(asset_email_history)表服务接口 @@ -10,4 +12,13 @@ import com.ruoyi.tc.entity.history.AssetEmailHistory; * @since 2024-11-28 17:13:07 */ public interface AssetEmailHistoryService extends IService { + + + /** + * 电子邮件资产提交记录 + * + * @param req + * @return + */ + AssetEmailHistory findByTaskIdandAssetId(AssetzcTjRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetMiniProgramsHistoryService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetMiniProgramsHistoryService.java index 461e46a..d899a70 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetMiniProgramsHistoryService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetMiniProgramsHistoryService.java @@ -2,6 +2,7 @@ package com.ruoyi.tc.historyService; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; /** * 小程序资产(asset_mini_programs_history)表服务接口 @@ -10,4 +11,13 @@ import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory; * @since 2024-11-28 17:13:07 */ public interface AssetMiniProgramsHistoryService extends IService { + + + /** + * 小程序资产提交记录 + * + * @param req + * @return + */ + AssetMiniProgramsHistory findByTaskIdandAssetId(AssetzcTjRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetOfficialAccountHistoryService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetOfficialAccountHistoryService.java index e8b5b4c..655a110 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetOfficialAccountHistoryService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/AssetOfficialAccountHistoryService.java @@ -1,7 +1,9 @@ package com.ruoyi.tc.historyService; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.tc.entity.history.AssetCurrentHistory; import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; /** * 公众号资产(asset_official_account_history)表服务接口 @@ -10,4 +12,18 @@ import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory; * @since 2024-11-28 17:13:07 */ public interface AssetOfficialAccountHistoryService extends IService { + + + + + /** + * 公众号资产提交记录 + * + * @param req + * @return + */ + AssetOfficialAccountHistory findByTaskIdandAssetId(AssetzcTjRequest req); } + + + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetAppHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetAppHistoryServiceImpl.java index 7080e4d..889bbb9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetAppHistoryServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetAppHistoryServiceImpl.java @@ -2,10 +2,13 @@ package com.ruoyi.tc.historyService.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.tc.entity.history.AssetAppHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.historyService.AssetAppHistoryService; import com.ruoyi.tc.mapper.history.AssetAppHistoryMapper; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** * 资产移动应用程序表(asset_app_history)表服务实现类 * @@ -15,5 +18,11 @@ import org.springframework.stereotype.Service; @Service public class AssetAppHistoryServiceImpl extends ServiceImpl implements AssetAppHistoryService { + @Resource + private AssetAppHistoryMapper assetAppHistoryMapper; + @Override + public AssetAppHistory findByTaskIdandAssetId(AssetzcTjRequest req) { + return assetAppHistoryMapper.findByTaskIdandAssetId(req); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetCurrentHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetCurrentHistoryServiceImpl.java index 01e6bae..32a1083 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetCurrentHistoryServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetCurrentHistoryServiceImpl.java @@ -2,10 +2,13 @@ package com.ruoyi.tc.historyService.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.tc.entity.history.AssetCurrentHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.historyService.AssetCurrentHistoryService; import com.ruoyi.tc.mapper.history.AssetCurrentHistoryMapper; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** * 现有资产复制表(asset_current_history)表服务实现类 * @@ -14,5 +17,14 @@ import org.springframework.stereotype.Service; */ @Service public class AssetCurrentHistoryServiceImpl extends ServiceImpl implements AssetCurrentHistoryService { + + + @Resource + private AssetCurrentHistoryMapper assetCurrentHistoryMapper; + + @Override + public AssetCurrentHistory findByTaskIdandAssetId(AssetzcTjRequest req) { + return assetCurrentHistoryMapper.findByTaskIdandAssetId(req); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetEmailHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetEmailHistoryServiceImpl.java index ebebdda..4863a18 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetEmailHistoryServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetEmailHistoryServiceImpl.java @@ -2,10 +2,13 @@ package com.ruoyi.tc.historyService.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.tc.entity.history.AssetEmailHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.historyService.AssetEmailHistoryService; import com.ruoyi.tc.mapper.history.AssetEmailHistoryMapper; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** * 电子邮件资产表(asset_email_history)表服务实现类 * @@ -14,4 +17,11 @@ import org.springframework.stereotype.Service; */ @Service public class AssetEmailHistoryServiceImpl extends ServiceImpl implements AssetEmailHistoryService { + @Resource + private AssetEmailHistoryMapper assetEmailHistoryMapper; + + @Override + public AssetEmailHistory findByTaskIdandAssetId(AssetzcTjRequest req) { + return assetEmailHistoryMapper.findByTaskIdandAssetId(req); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetMiniProgramsHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetMiniProgramsHistoryServiceImpl.java index d87bc16..9c65e0f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetMiniProgramsHistoryServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetMiniProgramsHistoryServiceImpl.java @@ -2,10 +2,13 @@ package com.ruoyi.tc.historyService.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.historyService.AssetMiniProgramsHistoryService; import com.ruoyi.tc.mapper.history.AssetMiniProgramsHistoryMapper; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** * 小程序资产(asset_mini_programs_history)表服务实现类 * @@ -14,4 +17,10 @@ import org.springframework.stereotype.Service; */ @Service public class AssetMiniProgramsHistoryServiceImpl extends ServiceImpl implements AssetMiniProgramsHistoryService { + @Resource + private AssetMiniProgramsHistoryMapper assetMiniProgramsHistoryMapper; + @Override + public AssetMiniProgramsHistory findByTaskIdandAssetId(AssetzcTjRequest req) { + return assetMiniProgramsHistoryMapper.findByTaskIdandAssetId(req); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetOfficialAccountHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetOfficialAccountHistoryServiceImpl.java index 44a6a6d..2591033 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetOfficialAccountHistoryServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/historyService/impl/AssetOfficialAccountHistoryServiceImpl.java @@ -2,10 +2,13 @@ package com.ruoyi.tc.historyService.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.historyService.AssetOfficialAccountHistoryService; import com.ruoyi.tc.mapper.history.AssetOfficialAccountHistoryMapper; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** * 公众号资产(asset_official_account_history)表服务实现类 * @@ -14,4 +17,10 @@ import org.springframework.stereotype.Service; */ @Service public class AssetOfficialAccountHistoryServiceImpl extends ServiceImpl implements AssetOfficialAccountHistoryService { + @Resource + private AssetOfficialAccountHistoryMapper assetOfficialAccountHistoryMapper; + @Override + public AssetOfficialAccountHistory findByTaskIdandAssetId(AssetzcTjRequest req) { + return assetOfficialAccountHistoryMapper.findByTaskIdandAssetId(req); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetAppCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetAppCpMapper.java index 8f4b67c..6c33472 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetAppCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetAppCpMapper.java @@ -37,13 +37,13 @@ public interface AssetAppCpMapper extends BaseMapper { void deletByAssetId(@Param("assetId") Long assetId); /** - * 根据taskid查询查询数据 + * 根据assetId查询查询数据 * - * @param taskId 任务id + * @param assetId 资产id * @return */ - @Select("select * from asset_app_cp where task_id=#{taskId}") - List findByTaskId(@Param("taskId") int taskId); + @Select("select * from asset_app_cp where asset_id=#{assetId}") + AssetAppCpPo findByTaskId(@Param("assetId") int assetId); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBasicNetWorkCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBasicNetWorkCpMapper.java index 8a31410..c474a40 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBasicNetWorkCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBasicNetWorkCpMapper.java @@ -36,16 +36,14 @@ public interface AssetBasicNetWorkCpMapper extends BaseMapper findByTaskId(int taskId); + @Select("select * from asset_basic_network_cp where asset_id=#{assetId}") + AssetBasicNetworkCpPo findByTaskId(int assetId); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormCpMapper.java index 318bf8b..065a55a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormCpMapper.java @@ -2,7 +2,6 @@ package com.ruoyi.tc.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.po.AssetBusinessFormCpPo; -import com.ruoyi.tc.entity.po.AssetCurrentCpPo; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -35,7 +34,7 @@ public interface AssetBusinessFormCpMapper extends BaseMapper findByTaskId(int taskId); + @Select("select * from asset_business_form_cp where asset_id=#{assetId}") + AssetBusinessFormCpPo findByTaskId(int assetId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentCpMapper.java index 30e8203..919a31d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentCpMapper.java @@ -28,13 +28,13 @@ public interface AssetCurrentCpMapper extends BaseMapper { /** - * 根据taskid查询查询数据 + * 根据资产id查询查询数据 * - * @param taskId 任务id + * @param assetId 资产id * @return */ - @Select("select * from asset_current_cp where task_id=#{taskId}") - List findByTaskId(int taskId); + @Select("select * from asset_current_cp where id=#{assetId}") + AssetCurrentCpPo findByTaskId(int assetId); /** @@ -60,7 +60,7 @@ public interface AssetCurrentCpMapper extends BaseMapper { @Select(" select * from asset_current_cp where id = #{id} ") - AssetCurrentCpPo findDwmc(Long id); + List findDwmc(Long id); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java index 3cc40c8..35f5723 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java @@ -50,9 +50,9 @@ public interface AssetCurrentMapper extends BaseMapper { /** * 删除 - * @param idList + * @param id */ - void deleteIdList(@Param("idList") List idList); + void deleteIdList(@Param("id") Long id); /** * 查询所有数据(带子表) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetEmailCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetEmailCpMapper.java index 05d40e6..770c134 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetEmailCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetEmailCpMapper.java @@ -35,13 +35,13 @@ public interface AssetEmailCpMapper extends BaseMapper { void deletByAssetId(@Param("assetId") Long assetId); /** - * 根据taskid查询查询数据 + * 根据assetId查询查询数据 * - * @param taskId 任务id + * @param assetId 资产id * @return */ - @Select("select * from asset_email_cp where task_id=#{taskId}") - List findByTaskId(@Param("taskId") int taskId); + @Select("select * from asset_email_cp where asset_id=#{assetId}") + AssetEmailCpPo findByTaskId(@Param("taskId") int assetId); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetMiniProgramsCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetMiniProgramsCpMapper.java index e3414bf..201ceac 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetMiniProgramsCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetMiniProgramsCpMapper.java @@ -38,13 +38,13 @@ public interface AssetMiniProgramsCpMapper extends BaseMapper findByTaskId(@Param("taskId") int taskId); + @Select("select * from asset_mini_programs_cp where asset_id=#{assetId}") + AssetMiniProgramsCpPo findByTaskId(@Param("assetId") int assetId); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetOfficialAccountCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetOfficialAccountCpMapper.java index f13a530..36ba2ce 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetOfficialAccountCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetOfficialAccountCpMapper.java @@ -7,8 +7,6 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; -import java.util.List; - /** * 公众号资产表(asset_official_account_cp)表数据库访问层 * @@ -37,13 +35,13 @@ public interface AssetOfficialAccountCpMapper extends BaseMapper findByTaskId(@Param("taskId") int taskId); + @Select("select * from asset_official_account_cp where asset_id=#{assetId}") + AssetOfficialAccountCpPo findByTaskId(@Param("assetId") int assetId); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainCpMapper.java index e61f0d7..f8bea60 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainCpMapper.java @@ -47,12 +47,12 @@ public interface AssetSupplyChainCpMapper extends BaseMapper findByTaskId(int taskId); + @Select("select * from asset_supply_chain_cp where asset_id=#{assetId}") + AssetSupplyChainCpPo findByTaskId(int assetId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetTaskMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetTaskMapper.java index dd7f13e..1cf92c0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetTaskMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetTaskMapper.java @@ -274,6 +274,20 @@ public interface AssetTaskMapper extends BaseMapper { */ AssetTask getByTaskId(@Param("taskId") int taskId); + /** + * 根据taskid获取进行中数量 + * @param taskId + * @return + */ + Integer getJxz(@Param("taskId") int taskId); + + + /** + * 根据taskid获取是否超期的数量 + * @param taskId + * @return + */ + String getifcq(@Param("taskId") int taskId); /** * 管理端关闭 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatCpMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatCpMapper.java index 98f3618..2f0c7dd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatCpMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatCpMapper.java @@ -33,7 +33,7 @@ public interface UnitOtherConcatCpMapper extends BaseMapper * @param taskId 任务id */ @Delete("delete from unit_other_contact_cp where asset_id=#{assetId} and task_id =#{taskId} ") - void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId")Integer taskId); + void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") Integer taskId); /** * 根据资产id和任务id删除数据 @@ -44,11 +44,11 @@ public interface UnitOtherConcatCpMapper extends BaseMapper void deletByAssetId(@Param("assetId") Long assetId); /** - * 根据taskid查询查询数据 + * 根据资产id查询查询数据 * - * @param taskId 任务id + * @param assetId 资产id * @return */ - @Select("select * from unit_other_contact_cp where task_id=#{taskId}") - List findByTaskId(int taskId); + @Select("select * from unit_other_contact_cp where asset_id=#{assetId}") + UnitOtherConcatCpPo findByTaskId(int assetId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetAppHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetAppHistoryMapper.java index f2fe5e1..440124c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetAppHistoryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetAppHistoryMapper.java @@ -2,6 +2,8 @@ package com.ruoyi.tc.mapper.history; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.history.AssetAppHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; +import org.apache.ibatis.annotations.Select; /** * 资产移动应用程序表(asset_app_history)表数据库访问层 @@ -10,5 +12,16 @@ import com.ruoyi.tc.entity.history.AssetAppHistory; * @since 2024-11-15 10:03:56 */ public interface AssetAppHistoryMapper extends BaseMapper { + + + /** + * 资产移动应用程序资产提交记录 + * + * @param req + * @return + */ + @Select("select * from asset_app_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") + AssetAppHistory findByTaskIdandAssetId(AssetzcTjRequest req); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetCurrentHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetCurrentHistoryMapper.java index 0450136..a608c15 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetCurrentHistoryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetCurrentHistoryMapper.java @@ -2,6 +2,9 @@ package com.ruoyi.tc.mapper.history; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.history.AssetCurrentHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * 现有资产复制表(asset_current_history)表数据库访问层 @@ -10,5 +13,16 @@ import com.ruoyi.tc.entity.history.AssetCurrentHistory; * @since 2024-11-15 10:03:56 */ public interface AssetCurrentHistoryMapper extends BaseMapper { + + + + /** + * web资产提交记录 + * + * @param req + * @return + */ + @Select("select * from asset_mini_programs_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") + AssetCurrentHistory findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetEmailHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetEmailHistoryMapper.java index 4585a26..98be8c5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetEmailHistoryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetEmailHistoryMapper.java @@ -2,6 +2,9 @@ package com.ruoyi.tc.mapper.history; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.history.AssetEmailHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * 电子邮件资产表(asset_email_cp)表数据库访问层 @@ -10,5 +13,15 @@ import com.ruoyi.tc.entity.history.AssetEmailHistory; * @since 2024-11-15 10:03:56 */ public interface AssetEmailHistoryMapper extends BaseMapper { + + + /** + * 电子邮件资产提交记录 + * + * @param req + * @return + */ + @Select("select * from asset_email_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") + AssetEmailHistory findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetMiniProgramsHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetMiniProgramsHistoryMapper.java index 4184a0f..d966432 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetMiniProgramsHistoryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetMiniProgramsHistoryMapper.java @@ -2,6 +2,9 @@ package com.ruoyi.tc.mapper.history; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * 小程序资产表(asset_mini_programs_history)表数据库访问层 @@ -10,5 +13,15 @@ import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory; * @since 2024-11-15 10:03:56 */ public interface AssetMiniProgramsHistoryMapper extends BaseMapper { + + + /** + * 小程序资产提交记录 + * + * @param req + * @return + */ + @Select("select * from asset_current_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") + AssetMiniProgramsHistory findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetOfficialAccountHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetOfficialAccountHistoryMapper.java index 2ea5bd0..a752bff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetOfficialAccountHistoryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/history/AssetOfficialAccountHistoryMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.tc.mapper.history; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory; import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo; +import com.ruoyi.tc.entity.request.AssetzcTjRequest; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -17,5 +18,15 @@ import java.util.List; * @since 2024-11-15 10:03:56 */ public interface AssetOfficialAccountHistoryMapper extends BaseMapper { + + + /** + * 公众号资产提交记录 + * + * @param req + * @return + */ + @Select("select * from asset_official_account_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") + AssetOfficialAccountHistory findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetAppCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetAppCpService.java index e00b9c7..c8ae5c5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetAppCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetAppCpService.java @@ -34,12 +34,12 @@ public interface AssetAppCpService extends IService { /** - * 根据taskid查询查询数据 + * 根据资产id查询查询数据 * - * @param taskId 任务id + * @param assetId 资产id * @return */ - List findByTaskId(int taskId); + AssetAppCpPo findByTaskId(int assetId); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBasicNetworkCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBasicNetworkCpService.java index f928b68..55f9572 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBasicNetworkCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBasicNetworkCpService.java @@ -34,12 +34,12 @@ public interface AssetBasicNetworkCpService extends IService findByTaskId(int taskId); + AssetBasicNetworkCpPo findByTaskId(int assetId); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBusinessFormCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBusinessFormCpService.java index a1149a0..b8464d1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBusinessFormCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetBusinessFormCpService.java @@ -38,12 +38,12 @@ public interface AssetBusinessFormCpService extends IService findByTaskId(int taskId); + AssetBusinessFormCpPo findByTaskId(int assetId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetCurrentCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetCurrentCpService.java index c7944cb..64b4cd5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetCurrentCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetCurrentCpService.java @@ -27,12 +27,12 @@ public interface AssetCurrentCpService extends IService { /** - * 根据taskid查询查询数据 + * 根据资产id查询查询数据 * - * @param taskId 任务id + * @param assetId 资产id * @return */ - List findByTaskId(int taskId); + AssetCurrentCpPo findByTaskId(int assetId); /** @@ -63,7 +63,7 @@ public interface AssetCurrentCpService extends IService { * @param id * @return */ - AssetCurrentCpPo findDwmc(Long id); + List findDwmc(Long id); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetCurrentService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetCurrentService.java index 54acff8..49d0e03 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetCurrentService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetCurrentService.java @@ -52,7 +52,7 @@ public interface AssetCurrentService extends IService { * * @param idList */ - void deleteIdList(List idList); + void deleteIdList(Long idList); /** * 查询所有数据(带子表) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetEmailCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetEmailCpService.java index 947ab6d..88c5cba 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetEmailCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetEmailCpService.java @@ -33,12 +33,12 @@ public interface AssetEmailCpService extends IService { /** - * 根据taskid查询查询数据 + * 根据assetId查询查询数据 * - * @param taskId 任务id + * @param assetId 资产id * @return */ - List findByTaskId(int taskId); + AssetEmailCpPo findByTaskId(int assetId); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetMiniProgramsCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetMiniProgramsCpService.java index 318a8ce..c71fec8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetMiniProgramsCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetMiniProgramsCpService.java @@ -36,12 +36,12 @@ public interface AssetMiniProgramsCpService extends IService findByTaskId(int taskId); + AssetMiniProgramsCpPo findByTaskId(int assetId); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetOfficialAccountCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetOfficialAccountCpService.java index 9c444e0..19aaf9b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetOfficialAccountCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetOfficialAccountCpService.java @@ -34,12 +34,12 @@ public interface AssetOfficialAccountCpService extends IService findByTaskId(int taskId); + AssetOfficialAccountCpPo findByTaskId(int assetId); /** * 修改不通过原因 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetSupplyChainCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetSupplyChainCpService.java index 979b2b2..2396325 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetSupplyChainCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/AssetSupplyChainCpService.java @@ -24,12 +24,12 @@ public interface AssetSupplyChainCpService extends IService findByTaskId(int taskId); + AssetSupplyChainCpPo findByTaskId(int assetId); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitOtherConcatCpService.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitOtherConcatCpService.java index 65407be..47ae043 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitOtherConcatCpService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/UnitOtherConcatCpService.java @@ -43,10 +43,10 @@ public interface UnitOtherConcatCpService extends IService /** - * 根据taskid查询查询数据 + * 根据assetId查询查询数据 * - * @param taskId 任务id + * @param assetId 资产id * @return */ - List findByTaskId(int taskId); + UnitOtherConcatCpPo findByTaskId(int assetId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppCpServiceImpl.java index 22f6145..9b553e2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppCpServiceImpl.java @@ -38,8 +38,8 @@ public class AssetAppCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return assetAppCpMapper.findByTaskId(taskId); + public AssetAppCpPo findByTaskId(int assetId) { + return assetAppCpMapper.findByTaskId(assetId); } @Override diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBasicNetworkCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBasicNetworkCpServiceImpl.java index 3b8edf5..c2b1ef5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBasicNetworkCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBasicNetworkCpServiceImpl.java @@ -32,8 +32,8 @@ public class AssetBasicNetworkCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return assetBasicNetWorkCpMapper.findByTaskId(taskId); + public AssetBasicNetworkCpPo findByTaskId(int assetId) { + return assetBasicNetWorkCpMapper.findByTaskId(assetId); } @Override diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBusinessFormCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBusinessFormCpServiceImpl.java index f9fd68f..08641bd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBusinessFormCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetBusinessFormCpServiceImpl.java @@ -37,8 +37,8 @@ public class AssetBusinessFormCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return assetBusinessFormCpMapper.findByTaskId(taskId); + public AssetBusinessFormCpPo findByTaskId(int assetId) { + return assetBusinessFormCpMapper.findByTaskId(assetId); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentCpServiceImpl.java index 893931b..ceed896 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentCpServiceImpl.java @@ -31,8 +31,8 @@ public class AssetCurrentCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return assetCurrentCpMapper.findByTaskId(taskId); + public AssetCurrentCpPo findByTaskId(int assetId) { + return assetCurrentCpMapper.findByTaskId(assetId); } @Override @@ -47,7 +47,7 @@ public class AssetCurrentCpServiceImpl extends ServiceImpl findDwmc(Long id) { return baseMapper.findDwmc(id); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java index b7fd5f3..c1e3b95 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java @@ -102,8 +102,8 @@ public class AssetCurrentServiceImpl extends ServiceImpl idList) { - baseMapper.deleteIdList(idList); + public void deleteIdList(Long id) { + baseMapper.deleteIdList(id); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailCpServiceImpl.java index caa1b7e..1509f0d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailCpServiceImpl.java @@ -41,8 +41,8 @@ public class AssetEmailCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return assetEmailCpMapper.findByTaskId(taskId); + public AssetEmailCpPo findByTaskId(int assetId) { + return assetEmailCpMapper.findByTaskId(assetId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetMiniProgramsCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetMiniProgramsCpServiceImpl.java index 56d6a36..d28227a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetMiniProgramsCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetMiniProgramsCpServiceImpl.java @@ -33,8 +33,8 @@ public class AssetMiniProgramsCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return assetMiniProgramsCpMapper.findByTaskId(taskId); + public AssetMiniProgramsCpPo findByTaskId(int assetId) { + return assetMiniProgramsCpMapper.findByTaskId(assetId); } @Override diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountCpServiceImpl.java index edf7dbc..3439960 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountCpServiceImpl.java @@ -42,8 +42,8 @@ public class AssetOfficialAccountCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return assetOfficialAccountCpMapper.findByTaskId(taskId); + public AssetOfficialAccountCpPo findByTaskId(int assetId) { + return assetOfficialAccountCpMapper.findByTaskId(assetId); } @Override diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetSupplyChainCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetSupplyChainCpServiceImpl.java index fbd8fae..84665c0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetSupplyChainCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetSupplyChainCpServiceImpl.java @@ -27,8 +27,8 @@ public class AssetSupplyChainCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return assetSupplyChainCpMapper.findByTaskId(taskId); + public AssetSupplyChainCpPo findByTaskId(int assetId) { + return assetSupplyChainCpMapper.findByTaskId(assetId); } @Override diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetTaskServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetTaskServiceImpl.java index 551f324..dd2ae19 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetTaskServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetTaskServiceImpl.java @@ -1,22 +1,26 @@ package com.ruoyi.tc.service.impl; -import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.tc.entity.*; +import com.ruoyi.tc.entity.history.*; import com.ruoyi.tc.entity.po.*; import com.ruoyi.tc.entity.request.*; import com.ruoyi.tc.entity.response.AssestTaskXqresponse; import com.ruoyi.tc.entity.response.AssetTaskResponse; import com.ruoyi.tc.entity.response.AssetdwHcBlResponse; import com.ruoyi.tc.entity.response.AssetdwHcResponse; +import com.ruoyi.tc.historyService.*; import com.ruoyi.tc.mapper.AssetTaskMapper; import com.ruoyi.tc.service.*; +import lombok.SneakyThrows; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; @@ -101,6 +105,39 @@ public class AssetTaskServiceImpl extends ServiceImpl { - if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { - a.append(x.getKey()); - a.append(","); - } - }); - } - req.getAssetCurrentCpPo().setGlym(a.toString()); - StringBuilder b = new StringBuilder(); - if (!req.getAssetCurrentCpPo().getGlIpList().isEmpty()) { - req.getAssetCurrentCpPo().getGlIpList().forEach(x -> { - if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { - b.append(x.getKey()); - b.append(","); - } - }); - } - req.getAssetCurrentCpPo().setGlIp(b.toString()); - req.getAssetCurrentCpPo().setStatus(req.getStatus()); - - // 设置更新时间 - req.getAssetCurrentCpPo().setUpdateTime(date); - assetCurrentCpService.save(req.getAssetCurrentCpPo()); - //新增新监管业务形态 - if (req.getAssetCurrentCpPo().getXjgywxt() != null) { - req.getAssetCurrentCpPo().getXjgywxt().setAssetId(req.getAssetCurrentCpPo().getId()); - req.getAssetCurrentCpPo().getXjgywxt().setTaskId(req.getAssetCurrentCpPo().getTaskId()); - assetBusinessFormCpService.save(req.getAssetCurrentCpPo().getXjgywxt()); - } - if (!req.getAssetCurrentCpPo().getGylxxList().isEmpty()) { - for (AssetSupplyChainCpPo items : req.getAssetCurrentCpPo().getGylxxList()) { - items.setAssetId(req.getAssetCurrentCpPo().getId()); - items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); - - } - //新增供应链 - assetSupplyChainCpService.saveBatch(req.getAssetCurrentCpPo().getGylxxList()); - } - if (!req.getAssetCurrentCpPo().getJcwlList().isEmpty()) { - for (AssetBasicNetworkCpPo items : req.getAssetCurrentCpPo().getJcwlList()) { - items.setAssetId(req.getAssetCurrentCpPo().getId()); - items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); - - } - //新增基础网络 - assetBasicNetworkCpService.saveBatch(req.getAssetCurrentCpPo().getJcwlList()); - } - if (!req.getAssetCurrentCpPo().getOtherConcat().isEmpty()) { - for (UnitOtherConcatCpPo items : req.getAssetCurrentCpPo().getOtherConcat()) { - items.setAssetId(req.getAssetCurrentCpPo().getId()); - items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); - } - //新增其他联系人 - unitOtherConcatCpService.saveBatch(req.getAssetCurrentCpPo().getOtherConcat()); - } + //修改子表和新增历史表 + updateZiandHistory(req, date); + } else { + //修改子表和新增历史表 + updateZiandHistory(req, date); + //同步主表 + taskSaveOrDelete(req); } } else if (req.getType() == 1) { //小程序资产 //创建任务流程 ifCq(req, assetTask); + // //创建任务流程 getTaskStatus(req); - if (req.getBtgyy()!=null){ + if (req.getBtgyy() != null) { assetTaskDao.xcxsh(req); - }else { - req.getAssetMiniProgramsCpPo().setStatus(req.getStatus()); - req.getAssetMiniProgramsCpPo().setUpdateTime(date); - assetMiniProgramsCpService.updateById(req.getAssetMiniProgramsCpPo()); + //修改子表和新增历史表 + updateMinZiandHistory(req, date); + } else { + //修改子表和新增历史表 + updateMinZiandHistory(req, date); + //同步主表 + syb(req); } } else if (req.getType() == 2) { //公众号资产 //创建任务流程 ifCq(req, assetTask); + //创建任务流程 getTaskStatus(req); - if (req.getBtgyy()!=null){ + if (req.getBtgyy() != null) { assetTaskDao.gzhsh(req); - }else { - if (req.getAssetOfficialAccountCpPo().getCdList() != null && !req.getAssetOfficialAccountCpPo().getCdList().isEmpty()) { - StringBuilder a = new StringBuilder(); - StringBuilder b = new StringBuilder(); - StringBuilder c = new StringBuilder(); - req.getAssetOfficialAccountCpPo().getCdList().forEach(x -> { - a.append(x.getCdmc()).append("|"); - b.append(x.getCdlj()).append("|"); - c.append(x.getCdlx()).append("|"); - }); - req.getAssetOfficialAccountCpPo().setCdmc(a.toString()); - req.getAssetOfficialAccountCpPo().setCdlj(b.toString()); - req.getAssetOfficialAccountCpPo().setCdlx(c.toString()); - } - req.getAssetOfficialAccountCpPo().setStatus(req.getStatus()); - req.getAssetOfficialAccountCpPo().setUpdateTime(date); - assetOfficialAccountCpService.updateById(req.getAssetOfficialAccountCpPo()); + //修改子表和历史表新增 + updateGzhZiandHistory(req, date); + } else { + //修改子表和历史表新增 + updateGzhZiandHistory(req, date); + //同步主表 + syb(req); } } else if (req.getType() == 3) { //电子邮件 //创建任务流程 ifCq(req, assetTask); + //创建任务流程 getTaskStatus(req); - if (req.getBtgyy()!=null){ + if (req.getBtgyy() != null) { assetTaskDao.emailsh(req); - }else { - req.getAssetEmailCpPo().setStatus(req.getStatus()); - req.getAssetEmailCpPo().setUpdateTime(date); - assetEmailCpService.updateById(req.getAssetEmailCpPo()); + //修改子表和历史表新增 + updateEmailZiandHistory(req, date); + } else { + //修改子表和历史表新增 + updateEmailZiandHistory(req, date); + //同步主表 + syb(req); } } else if (req.getType() == 4) { //app //创建任务流程 ifCq(req, assetTask); + //创建任务流程 getTaskStatus(req); - if (req.getBtgyy()!=null){ + if (req.getBtgyy() != null) { assetTaskDao.appsh(req); - }else{ - req.getAssetAppCpPo().setStatus(req.getStatus()); - req.getAssetAppCpPo().setUpdateTime(date); - assetAppCpService.updateById(req.getAssetAppCpPo()); + //修改子表和历史表新增 + updateAppZiandHistory(req, date); + } else { + //修改子表和历史表新增 + updateAppZiandHistory(req, date); + //同步主表 + syb(req); } } AssetTask finalTask = assetTaskDao.getByTaskId(req.getTaskId()); - //判断当前任务资产是否全部审核完成 - int deadlineCount = Optional.ofNullable(finalTask.getDeadlineCount()).orElse(0); - int count = Optional.ofNullable(finalTask.getCount()).orElse(0); - int totalCount = Optional.ofNullable(finalTask.getTotalCount()).orElse(0); - int ygt = Optional.ofNullable(finalTask.getYgt()).orElse(0); LocalDateTime finishTime = null; - if (ygt + count >= totalCount && deadlineCount == 0) { - //关停和通过数量=全部数量并且超期完成数量为0 状态是正常完成 status=2 - finalTask.setTaskStatus(2); - finishTime = LocalDateTime.now(); - finalTask.setTaskFinishTime(finishTime); - assetTaskService.update(finalTask); - //同步主表数据 web - taskSaveOrDelete(req); - syb(req); - - } else if (deadlineCount + count + ygt >= totalCount && deadlineCount != 0) { - //超期完成和通过数量=全部数量并且超期完成数量不为0 状态是超期完成 status=3 - finalTask.setTaskStatus(3); - finishTime = LocalDateTime.now(); - finalTask.setTaskFinishTime(finishTime); - assetTaskService.update(finalTask); - - //同步主表数据 web - taskSaveOrDelete(req); - syb(req); - } else if (req.getBtgyy() != null) { - //不通过 状态为1 - finalTask.setTaskStatus(1); - String btgyy = req.getBtgyy(); - assetTaskService.update(finalTask); - //修改不通过原因 - if (req.getType() == 0) { - //根据任务id,资产id获取退回次数 - AssetCurrentCpPo assetCurrentCpPo = assetCurrentCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId()); - - //获取退回次数 - Integer thcs = 0; - if (assetCurrentCpPo.getCount() != null) { - thcs = assetCurrentCpPo.getCount(); - } - int newThcs = thcs + 1; - assetCurrentCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs); - } else if (req.getType() == 1) { - //根据任务id,资产id获取退回次数 - AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId()); - //获取退回次数 - Integer thcs = 0; - if (assetMiniProgramsCpPo.getCount() != null) { - thcs = assetMiniProgramsCpPo.getCount(); + //根据任务id查询是否进行中 + Integer jxz=assetTaskDao.getJxz(req.getTaskId()); + if(jxz>0){ + //进行中 + finalTask.setTaskStatus(1); + finalTask.setTaskFinishTime(finishTime); + assetTaskService.update(finalTask); + }else{ + //根据任务id查询是否超期 + String ifcq=assetTaskDao.getifcq(req.getTaskId()); + String taskDeadline = finalTask.getTaskDeadline(); // 定义日期格式,确保格式与字符串一致 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 根据你的时间格式调整 + // 将字符串转换为日期对象 + Date ifcqDate = dateFormat.parse(ifcq); + Date taskDeadlineDate = dateFormat.parse(taskDeadline); + // 比较两个日期 + if (ifcqDate.before(taskDeadlineDate)) { + //超期完成 + finalTask.setTaskStatus(3); + finishTime = LocalDateTime.now(); + finalTask.setTaskFinishTime(finishTime); + assetTaskService.update(finalTask); + } else if (ifcqDate.after(taskDeadlineDate)) { + //正常完成 + finalTask.setTaskStatus(2); + finishTime = LocalDateTime.now(); + finalTask.setTaskFinishTime(finishTime); + assetTaskService.update(finalTask); + } + } + + return 0; + } + + private void updateAppZiandHistory(AssetCurrentShRequest req, Date date) { + req.getAssetAppCpPo().setStatus(req.getStatus()); + req.getAssetAppCpPo().setUpdateTime(date); + assetAppCpService.updateById(req.getAssetAppCpPo()); + //新增历史记录表 + AssetAppHistory assetAppHistory = new AssetAppHistory(); + BeanUtils.copyProperties(req.getAssetAppCpPo(), assetAppHistory); + assetAppHistoryService.save(assetAppHistory); + } + + private void updateEmailZiandHistory(AssetCurrentShRequest req, Date date) { + req.getAssetEmailCpPo().setStatus(req.getStatus()); + req.getAssetEmailCpPo().setUpdateTime(date); + assetEmailCpService.updateById(req.getAssetEmailCpPo()); + //新增历史记录表 + AssetEmailHistory assetEmailHistory = new AssetEmailHistory(); + BeanUtils.copyProperties(req.getAssetEmailCpPo(), assetEmailHistory); + assetEmailHistoryService.save(assetEmailHistory); + } + + private void updateGzhZiandHistory(AssetCurrentShRequest req, Date date) { + if (req.getAssetOfficialAccountCpPo().getCdList() != null && !req.getAssetOfficialAccountCpPo().getCdList().isEmpty()) { + StringBuilder a = new StringBuilder(); + StringBuilder b = new StringBuilder(); + StringBuilder c = new StringBuilder(); + req.getAssetOfficialAccountCpPo().getCdList().forEach(x -> { + a.append(x.getCdmc()).append("|"); + b.append(x.getCdlj()).append("|"); + c.append(x.getCdlx()).append("|"); + }); + req.getAssetOfficialAccountCpPo().setCdmc(a.toString()); + req.getAssetOfficialAccountCpPo().setCdlj(b.toString()); + req.getAssetOfficialAccountCpPo().setCdlx(c.toString()); + } + req.getAssetOfficialAccountCpPo().setStatus(req.getStatus()); + req.getAssetOfficialAccountCpPo().setUpdateTime(date); + assetOfficialAccountCpService.updateById(req.getAssetOfficialAccountCpPo()); + //新增历史记录表 + AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory(); + BeanUtils.copyProperties(req.getAssetOfficialAccountCpPo(), assetOfficialAccountHistory); + assetOfficialAccountHistoryService.save(assetOfficialAccountHistory); + } + + private void updateMinZiandHistory(AssetCurrentShRequest req, Date date) { + req.getAssetMiniProgramsCpPo().setStatus(req.getStatus()); + req.getAssetMiniProgramsCpPo().setUpdateTime(date); + assetMiniProgramsCpService.updateById(req.getAssetMiniProgramsCpPo()); + //新增历史记录表 + AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory(); + BeanUtils.copyProperties(req.getAssetMiniProgramsCpPo(), assetMiniProgramsHistory); + assetMiniProgramsHistoryService.save(assetMiniProgramsHistory); + } + + private void updateZiandHistory(AssetCurrentShRequest req, Date date) { + //根据资产id和任务id删除五张表数据 + assetCurrentCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId()); + assetBusinessFormCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId()); + 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(); + if (!req.getAssetCurrentCpPo().getGlymList().isEmpty()) { + req.getAssetCurrentCpPo().getGlymList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + a.append(x.getKey()); + a.append(","); } - int newThcs = thcs + 1; - assetMiniProgramsCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs); - } else if (req.getType() == 2) { - //根据任务id,资产id获取退回次数 - AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId()); - //获取退回次数 - Integer thcs = 0; - if (assetOfficialAccountCpPo.getCount() != null) { - thcs = assetOfficialAccountCpPo.getCount(); + }); + } + req.getAssetCurrentCpPo().setGlym(a.toString()); + StringBuilder b = new StringBuilder(); + if (!req.getAssetCurrentCpPo().getGlIpList().isEmpty()) { + req.getAssetCurrentCpPo().getGlIpList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + b.append(x.getKey()); + b.append(","); } + }); + } + req.getAssetCurrentCpPo().setGlIp(b.toString()); + req.getAssetCurrentCpPo().setStatus(req.getStatus()); + + // 设置更新时间 + req.getAssetCurrentCpPo().setUpdateTime(date); + AssetCurrentHistory assetCurrentHistory = new AssetCurrentHistory(); + assetCurrentCpService.save(req.getAssetCurrentCpPo()); + //新增新监管业务形态 + if (req.getAssetCurrentCpPo().getXjgywxt() != null) { + req.getAssetCurrentCpPo().getXjgywxt().setAssetId(req.getAssetCurrentCpPo().getId()); + req.getAssetCurrentCpPo().getXjgywxt().setTaskId(req.getAssetCurrentCpPo().getTaskId()); + assetBusinessFormCpService.save(req.getAssetCurrentCpPo().getXjgywxt()); + } + if (!req.getAssetCurrentCpPo().getGylxxList().isEmpty()) { + for (AssetSupplyChainCpPo items : req.getAssetCurrentCpPo().getGylxxList()) { + items.setAssetId(req.getAssetCurrentCpPo().getId()); + items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); - int newThcs = thcs + 1; - assetOfficialAccountCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs); - } else if (req.getType() == 3) { - //根据任务id,资产id获取退回次数 - AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId()); - //获取退回次数 - Integer thcs = 0; - if (assetEmailCpPo.getCount() != null) { - thcs = assetEmailCpPo.getCount(); + } + //新增供应链 + assetSupplyChainCpService.saveBatch(req.getAssetCurrentCpPo().getGylxxList()); + } + if (!req.getAssetCurrentCpPo().getJcwlList().isEmpty()) { + for (AssetBasicNetworkCpPo items : req.getAssetCurrentCpPo().getJcwlList()) { + items.setAssetId(req.getAssetCurrentCpPo().getId()); + items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); + + } + //新增基础网络 + assetBasicNetworkCpService.saveBatch(req.getAssetCurrentCpPo().getJcwlList()); + } + if (!req.getAssetCurrentCpPo().getOtherConcat().isEmpty()) { + for (UnitOtherConcatCpPo items : req.getAssetCurrentCpPo().getOtherConcat()) { + items.setAssetId(req.getAssetCurrentCpPo().getId()); + items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); + } + //新增其他联系人 + unitOtherConcatCpService.saveBatch(req.getAssetCurrentCpPo().getOtherConcat()); + } + //新增历史记录 + saveHistory(req, a, b, date, assetCurrentHistory); + } + + private void saveHistory(AssetCurrentShRequest req, StringBuilder a, StringBuilder b, Date date, AssetCurrentHistory assetCurrentHistory) { + //新增历史记录 + StringBuilder c = new StringBuilder(); + if (!req.getAssetCurrentCpPo().getGlymList().isEmpty()) { + req.getAssetCurrentCpPo().getGlymList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + c.append(x.getKey()); + c.append(","); } - int newThcs = thcs + 1; - assetEmailCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs); - } else if (req.getType() == 4) { - //根据任务id,资产id获取退回次数 - AssetAppCpPo assetAppCpPo = assetAppCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId()); - //获取退回次数 - Integer thcs = 0; - if (assetAppCpPo.getCount() != null) { - thcs = assetAppCpPo.getCount(); + }); + } + req.getAssetCurrentCpPo().setGlym(a.toString()); + StringBuilder d = new StringBuilder(); + if (!req.getAssetCurrentCpPo().getGlIpList().isEmpty()) { + req.getAssetCurrentCpPo().getGlIpList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + d.append(x.getKey()); + d.append(","); } - int newThcs = thcs + 1; - assetAppCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs); + }); + } + req.getAssetCurrentCpPo().setGlIp(b.toString()); + req.getAssetCurrentCpPo().setStatus(req.getStatus()); + + // 设置更新时间 + req.getAssetCurrentCpPo().setUpdateTime(date); + BeanUtils.copyProperties(req.getAssetCurrentCpPo(), assetCurrentHistory); + assetCurrentHistoryService.save(assetCurrentHistory); + + //新增新监管业务形态历史表 + if (req.getAssetCurrentCpPo().getXjgywxt() != null) { + req.getAssetCurrentCpPo().getXjgywxt().setAssetId(req.getAssetCurrentCpPo().getId()); + req.getAssetCurrentCpPo().getXjgywxt().setTaskId(req.getAssetCurrentCpPo().getTaskId()); + AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory(); + assetBusinessFormHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId()); + BeanUtils.copyProperties(req.getAssetCurrentCpPo().getXjgywxt(), assetBusinessFormHistory); + assetBusinessFormHistoryService.save(assetBusinessFormHistory); + + } + if (!req.getAssetCurrentCpPo().getGylxxList().isEmpty()) { + for (AssetSupplyChainCpPo items : req.getAssetCurrentCpPo().getGylxxList()) { + items.setAssetId(req.getAssetCurrentCpPo().getId()); + items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); + } + //新增供应链历史表 + List assetSupplyChainHistoryList = req.getAssetCurrentCpPo().getGylxxList().stream() + .map(cpPo -> { + AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory(); + assetSupplyChainHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId()); + BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性 + return assetSupplyChainHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + assetSupplyChainHistoryService.saveBatch(assetSupplyChainHistoryList); } + if (!req.getAssetCurrentCpPo().getJcwlList().isEmpty()) { + for (AssetBasicNetworkCpPo items : req.getAssetCurrentCpPo().getJcwlList()) { + items.setAssetId(req.getAssetCurrentCpPo().getId()); + items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); - return 0; + } + //新增基础网络历史表 + List assetSupplyChainHistoryList = req.getAssetCurrentCpPo().getJcwlList().stream() + .map(cpPo -> { + AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory(); + assetBasicNetworkHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId()); + BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性 + return assetBasicNetworkHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + assetBasicNetworkHistoryService.saveBatch(assetSupplyChainHistoryList); + } + if (!req.getAssetCurrentCpPo().getOtherConcat().isEmpty()) { + for (UnitOtherConcatCpPo items : req.getAssetCurrentCpPo().getOtherConcat()) { + items.setAssetId(req.getAssetCurrentCpPo().getId()); + items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); + } + //新增其他联系人 + List unitOtherConcatHistoryList = req.getAssetCurrentCpPo().getOtherConcat().stream() + .map(cpPo -> { + UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory(); + unitOtherConcatHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId()); + BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性 + return unitOtherConcatHistory; // 返回新对象 + }) + .collect(Collectors.toList()); // 收集到列表中 + unitOtherConcatHistoryService.saveBatch(unitOtherConcatHistoryList); + } } private void syb(AssetCurrentShRequest req) { - //app 小程序 邮件 公众号 - List appList = assetAppCpService.findByTaskId(req.getTaskId()); - List emailCpPoListList = assetEmailCpService.findByTaskId(req.getTaskId()); - List miniProgramsCpPoListList = assetMiniProgramsCpService.findByTaskId(req.getTaskId()); - List officialAccountCpPoListList = assetOfficialAccountCpService.findByTaskId(req.getTaskId()); - //app - List appidList = appList.stream() - .map(AssetAppCpPo::getAssetId) - .collect(Collectors.toList()); - //删除原有数据 - if (CollectionUtil.isNotEmpty(appidList)) { - assetAppService.deleteIdList(appidList); - } - //将子表数据复制到主表中 - List appNewList = appList.stream() - .map(cpPo -> { - AssetApp current = new AssetApp(); - BeanUtils.copyProperties(cpPo, current); // 复制属性 - return current; // 返回新对象 - }) - .collect(Collectors.toList()); // 收集到列表中 - assetAppService.saveBatch(appNewList); - - //邮件 - List emailidList = emailCpPoListList.stream() - .map(AssetEmailCpPo::getAssetId) - .collect(Collectors.toList()); - //删除原有数据 - if (CollectionUtil.isNotEmpty(emailidList)) { - assetEmailService.deleteIdList(emailidList); - } - //将子表数据复制到主表中 - List emailNewList = emailCpPoListList.stream() - .map(cpPo -> { - AssetEmail current = new AssetEmail(); - BeanUtils.copyProperties(cpPo, current); // 复制属性 - return current; // 返回新对象 - }) - .collect(Collectors.toList()); // 收集到列表中 - assetEmailService.saveBatch(emailNewList); - - //小程序 - List miniidList = miniProgramsCpPoListList.stream() - .map(AssetMiniProgramsCpPo::getAssetId) - .collect(Collectors.toList()); - //删除原有数据 - if (CollectionUtil.isNotEmpty(miniidList)) { - assetMiniProgramsService.deleteIdList(miniidList); - } - //将子表数据复制到主表中 - List miniNewList = miniProgramsCpPoListList.stream() - .map(cpPo -> { - AssetMiniPrograms current = new AssetMiniPrograms(); - BeanUtils.copyProperties(cpPo, current); // 复制属性 - return current; // 返回新对象 - }) - .collect(Collectors.toList()); // 收集到列表中 - assetMiniProgramsService.saveBatch(miniNewList); - - - //公众号 - List officialidList = officialAccountCpPoListList.stream() - .map(AssetOfficialAccountCpPo::getAssetId) - .collect(Collectors.toList()); - //删除原有数据 - if (CollectionUtil.isNotEmpty(officialidList)) { - assetOfficialAccountService.deleteIdList(officialidList); - } - //将子表数据复制到主表中 - List officialNewList = officialAccountCpPoListList.stream() - .map(cpPo -> { - AssetOfficialAccount current = new AssetOfficialAccount(); - BeanUtils.copyProperties(cpPo, current); // 复制属性 - return current; // 返回新对象 - }) - .collect(Collectors.toList()); // 收集到列表中 - assetOfficialAccountService.saveBatch(officialNewList); + if (req.getType() == 1) { + //小程序 + AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByTaskId(req.getAssetId()); + //删除原有数据 + if (assetMiniProgramsCpPo != null) { + assetMiniProgramsService.deleteIdList(Collections.singletonList(assetMiniProgramsCpPo.getAssetId())); + //将子表数据复制到主表中 + AssetMiniPrograms assetMiniPrograms = new AssetMiniPrograms(); + BeanUtils.copyProperties(assetMiniProgramsCpPo, assetMiniPrograms); // 复制属性 + assetMiniPrograms.setId(null); + assetMiniProgramsService.save(assetMiniPrograms); + } + + } + if (req.getType() == 2) { + //公众号资产 + AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByTaskId(req.getAssetId()); + + //删除原有数据 + if (assetOfficialAccountCpPo != null) { + assetOfficialAccountService.deleteIdList(Collections.singletonList(assetOfficialAccountCpPo.getAssetId())); + //将子表数据复制到主表中 + AssetOfficialAccount assetOfficialAccount = new AssetOfficialAccount(); + BeanUtils.copyProperties(assetOfficialAccountCpPo, assetOfficialAccount); // 复制属性 + assetOfficialAccountService.save(assetOfficialAccount); + } + + + } + if (req.getType() == 3) { + //电子邮件资产 + //根据assetId查询查询数据 + AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByTaskId(req.getAssetId()); + //删除原有数据 + if (assetEmailCpPo != null) { + assetEmailService.deleteIdList(Collections.singletonList(assetEmailCpPo.getAssetId())); + //将子表数据复制到主表中 + AssetEmail assetEmail = new AssetEmail(); + BeanUtils.copyProperties(assetEmailCpPo, assetEmail); // 复制属性 + assetEmail.setId(null); + assetEmailService.save(assetEmail); + } + } + if (req.getType() == 4) { + //移动应用程序资产 + //根据资产id查询 + AssetAppCpPo assetAppCpPo = assetAppCpService.findByTaskId(req.getAssetId()); + //删除原有数据 + if (assetAppCpPo != null) { + assetAppService.deleteIdList(Collections.singletonList(assetAppCpPo.getAssetId())); + //将子表数据复制到主表中 + AssetApp assetApp = new AssetApp(); + BeanUtils.copyProperties(assetAppCpPo, assetApp); // 复制属性 + assetApp.setId(null); + assetAppService.save(assetApp); + } + + + } + + } private void ifCq(AssetCurrentShRequest req, AssetTask assetTask) { @@ -823,99 +949,61 @@ public class AssetTaskServiceImpl extends ServiceImpl currentList = assetCurrentCpService.findByTaskId(req.getTaskId()); - List idList = currentList.stream() - .map(AssetCurrentCpPo::getId) - .collect(Collectors.toList()); - //删除原有数据 - if (CollectionUtil.isNotEmpty(idList)) { - assetCurrentService.deleteIdList(idList); - } - - //将子表数据复制到主表中 - List currentNewList = currentList.stream() - .map(cpPo -> { - AssetCurrent current = new AssetCurrent(); - BeanUtils.copyProperties(cpPo, current); // 复制属性 - return current; // 返回新对象 - }) - .collect(Collectors.toList()); // 收集到列表中 - assetCurrentService.saveBatch(currentNewList); + // 根据资产id查询五张数据 + AssetCurrentCpPo currentCpPo = assetCurrentCpService.findByTaskId(req.getAssetId()); + //删除主表原有数据 + if (currentCpPo != null) { + assetCurrentService.deleteIdList(currentCpPo.getId()); + //将子表数据复制到主表中 + AssetCurrent current = new AssetCurrent(); + BeanUtils.copyProperties(currentCpPo, current); // 复制属性 + current.setId(null); + assetCurrentService.save(current); + } + //AssetBusinessFormCpPo - List bussinessList = assetBusinessFormCpService.findByTaskId(req.getTaskId()); - List bussinessidList = bussinessList.stream() - .map(AssetBusinessFormCpPo::getAssetId) - .collect(Collectors.toList()); + AssetBusinessFormCpPo businessFormCpPo = assetBusinessFormCpService.findByTaskId(req.getAssetId()); //删除原有数据 - if (CollectionUtil.isNotEmpty(bussinessidList)) { - assetBusinessFormService.deleteIdList(bussinessidList); - } - - //将子表数据复制到主表中 - List bussinessNewList = bussinessList.stream() - .map(cpPo -> { - AssetBusinessForm businessForm = new AssetBusinessForm(); - BeanUtils.copyProperties(cpPo, businessForm); // 复制属性 - return businessForm; // 返回新对象 - }) - .collect(Collectors.toList()); // 收集到列表中 - assetBusinessFormService.saveBatch(bussinessNewList); + if (businessFormCpPo != null) { + assetBusinessFormService.deleteIdList(Collections.singletonList(businessFormCpPo.getAssetId())); + //将子表数据复制到主表中 + AssetBusinessForm businessForm = new AssetBusinessForm(); + BeanUtils.copyProperties(businessFormCpPo, businessForm); // 复制属性 + businessForm.setId(null); + assetBusinessFormService.save(businessForm); + } //AssetBasicNetworkCpPo - List netWorkList = assetBasicNetworkCpService.findByTaskId(req.getTaskId()); - List netWorkidList = netWorkList.stream() - .map(AssetBasicNetworkCpPo::getAssetId) - .collect(Collectors.toList()); + AssetBasicNetworkCpPo networkCpPo = assetBasicNetworkCpService.findByTaskId(req.getAssetId()); //删除原有数据 - if (CollectionUtil.isNotEmpty(netWorkidList)) { - assetBasicNetworkService.deleteIdList(netWorkidList); - } - - //将子表数据复制到主表中 - List netWorkNewList = netWorkList.stream() - .map(cpPo -> { - AssetBasicNetwork network = new AssetBasicNetwork(); - BeanUtils.copyProperties(cpPo, network); // 复制属性 - return network; // 返回新对象 - }) - .collect(Collectors.toList()); // 收集到列表中 - assetBasicNetworkService.saveBatch(netWorkNewList); + if (networkCpPo != null) { + assetBasicNetworkService.deleteIdList(Collections.singletonList(networkCpPo.getAssetId())); + AssetBasicNetwork network = new AssetBasicNetwork(); + BeanUtils.copyProperties(networkCpPo, network); + network.setId(null); + assetBasicNetworkService.save(network); + } + //AssetSupplyChainCpPo - List SupplyChainList = assetSupplyChainCpService.findByTaskId(req.getTaskId()); - List SupplyChainidList = SupplyChainList.stream() - .map(AssetSupplyChainCpPo::getAssetId) - .collect(Collectors.toList()); + AssetSupplyChainCpPo supplyChainCpPo = assetSupplyChainCpService.findByTaskId(req.getAssetId()); //删除原有数据 - if (CollectionUtil.isNotEmpty(SupplyChainidList)) { - assetSupplyChainService.deleteIdList(SupplyChainidList); - } - - List SupplyChainNewList = SupplyChainList.stream() - .map(cpPo -> { - AssetSupplyChain supplyChain = new AssetSupplyChain(); - supplyChain.setId(null); - BeanUtils.copyProperties(cpPo, supplyChain); // 复制属性 - return supplyChain; // 返回新对象 - }) - .collect(Collectors.toList()); - assetSupplyChainService.saveBatch(SupplyChainNewList); + if (supplyChainCpPo != null) { + assetSupplyChainService.deleteIdList(Collections.singletonList(supplyChainCpPo.getAssetId())); + AssetSupplyChain supplyChain = new AssetSupplyChain(); + BeanUtils.copyProperties(supplyChainCpPo, supplyChain); + supplyChain.setId(null); + assetSupplyChainService.save(supplyChain); + } + //UnitOtherConcatCpPo - List UnitOtherConcatList = unitOtherConcatCpService.findByTaskId(req.getTaskId()); - List UnitOtherConcatidList = UnitOtherConcatList.stream() - .map(UnitOtherConcatCpPo::getAssetId) - .collect(Collectors.toList()); + UnitOtherConcatCpPo unitOtherConcatCpPo = unitOtherConcatCpService.findByTaskId(req.getAssetId()); //删除原有数据 - if (CollectionUtil.isNotEmpty(UnitOtherConcatidList)) { - unitOtherConcatService.deleteIdList(UnitOtherConcatidList); - } - List UnitOtherConcatNewList = UnitOtherConcatList.stream() - .map(cpPo -> { - UnitOtherConcat unitOtherConcat = new UnitOtherConcat(); - BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性 - return unitOtherConcat; // 返回新对象 - }) - .collect(Collectors.toList()); - unitOtherConcatService.saveBatch(UnitOtherConcatNewList); + if (unitOtherConcatCpPo != null) { + unitOtherConcatService.deleteIdList(Collections.singletonList(unitOtherConcatCpPo.getAssetId())); + UnitOtherConcat unitOtherConcat = new UnitOtherConcat(); + BeanUtils.copyProperties(unitOtherConcatCpPo, unitOtherConcat); // 复制属性 + unitOtherConcat.setConcatId(null); + unitOtherConcatService.save(unitOtherConcat); + } } @Override diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitOtherConcatCpServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitOtherConcatCpServiceImpl.java index 6a7470c..ac55ac6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitOtherConcatCpServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitOtherConcatCpServiceImpl.java @@ -36,7 +36,7 @@ public class UnitOtherConcatCpServiceImpl extends ServiceImpl findByTaskId(int taskId) { - return unitOtherConcatCpMapper.findByTaskId(taskId); + public UnitOtherConcatCpPo findByTaskId(int assetId) { + return unitOtherConcatCpMapper.findByTaskId(assetId); } } diff --git a/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml b/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml index 4ce1422..41ec3d5 100644 --- a/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml @@ -5,10 +5,8 @@ DELETE FROM asset_current - WHERE id IN - - #{id} - + WHERE id =#{id} + diff --git a/ruoyi-admin/src/main/resources/mapper/AssetTaskDao.xml b/ruoyi-admin/src/main/resources/mapper/AssetTaskDao.xml index e3a08e5..18183db 100644 --- a/ruoyi-admin/src/main/resources/mapper/AssetTaskDao.xml +++ b/ruoyi-admin/src/main/resources/mapper/AssetTaskDao.xml @@ -235,7 +235,7 @@ and b.xtlx = #{req.xtlx} - and b.xtmc = #{req.xtmc} + and b.xtmc like concat('%',#{req.xtmc},'%') order by FIELD(status,1,4,3,0,5), b.update_time @@ -472,7 +472,7 @@ and b.status =#{req.status} - and b.xcxmc = #{req.xtmc} + and b.xcxmc like concat('%',#{req.xtmc},'%') @@ -504,7 +504,7 @@ and b.status =#{req.status} - and b.gzhmc = #{req.xtmc} + and b.gzhmc like concat('%',#{req.xtmc},'%') order by FIELD(status,1,4,3,0,5), b.update_time @@ -535,7 +535,7 @@ and b.status =#{req.status} - and b.dzyxhz = #{req.xtmc} + and b.dzyxhz like concat('%',#{req.xtmc},'%') order by FIELD(status,1,4,3,0,5), b.update_time @@ -566,14 +566,12 @@ and b.status =#{req.status} - and b.app_name = #{req.xtmc} + and b.app_name like concat('%',#{req.xtmc},'%') order by FIELD(status,1,4,3,0,5), b.update_time - + select * from asset_task where dwmc like concat('%', #{dwmc}, '%') and task_status=1 - select * from asset_task where id =#{taskId} + + + + update asset_mini_programs_cp