管理端可在资产管理模块编辑资产所属单位信息,并同步至任务中

duhanyu
dongdingding 1 month ago
parent c4b3f52ecc
commit 36e24cc5cd

@ -1,5 +1,6 @@
package com.ruoyi.tc.controller; package com.ruoyi.tc.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.text.ParseException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.Date; import java.util.Date;
@ -236,10 +238,40 @@ public class AssetTaskController extends BaseController {
return AjaxResult.success(assetTaskService.taskSh(taskId, assetId)); return AjaxResult.success(assetTaskService.taskSh(taskId, assetId));
} }
/**
*
*
* @param id id
* @return
*/
@ApiOperation(value = "历史详情信息", response = AssetHistoryResponse.class)
@GetMapping("/history")
public AjaxResult webHistory(@RequestParam("id") Long id, @RequestParam("type") Integer type) {
AssetHistoryResponse assetHistoryResponse = new AssetHistoryResponse();
if (type == 0) {
//web
assetHistoryResponse.setAssetCurrentHistory(assetTaskService.webHistory(id));
} else if (type == 1) {
//小程序资产
assetHistoryResponse.setAssetMiniProgramsHistory(assetTaskService.miniHistory(id));
} else if (type == 2) {
//公众号资产
assetHistoryResponse.setAssetOfficialAccountHistory(assetTaskService.officeHistory(id));
} else if (type == 3) {
//电子邮件资产
assetHistoryResponse.setAssetEmailHistory(assetTaskService.emailHistory(id));
} else if (type == 4) {
//移动应用程序资产
assetHistoryResponse.setAssetAppHistory(assetTaskService.appHistory(id));
}
return AjaxResult.success(assetHistoryResponse);
}
/** /**
* *
* *
* @param taskId id
* @param assetId id * @param assetId id
* @return * @return
*/ */
@ -250,6 +282,7 @@ public class AssetTaskController extends BaseController {
return AjaxResult.success(assetTaskService.minitaskSh(taskId, assetId)); return AjaxResult.success(assetTaskService.minitaskSh(taskId, assetId));
} }
/** /**
* *
* *
@ -279,6 +312,7 @@ public class AssetTaskController extends BaseController {
return AjaxResult.success(assetTaskService.emailtaskSh(taskId, assetId)); return AjaxResult.success(assetTaskService.emailtaskSh(taskId, assetId));
} }
/** /**
* *
* *
@ -293,6 +327,7 @@ public class AssetTaskController extends BaseController {
return AjaxResult.success(assetTaskService.apptaskSh(taskId, assetId)); return AjaxResult.success(assetTaskService.apptaskSh(taskId, assetId));
} }
/** /**
* *
* *
@ -340,7 +375,7 @@ public class AssetTaskController extends BaseController {
} }
StringBuilder a = new StringBuilder(); StringBuilder a = new StringBuilder();
if (!assetCurrent.getGlymList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlymList())) {
assetCurrent.getGlymList().forEach(x -> { assetCurrent.getGlymList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
a.append(x.getKey()); a.append(x.getKey());
@ -350,7 +385,7 @@ public class AssetTaskController extends BaseController {
} }
assetCurrent.setGlym(a.toString()); assetCurrent.setGlym(a.toString());
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
if (!assetCurrent.getGlIpList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlIpList())) {
assetCurrent.getGlIpList().forEach(x -> { assetCurrent.getGlIpList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
b.append(x.getKey()); b.append(x.getKey());
@ -402,7 +437,7 @@ public class AssetTaskController extends BaseController {
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
//新增历史记录 //新增历史记录
StringBuilder c = new StringBuilder(); StringBuilder c = new StringBuilder();
if (!assetCurrent.getGlymList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlymList())) {
assetCurrent.getGlymList().forEach(x -> { assetCurrent.getGlymList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
c.append(x.getKey()); c.append(x.getKey());
@ -412,7 +447,7 @@ public class AssetTaskController extends BaseController {
} }
assetCurrent.setGlym(a.toString()); assetCurrent.setGlym(a.toString());
StringBuilder d = new StringBuilder(); StringBuilder d = new StringBuilder();
if (!assetCurrent.getGlIpList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlIpList())) {
assetCurrent.getGlIpList().forEach(x -> { assetCurrent.getGlIpList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
d.append(x.getKey()); d.append(x.getKey());
@ -435,6 +470,7 @@ public class AssetTaskController extends BaseController {
AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory(); AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory();
assetBusinessFormHistory.setCopyId(assetCurrent.getCurrentId()); assetBusinessFormHistory.setCopyId(assetCurrent.getCurrentId());
BeanUtils.copyProperties(assetCurrent.getXjgywxt(), assetBusinessFormHistory); BeanUtils.copyProperties(assetCurrent.getXjgywxt(), assetBusinessFormHistory);
assetBusinessFormHistory.setBusinessId(null);
assetBusinessFormHistoryService.save(assetBusinessFormHistory); assetBusinessFormHistoryService.save(assetBusinessFormHistory);
} }
@ -450,6 +486,7 @@ public class AssetTaskController extends BaseController {
AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory(); AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory();
assetSupplyChainHistory.setCopyId(assetCurrent.getCurrentId()); assetSupplyChainHistory.setCopyId(assetCurrent.getCurrentId());
BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性 BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性
assetSupplyChainHistory.setSupplyId(null);
return assetSupplyChainHistory; // 返回新对象 return assetSupplyChainHistory; // 返回新对象
}) })
.collect(Collectors.toList()); // 收集到列表中 .collect(Collectors.toList()); // 收集到列表中
@ -467,6 +504,7 @@ public class AssetTaskController extends BaseController {
AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory(); AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory();
assetBasicNetworkHistory.setCopyId(assetCurrent.getCurrentId()); assetBasicNetworkHistory.setCopyId(assetCurrent.getCurrentId());
BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性 BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性
assetBasicNetworkHistory.setNetworkId(null);
return assetBasicNetworkHistory; // 返回新对象 return assetBasicNetworkHistory; // 返回新对象
}) })
.collect(Collectors.toList()); // 收集到列表中 .collect(Collectors.toList()); // 收集到列表中
@ -483,6 +521,7 @@ public class AssetTaskController extends BaseController {
UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory(); UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory();
unitOtherConcatHistory.setCopyId(assetCurrent.getCurrentId()); unitOtherConcatHistory.setCopyId(assetCurrent.getCurrentId());
BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性 BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性
unitOtherConcatHistory.setUnitId(null);
return unitOtherConcatHistory; // 返回新对象 return unitOtherConcatHistory; // 返回新对象
}) })
.collect(Collectors.toList()); // 收集到列表中 .collect(Collectors.toList()); // 收集到列表中
@ -520,7 +559,7 @@ public class AssetTaskController extends BaseController {
// } // }
StringBuilder a = new StringBuilder(); StringBuilder a = new StringBuilder();
if (!assetCurrent.getGlymList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlymList())) {
assetCurrent.getGlymList().forEach(x -> { assetCurrent.getGlymList().forEach(x -> {
a.append(x); a.append(x);
a.append(","); a.append(",");
@ -528,7 +567,7 @@ public class AssetTaskController extends BaseController {
} }
assetCurrent.setGlym(a.toString()); assetCurrent.setGlym(a.toString());
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
if (!assetCurrent.getGlIpList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlIpList())) {
assetCurrent.getGlymList().forEach(x -> { assetCurrent.getGlymList().forEach(x -> {
b.append(x); b.append(x);
b.append(","); b.append(",");
@ -550,7 +589,7 @@ public class AssetTaskController extends BaseController {
assetCurrent.getXjgywxt().setTaskId(assetCurrent.getTaskId()); assetCurrent.getXjgywxt().setTaskId(assetCurrent.getTaskId());
assetBusinessFormJyService.save(assetCurrent.getXjgywxt()); assetBusinessFormJyService.save(assetCurrent.getXjgywxt());
} }
if (!assetCurrent.getGylxxList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGylxxList())) {
for (AssetSupplyChainJyPo items : assetCurrent.getGylxxList()) { for (AssetSupplyChainJyPo items : assetCurrent.getGylxxList()) {
items.setAssetId(assetCurrent.getId()); items.setAssetId(assetCurrent.getId());
items.setTaskId(assetCurrent.getTaskId()); items.setTaskId(assetCurrent.getTaskId());
@ -558,7 +597,7 @@ public class AssetTaskController extends BaseController {
//新增供应链 //新增供应链
assetSupplyChainJyService.saveBatch(assetCurrent.getGylxxList()); assetSupplyChainJyService.saveBatch(assetCurrent.getGylxxList());
} }
if (!assetCurrent.getJcwlList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getJcwlList())) {
for (AssetBasicNetworkJyPo items : assetCurrent.getJcwlList()) { for (AssetBasicNetworkJyPo items : assetCurrent.getJcwlList()) {
items.setAssetId(assetCurrent.getId()); items.setAssetId(assetCurrent.getId());
items.setTaskId(assetCurrent.getTaskId()); items.setTaskId(assetCurrent.getTaskId());
@ -580,7 +619,7 @@ public class AssetTaskController extends BaseController {
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
//新增历史记录 //新增历史记录
StringBuilder c = new StringBuilder(); StringBuilder c = new StringBuilder();
if (!assetCurrent.getGlymList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlymList())) {
assetCurrent.getGlymList().forEach(x -> { assetCurrent.getGlymList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
c.append(x.getKey()); c.append(x.getKey());
@ -590,7 +629,7 @@ public class AssetTaskController extends BaseController {
} }
assetCurrent.setGlym(a.toString()); assetCurrent.setGlym(a.toString());
StringBuilder d = new StringBuilder(); StringBuilder d = new StringBuilder();
if (!assetCurrent.getGlIpList().isEmpty()) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlIpList())) {
assetCurrent.getGlIpList().forEach(x -> { assetCurrent.getGlIpList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
d.append(x.getKey()); d.append(x.getKey());
@ -604,6 +643,7 @@ public class AssetTaskController extends BaseController {
// 设置更新时间 // 设置更新时间
assetCurrent.setUpdateTime(date); assetCurrent.setUpdateTime(date);
BeanUtils.copyProperties(assetCurrent, assetCurrentHistory); BeanUtils.copyProperties(assetCurrent, assetCurrentHistory);
assetCurrentHistory.setCurrentId(null);
assetCurrentHistoryService.save(assetCurrentHistory); assetCurrentHistoryService.save(assetCurrentHistory);
//新增新监管业务形态历史表 //新增新监管业务形态历史表
@ -613,6 +653,7 @@ public class AssetTaskController extends BaseController {
AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory(); AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory();
assetBusinessFormHistory.setCopyId(assetCurrent.getCurrentId()); assetBusinessFormHistory.setCopyId(assetCurrent.getCurrentId());
BeanUtils.copyProperties(assetCurrent.getXjgywxt(), assetBusinessFormHistory); BeanUtils.copyProperties(assetCurrent.getXjgywxt(), assetBusinessFormHistory);
assetBusinessFormHistory.setBusinessId(null);
assetBusinessFormHistoryService.save(assetBusinessFormHistory); assetBusinessFormHistoryService.save(assetBusinessFormHistory);
} }
@ -628,6 +669,7 @@ public class AssetTaskController extends BaseController {
AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory(); AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory();
assetSupplyChainHistory.setCopyId(assetCurrent.getCurrentId()); assetSupplyChainHistory.setCopyId(assetCurrent.getCurrentId());
BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性 BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性
assetSupplyChainHistory.setSupplyId(null);
return assetSupplyChainHistory; // 返回新对象 return assetSupplyChainHistory; // 返回新对象
}) })
.collect(Collectors.toList()); // 收集到列表中 .collect(Collectors.toList()); // 收集到列表中
@ -645,6 +687,7 @@ public class AssetTaskController extends BaseController {
AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory(); AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory();
assetBasicNetworkHistory.setCopyId(assetCurrent.getCurrentId()); assetBasicNetworkHistory.setCopyId(assetCurrent.getCurrentId());
BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性 BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性
assetBasicNetworkHistory.setNetworkId(null);
return assetBasicNetworkHistory; // 返回新对象 return assetBasicNetworkHistory; // 返回新对象
}) })
.collect(Collectors.toList()); // 收集到列表中 .collect(Collectors.toList()); // 收集到列表中
@ -661,6 +704,7 @@ public class AssetTaskController extends BaseController {
UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory(); UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory();
unitOtherConcatHistory.setCopyId(assetCurrent.getCurrentId()); unitOtherConcatHistory.setCopyId(assetCurrent.getCurrentId());
BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性 BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性
unitOtherConcatHistory.setConcatId(null);
return unitOtherConcatHistory; // 返回新对象 return unitOtherConcatHistory; // 返回新对象
}) })
.collect(Collectors.toList()); // 收集到列表中 .collect(Collectors.toList()); // 收集到列表中
@ -678,7 +722,7 @@ public class AssetTaskController extends BaseController {
*/ */
@ApiOperation(value = "管理端审核") @ApiOperation(value = "管理端审核")
@PostMapping("/sh") @PostMapping("/sh")
public AjaxResult sh(@RequestBody @Validated AssetCurrentShRequest req) { public AjaxResult sh(@RequestBody @Validated AssetCurrentShRequest req) throws ParseException {
return AjaxResult.success(assetTaskService.sh(req)); return AjaxResult.success(assetTaskService.sh(req));
} }
@ -749,6 +793,7 @@ public class AssetTaskController extends BaseController {
//新增历史记录表 //新增历史记录表
AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory(); AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory();
BeanUtils.copyProperties(assetMiniProgramsCpPo, assetMiniProgramsHistory); BeanUtils.copyProperties(assetMiniProgramsCpPo, assetMiniProgramsHistory);
assetMiniProgramsHistory.setMiniId(null);
assetMiniProgramsHistoryService.save(assetMiniProgramsHistory); assetMiniProgramsHistoryService.save(assetMiniProgramsHistory);
return success(); return success();
} }
@ -808,6 +853,7 @@ public class AssetTaskController extends BaseController {
//新增历史记录表 //新增历史记录表
AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory(); AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory();
BeanUtils.copyProperties(assetOfficialAccountCpPo, assetOfficialAccountHistory); BeanUtils.copyProperties(assetOfficialAccountCpPo, assetOfficialAccountHistory);
assetOfficialAccountHistory.setAccountId(null);
assetOfficialAccountHistoryService.save(assetOfficialAccountHistory); assetOfficialAccountHistoryService.save(assetOfficialAccountHistory);
return success(); return success();
} }
@ -848,6 +894,7 @@ public class AssetTaskController extends BaseController {
//新增历史记录表 //新增历史记录表
AssetAppHistory assetAppHistory = new AssetAppHistory(); AssetAppHistory assetAppHistory = new AssetAppHistory();
BeanUtils.copyProperties(assetAppCpPo, assetAppHistory); BeanUtils.copyProperties(assetAppCpPo, assetAppHistory);
assetAppHistory.setAppId(null);
assetAppHistoryService.save(assetAppHistory); assetAppHistoryService.save(assetAppHistory);
return success(); return success();
} }
@ -888,6 +935,7 @@ public class AssetTaskController extends BaseController {
//新增历史记录表 //新增历史记录表
AssetEmailHistory assetEmailHistory = new AssetEmailHistory(); AssetEmailHistory assetEmailHistory = new AssetEmailHistory();
BeanUtils.copyProperties(assetEmailCpPo, assetEmailHistory); BeanUtils.copyProperties(assetEmailCpPo, assetEmailHistory);
assetEmailHistory.setEmailId(null);
assetEmailHistoryService.save(assetEmailHistory); assetEmailHistoryService.save(assetEmailHistory);
return success(); return success();
} }
@ -920,6 +968,7 @@ public class AssetTaskController extends BaseController {
//新增历史记录表 //新增历史记录表
AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory(); AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory();
BeanUtils.copyProperties(assetMiniProgramsJyPo, assetMiniProgramsHistory); BeanUtils.copyProperties(assetMiniProgramsJyPo, assetMiniProgramsHistory);
assetMiniProgramsHistory.setMiniId(null);
assetMiniProgramsHistoryService.save(assetMiniProgramsHistory); assetMiniProgramsHistoryService.save(assetMiniProgramsHistory);
return success(); return success();
} }
@ -971,6 +1020,7 @@ public class AssetTaskController extends BaseController {
//新增历史记录表 //新增历史记录表
AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory(); AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory();
BeanUtils.copyProperties(assetOfficialAccountJyPo, assetOfficialAccountHistory); BeanUtils.copyProperties(assetOfficialAccountJyPo, assetOfficialAccountHistory);
assetOfficialAccountHistory.setAccountId(null);
assetOfficialAccountHistoryService.save(assetOfficialAccountHistory); assetOfficialAccountHistoryService.save(assetOfficialAccountHistory);
return success(); return success();
} }
@ -1004,6 +1054,7 @@ public class AssetTaskController extends BaseController {
//新增历史记录表 //新增历史记录表
AssetAppHistory assetAppHistory = new AssetAppHistory(); AssetAppHistory assetAppHistory = new AssetAppHistory();
BeanUtils.copyProperties(assetAppJyPo, assetAppHistory); BeanUtils.copyProperties(assetAppJyPo, assetAppHistory);
assetAppHistory.setAppId(null);
assetAppHistoryService.save(assetAppHistory); assetAppHistoryService.save(assetAppHistory);
return success(); return success();
} }
@ -1037,6 +1088,7 @@ public class AssetTaskController extends BaseController {
//新增历史记录表 //新增历史记录表
AssetEmailHistory assetEmailHistory = new AssetEmailHistory(); AssetEmailHistory assetEmailHistory = new AssetEmailHistory();
BeanUtils.copyProperties(assetEmailJyPo, assetEmailHistory); BeanUtils.copyProperties(assetEmailJyPo, assetEmailHistory);
assetEmailHistory.setEmailId(null);
assetEmailHistoryService.save(assetEmailHistory); assetEmailHistoryService.save(assetEmailHistory);
return success(); return success();
} }
@ -1083,29 +1135,28 @@ public class AssetTaskController extends BaseController {
@ApiOperation(value = "资产提交记录", response = AssetzcTjResponse.class) @ApiOperation(value = "资产提交记录", response = AssetzcTjResponse.class)
@PostMapping("/zcTj") @PostMapping("/zcTj")
public AjaxResult zcTj(@RequestBody AssetzcTjRequest req) { public AjaxResult zcTj(@RequestBody AssetzcTjRequest req) {
AssetzcTjResponse assetzcTjResponse = new AssetzcTjResponse();
List<AssetzcTjResponse> list = null;
if (req.getType() == 0) { if (req.getType() == 0) {
//web //web
AssetCurrentHistory assetCurrentHistory = assetCurrentHistoryService.findByTaskIdandAssetId(req); list = assetCurrentHistoryService.findByTaskIdandAssetId(req);
assetzcTjResponse.setAssetCurrentHistory(assetCurrentHistory);
} else if (req.getType() == 1) { } else if (req.getType() == 1) {
//小程序资产 //小程序资产
AssetMiniProgramsHistory assetMiniProgramsHistory = assetMiniProgramsHistoryService.findByTaskIdandAssetId(req); list = assetMiniProgramsHistoryService.findByTaskIdandAssetId(req);
assetzcTjResponse.setAssetMiniProgramsHistory(assetMiniProgramsHistory);
} else if (req.getType() == 2) { } else if (req.getType() == 2) {
//公众号资产 //公众号资产
AssetOfficialAccountHistory assetOfficialAccountHistory = assetOfficialAccountHistoryService.findByTaskIdandAssetId(req); list = assetOfficialAccountHistoryService.findByTaskIdandAssetId(req);
assetzcTjResponse.setAssetOfficialAccountHistory(assetOfficialAccountHistory);
} else if (req.getType() == 3) { } else if (req.getType() == 3) {
//电子邮件资产 //电子邮件资产
AssetEmailHistory assetEmailHistory = assetEmailHistoryService.findByTaskIdandAssetId(req); list = assetEmailHistoryService.findByTaskIdandAssetId(req);
assetzcTjResponse.setAssetEmailHistory(assetEmailHistory);
} else if (req.getType() == 4) { } else if (req.getType() == 4) {
//移动应用程序资产 //移动应用程序资产
AssetAppHistory assetAppHistory = assetAppHistoryService.findByTaskIdandAssetId(req); list = assetAppHistoryService.findByTaskIdandAssetId(req);
assetzcTjResponse.setAssetAppHistory(assetAppHistory);
} }
return AjaxResult.success(assetzcTjResponse); return AjaxResult.success(list);
} }
} }

@ -43,7 +43,7 @@ import java.util.stream.Collectors;
*/ */
@Api(tags = "单位表控制层") @Api(tags = "单位表控制层")
@RestController @RestController
@PreAuthorize("@ss.hasAnyRoles('admin,common')") //@PreAuthorize("@ss.hasAnyRoles('admin,common')")
@RequestMapping("/tc/unit") @RequestMapping("/tc/unit")
public class UnitController { public class UnitController {
@Resource @Resource
@ -440,10 +440,9 @@ public class UnitController {
*/ */
@ApiOperation(value = "单位列表过滤", response = Unit.class) @ApiOperation(value = "单位列表过滤", response = Unit.class)
@GetMapping("/dwList") @GetMapping("/dwList")
public AjaxResult dwList(UnitRequest unit) { public AjaxResult dwList(Page<Unit>page, UnitRequest request) {
Page<Unit> page = new Page<>();
page.setSize(unit.getSize());
page.setCurrent(unit.getCurrent()); return AjaxResult.success(unitService.dwList(page,request));
return AjaxResult.success(unitService.dwList(page, unit));
} }
} }

@ -1,14 +1,17 @@
package com.ruoyi.tc.entity.history; package com.ruoyi.tc.entity.history;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.tc.baseClass.BaseClass; import com.ruoyi.tc.baseClass.BaseClass;
import com.ruoyi.tc.entity.request.AssetOfficialAccountMenu;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* (asset_official_account_history) * (asset_official_account_history)
@ -189,4 +192,12 @@ public class AssetOfficialAccountHistory extends BaseClass implements Serializab
@ApiModelProperty("单位自己编辑的 不通过原因") @ApiModelProperty("单位自己编辑的 不通过原因")
private String auditYy; private String auditYy;
/**
*
*/
@TableField(exist = false)
@ApiModelProperty("菜单类型")
private List<AssetOfficialAccountMenu> cdList;
} }

@ -12,6 +12,7 @@ import lombok.Data;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -112,11 +113,11 @@ public class AssetCurrentCpPo extends BaseClass implements Serializable {
@ApiModelProperty("关联域名list") @ApiModelProperty("关联域名list")
@TableField(exist = false) @TableField(exist = false)
private List<Acomma> glymList; private List<Acomma> glymList = new ArrayList<>();
@ApiModelProperty("关联iplist") @ApiModelProperty("关联iplist")
@TableField(exist = false) @TableField(exist = false)
private List<Acomma> glIpList; private List<Acomma> glIpList = new ArrayList<>();
/** /**

@ -3,15 +3,18 @@ package com.ruoyi.tc.entity.request;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
/** /**
* *
*
* @author du * @author du
* @since 2024/11/13 16:52 * @since 2024/11/13 16:52
*/ */
@Data @Data
public class UnitRequest { public class UnitRequest implements Serializable {
private static final long serialVersionUID = 7435831888175099189L;
// @ApiModelProperty("1 查询已有资产的单位") // @ApiModelProperty("1 查询已有资产的单位")
// private String isSearch; // private String isSearch;
@ -28,10 +31,10 @@ public class UnitRequest {
private String dwlx; private String dwlx;
@ApiModelProperty("页码") @ApiModelProperty("页码")
private Long current=1L; private Long current = 1L;
@ApiModelProperty("页数") @ApiModelProperty("页数")
private Long size=10L; private Long size = 10L;
/** /**
* *

@ -0,0 +1,35 @@
package com.ruoyi.tc.entity.response;
import com.ruoyi.tc.entity.history.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dong
* @since 2025/1/14 10:58
*/
@Data
@ApiModel("历史详情信息")
public class AssetHistoryResponse {
@ApiModelProperty("APP历史详情")
private AssetAppHistory assetAppHistory;
@ApiModelProperty("web历史详情")
private AssetCurrentHistory assetCurrentHistory;
@ApiModelProperty("gzh历史详情")
private AssetOfficialAccountHistory assetOfficialAccountHistory;
@ApiModelProperty("小程序历史详情")
private AssetMiniProgramsHistory assetMiniProgramsHistory;
@ApiModelProperty("邮件历史详情")
private AssetEmailHistory assetEmailHistory;
}

@ -1,9 +1,15 @@
package com.ruoyi.tc.entity.response; package com.ruoyi.tc.entity.response;
import com.ruoyi.tc.entity.history.*; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.Date;
/** /**
* @author dong * @author dong
@ -13,17 +19,20 @@ import lombok.Data;
@Api("资产提交响应类") @Api("资产提交响应类")
public class AssetzcTjResponse { public class AssetzcTjResponse {
@ApiModelProperty("web资产历史类") @ApiModelProperty("系统名称")
private AssetCurrentHistory assetCurrentHistory; private String xtmc;
@ApiModelProperty("提交时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@ApiModelProperty("小程序资产历史类") @ApiModelProperty("提交状态")
private AssetMiniProgramsHistory assetMiniProgramsHistory; private Integer status;
@ApiModelProperty("公众号资产历史类") @ApiModelProperty("历史id")
private AssetOfficialAccountHistory assetOfficialAccountHistory; private Long id;
@ApiModelProperty("电子邮件资产历史类")
private AssetEmailHistory assetEmailHistory;
@ApiModelProperty("资产移动应用程序历史类")
private AssetAppHistory assetAppHistory;
} }

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.history.AssetAppHistory; import com.ruoyi.tc.entity.history.AssetAppHistory;
import com.ruoyi.tc.entity.history.AssetCurrentHistory; import com.ruoyi.tc.entity.history.AssetCurrentHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import java.util.List;
/** /**
* (asset_app_history) * (asset_app_history)
@ -21,5 +24,5 @@ public interface AssetAppHistoryService extends IService<AssetAppHistory> {
* @param req * @param req
* @return * @return
*/ */
AssetAppHistory findByTaskIdandAssetId(AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req);
} }

@ -3,6 +3,9 @@ package com.ruoyi.tc.historyService;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.history.AssetCurrentHistory; import com.ruoyi.tc.entity.history.AssetCurrentHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import java.util.List;
/** /**
* (asset_current_history) * (asset_current_history)
@ -18,7 +21,7 @@ public interface AssetCurrentHistoryService extends IService<AssetCurrentHistory
* @param req * @param req
* @return * @return
*/ */
AssetCurrentHistory findByTaskIdandAssetId(AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req);
} }

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.history.AssetCurrentHistory; import com.ruoyi.tc.entity.history.AssetCurrentHistory;
import com.ruoyi.tc.entity.history.AssetEmailHistory; import com.ruoyi.tc.entity.history.AssetEmailHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import java.util.List;
/** /**
* (asset_email_history) * (asset_email_history)
@ -20,5 +23,5 @@ public interface AssetEmailHistoryService extends IService<AssetEmailHistory> {
* @param req * @param req
* @return * @return
*/ */
AssetEmailHistory findByTaskIdandAssetId(AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req);
} }

@ -3,6 +3,9 @@ package com.ruoyi.tc.historyService;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory; import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import java.util.List;
/** /**
* (asset_mini_programs_history) * (asset_mini_programs_history)
@ -19,5 +22,5 @@ public interface AssetMiniProgramsHistoryService extends IService<AssetMiniProgr
* @param req * @param req
* @return * @return
*/ */
AssetMiniProgramsHistory findByTaskIdandAssetId(AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req);
} }

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.history.AssetCurrentHistory; import com.ruoyi.tc.entity.history.AssetCurrentHistory;
import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory; import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import java.util.List;
/** /**
* (asset_official_account_history) * (asset_official_account_history)
@ -22,7 +25,7 @@ public interface AssetOfficialAccountHistoryService extends IService<AssetOffici
* @param req * @param req
* @return * @return
*/ */
AssetOfficialAccountHistory findByTaskIdandAssetId(AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req);
} }

@ -3,11 +3,13 @@ package com.ruoyi.tc.historyService.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.history.AssetAppHistory; import com.ruoyi.tc.entity.history.AssetAppHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import com.ruoyi.tc.historyService.AssetAppHistoryService; import com.ruoyi.tc.historyService.AssetAppHistoryService;
import com.ruoyi.tc.mapper.history.AssetAppHistoryMapper; import com.ruoyi.tc.mapper.history.AssetAppHistoryMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* (asset_app_history) * (asset_app_history)
@ -22,7 +24,7 @@ public class AssetAppHistoryServiceImpl extends ServiceImpl<AssetAppHistoryMappe
private AssetAppHistoryMapper assetAppHistoryMapper; private AssetAppHistoryMapper assetAppHistoryMapper;
@Override @Override
public AssetAppHistory findByTaskIdandAssetId(AssetzcTjRequest req) { public List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req) {
return assetAppHistoryMapper.findByTaskIdandAssetId(req); return assetAppHistoryMapper.findByTaskIdandAssetId(req);
} }
} }

@ -3,11 +3,13 @@ package com.ruoyi.tc.historyService.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.history.AssetCurrentHistory; import com.ruoyi.tc.entity.history.AssetCurrentHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import com.ruoyi.tc.historyService.AssetCurrentHistoryService; import com.ruoyi.tc.historyService.AssetCurrentHistoryService;
import com.ruoyi.tc.mapper.history.AssetCurrentHistoryMapper; import com.ruoyi.tc.mapper.history.AssetCurrentHistoryMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* (asset_current_history) * (asset_current_history)
@ -23,7 +25,7 @@ public class AssetCurrentHistoryServiceImpl extends ServiceImpl<AssetCurrentHist
private AssetCurrentHistoryMapper assetCurrentHistoryMapper; private AssetCurrentHistoryMapper assetCurrentHistoryMapper;
@Override @Override
public AssetCurrentHistory findByTaskIdandAssetId(AssetzcTjRequest req) { public List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req) {
return assetCurrentHistoryMapper.findByTaskIdandAssetId(req); return assetCurrentHistoryMapper.findByTaskIdandAssetId(req);
} }
} }

@ -3,11 +3,13 @@ package com.ruoyi.tc.historyService.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.history.AssetEmailHistory; import com.ruoyi.tc.entity.history.AssetEmailHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import com.ruoyi.tc.historyService.AssetEmailHistoryService; import com.ruoyi.tc.historyService.AssetEmailHistoryService;
import com.ruoyi.tc.mapper.history.AssetEmailHistoryMapper; import com.ruoyi.tc.mapper.history.AssetEmailHistoryMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* (asset_email_history) * (asset_email_history)
@ -21,7 +23,7 @@ public class AssetEmailHistoryServiceImpl extends ServiceImpl<AssetEmailHistoryM
private AssetEmailHistoryMapper assetEmailHistoryMapper; private AssetEmailHistoryMapper assetEmailHistoryMapper;
@Override @Override
public AssetEmailHistory findByTaskIdandAssetId(AssetzcTjRequest req) { public List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req) {
return assetEmailHistoryMapper.findByTaskIdandAssetId(req); return assetEmailHistoryMapper.findByTaskIdandAssetId(req);
} }
} }

@ -3,11 +3,13 @@ package com.ruoyi.tc.historyService.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory; import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import com.ruoyi.tc.historyService.AssetMiniProgramsHistoryService; import com.ruoyi.tc.historyService.AssetMiniProgramsHistoryService;
import com.ruoyi.tc.mapper.history.AssetMiniProgramsHistoryMapper; import com.ruoyi.tc.mapper.history.AssetMiniProgramsHistoryMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* (asset_mini_programs_history) * (asset_mini_programs_history)
@ -20,7 +22,7 @@ public class AssetMiniProgramsHistoryServiceImpl extends ServiceImpl<AssetMiniPr
@Resource @Resource
private AssetMiniProgramsHistoryMapper assetMiniProgramsHistoryMapper; private AssetMiniProgramsHistoryMapper assetMiniProgramsHistoryMapper;
@Override @Override
public AssetMiniProgramsHistory findByTaskIdandAssetId(AssetzcTjRequest req) { public List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req) {
return assetMiniProgramsHistoryMapper.findByTaskIdandAssetId(req); return assetMiniProgramsHistoryMapper.findByTaskIdandAssetId(req);
} }
} }

@ -3,11 +3,13 @@ package com.ruoyi.tc.historyService.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory; import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import com.ruoyi.tc.historyService.AssetOfficialAccountHistoryService; import com.ruoyi.tc.historyService.AssetOfficialAccountHistoryService;
import com.ruoyi.tc.mapper.history.AssetOfficialAccountHistoryMapper; import com.ruoyi.tc.mapper.history.AssetOfficialAccountHistoryMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* (asset_official_account_history) * (asset_official_account_history)
@ -20,7 +22,7 @@ public class AssetOfficialAccountHistoryServiceImpl extends ServiceImpl<AssetOff
@Resource @Resource
private AssetOfficialAccountHistoryMapper assetOfficialAccountHistoryMapper; private AssetOfficialAccountHistoryMapper assetOfficialAccountHistoryMapper;
@Override @Override
public AssetOfficialAccountHistory findByTaskIdandAssetId(AssetzcTjRequest req) { public List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req) {
return assetOfficialAccountHistoryMapper.findByTaskIdandAssetId(req); return assetOfficialAccountHistoryMapper.findByTaskIdandAssetId(req);
} }
} }

@ -17,14 +17,14 @@ import java.util.List;
public interface AssetBasicNetWorkCpMapper extends BaseMapper<AssetBasicNetworkCpPo> { public interface AssetBasicNetWorkCpMapper extends BaseMapper<AssetBasicNetworkCpPo> {
/** /**
* idid * idid
* *
* @param assetId id * @param taskId id
* @return * @return
*/ */
@Select("select a.* from asset_basic_network a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId} ")
List<AssetBasicNetworkCpPo> findByassetId(String taskId);
@Select("select * from asset_basic_network where asset_id=#{assetId} ")
List<AssetBasicNetworkCpPo> findByassetId(Long assetId);
/** /**
@ -36,16 +36,16 @@ public interface AssetBasicNetWorkCpMapper extends BaseMapper<AssetBasicNetworkC
@Delete("delete from asset_basic_network_cp where asset_id=#{assetId} and task_id =#{taskId} ") @Delete("delete from asset_basic_network_cp where asset_id=#{assetId} and task_id =#{taskId} ")
void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") int taskId); void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") int taskId);
/** /**
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @param taskId id
* @return * @return
*/ */
@Select("select * from asset_basic_network_cp where asset_id=#{assetId}") @Select("select * from asset_basic_network_cp where asset_id=#{assetId} and task_id =#{taskId}")
AssetBasicNetworkCpPo findByTaskId(int assetId); List<AssetBasicNetworkCpPo> findByTaskId(@Param("assetId") int assetId, @Param("taskId") int taskId);
/** /**

@ -18,13 +18,15 @@ public interface AssetBusinessFormCpMapper extends BaseMapper<AssetBusinessFormC
/** /**
* idid * idid
* *
* @param assetId id * @param taskId id
* @return * @return
*/ */
@Select("select * from asset_business_form where asset_id =#{assetId}") @Select("select a.* from asset_business_form a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId} ")
List<AssetBusinessFormCpPo> findByassetId(Long assetId); List<AssetBusinessFormCpPo> findByassetId(String taskId);
/** /**
@ -45,14 +47,15 @@ public interface AssetBusinessFormCpMapper extends BaseMapper<AssetBusinessFormC
@Delete("delete from asset_business_form_cp where asset_id=#{assetId} ") @Delete("delete from asset_business_form_cp where asset_id=#{assetId} ")
void deletByAssetId(@Param("assetId") Long assetId); void deletByAssetId(@Param("assetId") Long assetId);
/** /**
* id * assetId
* *
* @param assetId id * @param assetId id
* @param taskId id
* @return * @return
*/ */
@Select("select * from asset_business_form_cp where asset_id=#{assetId}") @Select("select * from asset_business_form_cp where asset_id=#{assetId} and task_id =#{taskId}")
AssetBusinessFormCpPo findByTaskId(int assetId); List<AssetBusinessFormCpPo> findByTaskId(@Param("assetId") int assetId, @Param("taskId") int taskId);
} }

@ -26,15 +26,16 @@ public interface AssetCurrentCpMapper extends BaseMapper<AssetCurrentCpPo> {
@Delete("delete from asset_current_cp where id=#{assetId} and task_id =#{taskId} ") @Delete("delete from asset_current_cp where 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
* *
* @param assetId id * @param assetId id
* @param taskId id
* @return * @return
*/ */
@Select("select * from asset_current_cp where id=#{assetId}") @Select("select * from asset_current_cp where id=#{assetId} and task_id =#{taskId}")
AssetCurrentCpPo findByTaskId(int assetId); AssetCurrentCpPo findByTaskId(@Param("assetId") int assetId, @Param("taskId") int taskId);
/** /**

@ -41,7 +41,7 @@ public interface AssetEmailCpMapper extends BaseMapper<AssetEmailCpPo> {
* @return * @return
*/ */
@Select("select * from asset_email_cp where asset_id=#{assetId}") @Select("select * from asset_email_cp where asset_id=#{assetId}")
AssetEmailCpPo findByTaskId(@Param("taskId") int assetId); AssetEmailCpPo findByTaskId(@Param("assetId") int assetId);
/** /**

@ -1,7 +1,6 @@
package com.ruoyi.tc.mapper; package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo; import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -19,13 +18,14 @@ public interface AssetSupplyChainCpMapper extends BaseMapper<AssetSupplyChainCpP
/** /**
* idid * idid
* *
* @param assetId id * @param taskId id
* @return * @return
*/ */
@Select("select * from asset_supply_chain where asset_id=#{assetId}") @Select("select a.* from asset_supply_chain a left join asset_current_cp b on a.asset_id =b.id where b.task_id=#{taskId}")
List<AssetSupplyChainCpPo> findByassetId(Long assetId); List<AssetSupplyChainCpPo> findByassetId(String taskId);
/** /**
@ -35,7 +35,7 @@ public interface AssetSupplyChainCpMapper extends BaseMapper<AssetSupplyChainCpP
* @param taskId id * @param taskId id
*/ */
@Delete("delete from asset_supply_chain_cp where asset_id=#{assetId} and task_id =#{taskId} ") @Delete("delete from asset_supply_chain_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);
/** /**
* idid * idid
@ -43,16 +43,17 @@ public interface AssetSupplyChainCpMapper extends BaseMapper<AssetSupplyChainCpP
* @param assetId id * @param assetId id
*/ */
@Delete("delete from asset_supply_chain_cp where asset_id=#{assetId} ") @Delete("delete from asset_supply_chain_cp where asset_id=#{assetId} ")
void deletByAssetId(@Param("assetId")Long assetId); void deletByAssetId(@Param("assetId") Long assetId);
/** /**
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @param taskId id
* @return * @return
*/ */
@Select("select * from asset_supply_chain_cp where asset_id=#{assetId}") @Select("select * from asset_supply_chain_cp where asset_id=#{assetId} and task_id=#{taskId}")
AssetSupplyChainCpPo findByTaskId(int assetId); List<AssetSupplyChainCpPo> findByTaskId(@Param("assetId") int assetId,@Param("taskId") int taskId);
} }

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

@ -3,8 +3,11 @@ package com.ruoyi.tc.mapper.history;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.history.AssetAppHistory; import com.ruoyi.tc.entity.history.AssetAppHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* (asset_app_history)访 * (asset_app_history)访
* *
@ -20,8 +23,8 @@ public interface AssetAppHistoryMapper extends BaseMapper<AssetAppHistory> {
* @param req * @param req
* @return * @return
*/ */
@Select("select * from asset_app_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") @Select("select app_name as xtmc,update_time as updateTime,status, app_id as id from asset_app_history where task_id= #{req.taskId} and asset_id =#{req.assetId} and status!=0")
AssetAppHistory findByTaskIdandAssetId(AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(AssetzcTjRequest req);
} }

@ -3,9 +3,12 @@ package com.ruoyi.tc.mapper.history;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.history.AssetCurrentHistory; import com.ruoyi.tc.entity.history.AssetCurrentHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* (asset_current_history)访 * (asset_current_history)访
* *
@ -22,7 +25,7 @@ public interface AssetCurrentHistoryMapper extends BaseMapper<AssetCurrentHistor
* @param req * @param req
* @return * @return
*/ */
@Select("select * from asset_mini_programs_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") @Select("select xtmc,update_time as updateTime,status,current_id as id from asset_current_history where task_id= #{req.taskId} and id =#{req.assetId} and status!=0")
AssetCurrentHistory findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req);
} }

@ -3,9 +3,12 @@ package com.ruoyi.tc.mapper.history;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.history.AssetEmailHistory; import com.ruoyi.tc.entity.history.AssetEmailHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* (asset_email_cp)访 * (asset_email_cp)访
* *
@ -21,7 +24,7 @@ public interface AssetEmailHistoryMapper extends BaseMapper<AssetEmailHistory> {
* @param req * @param req
* @return * @return
*/ */
@Select("select * from asset_email_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") @Select("select dzyxhz as xtmc, update_time as updateTime,status,email_id as id from asset_email_history where task_id= #{req.taskId} and asset_id =#{req.assetId} and status!=0")
AssetEmailHistory findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req);
} }

@ -3,9 +3,12 @@ package com.ruoyi.tc.mapper.history;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory; import com.ruoyi.tc.entity.history.AssetMiniProgramsHistory;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* (asset_mini_programs_history)访 * (asset_mini_programs_history)访
* *
@ -21,7 +24,7 @@ public interface AssetMiniProgramsHistoryMapper extends BaseMapper<AssetMiniProg
* @param req * @param req
* @return * @return
*/ */
@Select("select * from asset_current_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") @Select("select xcxmc as xtmc,update_time as updateTime,status,mini_id as id from asset_mini_programs_history where task_id= #{req.taskId} and asset_id =#{req.assetId} and status!=0")
AssetMiniProgramsHistory findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req);
} }

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory; import com.ruoyi.tc.entity.history.AssetOfficialAccountHistory;
import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo; import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo;
import com.ruoyi.tc.entity.request.AssetzcTjRequest; import com.ruoyi.tc.entity.request.AssetzcTjRequest;
import com.ruoyi.tc.entity.response.AssetzcTjResponse;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -26,7 +27,7 @@ public interface AssetOfficialAccountHistoryMapper extends BaseMapper<AssetOffic
* @param req * @param req
* @return * @return
*/ */
@Select("select * from asset_official_account_history where task_id= #{req.taskId} and asset_id =#{req.assetId}") @Select("select gzhmc as xtmc,update_time as updateTime,status,account_id as id from asset_official_account_history where task_id= #{req.taskId} and asset_id =#{req.assetId} and status!=0")
AssetOfficialAccountHistory findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req); List<AssetzcTjResponse> findByTaskIdandAssetId(@Param("req") AssetzcTjRequest req);
} }

@ -2,7 +2,6 @@ package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo; import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
import com.ruoyi.tc.entity.po.AssetBusinessFormCpPo;
import java.util.List; import java.util.List;
@ -15,13 +14,12 @@ import java.util.List;
public interface AssetBasicNetworkCpService extends IService<AssetBasicNetworkCpPo> { public interface AssetBasicNetworkCpService extends IService<AssetBasicNetworkCpPo> {
/** /**
* idid * idid
* *
* @param assetId id * @param taskId id
* @return * @return
*/ */
List<AssetBasicNetworkCpPo> findByassetId(Long assetId); List<AssetBasicNetworkCpPo> findByassetId(String taskId);
/** /**
@ -30,24 +28,23 @@ public interface AssetBasicNetworkCpService extends IService<AssetBasicNetworkCp
* @param assetId id * @param assetId id
* @param taskId id * @param taskId id
*/ */
void deletByAssetIdandTaskId(Long assetId, Integer taskId); void deletByAssetIdandTaskId(Long assetId, Integer taskId);
/** /**
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @param taskId id
* @return * @return
*/ */
AssetBasicNetworkCpPo findByTaskId(int assetId); List<AssetBasicNetworkCpPo> findByTaskId(int assetId, int taskId);
/** /**
* idid * idid
* *
* @param assetId id * @param assetId id
*/ */
void deletByAssetId(Long assetId); void deletByAssetId(Long assetId);
} }

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

@ -1,10 +1,7 @@
package com.ruoyi.tc.service; package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.AssetCurrent;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo; import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import java.util.List; import java.util.List;
@ -30,9 +27,10 @@ public interface AssetCurrentCpService extends IService<AssetCurrentCpPo> {
* id * id
* *
* @param assetId id * @param assetId id
* @param taskId id
* @return * @return
*/ */
AssetCurrentCpPo findByTaskId(int assetId); AssetCurrentCpPo findByTaskId(int assetId, int taskId);
/** /**
@ -56,7 +54,6 @@ public interface AssetCurrentCpService extends IService<AssetCurrentCpPo> {
AssetCurrentCpPo findByassetIdandTaskId(Integer assetId, Integer taskId); AssetCurrentCpPo findByassetIdandTaskId(Integer assetId, Integer taskId);
/** /**
* id * id
* *
@ -66,7 +63,6 @@ public interface AssetCurrentCpService extends IService<AssetCurrentCpPo> {
List<AssetCurrentCpPo> findDwmc(Long id); List<AssetCurrentCpPo> findDwmc(Long id);
/** /**
* idid * idid
* *

@ -1,7 +1,6 @@
package com.ruoyi.tc.service; package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo; import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import java.util.List; import java.util.List;
@ -15,23 +14,22 @@ import java.util.List;
public interface AssetSupplyChainCpService extends IService<AssetSupplyChainCpPo> { public interface AssetSupplyChainCpService extends IService<AssetSupplyChainCpPo> {
/** /**
* idid * idid
* *
* @param assetId id * @param taskId id
* @return * @return
*/ */
List<AssetSupplyChainCpPo> findByassetId(Long assetId); List<AssetSupplyChainCpPo> findByassetId(String taskId);
/** /**
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @param taskId id
* @return * @return
*/ */
AssetSupplyChainCpPo findByTaskId(int assetId); List<AssetSupplyChainCpPo> findByTaskId(int assetId, int taskId);
/** /**
@ -43,7 +41,6 @@ public interface AssetSupplyChainCpService extends IService<AssetSupplyChainCpPo
void deletByAssetIdandTaskId(Long assetId, Integer taskId); void deletByAssetIdandTaskId(Long assetId, Integer taskId);
/** /**
* idid * idid
* *

@ -3,6 +3,7 @@ package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.history.*;
import com.ruoyi.tc.entity.po.*; import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest; import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
import com.ruoyi.tc.entity.request.AssetCurrentShRequest; import com.ruoyi.tc.entity.request.AssetCurrentShRequest;
@ -12,8 +13,8 @@ import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.response.AssetTaskResponse; import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.response.AssetdwHcBlResponse; import com.ruoyi.tc.entity.response.AssetdwHcBlResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse; import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import io.swagger.models.auth.In;
import java.text.ParseException;
import java.util.List; import java.util.List;
/** /**
@ -76,6 +77,15 @@ public interface AssetTaskService extends IService<AssetTask> {
AssetCurrentCpPo taskSh(int taskId, int assetId); AssetCurrentCpPo taskSh(int taskId, int assetId);
/**
* web
*
* @param id id
* @return
*/
AssetCurrentHistory webHistory(Long id);
/** /**
* *
* *
@ -86,6 +96,15 @@ public interface AssetTaskService extends IService<AssetTask> {
AssetMiniProgramsCpPo minitaskSh(int taskId, int assetId); AssetMiniProgramsCpPo minitaskSh(int taskId, int assetId);
/**
*
*
* @param id id
* @return
*/
AssetMiniProgramsHistory miniHistory(Long id);
/** /**
* *
* *
@ -95,6 +114,14 @@ public interface AssetTaskService extends IService<AssetTask> {
*/ */
AssetOfficialAccountCpPo officetaskSh(int taskId, int assetId); AssetOfficialAccountCpPo officetaskSh(int taskId, int assetId);
/**
*
*
* @param id id
* @return
*/
AssetOfficialAccountHistory officeHistory(Long id);
/** /**
* *
@ -105,6 +132,16 @@ public interface AssetTaskService extends IService<AssetTask> {
*/ */
AssetEmailCpPo emailtaskSh(int taskId, int assetId); AssetEmailCpPo emailtaskSh(int taskId, int assetId);
/**
*
*
* @param id id
* @return
*/
AssetEmailHistory emailHistory(Long id);
/** /**
* *
* *
@ -114,6 +151,16 @@ public interface AssetTaskService extends IService<AssetTask> {
*/ */
AssetAppCpPo apptaskSh(int taskId, int assetId); AssetAppCpPo apptaskSh(int taskId, int assetId);
/**
*
*
* @param id id
* @return
*/
AssetAppHistory appHistory(Long id);
/** /**
* *
* *
@ -130,7 +177,7 @@ public interface AssetTaskService extends IService<AssetTask> {
* @param req * @param req
* @return * @return
*/ */
int sh(AssetCurrentShRequest req); int sh(AssetCurrentShRequest req) throws ParseException;
/** /**
@ -187,10 +234,11 @@ public interface AssetTaskService extends IService<AssetTask> {
* @param dwmc * @param dwmc
* @return * @return
*/ */
AssetTask findByDwmc(String dwmc); AssetTask findByDwmc(String dwmc);
/** /**
* id * id
*
* @param taskId * @param taskId
* @return * @return
*/ */

@ -1,14 +1,13 @@
package com.ruoyi.tc.service; package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import com.ruoyi.tc.entity.po.UnitOtherConcatCpPo; import com.ruoyi.tc.entity.po.UnitOtherConcatCpPo;
import com.ruoyi.tc.entity.po.UnitOtherConcatJyPo;
import java.util.List; import java.util.List;
/** /**
* (unit_other_contact_cp) * (unit_other_contact_cp)
*
* @author du * @author du
* @since 2024/11/13 14:55 * @since 2024/11/13 14:55
*/ */
@ -17,10 +16,10 @@ public interface UnitOtherConcatCpService extends IService<UnitOtherConcatCpPo>
/** /**
* idid * idid
* *
* @param assetId id * @param taskId id
* @return * @return
*/ */
List<UnitOtherConcatCpPo> findByassetId(Long assetId); List<UnitOtherConcatCpPo> findByassetId(String taskId);
/** /**
@ -32,7 +31,6 @@ public interface UnitOtherConcatCpService extends IService<UnitOtherConcatCpPo>
void deletByAssetIdandTaskId(Long assetId, Integer taskId); void deletByAssetIdandTaskId(Long assetId, Integer taskId);
/** /**
* idid * idid
* *
@ -41,12 +39,12 @@ public interface UnitOtherConcatCpService extends IService<UnitOtherConcatCpPo>
void deletByAssetId(Long assetId); void deletByAssetId(Long assetId);
/** /**
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @param taskId id
* @return * @return
*/ */
UnitOtherConcatCpPo findByTaskId(int assetId); List<UnitOtherConcatCpPo> findByTaskId(int assetId, int taskId);
} }

@ -68,7 +68,7 @@ public interface UnitService extends IService<Unit> {
* @param unit * @param unit
* @return * @return
*/ */
Page<Unit> dwList(Page<Unit> page, UnitRequest unit); Page<Unit> dwList(Page<Unit>page,UnitRequest request);
/** /**
* *

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

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

@ -31,8 +31,8 @@ public class AssetCurrentCpServiceImpl extends ServiceImpl<AssetCurrentCpMapper,
} }
@Override @Override
public AssetCurrentCpPo findByTaskId(int assetId) { public AssetCurrentCpPo findByTaskId(int assetId,int taskId) {
return assetCurrentCpMapper.findByTaskId(assetId); return assetCurrentCpMapper.findByTaskId(assetId,taskId);
} }
@Override @Override

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

@ -1,5 +1,6 @@
package com.ruoyi.tc.service.impl; package com.ruoyi.tc.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -15,7 +16,6 @@ import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import com.ruoyi.tc.historyService.*; import com.ruoyi.tc.historyService.*;
import com.ruoyi.tc.mapper.AssetTaskMapper; import com.ruoyi.tc.mapper.AssetTaskMapper;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.*;
import lombok.SneakyThrows;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -169,41 +169,6 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
*/ */
@Override @Override
public void insert(AssetTask assetTask) { public void insert(AssetTask assetTask) {
int a = 0;
//遍历单位
String[] taskParts = assetTask.getDwmc().split(",");
int current = 0;
int xcx = 0;
int gzh = 0;
int email = 0;
int app = 0;
int totalCount = 0;
for (String part : taskParts) {
//根据单位查询所有资产
//web
// 遍历资产类型字段
String[] uParts = assetTask.getType().split(",");
for (String qq : uParts) {
if (qq.equals("0")) {
current = assetCurrentService.findBydwmc(part);
totalCount += current;
} else if (qq.equals("1")) {
xcx = assetMiniProgramsService.findBydwmc(part);
totalCount += xcx;
} else if (qq.equals("2")) {
gzh = assetOfficialAccountService.findBydwmc(part);
totalCount += gzh;
} else if (qq.equals("3")) {
email = assetEmailService.findBydwmc(part);
totalCount += email;
} else if (qq.equals("4")) {
app = assetAppService.findBydwmc(part);
totalCount += app;
}
}
assetTask.setTotalCount(totalCount);
}
//任务新增 //任务新增
assetTaskDao.insert(assetTask); assetTaskDao.insert(assetTask);
int id = assetTask.getId(); int id = assetTask.getId();
@ -226,55 +191,18 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetCurrentResponse.setTaskId(id); assetCurrentResponse.setTaskId(id);
} }
assetCurrentCpService.saveBatch(list); assetCurrentCpService.saveBatch(list);
List<AssetBusinessFormCpPo> assetBusinessFormCpResponseList = new ArrayList<>(); //新增新监管业务形态
for (AssetCurrentCpPo assetCurrentResponse : list) { List<AssetBusinessFormCpPo> bussList = assetBusinessFormCpService.findByassetId(assetTask.getTaskId());
//新增新监管业务形态 assetBusinessFormCpService.saveBatch(bussList);
//根据资产id查询新监管业务形态主表id //新增供应链
List<AssetBusinessFormCpPo> bussList = assetBusinessFormCpService.findByassetId(assetCurrentResponse.getId()); List<AssetSupplyChainCpPo> supplyChainList = assetSupplyChainCpService.findByassetId(assetTask.getTaskId());
if (bussList != null) { assetSupplyChainCpService.saveBatch(supplyChainList);
for (AssetBusinessFormCpPo assetBusinessFormCpResponse : bussList) { //新增基础网络
if (assetCurrentResponse.getXjgywxt() != null) { List<AssetBasicNetworkCpPo> BasicNetworkCpList = assetBasicNetworkCpService.findByassetId(assetTask.getTaskId());
assetCurrentResponse.getXjgywxt().setAssetId(assetBusinessFormCpResponse.getAssetId()); assetBasicNetworkCpService.saveBatch(BasicNetworkCpList);
assetCurrentResponse.getXjgywxt().setTaskId(id); //新增其他联系人
assetBusinessFormCpResponseList.add(assetCurrentResponse.getXjgywxt()); List<UnitOtherConcatCpPo> unitOtherConcatList = unitOtherConcatCpService.findByassetId(assetTask.getTaskId());
} unitOtherConcatCpService.saveBatch(unitOtherConcatList);
}
assetBusinessFormCpService.saveBatch(assetBusinessFormCpResponseList);
}
//根据资产id查询供应链主表id-
List<AssetSupplyChainCpPo> supplyChainList = assetSupplyChainCpService.findByassetId(assetCurrentResponse.getId());
if (supplyChainList != null) {
for (AssetSupplyChainCpPo items : supplyChainList) {
items.setAssetId(assetCurrentResponse.getId());
items.setSupplyId(items.getSupplyId());
items.setTaskId(id);
//新增供应链
}
assetSupplyChainCpService.saveBatch(supplyChainList);
}
List<AssetBasicNetworkCpPo> BasicNetworkCpList = assetBasicNetworkCpService.findByassetId(assetCurrentResponse.getId());
if (BasicNetworkCpList != null) {
for (AssetBasicNetworkCpPo items : BasicNetworkCpList) {
//根据资产id查询基础网络主表id
items.setAssetId(assetCurrentResponse.getId());
items.setNetworkId(items.getNetworkId());
items.setTaskId(id);
//新增基础网络
}
assetBasicNetworkCpService.saveBatch(BasicNetworkCpList);
}
List<UnitOtherConcatCpPo> unitOtherConcatList = unitOtherConcatCpService.findByassetId(assetCurrentResponse.getId());
if (unitOtherConcatList != null) {
for (UnitOtherConcatCpPo items : unitOtherConcatList) {
//根据资产id查询其他联系人主表id
items.setAssetId(assetCurrentResponse.getId());
items.setConcatId(items.getConcatId());
items.setTaskId(id);
//新增其他联系人
}
unitOtherConcatCpService.saveBatch(unitOtherConcatList);
}
}
} }
} else if (assetPart.equals("1")) { } else if (assetPart.equals("1")) {
//遍历小程序资产单位 //遍历小程序资产单位
@ -285,16 +213,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
queryWrapper.eq("ssdw", part); queryWrapper.eq("ssdw", part);
queryWrapper.eq("del_flag", 0); queryWrapper.eq("del_flag", 0);
List<AssetMiniPrograms> list = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getSsdw, part).eq(AssetMiniPrograms::getDelFlag, 0).list(); List<AssetMiniPrograms> list = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getSsdw, part).eq(AssetMiniPrograms::getDelFlag, 0).list();
List<AssetMiniProgramsCpPo> miniProgramsNewList = list.stream() List<AssetMiniProgramsCpPo> miniProgramsNewList = list.stream().map(cpPo -> {
.map(cpPo -> { AssetMiniProgramsCpPo assetMiniProgramsCpPo = new AssetMiniProgramsCpPo();
AssetMiniProgramsCpPo assetMiniProgramsCpPo = new AssetMiniProgramsCpPo(); assetMiniProgramsCpPo.setTaskId(id);
assetMiniProgramsCpPo.setTaskId(id); assetMiniProgramsCpPo.setStatus(0);
assetMiniProgramsCpPo.setStatus(0); assetMiniProgramsCpPo.setAssetId(cpPo.getId());
assetMiniProgramsCpPo.setAssetId(cpPo.getId()); BeanUtils.copyProperties(cpPo, assetMiniProgramsCpPo); // 复制属性
BeanUtils.copyProperties(cpPo, assetMiniProgramsCpPo); // 复制属性 return assetMiniProgramsCpPo; // 返回新对象
return assetMiniProgramsCpPo; // 返回新对象 }).collect(Collectors.toList()); // 收集到列表中
})
.collect(Collectors.toList()); // 收集到列表中
assetMiniProgramsCpService.saveBatch(miniProgramsNewList); assetMiniProgramsCpService.saveBatch(miniProgramsNewList);
} }
} else if (assetPart.equals("2")) { } else if (assetPart.equals("2")) {
@ -306,16 +232,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
queryWrapper.eq("ssdw", part); queryWrapper.eq("ssdw", part);
queryWrapper.eq("del_flag", 0); queryWrapper.eq("del_flag", 0);
List<AssetOfficialAccount> list = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getSsdw, part).eq(AssetOfficialAccount::getDelFlag, 0).list(); List<AssetOfficialAccount> list = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getSsdw, part).eq(AssetOfficialAccount::getDelFlag, 0).list();
List<AssetOfficialAccountCpPo> officialAccountProgramsNewList = list.stream() List<AssetOfficialAccountCpPo> officialAccountProgramsNewList = list.stream().map(cpPo -> {
.map(cpPo -> { AssetOfficialAccountCpPo assetOfficialAccountCpPo = new AssetOfficialAccountCpPo();
AssetOfficialAccountCpPo assetOfficialAccountCpPo = new AssetOfficialAccountCpPo(); assetOfficialAccountCpPo.setTaskId(id);
assetOfficialAccountCpPo.setTaskId(id); assetOfficialAccountCpPo.setStatus(0);
assetOfficialAccountCpPo.setStatus(0); assetOfficialAccountCpPo.setAssetId(cpPo.getId());
assetOfficialAccountCpPo.setAssetId(cpPo.getId()); BeanUtils.copyProperties(cpPo, assetOfficialAccountCpPo); // 复制属性
BeanUtils.copyProperties(cpPo, assetOfficialAccountCpPo); // 复制属性 return assetOfficialAccountCpPo; // 返回新对象
return assetOfficialAccountCpPo; // 返回新对象 }).collect(Collectors.toList()); // 收集到列表中
})
.collect(Collectors.toList()); // 收集到列表中
assetOfficialAccountCpService.saveBatch(officialAccountProgramsNewList); assetOfficialAccountCpService.saveBatch(officialAccountProgramsNewList);
} }
} else if (assetPart.equals("3")) { } else if (assetPart.equals("3")) {
@ -328,16 +252,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
queryWrapper.eq("del_flag", 0); queryWrapper.eq("del_flag", 0);
List<AssetEmail> list = assetEmailService.lambdaQuery().eq(AssetEmail::getSsdw, part).eq(AssetEmail::getDelFlag, 0).list(); List<AssetEmail> list = assetEmailService.lambdaQuery().eq(AssetEmail::getSsdw, part).eq(AssetEmail::getDelFlag, 0).list();
; ;
List<AssetEmailCpPo> emailCpNewList = list.stream() List<AssetEmailCpPo> emailCpNewList = list.stream().map(cpPo -> {
.map(cpPo -> { AssetEmailCpPo emailCpPo = new AssetEmailCpPo();
AssetEmailCpPo emailCpPo = new AssetEmailCpPo(); emailCpPo.setTaskId(id);
emailCpPo.setTaskId(id); emailCpPo.setAssetId(cpPo.getId());
emailCpPo.setAssetId(cpPo.getId()); emailCpPo.setStatus(0);
emailCpPo.setStatus(0); BeanUtils.copyProperties(cpPo, emailCpPo); // 复制属性
BeanUtils.copyProperties(cpPo, emailCpPo); // 复制属性 return emailCpPo; // 返回新对象
return emailCpPo; // 返回新对象 }).collect(Collectors.toList()); // 收集到列表中
})
.collect(Collectors.toList()); // 收集到列表中
assetEmailCpService.saveBatch(emailCpNewList); assetEmailCpService.saveBatch(emailCpNewList);
} }
} else if (assetPart.equals("4")) { } else if (assetPart.equals("4")) {
@ -349,16 +271,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
queryWrapper.eq("ssdw", part); queryWrapper.eq("ssdw", part);
queryWrapper.eq("del_flag", 0); queryWrapper.eq("del_flag", 0);
List<AssetApp> list = assetAppService.lambdaQuery().eq(AssetApp::getSsdw, part).eq(AssetApp::getDelFlag, 0).list(); List<AssetApp> list = assetAppService.lambdaQuery().eq(AssetApp::getSsdw, part).eq(AssetApp::getDelFlag, 0).list();
List<AssetAppCpPo> appCpNewList = list.stream() List<AssetAppCpPo> appCpNewList = list.stream().map(cpPo -> {
.map(cpPo -> { AssetAppCpPo appCpPo = new AssetAppCpPo();
AssetAppCpPo appCpPo = new AssetAppCpPo(); appCpPo.setTaskId(id);
appCpPo.setTaskId(id); appCpPo.setAssetId(cpPo.getId());
appCpPo.setAssetId(cpPo.getId()); appCpPo.setStatus(0);
appCpPo.setStatus(0); BeanUtils.copyProperties(cpPo, appCpPo); // 复制属性
BeanUtils.copyProperties(cpPo, appCpPo); // 复制属性 return appCpPo; // 返回新对象
return appCpPo; // 返回新对象 }).collect(Collectors.toList()); // 收集到列表中
})
.collect(Collectors.toList()); // 收集到列表中
assetAppCpService.saveBatch(appCpNewList); assetAppCpService.saveBatch(appCpNewList);
} }
} }
@ -420,6 +340,36 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
@Override
public AssetCurrentHistory webHistory(Long id) {
QueryWrapper<AssetCurrentHistory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("current_id", id);
AssetCurrentHistory byId = assetCurrentHistoryService.getOne(queryWrapper);
byId.setGylxxList(assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpPo::getAssetId, byId.getId()).eq(AssetSupplyChainCpPo::getDelFlag, "0").eq(AssetSupplyChainCpPo::getTaskId, byId.getTaskId()).list());
byId.setJcwlList(assetBasicNetworkCpService.lambdaQuery().eq(AssetBasicNetworkCpPo::getAssetId, byId.getId()).eq(AssetBasicNetworkCpPo::getDelFlag, "0").eq(AssetBasicNetworkCpPo::getTaskId, byId.getTaskId()).list());
byId.setXjgywxt(assetBusinessFormCpService.lambdaQuery().eq(AssetBusinessFormCpPo::getAssetId, byId.getId()).eq(AssetBusinessFormCpPo::getDelFlag, "0").eq(AssetBusinessFormCpPo::getTaskId, byId.getTaskId()).one());
byId.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpPo::getAssetId, byId.getId()).eq(UnitOtherConcatCpPo::getDelFlag, "0").eq(UnitOtherConcatCpPo::getTaskId, byId.getTaskId()).list());
List<Acomma> a1 = new ArrayList<>();
if (byId.getGlym() != null) {
Arrays.asList(byId.getGlym().split(",")).forEach(x -> {
Acomma acomma = new Acomma();
acomma.setKey(x);
a1.add(acomma);
});
byId.setGlymList(a1);
}
List<Acomma> a2 = new ArrayList<>();
if (byId.getGlIp() != null) {
Arrays.asList(byId.getGlIp().split(",")).forEach(x -> {
Acomma acomma = new Acomma();
acomma.setKey(x);
a2.add(acomma);
});
byId.setGlIpList(a2);
}
return byId;
}
@Override @Override
public AssetMiniProgramsCpPo minitaskSh(int taskId, int assetId) { public AssetMiniProgramsCpPo minitaskSh(int taskId, int assetId) {
QueryWrapper<AssetMiniProgramsCpPo> queryWrapper = new QueryWrapper<>(); QueryWrapper<AssetMiniProgramsCpPo> queryWrapper = new QueryWrapper<>();
@ -428,6 +378,13 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
return assetMiniProgramsCpService.getOne(queryWrapper); return assetMiniProgramsCpService.getOne(queryWrapper);
} }
@Override
public AssetMiniProgramsHistory miniHistory(Long id) {
QueryWrapper<AssetMiniProgramsHistory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mini_id", id);
return assetMiniProgramsHistoryService.getOne(queryWrapper);
}
@Override @Override
public AssetOfficialAccountCpPo officetaskSh(int taskId, int assetId) { public AssetOfficialAccountCpPo officetaskSh(int taskId, int assetId) {
QueryWrapper<AssetOfficialAccountCpPo> queryWrapper = new QueryWrapper<>(); QueryWrapper<AssetOfficialAccountCpPo> queryWrapper = new QueryWrapper<>();
@ -456,6 +413,32 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
return byId; return byId;
} }
@Override
public AssetOfficialAccountHistory officeHistory(Long id) {
QueryWrapper<AssetOfficialAccountHistory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("account_id", id);
AssetOfficialAccountHistory byId = assetOfficialAccountHistoryService.getOne(queryWrapper);
List<AssetOfficialAccountMenu> a1 = new ArrayList<>();
String[] s1 = byId.getCdmc().split("\\|");
String[] s2 = byId.getCdlj().split("\\|");
String[] s3 = byId.getCdlx().split("\\|");
for (int i = 0; i < s1.length; i++) {
AssetOfficialAccountMenu as = new AssetOfficialAccountMenu();
if (s1[i] != null && !Objects.equals(s1[i], "")) {
as.setCdmc(s1[i]);
}
if (s2[i] != null && !Objects.equals(s2[i], "")) {
as.setCdlj(s2[i]);
}
if (s3[i] != null && !Objects.equals(s3[i], "")) {
as.setCdlx(s3[i]);
}
a1.add(as);
}
byId.setCdList(a1);
return byId;
}
@Override @Override
public AssetEmailCpPo emailtaskSh(int taskId, int assetId) { public AssetEmailCpPo emailtaskSh(int taskId, int assetId) {
QueryWrapper<AssetEmailCpPo> queryWrapper = new QueryWrapper<>(); QueryWrapper<AssetEmailCpPo> queryWrapper = new QueryWrapper<>();
@ -464,6 +447,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
return assetEmailCpService.getOne(queryWrapper); return assetEmailCpService.getOne(queryWrapper);
} }
@Override
public AssetEmailHistory emailHistory(Long id) {
QueryWrapper<AssetEmailHistory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("eamil_id", id);
return assetEmailHistoryService.getOne(queryWrapper);
}
@Override @Override
public AssetAppCpPo apptaskSh(int taskId, int assetId) { public AssetAppCpPo apptaskSh(int taskId, int assetId) {
QueryWrapper<AssetAppCpPo> queryWrapper = new QueryWrapper<>(); QueryWrapper<AssetAppCpPo> queryWrapper = new QueryWrapper<>();
@ -472,6 +463,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
return assetAppCpService.getOne(queryWrapper); return assetAppCpService.getOne(queryWrapper);
} }
@Override
public AssetAppHistory appHistory(Long id) {
QueryWrapper<AssetAppHistory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("app_id", id);
return assetAppHistoryService.getOne(queryWrapper);
}
@Override @Override
public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest) { public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest) {
assetTask.setOptimizeCountSql(false); assetTask.setOptimizeCountSql(false);
@ -494,9 +493,9 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
return result; return result;
} }
@SneakyThrows
@Override @Override
public int sh(AssetCurrentShRequest req) { public int sh(AssetCurrentShRequest req) throws ParseException {
//根据taskid获取当前任务的count数量 //根据taskid获取当前任务的count数量
AssetTask assetTask = assetTaskDao.getByTaskId(req.getTaskId()); AssetTask assetTask = assetTaskDao.getByTaskId(req.getTaskId());
// 获取当前时间 // 获取当前时间
@ -511,8 +510,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
getTaskStatus(req); getTaskStatus(req);
if (req.getBtgyy() != null) { if (req.getBtgyy() != null) {
assetTaskDao.sh(req); assetTaskDao.sh(req);
//修改子表和新增历史表 // //修改子表和新增历史表
updateZiandHistory(req, date); // updateZiandHistory(req, date);
} else { } else {
//修改子表和新增历史表 //修改子表和新增历史表
updateZiandHistory(req, date); updateZiandHistory(req, date);
@ -527,8 +526,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
getTaskStatus(req); getTaskStatus(req);
if (req.getBtgyy() != null) { if (req.getBtgyy() != null) {
assetTaskDao.xcxsh(req); assetTaskDao.xcxsh(req);
//修改子表和新增历史表 // //修改子表和新增历史表
updateMinZiandHistory(req, date); // updateMinZiandHistory(req, date);
} else { } else {
//修改子表和新增历史表 //修改子表和新增历史表
updateMinZiandHistory(req, date); updateMinZiandHistory(req, date);
@ -544,8 +543,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
getTaskStatus(req); getTaskStatus(req);
if (req.getBtgyy() != null) { if (req.getBtgyy() != null) {
assetTaskDao.gzhsh(req); assetTaskDao.gzhsh(req);
//修改子表和历史表新增 // //修改子表和历史表新增
updateGzhZiandHistory(req, date); // updateGzhZiandHistory(req, date);
} else { } else {
//修改子表和历史表新增 //修改子表和历史表新增
updateGzhZiandHistory(req, date); updateGzhZiandHistory(req, date);
@ -561,8 +560,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
getTaskStatus(req); getTaskStatus(req);
if (req.getBtgyy() != null) { if (req.getBtgyy() != null) {
assetTaskDao.emailsh(req); assetTaskDao.emailsh(req);
//修改子表和历史表新增 // //修改子表和历史表新增
updateEmailZiandHistory(req, date); // updateEmailZiandHistory(req, date);
} else { } else {
//修改子表和历史表新增 //修改子表和历史表新增
updateEmailZiandHistory(req, date); updateEmailZiandHistory(req, date);
@ -578,8 +577,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
getTaskStatus(req); getTaskStatus(req);
if (req.getBtgyy() != null) { if (req.getBtgyy() != null) {
assetTaskDao.appsh(req); assetTaskDao.appsh(req);
//修改子表和历史表新增 // //修改子表和历史表新增
updateAppZiandHistory(req, date); // updateAppZiandHistory(req, date);
} else { } else {
//修改子表和历史表新增 //修改子表和历史表新增
updateAppZiandHistory(req, date); updateAppZiandHistory(req, date);
@ -591,35 +590,35 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
AssetTask finalTask = assetTaskDao.getByTaskId(req.getTaskId()); AssetTask finalTask = assetTaskDao.getByTaskId(req.getTaskId());
LocalDateTime finishTime = null; LocalDateTime finishTime = null;
//根据任务id查询是否进行中 //根据任务id查询是否进行中
Integer jxz=assetTaskDao.getJxz(req.getTaskId()); Integer jxz = assetTaskDao.getJxz(req.getTaskId());
if(jxz>0){ if (jxz > 0) {
//进行中 //进行中
finalTask.setTaskStatus(1); finalTask.setTaskStatus(1);
finalTask.setTaskFinishTime(finishTime); finalTask.setTaskFinishTime(finishTime);
assetTaskService.update(finalTask); assetTaskService.update(finalTask);
}else{ } else {
//根据任务id查询是否超期 //根据任务id查询是否超期
String ifcq=assetTaskDao.getifcq(req.getTaskId()); String ifcq = assetTaskDao.getifcq(req.getTaskId());
String taskDeadline = finalTask.getTaskDeadline(); // 定义日期格式,确保格式与字符串一致 String taskDeadline = finalTask.getTaskDeadline(); // 定义日期格式,确保格式与字符串一致
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 根据你的时间格式调整 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 根据你的时间格式调整
// 将字符串转换为日期对象 // 将字符串转换为日期对象
Date ifcqDate = dateFormat.parse(ifcq); Date ifcqDate = dateFormat.parse(ifcq);
Date taskDeadlineDate = dateFormat.parse(taskDeadline); Date taskDeadlineDate = dateFormat.parse(taskDeadline);
// 比较两个日期 // 比较两个日期
if (ifcqDate.before(taskDeadlineDate)) { if (ifcqDate.before(taskDeadlineDate)) {
//超期完成 //超期完成
finalTask.setTaskStatus(3); finalTask.setTaskStatus(3);
finishTime = LocalDateTime.now(); finishTime = LocalDateTime.now();
finalTask.setTaskFinishTime(finishTime); finalTask.setTaskFinishTime(finishTime);
assetTaskService.update(finalTask); assetTaskService.update(finalTask);
} else if (ifcqDate.after(taskDeadlineDate)) { } else if (ifcqDate.after(taskDeadlineDate)) {
//正常完成 //正常完成
finalTask.setTaskStatus(2); finalTask.setTaskStatus(2);
finishTime = LocalDateTime.now(); finishTime = LocalDateTime.now();
finalTask.setTaskFinishTime(finishTime); finalTask.setTaskFinishTime(finishTime);
assetTaskService.update(finalTask); assetTaskService.update(finalTask);
} }
} }
return 0; return 0;
} }
@ -631,6 +630,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//新增历史记录表 //新增历史记录表
AssetAppHistory assetAppHistory = new AssetAppHistory(); AssetAppHistory assetAppHistory = new AssetAppHistory();
BeanUtils.copyProperties(req.getAssetAppCpPo(), assetAppHistory); BeanUtils.copyProperties(req.getAssetAppCpPo(), assetAppHistory);
assetAppHistory.setAppId(null);
assetAppHistoryService.save(assetAppHistory); assetAppHistoryService.save(assetAppHistory);
} }
@ -641,6 +641,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//新增历史记录表 //新增历史记录表
AssetEmailHistory assetEmailHistory = new AssetEmailHistory(); AssetEmailHistory assetEmailHistory = new AssetEmailHistory();
BeanUtils.copyProperties(req.getAssetEmailCpPo(), assetEmailHistory); BeanUtils.copyProperties(req.getAssetEmailCpPo(), assetEmailHistory);
assetEmailHistory.setEmailId(null);
assetEmailHistoryService.save(assetEmailHistory); assetEmailHistoryService.save(assetEmailHistory);
} }
@ -664,6 +665,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//新增历史记录表 //新增历史记录表
AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory(); AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory();
BeanUtils.copyProperties(req.getAssetOfficialAccountCpPo(), assetOfficialAccountHistory); BeanUtils.copyProperties(req.getAssetOfficialAccountCpPo(), assetOfficialAccountHistory);
assetOfficialAccountHistory.setAccountId(null);
assetOfficialAccountHistoryService.save(assetOfficialAccountHistory); assetOfficialAccountHistoryService.save(assetOfficialAccountHistory);
} }
@ -674,6 +676,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//新增历史记录表 //新增历史记录表
AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory(); AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory();
BeanUtils.copyProperties(req.getAssetMiniProgramsCpPo(), assetMiniProgramsHistory); BeanUtils.copyProperties(req.getAssetMiniProgramsCpPo(), assetMiniProgramsHistory);
assetMiniProgramsHistory.setMiniId(null);
assetMiniProgramsHistoryService.save(assetMiniProgramsHistory); assetMiniProgramsHistoryService.save(assetMiniProgramsHistory);
} }
@ -685,7 +688,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
unitOtherConcatCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId()); unitOtherConcatCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
assetBasicNetworkCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId()); assetBasicNetworkCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
StringBuilder a = new StringBuilder(); StringBuilder a = new StringBuilder();
if (!req.getAssetCurrentCpPo().getGlymList().isEmpty()) { if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlymList())) {
req.getAssetCurrentCpPo().getGlymList().forEach(x -> { req.getAssetCurrentCpPo().getGlymList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
a.append(x.getKey()); a.append(x.getKey());
@ -695,7 +698,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
req.getAssetCurrentCpPo().setGlym(a.toString()); req.getAssetCurrentCpPo().setGlym(a.toString());
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
if (!req.getAssetCurrentCpPo().getGlIpList().isEmpty()) { if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlIpList())) {
req.getAssetCurrentCpPo().getGlIpList().forEach(x -> { req.getAssetCurrentCpPo().getGlIpList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
b.append(x.getKey()); b.append(x.getKey());
@ -749,7 +752,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
private void saveHistory(AssetCurrentShRequest req, StringBuilder a, StringBuilder b, Date date, AssetCurrentHistory assetCurrentHistory) { private void saveHistory(AssetCurrentShRequest req, StringBuilder a, StringBuilder b, Date date, AssetCurrentHistory assetCurrentHistory) {
//新增历史记录 //新增历史记录
StringBuilder c = new StringBuilder(); StringBuilder c = new StringBuilder();
if (!req.getAssetCurrentCpPo().getGlymList().isEmpty()) { if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlymList())) {
req.getAssetCurrentCpPo().getGlymList().forEach(x -> { req.getAssetCurrentCpPo().getGlymList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
c.append(x.getKey()); c.append(x.getKey());
@ -759,7 +762,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
req.getAssetCurrentCpPo().setGlym(a.toString()); req.getAssetCurrentCpPo().setGlym(a.toString());
StringBuilder d = new StringBuilder(); StringBuilder d = new StringBuilder();
if (!req.getAssetCurrentCpPo().getGlIpList().isEmpty()) { if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGlIpList())) {
req.getAssetCurrentCpPo().getGlIpList().forEach(x -> { req.getAssetCurrentCpPo().getGlIpList().forEach(x -> {
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
d.append(x.getKey()); d.append(x.getKey());
@ -773,6 +776,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
// 设置更新时间 // 设置更新时间
req.getAssetCurrentCpPo().setUpdateTime(date); req.getAssetCurrentCpPo().setUpdateTime(date);
BeanUtils.copyProperties(req.getAssetCurrentCpPo(), assetCurrentHistory); BeanUtils.copyProperties(req.getAssetCurrentCpPo(), assetCurrentHistory);
assetCurrentHistory.setCurrentId(null);
assetCurrentHistoryService.save(assetCurrentHistory); assetCurrentHistoryService.save(assetCurrentHistory);
//新增新监管业务形态历史表 //新增新监管业务形态历史表
@ -782,6 +786,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory(); AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory();
assetBusinessFormHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId()); assetBusinessFormHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId());
BeanUtils.copyProperties(req.getAssetCurrentCpPo().getXjgywxt(), assetBusinessFormHistory); BeanUtils.copyProperties(req.getAssetCurrentCpPo().getXjgywxt(), assetBusinessFormHistory);
assetBusinessFormHistory.setBusinessId(null);
assetBusinessFormHistoryService.save(assetBusinessFormHistory); assetBusinessFormHistoryService.save(assetBusinessFormHistory);
} }
@ -792,14 +797,13 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
//新增供应链历史表 //新增供应链历史表
List<AssetSupplyChainHistory> assetSupplyChainHistoryList = req.getAssetCurrentCpPo().getGylxxList().stream() List<AssetSupplyChainHistory> assetSupplyChainHistoryList = req.getAssetCurrentCpPo().getGylxxList().stream().map(cpPo -> {
.map(cpPo -> { AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory();
AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory(); assetSupplyChainHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId());
assetSupplyChainHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId()); BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性
BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性 assetSupplyChainHistory.setSupplyId(null);
return assetSupplyChainHistory; // 返回新对象 return assetSupplyChainHistory; // 返回新对象
}) }).collect(Collectors.toList()); // 收集到列表中
.collect(Collectors.toList()); // 收集到列表中
assetSupplyChainHistoryService.saveBatch(assetSupplyChainHistoryList); assetSupplyChainHistoryService.saveBatch(assetSupplyChainHistoryList);
} }
if (!req.getAssetCurrentCpPo().getJcwlList().isEmpty()) { if (!req.getAssetCurrentCpPo().getJcwlList().isEmpty()) {
@ -809,14 +813,13 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
//新增基础网络历史表 //新增基础网络历史表
List<AssetBasicNetworkHistory> assetSupplyChainHistoryList = req.getAssetCurrentCpPo().getJcwlList().stream() List<AssetBasicNetworkHistory> assetSupplyChainHistoryList = req.getAssetCurrentCpPo().getJcwlList().stream().map(cpPo -> {
.map(cpPo -> { AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory();
AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory(); assetBasicNetworkHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId());
assetBasicNetworkHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId()); BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性
BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性 assetBasicNetworkHistory.setNetworkId(null);
return assetBasicNetworkHistory; // 返回新对象 return assetBasicNetworkHistory; // 返回新对象
}) }).collect(Collectors.toList()); // 收集到列表中
.collect(Collectors.toList()); // 收集到列表中
assetBasicNetworkHistoryService.saveBatch(assetSupplyChainHistoryList); assetBasicNetworkHistoryService.saveBatch(assetSupplyChainHistoryList);
} }
if (!req.getAssetCurrentCpPo().getOtherConcat().isEmpty()) { if (!req.getAssetCurrentCpPo().getOtherConcat().isEmpty()) {
@ -825,14 +828,13 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); items.setTaskId(req.getAssetCurrentCpPo().getTaskId());
} }
//新增其他联系人 //新增其他联系人
List<UnitOtherConcatHistory> unitOtherConcatHistoryList = req.getAssetCurrentCpPo().getOtherConcat().stream() List<UnitOtherConcatHistory> unitOtherConcatHistoryList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> {
.map(cpPo -> { UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory();
UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory(); unitOtherConcatHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId());
unitOtherConcatHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId()); BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性
BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性 unitOtherConcatHistory.setUnitId(null);
return unitOtherConcatHistory; // 返回新对象 return unitOtherConcatHistory; // 返回新对象
}) }).collect(Collectors.toList()); // 收集到列表中
.collect(Collectors.toList()); // 收集到列表中
unitOtherConcatHistoryService.saveBatch(unitOtherConcatHistoryList); unitOtherConcatHistoryService.saveBatch(unitOtherConcatHistoryList);
} }
} }
@ -862,6 +864,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//将子表数据复制到主表中 //将子表数据复制到主表中
AssetOfficialAccount assetOfficialAccount = new AssetOfficialAccount(); AssetOfficialAccount assetOfficialAccount = new AssetOfficialAccount();
BeanUtils.copyProperties(assetOfficialAccountCpPo, assetOfficialAccount); // 复制属性 BeanUtils.copyProperties(assetOfficialAccountCpPo, assetOfficialAccount); // 复制属性
assetOfficialAccount.setId(null);
assetOfficialAccountService.save(assetOfficialAccount); assetOfficialAccountService.save(assetOfficialAccount);
} }
@ -950,7 +953,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//web //web
private void taskSaveOrDelete(AssetCurrentShRequest req) { private void taskSaveOrDelete(AssetCurrentShRequest req) {
// 根据资产id查询五张数据 // 根据资产id查询五张数据
AssetCurrentCpPo currentCpPo = assetCurrentCpService.findByTaskId(req.getAssetId()); AssetCurrentCpPo currentCpPo = assetCurrentCpService.findByTaskId(req.getAssetId(), req.getTaskId());
//删除主表原有数据 //删除主表原有数据
if (currentCpPo != null) { if (currentCpPo != null) {
assetCurrentService.deleteIdList(currentCpPo.getId()); assetCurrentService.deleteIdList(currentCpPo.getId());
@ -962,47 +965,64 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
//AssetBusinessFormCpPo //AssetBusinessFormCpPo
AssetBusinessFormCpPo businessFormCpPo = assetBusinessFormCpService.findByTaskId(req.getAssetId()); List<AssetBusinessFormCpPo> businessFormCpPo = assetBusinessFormCpService.findByTaskId(req.getAssetId(), req.getTaskId());
List<Long> businessList = businessFormCpPo.stream().map(AssetBusinessFormCpPo::getAssetId).collect(Collectors.toList());
//删除原有数据 //删除原有数据
if (businessFormCpPo != null) { if (CollectionUtil.isNotEmpty(businessList)) {
assetBusinessFormService.deleteIdList(Collections.singletonList(businessFormCpPo.getAssetId())); assetBusinessFormService.deleteIdList(businessList);
//将子表数据复制到主表中 //将子表数据复制到主表中
AssetBusinessForm businessForm = new AssetBusinessForm(); List<AssetBusinessForm> businessFormCpPoList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> {
BeanUtils.copyProperties(businessFormCpPo, businessForm); // 复制属性 AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
businessForm.setId(null); BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性
assetBusinessFormService.save(businessForm); assetBusinessForm.setId(null);
return assetBusinessForm; // 返回新对象
}).collect(Collectors.toList());
assetBusinessFormService.saveBatch(businessFormCpPoList);
} }
//AssetBasicNetworkCpPo //AssetBasicNetworkCpPo
AssetBasicNetworkCpPo networkCpPo = assetBasicNetworkCpService.findByTaskId(req.getAssetId()); List<AssetBasicNetworkCpPo> networkCpPo = assetBasicNetworkCpService.findByTaskId(req.getAssetId(), req.getTaskId());
List<Long> netWorkList = networkCpPo.stream().map(AssetBasicNetworkCpPo::getAssetId).collect(Collectors.toList());
//删除原有数据 //删除原有数据
if (networkCpPo != null) { if (CollectionUtil.isNotEmpty(netWorkList)) {
assetBasicNetworkService.deleteIdList(Collections.singletonList(networkCpPo.getAssetId())); assetBasicNetworkService.deleteIdList(netWorkList);
AssetBasicNetwork network = new AssetBasicNetwork();
BeanUtils.copyProperties(networkCpPo, network); List<AssetBasicNetwork> networksCpPoList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> {
network.setId(null); AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
assetBasicNetworkService.save(network); BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
assetBasicNetwork.setId(null);
return assetBasicNetwork; // 返回新对象
}).collect(Collectors.toList());
assetBasicNetworkService.saveBatch(networksCpPoList);
} }
//AssetSupplyChainCpPo //AssetSupplyChainCpPo
AssetSupplyChainCpPo supplyChainCpPo = assetSupplyChainCpService.findByTaskId(req.getAssetId()); List<AssetSupplyChainCpPo> supplyChainCpPo = assetSupplyChainCpService.findByTaskId(req.getAssetId(), req.getTaskId());
List<Long> supplyList = supplyChainCpPo.stream().map(AssetSupplyChainCpPo::getAssetId).collect(Collectors.toList());
//删除原有数据 //删除原有数据
if (supplyChainCpPo != null) { if (CollectionUtil.isNotEmpty(supplyList)) {
assetSupplyChainService.deleteIdList(Collections.singletonList(supplyChainCpPo.getAssetId())); assetSupplyChainService.deleteIdList(supplyList);
AssetSupplyChain supplyChain = new AssetSupplyChain(); List<AssetSupplyChain> supplyChainList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> {
BeanUtils.copyProperties(supplyChainCpPo, supplyChain); AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
supplyChain.setId(null); BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
assetSupplyChainService.save(supplyChain); assetSupplyChain.setId(null);
return assetSupplyChain; // 返回新对象
}).collect(Collectors.toList());
assetSupplyChainService.saveBatch(supplyChainList);
} }
//UnitOtherConcatCpPo //UnitOtherConcatCpPo
UnitOtherConcatCpPo unitOtherConcatCpPo = unitOtherConcatCpService.findByTaskId(req.getAssetId()); List<UnitOtherConcatCpPo> unitOtherConcatCpPo = unitOtherConcatCpService.findByTaskId(req.getAssetId(), req.getTaskId());
List<Long> unitList = unitOtherConcatCpPo.stream().map(UnitOtherConcatCpPo::getAssetId).collect(Collectors.toList());
//删除原有数据 //删除原有数据
if (unitOtherConcatCpPo != null) { if (CollectionUtil.isNotEmpty(unitList)) {
unitOtherConcatService.deleteIdList(Collections.singletonList(unitOtherConcatCpPo.getAssetId())); unitOtherConcatService.deleteIdList(unitList);
UnitOtherConcat unitOtherConcat = new UnitOtherConcat(); List<UnitOtherConcat> unitOtherConcatList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> {
BeanUtils.copyProperties(unitOtherConcatCpPo, unitOtherConcat); // 复制属性 UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
unitOtherConcat.setConcatId(null); BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
unitOtherConcatService.save(unitOtherConcat); unitOtherConcat.setConcatId(null);
return unitOtherConcat; // 返回新对象
}).collect(Collectors.toList());
unitOtherConcatService.saveBatch(unitOtherConcatList);
} }
} }

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

@ -126,8 +126,8 @@ public class UnitServiceImpl extends ServiceImpl<UnitMapper, Unit> implements Un
} }
@Override @Override
public Page<Unit> dwList(Page<Unit> page, UnitRequest unit) { public Page<Unit> dwList(Page<Unit>page,UnitRequest request) {
return baseMapper.dwList(page, unit); return baseMapper.dwList(page,request);
} }
/** /**

@ -146,65 +146,44 @@
where id = #{id} and del_flag= '0' where id = #{id} and del_flag= '0'
</select> </select>
<select id="dwList" resultType="com.ruoyi.tc.entity.Unit"> <select id="dwList" resultType="com.ruoyi.tc.entity.Unit">
SELECT distinct a.* SELECT DISTINCT a.*
FROM unit_info a FROM unit_info a
<if test="req.type!= null and req.type.indexOf('0') != -1"> LEFT JOIN (
INNER JOIN asset_current cr ON a.nick_name = cr.dwmc <choose>
</if> <when test="req.type != null">
<if test="req.type!= null and req.type.indexOf('1') != -1"> <if test="req.type.indexOf('0') != -1">
INNER JOIN asset_mini_programs pr ON a.nick_name = pr.ssdw SELECT dwmc AS nick_name FROM asset_current WHERE del_flag = 0
</if> <if test="req.type.indexOf('1') != -1 or req.type.indexOf('2') != -1 or req.type.indexOf('3') != -1 or req.type.indexOf('4') != -1">
<if test="req.type!= null and req.type.indexOf('2') != -1"> UNION ALL
INNER JOIN asset_official_account ac ON a.nick_name = ac.ssdw </if>
</if> </if>
<if test="req.type!= null and req.type.indexOf('3') != -1"> <if test="req.type.indexOf('1') != -1">
INNER JOIN asset_email em ON a.nick_name = em.ssdw SELECT ssdw AS nick_name FROM asset_mini_programs WHERE del_flag = 0
</if> <if test="req.type.indexOf('2') != -1 or req.type.indexOf('3') != -1 or req.type.indexOf('4') != -1">
<if test="req.type!= null and req.type.indexOf('4') != -1"> UNION ALL
INNER JOIN asset_app ap ON a.nick_name = ap.ssdw </if>
</if> </if>
<where> <if test="req.type.indexOf('2') != -1">
NOT EXISTS ( SELECT ssdw AS nick_name FROM asset_official_account WHERE del_flag = 0
SELECT 1 <if test="req.type.indexOf('3') != -1 or req.type.indexOf('4') != -1">
FROM asset_task b UNION ALL
where </if>
b.task_status = 1 AND FIND_IN_SET(a.nick_name, b.dwmc) </if>
<if test="req.type != null"> <if test="req.type.indexOf('3') != -1">
AND ( SELECT ssdw AS nick_name FROM asset_email WHERE del_flag = 0
<foreach item="type" collection="req.type.split(',')" separator=" OR "> <if test="req.type.indexOf('4') != -1">
FIND_IN_SET(#{type}, b.type) UNION ALL
</foreach> </if>
) </if>
</if> <if test="req.type.indexOf('4') != -1">
) AND a.del_flag = 0 SELECT ssdw AS nick_name FROM asset_app WHERE del_flag = 0
<if test="req.type!= null and req.type.indexOf('0') != -1"> </if>
and cr.del_flag=0 </when>
</if> </choose>
<if test="req.type!= null and req.type.indexOf('1') != -1"> ) AS valid_nicknames ON a.nick_name = valid_nicknames.nick_name
and pr.del_flag=0 LEFT JOIN asset_task b ON FIND_IN_SET(a.nick_name, b.dwmc) AND b.task_status = 1
</if> WHERE valid_nicknames.nick_name IS NOT NULL
<if test="req.type!= null and req.type.indexOf('2') != -1"> AND b.dwmc IS NULL
and ac.del_flag=0
</if>
<if test="req.type!= null and req.type.indexOf('3') != -1">
and em.del_flag=0
</if>
<if test="req.type!= null and req.type.indexOf('4') != -1">
and ap.del_flag=0
</if>
<if test="req.nickName != null and req.nickName != '' ">
and a.nick_name like concat('%',#{req.nickName},'%')
</if>
<if test="req.dwlx != null">
and a.dwlx = #{req.dwlx}
</if>
<if test="req.userName != null and req.userName != '' ">
and a.user_name like concat('%',#{req.userName},'%')
</if>
</where>
</select> </select>
<select id="selectAllUnit" resultType="com.ruoyi.tc.entity.Unit"> <select id="selectAllUnit" resultType="com.ruoyi.tc.entity.Unit">

Loading…
Cancel
Save