|
|
@ -1,22 +1,26 @@
|
|
|
|
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;
|
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
|
import com.ruoyi.tc.entity.*;
|
|
|
|
import com.ruoyi.tc.entity.*;
|
|
|
|
|
|
|
|
import com.ruoyi.tc.entity.history.*;
|
|
|
|
import com.ruoyi.tc.entity.po.*;
|
|
|
|
import com.ruoyi.tc.entity.po.*;
|
|
|
|
import com.ruoyi.tc.entity.request.*;
|
|
|
|
import com.ruoyi.tc.entity.request.*;
|
|
|
|
import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
|
|
|
|
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 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;
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.ZoneId;
|
|
|
|
import java.time.ZoneId;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
@ -101,6 +105,39 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private AssetTaskService assetTaskService;
|
|
|
|
private AssetTaskService assetTaskService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetCurrentHistoryService assetCurrentHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetAppHistoryService assetAppHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetBasicNetworkHistoryService assetBasicNetworkHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetBusinessFormHistoryService assetBusinessFormHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetEmailHistoryService assetEmailHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetMiniProgramsHistoryService assetMiniProgramsHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetOfficialAccountHistoryService assetOfficialAccountHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AssetSupplyChainHistoryService assetSupplyChainHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private UnitOtherConcatHistoryService unitOtherConcatHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 通过ID查询单条数据
|
|
|
|
* 通过ID查询单条数据
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -404,13 +441,13 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
String[] s3 = byId.getCdlx().split("\\|");
|
|
|
|
String[] s3 = byId.getCdlx().split("\\|");
|
|
|
|
for (int i = 0; i < s1.length; i++) {
|
|
|
|
for (int i = 0; i < s1.length; i++) {
|
|
|
|
AssetOfficialAccountMenu as = new AssetOfficialAccountMenu();
|
|
|
|
AssetOfficialAccountMenu as = new AssetOfficialAccountMenu();
|
|
|
|
if(s1[i]!=null&& !Objects.equals(s1[i], "")){
|
|
|
|
if (s1[i] != null && !Objects.equals(s1[i], "")) {
|
|
|
|
as.setCdmc(s1[i]);
|
|
|
|
as.setCdmc(s1[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(s2[i]!=null&& !Objects.equals(s2[i], "")){
|
|
|
|
if (s2[i] != null && !Objects.equals(s2[i], "")) {
|
|
|
|
as.setCdlj(s2[i]);
|
|
|
|
as.setCdlj(s2[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(s3[i]!=null&& !Objects.equals(s3[i], "")){
|
|
|
|
if (s3[i] != null && !Objects.equals(s3[i], "")) {
|
|
|
|
as.setCdlx(s3[i]);
|
|
|
|
as.setCdlx(s3[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a1.add(as);
|
|
|
|
a1.add(as);
|
|
|
@ -457,6 +494,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SneakyThrows
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int sh(AssetCurrentShRequest req) {
|
|
|
|
public int sh(AssetCurrentShRequest req) {
|
|
|
|
//根据taskid获取当前任务的count数量
|
|
|
|
//根据taskid获取当前任务的count数量
|
|
|
@ -471,9 +509,175 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
//创建任务流程
|
|
|
|
//创建任务流程
|
|
|
|
getTaskStatus(req);
|
|
|
|
getTaskStatus(req);
|
|
|
|
if (req.getBtgyy()!=null){
|
|
|
|
if (req.getBtgyy() != null) {
|
|
|
|
assetTaskDao.sh(req);
|
|
|
|
assetTaskDao.sh(req);
|
|
|
|
|
|
|
|
//修改子表和新增历史表
|
|
|
|
|
|
|
|
updateZiandHistory(req, date);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//修改子表和新增历史表
|
|
|
|
|
|
|
|
updateZiandHistory(req, date);
|
|
|
|
|
|
|
|
//同步主表
|
|
|
|
|
|
|
|
taskSaveOrDelete(req);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (req.getType() == 1) {
|
|
|
|
|
|
|
|
//小程序资产
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
|
|
|
|
// //创建任务流程
|
|
|
|
|
|
|
|
getTaskStatus(req);
|
|
|
|
|
|
|
|
if (req.getBtgyy() != null) {
|
|
|
|
|
|
|
|
assetTaskDao.xcxsh(req);
|
|
|
|
|
|
|
|
//修改子表和新增历史表
|
|
|
|
|
|
|
|
updateMinZiandHistory(req, date);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//修改子表和新增历史表
|
|
|
|
|
|
|
|
updateMinZiandHistory(req, date);
|
|
|
|
|
|
|
|
//同步主表
|
|
|
|
|
|
|
|
syb(req);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (req.getType() == 2) {
|
|
|
|
|
|
|
|
//公众号资产
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
getTaskStatus(req);
|
|
|
|
|
|
|
|
if (req.getBtgyy() != null) {
|
|
|
|
|
|
|
|
assetTaskDao.gzhsh(req);
|
|
|
|
|
|
|
|
//修改子表和历史表新增
|
|
|
|
|
|
|
|
updateGzhZiandHistory(req, date);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//修改子表和历史表新增
|
|
|
|
|
|
|
|
updateGzhZiandHistory(req, date);
|
|
|
|
|
|
|
|
//同步主表
|
|
|
|
|
|
|
|
syb(req);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (req.getType() == 3) {
|
|
|
|
|
|
|
|
//电子邮件
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
getTaskStatus(req);
|
|
|
|
|
|
|
|
if (req.getBtgyy() != null) {
|
|
|
|
|
|
|
|
assetTaskDao.emailsh(req);
|
|
|
|
|
|
|
|
//修改子表和历史表新增
|
|
|
|
|
|
|
|
updateEmailZiandHistory(req, date);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//修改子表和历史表新增
|
|
|
|
|
|
|
|
updateEmailZiandHistory(req, date);
|
|
|
|
|
|
|
|
//同步主表
|
|
|
|
|
|
|
|
syb(req);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (req.getType() == 4) {
|
|
|
|
|
|
|
|
//app
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
getTaskStatus(req);
|
|
|
|
|
|
|
|
if (req.getBtgyy() != null) {
|
|
|
|
|
|
|
|
assetTaskDao.appsh(req);
|
|
|
|
|
|
|
|
//修改子表和历史表新增
|
|
|
|
|
|
|
|
updateAppZiandHistory(req, date);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//修改子表和历史表新增
|
|
|
|
|
|
|
|
updateAppZiandHistory(req, date);
|
|
|
|
|
|
|
|
//同步主表
|
|
|
|
|
|
|
|
syb(req);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
AssetTask finalTask = assetTaskDao.getByTaskId(req.getTaskId());
|
|
|
|
|
|
|
|
LocalDateTime finishTime = null;
|
|
|
|
|
|
|
|
//根据任务id查询是否进行中
|
|
|
|
|
|
|
|
Integer jxz=assetTaskDao.getJxz(req.getTaskId());
|
|
|
|
|
|
|
|
if(jxz>0){
|
|
|
|
|
|
|
|
//进行中
|
|
|
|
|
|
|
|
finalTask.setTaskStatus(1);
|
|
|
|
|
|
|
|
finalTask.setTaskFinishTime(finishTime);
|
|
|
|
|
|
|
|
assetTaskService.update(finalTask);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
|
|
|
|
//根据任务id查询是否超期
|
|
|
|
|
|
|
|
String ifcq=assetTaskDao.getifcq(req.getTaskId());
|
|
|
|
|
|
|
|
String taskDeadline = finalTask.getTaskDeadline(); // 定义日期格式,确保格式与字符串一致
|
|
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 根据你的时间格式调整
|
|
|
|
|
|
|
|
// 将字符串转换为日期对象
|
|
|
|
|
|
|
|
Date ifcqDate = dateFormat.parse(ifcq);
|
|
|
|
|
|
|
|
Date taskDeadlineDate = dateFormat.parse(taskDeadline);
|
|
|
|
|
|
|
|
// 比较两个日期
|
|
|
|
|
|
|
|
if (ifcqDate.before(taskDeadlineDate)) {
|
|
|
|
|
|
|
|
//超期完成
|
|
|
|
|
|
|
|
finalTask.setTaskStatus(3);
|
|
|
|
|
|
|
|
finishTime = LocalDateTime.now();
|
|
|
|
|
|
|
|
finalTask.setTaskFinishTime(finishTime);
|
|
|
|
|
|
|
|
assetTaskService.update(finalTask);
|
|
|
|
|
|
|
|
} else if (ifcqDate.after(taskDeadlineDate)) {
|
|
|
|
|
|
|
|
//正常完成
|
|
|
|
|
|
|
|
finalTask.setTaskStatus(2);
|
|
|
|
|
|
|
|
finishTime = LocalDateTime.now();
|
|
|
|
|
|
|
|
finalTask.setTaskFinishTime(finishTime);
|
|
|
|
|
|
|
|
assetTaskService.update(finalTask);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateAppZiandHistory(AssetCurrentShRequest req, Date date) {
|
|
|
|
|
|
|
|
req.getAssetAppCpPo().setStatus(req.getStatus());
|
|
|
|
|
|
|
|
req.getAssetAppCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
assetAppCpService.updateById(req.getAssetAppCpPo());
|
|
|
|
|
|
|
|
//新增历史记录表
|
|
|
|
|
|
|
|
AssetAppHistory assetAppHistory = new AssetAppHistory();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(req.getAssetAppCpPo(), assetAppHistory);
|
|
|
|
|
|
|
|
assetAppHistoryService.save(assetAppHistory);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateEmailZiandHistory(AssetCurrentShRequest req, Date date) {
|
|
|
|
|
|
|
|
req.getAssetEmailCpPo().setStatus(req.getStatus());
|
|
|
|
|
|
|
|
req.getAssetEmailCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
assetEmailCpService.updateById(req.getAssetEmailCpPo());
|
|
|
|
|
|
|
|
//新增历史记录表
|
|
|
|
|
|
|
|
AssetEmailHistory assetEmailHistory = new AssetEmailHistory();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(req.getAssetEmailCpPo(), assetEmailHistory);
|
|
|
|
|
|
|
|
assetEmailHistoryService.save(assetEmailHistory);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateGzhZiandHistory(AssetCurrentShRequest req, Date date) {
|
|
|
|
|
|
|
|
if (req.getAssetOfficialAccountCpPo().getCdList() != null && !req.getAssetOfficialAccountCpPo().getCdList().isEmpty()) {
|
|
|
|
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
|
|
|
|
StringBuilder b = new StringBuilder();
|
|
|
|
|
|
|
|
StringBuilder c = new StringBuilder();
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().getCdList().forEach(x -> {
|
|
|
|
|
|
|
|
a.append(x.getCdmc()).append("|");
|
|
|
|
|
|
|
|
b.append(x.getCdlj()).append("|");
|
|
|
|
|
|
|
|
c.append(x.getCdlx()).append("|");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setCdmc(a.toString());
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setCdlj(b.toString());
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setCdlx(c.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setStatus(req.getStatus());
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
assetOfficialAccountCpService.updateById(req.getAssetOfficialAccountCpPo());
|
|
|
|
|
|
|
|
//新增历史记录表
|
|
|
|
|
|
|
|
AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(req.getAssetOfficialAccountCpPo(), assetOfficialAccountHistory);
|
|
|
|
|
|
|
|
assetOfficialAccountHistoryService.save(assetOfficialAccountHistory);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateMinZiandHistory(AssetCurrentShRequest req, Date date) {
|
|
|
|
|
|
|
|
req.getAssetMiniProgramsCpPo().setStatus(req.getStatus());
|
|
|
|
|
|
|
|
req.getAssetMiniProgramsCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
assetMiniProgramsCpService.updateById(req.getAssetMiniProgramsCpPo());
|
|
|
|
|
|
|
|
//新增历史记录表
|
|
|
|
|
|
|
|
AssetMiniProgramsHistory assetMiniProgramsHistory = new AssetMiniProgramsHistory();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(req.getAssetMiniProgramsCpPo(), assetMiniProgramsHistory);
|
|
|
|
|
|
|
|
assetMiniProgramsHistoryService.save(assetMiniProgramsHistory);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateZiandHistory(AssetCurrentShRequest req, Date date) {
|
|
|
|
//根据资产id和任务id删除五张表数据
|
|
|
|
//根据资产id和任务id删除五张表数据
|
|
|
|
assetCurrentCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
|
|
|
|
assetCurrentCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
|
|
|
|
assetBusinessFormCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
|
|
|
|
assetBusinessFormCpService.deletByAssetIdandTaskId(req.getAssetCurrentCpPo().getId(), req.getAssetCurrentCpPo().getTaskId());
|
|
|
@ -504,6 +708,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
|
|
|
|
|
|
|
// 设置更新时间
|
|
|
|
// 设置更新时间
|
|
|
|
req.getAssetCurrentCpPo().setUpdateTime(date);
|
|
|
|
req.getAssetCurrentCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
AssetCurrentHistory assetCurrentHistory = new AssetCurrentHistory();
|
|
|
|
assetCurrentCpService.save(req.getAssetCurrentCpPo());
|
|
|
|
assetCurrentCpService.save(req.getAssetCurrentCpPo());
|
|
|
|
//新增新监管业务形态
|
|
|
|
//新增新监管业务形态
|
|
|
|
if (req.getAssetCurrentCpPo().getXjgywxt() != null) {
|
|
|
|
if (req.getAssetCurrentCpPo().getXjgywxt() != null) {
|
|
|
@ -537,242 +742,163 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
//新增其他联系人
|
|
|
|
//新增其他联系人
|
|
|
|
unitOtherConcatCpService.saveBatch(req.getAssetCurrentCpPo().getOtherConcat());
|
|
|
|
unitOtherConcatCpService.saveBatch(req.getAssetCurrentCpPo().getOtherConcat());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//新增历史记录
|
|
|
|
} else if (req.getType() == 1) {
|
|
|
|
saveHistory(req, a, b, date, assetCurrentHistory);
|
|
|
|
//小程序资产
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
|
|
|
|
getTaskStatus(req);
|
|
|
|
|
|
|
|
if (req.getBtgyy()!=null){
|
|
|
|
|
|
|
|
assetTaskDao.xcxsh(req);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
req.getAssetMiniProgramsCpPo().setStatus(req.getStatus());
|
|
|
|
|
|
|
|
req.getAssetMiniProgramsCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
assetMiniProgramsCpService.updateById(req.getAssetMiniProgramsCpPo());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else if (req.getType() == 2) {
|
|
|
|
private void saveHistory(AssetCurrentShRequest req, StringBuilder a, StringBuilder b, Date date, AssetCurrentHistory assetCurrentHistory) {
|
|
|
|
//公众号资产
|
|
|
|
//新增历史记录
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
|
|
|
|
getTaskStatus(req);
|
|
|
|
|
|
|
|
if (req.getBtgyy()!=null){
|
|
|
|
|
|
|
|
assetTaskDao.gzhsh(req);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
if (req.getAssetOfficialAccountCpPo().getCdList() != null && !req.getAssetOfficialAccountCpPo().getCdList().isEmpty()) {
|
|
|
|
|
|
|
|
StringBuilder a = new StringBuilder();
|
|
|
|
|
|
|
|
StringBuilder b = new StringBuilder();
|
|
|
|
|
|
|
|
StringBuilder c = new StringBuilder();
|
|
|
|
StringBuilder c = new StringBuilder();
|
|
|
|
req.getAssetOfficialAccountCpPo().getCdList().forEach(x -> {
|
|
|
|
if (!req.getAssetCurrentCpPo().getGlymList().isEmpty()) {
|
|
|
|
a.append(x.getCdmc()).append("|");
|
|
|
|
req.getAssetCurrentCpPo().getGlymList().forEach(x -> {
|
|
|
|
b.append(x.getCdlj()).append("|");
|
|
|
|
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
|
|
|
|
c.append(x.getCdlx()).append("|");
|
|
|
|
c.append(x.getKey());
|
|
|
|
});
|
|
|
|
c.append(",");
|
|
|
|
req.getAssetOfficialAccountCpPo().setCdmc(a.toString());
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setCdlj(b.toString());
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setCdlx(c.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setStatus(req.getStatus());
|
|
|
|
|
|
|
|
req.getAssetOfficialAccountCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
assetOfficialAccountCpService.updateById(req.getAssetOfficialAccountCpPo());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
} else if (req.getType() == 3) {
|
|
|
|
|
|
|
|
//电子邮件
|
|
|
|
|
|
|
|
//创建任务流程
|
|
|
|
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
|
|
|
|
getTaskStatus(req);
|
|
|
|
|
|
|
|
if (req.getBtgyy()!=null){
|
|
|
|
|
|
|
|
assetTaskDao.emailsh(req);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
req.getAssetEmailCpPo().setStatus(req.getStatus());
|
|
|
|
|
|
|
|
req.getAssetEmailCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
assetEmailCpService.updateById(req.getAssetEmailCpPo());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
req.getAssetCurrentCpPo().setGlym(a.toString());
|
|
|
|
} else if (req.getType() == 4) {
|
|
|
|
StringBuilder d = new StringBuilder();
|
|
|
|
//app
|
|
|
|
if (!req.getAssetCurrentCpPo().getGlIpList().isEmpty()) {
|
|
|
|
//创建任务流程
|
|
|
|
req.getAssetCurrentCpPo().getGlIpList().forEach(x -> {
|
|
|
|
ifCq(req, assetTask);
|
|
|
|
if (!Objects.equals(x.getKey(), "") && x.getKey() != null) {
|
|
|
|
getTaskStatus(req);
|
|
|
|
d.append(x.getKey());
|
|
|
|
if (req.getBtgyy()!=null){
|
|
|
|
d.append(",");
|
|
|
|
assetTaskDao.appsh(req);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
req.getAssetAppCpPo().setStatus(req.getStatus());
|
|
|
|
|
|
|
|
req.getAssetAppCpPo().setUpdateTime(date);
|
|
|
|
|
|
|
|
assetAppCpService.updateById(req.getAssetAppCpPo());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AssetTask finalTask = assetTaskDao.getByTaskId(req.getTaskId());
|
|
|
|
req.getAssetCurrentCpPo().setGlIp(b.toString());
|
|
|
|
//判断当前任务资产是否全部审核完成
|
|
|
|
req.getAssetCurrentCpPo().setStatus(req.getStatus());
|
|
|
|
int deadlineCount = Optional.ofNullable(finalTask.getDeadlineCount()).orElse(0);
|
|
|
|
|
|
|
|
int count = Optional.ofNullable(finalTask.getCount()).orElse(0);
|
|
|
|
|
|
|
|
int totalCount = Optional.ofNullable(finalTask.getTotalCount()).orElse(0);
|
|
|
|
|
|
|
|
int ygt = Optional.ofNullable(finalTask.getYgt()).orElse(0);
|
|
|
|
|
|
|
|
LocalDateTime finishTime = null;
|
|
|
|
|
|
|
|
if (ygt + count >= totalCount && deadlineCount == 0) {
|
|
|
|
|
|
|
|
//关停和通过数量=全部数量并且超期完成数量为0 状态是正常完成 status=2
|
|
|
|
|
|
|
|
finalTask.setTaskStatus(2);
|
|
|
|
|
|
|
|
finishTime = LocalDateTime.now();
|
|
|
|
|
|
|
|
finalTask.setTaskFinishTime(finishTime);
|
|
|
|
|
|
|
|
assetTaskService.update(finalTask);
|
|
|
|
|
|
|
|
//同步主表数据 web
|
|
|
|
|
|
|
|
taskSaveOrDelete(req);
|
|
|
|
|
|
|
|
syb(req);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (deadlineCount + count + ygt >= totalCount && deadlineCount != 0) {
|
|
|
|
// 设置更新时间
|
|
|
|
//超期完成和通过数量=全部数量并且超期完成数量不为0 状态是超期完成 status=3
|
|
|
|
req.getAssetCurrentCpPo().setUpdateTime(date);
|
|
|
|
finalTask.setTaskStatus(3);
|
|
|
|
BeanUtils.copyProperties(req.getAssetCurrentCpPo(), assetCurrentHistory);
|
|
|
|
finishTime = LocalDateTime.now();
|
|
|
|
assetCurrentHistoryService.save(assetCurrentHistory);
|
|
|
|
finalTask.setTaskFinishTime(finishTime);
|
|
|
|
|
|
|
|
assetTaskService.update(finalTask);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//同步主表数据 web
|
|
|
|
//新增新监管业务形态历史表
|
|
|
|
taskSaveOrDelete(req);
|
|
|
|
if (req.getAssetCurrentCpPo().getXjgywxt() != null) {
|
|
|
|
syb(req);
|
|
|
|
req.getAssetCurrentCpPo().getXjgywxt().setAssetId(req.getAssetCurrentCpPo().getId());
|
|
|
|
} else if (req.getBtgyy() != null) {
|
|
|
|
req.getAssetCurrentCpPo().getXjgywxt().setTaskId(req.getAssetCurrentCpPo().getTaskId());
|
|
|
|
//不通过 状态为1
|
|
|
|
AssetBusinessFormHistory assetBusinessFormHistory = new AssetBusinessFormHistory();
|
|
|
|
finalTask.setTaskStatus(1);
|
|
|
|
assetBusinessFormHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId());
|
|
|
|
String btgyy = req.getBtgyy();
|
|
|
|
BeanUtils.copyProperties(req.getAssetCurrentCpPo().getXjgywxt(), assetBusinessFormHistory);
|
|
|
|
assetTaskService.update(finalTask);
|
|
|
|
assetBusinessFormHistoryService.save(assetBusinessFormHistory);
|
|
|
|
//修改不通过原因
|
|
|
|
|
|
|
|
if (req.getType() == 0) {
|
|
|
|
|
|
|
|
//根据任务id,资产id获取退回次数
|
|
|
|
|
|
|
|
AssetCurrentCpPo assetCurrentCpPo = assetCurrentCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取退回次数
|
|
|
|
|
|
|
|
Integer thcs = 0;
|
|
|
|
|
|
|
|
if (assetCurrentCpPo.getCount() != null) {
|
|
|
|
|
|
|
|
thcs = assetCurrentCpPo.getCount();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int newThcs = thcs + 1;
|
|
|
|
|
|
|
|
assetCurrentCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
|
|
|
|
|
|
|
|
} else if (req.getType() == 1) {
|
|
|
|
|
|
|
|
//根据任务id,资产id获取退回次数
|
|
|
|
|
|
|
|
AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
|
|
|
|
|
|
|
|
//获取退回次数
|
|
|
|
|
|
|
|
Integer thcs = 0;
|
|
|
|
|
|
|
|
if (assetMiniProgramsCpPo.getCount() != null) {
|
|
|
|
|
|
|
|
thcs = assetMiniProgramsCpPo.getCount();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int newThcs = thcs + 1;
|
|
|
|
|
|
|
|
assetMiniProgramsCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
|
|
|
|
|
|
|
|
} else if (req.getType() == 2) {
|
|
|
|
|
|
|
|
//根据任务id,资产id获取退回次数
|
|
|
|
|
|
|
|
AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
|
|
|
|
|
|
|
|
//获取退回次数
|
|
|
|
|
|
|
|
Integer thcs = 0;
|
|
|
|
|
|
|
|
if (assetOfficialAccountCpPo.getCount() != null) {
|
|
|
|
|
|
|
|
thcs = assetOfficialAccountCpPo.getCount();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!req.getAssetCurrentCpPo().getGylxxList().isEmpty()) {
|
|
|
|
|
|
|
|
for (AssetSupplyChainCpPo items : req.getAssetCurrentCpPo().getGylxxList()) {
|
|
|
|
|
|
|
|
items.setAssetId(req.getAssetCurrentCpPo().getId());
|
|
|
|
|
|
|
|
items.setTaskId(req.getAssetCurrentCpPo().getTaskId());
|
|
|
|
|
|
|
|
|
|
|
|
int newThcs = thcs + 1;
|
|
|
|
|
|
|
|
assetOfficialAccountCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
|
|
|
|
|
|
|
|
} else if (req.getType() == 3) {
|
|
|
|
|
|
|
|
//根据任务id,资产id获取退回次数
|
|
|
|
|
|
|
|
AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
|
|
|
|
|
|
|
|
//获取退回次数
|
|
|
|
|
|
|
|
Integer thcs = 0;
|
|
|
|
|
|
|
|
if (assetEmailCpPo.getCount() != null) {
|
|
|
|
|
|
|
|
thcs = assetEmailCpPo.getCount();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int newThcs = thcs + 1;
|
|
|
|
|
|
|
|
assetEmailCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
|
|
|
|
|
|
|
|
} else if (req.getType() == 4) {
|
|
|
|
|
|
|
|
//根据任务id,资产id获取退回次数
|
|
|
|
|
|
|
|
AssetAppCpPo assetAppCpPo = assetAppCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
|
|
|
|
|
|
|
|
//获取退回次数
|
|
|
|
|
|
|
|
Integer thcs = 0;
|
|
|
|
|
|
|
|
if (assetAppCpPo.getCount() != null) {
|
|
|
|
|
|
|
|
thcs = assetAppCpPo.getCount();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int newThcs = thcs + 1;
|
|
|
|
|
|
|
|
assetAppCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增供应链历史表
|
|
|
|
return 0;
|
|
|
|
List<AssetSupplyChainHistory> assetSupplyChainHistoryList = req.getAssetCurrentCpPo().getGylxxList().stream()
|
|
|
|
|
|
|
|
.map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSupplyChainHistory assetSupplyChainHistory = new AssetSupplyChainHistory();
|
|
|
|
|
|
|
|
assetSupplyChainHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId());
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, assetSupplyChainHistory); // 复制属性
|
|
|
|
|
|
|
|
return assetSupplyChainHistory; // 返回新对象
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
|
|
|
|
assetSupplyChainHistoryService.saveBatch(assetSupplyChainHistoryList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!req.getAssetCurrentCpPo().getJcwlList().isEmpty()) {
|
|
|
|
|
|
|
|
for (AssetBasicNetworkCpPo items : req.getAssetCurrentCpPo().getJcwlList()) {
|
|
|
|
|
|
|
|
items.setAssetId(req.getAssetCurrentCpPo().getId());
|
|
|
|
|
|
|
|
items.setTaskId(req.getAssetCurrentCpPo().getTaskId());
|
|
|
|
|
|
|
|
|
|
|
|
private void syb(AssetCurrentShRequest req) {
|
|
|
|
|
|
|
|
//app 小程序 邮件 公众号
|
|
|
|
|
|
|
|
List<AssetAppCpPo> appList = assetAppCpService.findByTaskId(req.getTaskId());
|
|
|
|
|
|
|
|
List<AssetEmailCpPo> emailCpPoListList = assetEmailCpService.findByTaskId(req.getTaskId());
|
|
|
|
|
|
|
|
List<AssetMiniProgramsCpPo> miniProgramsCpPoListList = assetMiniProgramsCpService.findByTaskId(req.getTaskId());
|
|
|
|
|
|
|
|
List<AssetOfficialAccountCpPo> officialAccountCpPoListList = assetOfficialAccountCpService.findByTaskId(req.getTaskId());
|
|
|
|
|
|
|
|
//app
|
|
|
|
|
|
|
|
List<Long> appidList = appList.stream()
|
|
|
|
|
|
|
|
.map(AssetAppCpPo::getAssetId)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(appidList)) {
|
|
|
|
|
|
|
|
assetAppService.deleteIdList(appidList);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
//新增基础网络历史表
|
|
|
|
List<AssetApp> appNewList = appList.stream()
|
|
|
|
List<AssetBasicNetworkHistory> assetSupplyChainHistoryList = req.getAssetCurrentCpPo().getJcwlList().stream()
|
|
|
|
.map(cpPo -> {
|
|
|
|
.map(cpPo -> {
|
|
|
|
AssetApp current = new AssetApp();
|
|
|
|
AssetBasicNetworkHistory assetBasicNetworkHistory = new AssetBasicNetworkHistory();
|
|
|
|
BeanUtils.copyProperties(cpPo, current); // 复制属性
|
|
|
|
assetBasicNetworkHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId());
|
|
|
|
return current; // 返回新对象
|
|
|
|
BeanUtils.copyProperties(cpPo, assetBasicNetworkHistory); // 复制属性
|
|
|
|
|
|
|
|
return assetBasicNetworkHistory; // 返回新对象
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
assetAppService.saveBatch(appNewList);
|
|
|
|
assetBasicNetworkHistoryService.saveBatch(assetSupplyChainHistoryList);
|
|
|
|
|
|
|
|
|
|
|
|
//邮件
|
|
|
|
|
|
|
|
List<Long> emailidList = emailCpPoListList.stream()
|
|
|
|
|
|
|
|
.map(AssetEmailCpPo::getAssetId)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(emailidList)) {
|
|
|
|
|
|
|
|
assetEmailService.deleteIdList(emailidList);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
if (!req.getAssetCurrentCpPo().getOtherConcat().isEmpty()) {
|
|
|
|
List<AssetEmail> emailNewList = emailCpPoListList.stream()
|
|
|
|
for (UnitOtherConcatCpPo items : req.getAssetCurrentCpPo().getOtherConcat()) {
|
|
|
|
|
|
|
|
items.setAssetId(req.getAssetCurrentCpPo().getId());
|
|
|
|
|
|
|
|
items.setTaskId(req.getAssetCurrentCpPo().getTaskId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增其他联系人
|
|
|
|
|
|
|
|
List<UnitOtherConcatHistory> unitOtherConcatHistoryList = req.getAssetCurrentCpPo().getOtherConcat().stream()
|
|
|
|
.map(cpPo -> {
|
|
|
|
.map(cpPo -> {
|
|
|
|
AssetEmail current = new AssetEmail();
|
|
|
|
UnitOtherConcatHistory unitOtherConcatHistory = new UnitOtherConcatHistory();
|
|
|
|
BeanUtils.copyProperties(cpPo, current); // 复制属性
|
|
|
|
unitOtherConcatHistory.setCopyId(req.getAssetCurrentCpPo().getCurrentId());
|
|
|
|
return current; // 返回新对象
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcatHistory); // 复制属性
|
|
|
|
|
|
|
|
return unitOtherConcatHistory; // 返回新对象
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
assetEmailService.saveBatch(emailNewList);
|
|
|
|
unitOtherConcatHistoryService.saveBatch(unitOtherConcatHistoryList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void syb(AssetCurrentShRequest req) {
|
|
|
|
|
|
|
|
if (req.getType() == 1) {
|
|
|
|
//小程序
|
|
|
|
//小程序
|
|
|
|
List<Long> miniidList = miniProgramsCpPoListList.stream()
|
|
|
|
AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByTaskId(req.getAssetId());
|
|
|
|
.map(AssetMiniProgramsCpPo::getAssetId)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
if (CollectionUtil.isNotEmpty(miniidList)) {
|
|
|
|
if (assetMiniProgramsCpPo != null) {
|
|
|
|
assetMiniProgramsService.deleteIdList(miniidList);
|
|
|
|
assetMiniProgramsService.deleteIdList(Collections.singletonList(assetMiniProgramsCpPo.getAssetId()));
|
|
|
|
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
|
|
|
|
AssetMiniPrograms assetMiniPrograms = new AssetMiniPrograms();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(assetMiniProgramsCpPo, assetMiniPrograms); // 复制属性
|
|
|
|
|
|
|
|
assetMiniPrograms.setId(null);
|
|
|
|
|
|
|
|
assetMiniProgramsService.save(assetMiniPrograms);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (req.getType() == 2) {
|
|
|
|
|
|
|
|
//公众号资产
|
|
|
|
|
|
|
|
AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByTaskId(req.getAssetId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (assetOfficialAccountCpPo != null) {
|
|
|
|
|
|
|
|
assetOfficialAccountService.deleteIdList(Collections.singletonList(assetOfficialAccountCpPo.getAssetId()));
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
List<AssetMiniPrograms> miniNewList = miniProgramsCpPoListList.stream()
|
|
|
|
AssetOfficialAccount assetOfficialAccount = new AssetOfficialAccount();
|
|
|
|
.map(cpPo -> {
|
|
|
|
BeanUtils.copyProperties(assetOfficialAccountCpPo, assetOfficialAccount); // 复制属性
|
|
|
|
AssetMiniPrograms current = new AssetMiniPrograms();
|
|
|
|
assetOfficialAccountService.save(assetOfficialAccount);
|
|
|
|
BeanUtils.copyProperties(cpPo, current); // 复制属性
|
|
|
|
}
|
|
|
|
return current; // 返回新对象
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
|
|
|
|
assetMiniProgramsService.saveBatch(miniNewList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//公众号
|
|
|
|
}
|
|
|
|
List<Long> officialidList = officialAccountCpPoListList.stream()
|
|
|
|
if (req.getType() == 3) {
|
|
|
|
.map(AssetOfficialAccountCpPo::getAssetId)
|
|
|
|
//电子邮件资产
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
//根据assetId查询查询数据
|
|
|
|
|
|
|
|
AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByTaskId(req.getAssetId());
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
if (CollectionUtil.isNotEmpty(officialidList)) {
|
|
|
|
if (assetEmailCpPo != null) {
|
|
|
|
assetOfficialAccountService.deleteIdList(officialidList);
|
|
|
|
assetEmailService.deleteIdList(Collections.singletonList(assetEmailCpPo.getAssetId()));
|
|
|
|
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
|
|
|
|
AssetEmail assetEmail = new AssetEmail();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(assetEmailCpPo, assetEmail); // 复制属性
|
|
|
|
|
|
|
|
assetEmail.setId(null);
|
|
|
|
|
|
|
|
assetEmailService.save(assetEmail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (req.getType() == 4) {
|
|
|
|
|
|
|
|
//移动应用程序资产
|
|
|
|
|
|
|
|
//根据资产id查询
|
|
|
|
|
|
|
|
AssetAppCpPo assetAppCpPo = assetAppCpService.findByTaskId(req.getAssetId());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (assetAppCpPo != null) {
|
|
|
|
|
|
|
|
assetAppService.deleteIdList(Collections.singletonList(assetAppCpPo.getAssetId()));
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
List<AssetOfficialAccount> officialNewList = officialAccountCpPoListList.stream()
|
|
|
|
AssetApp assetApp = new AssetApp();
|
|
|
|
.map(cpPo -> {
|
|
|
|
BeanUtils.copyProperties(assetAppCpPo, assetApp); // 复制属性
|
|
|
|
AssetOfficialAccount current = new AssetOfficialAccount();
|
|
|
|
assetApp.setId(null);
|
|
|
|
BeanUtils.copyProperties(cpPo, current); // 复制属性
|
|
|
|
assetAppService.save(assetApp);
|
|
|
|
return current; // 返回新对象
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
|
|
|
|
assetOfficialAccountService.saveBatch(officialNewList);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ifCq(AssetCurrentShRequest req, AssetTask assetTask) {
|
|
|
|
private void ifCq(AssetCurrentShRequest req, AssetTask assetTask) {
|
|
|
@ -823,99 +949,61 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
|
|
|
|
|
|
|
|
|
|
|
|
//web
|
|
|
|
//web
|
|
|
|
private void taskSaveOrDelete(AssetCurrentShRequest req) {
|
|
|
|
private void taskSaveOrDelete(AssetCurrentShRequest req) {
|
|
|
|
// 根据taskid查询五张数据
|
|
|
|
// 根据资产id查询五张数据
|
|
|
|
List<AssetCurrentCpPo> currentList = assetCurrentCpService.findByTaskId(req.getTaskId());
|
|
|
|
AssetCurrentCpPo currentCpPo = assetCurrentCpService.findByTaskId(req.getAssetId());
|
|
|
|
List<Long> idList = currentList.stream()
|
|
|
|
//删除主表原有数据
|
|
|
|
.map(AssetCurrentCpPo::getId)
|
|
|
|
if (currentCpPo != null) {
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
assetCurrentService.deleteIdList(currentCpPo.getId());
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(idList)) {
|
|
|
|
|
|
|
|
assetCurrentService.deleteIdList(idList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
List<AssetCurrent> currentNewList = currentList.stream()
|
|
|
|
|
|
|
|
.map(cpPo -> {
|
|
|
|
|
|
|
|
AssetCurrent current = new AssetCurrent();
|
|
|
|
AssetCurrent current = new AssetCurrent();
|
|
|
|
BeanUtils.copyProperties(cpPo, current); // 复制属性
|
|
|
|
BeanUtils.copyProperties(currentCpPo, current); // 复制属性
|
|
|
|
return current; // 返回新对象
|
|
|
|
current.setId(null);
|
|
|
|
})
|
|
|
|
assetCurrentService.save(current);
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
|
|
|
|
assetCurrentService.saveBatch(currentNewList);
|
|
|
|
|
|
|
|
//AssetBusinessFormCpPo
|
|
|
|
|
|
|
|
List<AssetBusinessFormCpPo> bussinessList = assetBusinessFormCpService.findByTaskId(req.getTaskId());
|
|
|
|
|
|
|
|
List<Long> bussinessidList = bussinessList.stream()
|
|
|
|
|
|
|
|
.map(AssetBusinessFormCpPo::getAssetId)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bussinessidList)) {
|
|
|
|
|
|
|
|
assetBusinessFormService.deleteIdList(bussinessidList);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//AssetBusinessFormCpPo
|
|
|
|
|
|
|
|
AssetBusinessFormCpPo businessFormCpPo = assetBusinessFormCpService.findByTaskId(req.getAssetId());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
|
|
|
|
if (businessFormCpPo != null) {
|
|
|
|
|
|
|
|
assetBusinessFormService.deleteIdList(Collections.singletonList(businessFormCpPo.getAssetId()));
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
List<AssetBusinessForm> bussinessNewList = bussinessList.stream()
|
|
|
|
|
|
|
|
.map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBusinessForm businessForm = new AssetBusinessForm();
|
|
|
|
AssetBusinessForm businessForm = new AssetBusinessForm();
|
|
|
|
BeanUtils.copyProperties(cpPo, businessForm); // 复制属性
|
|
|
|
BeanUtils.copyProperties(businessFormCpPo, businessForm); // 复制属性
|
|
|
|
return businessForm; // 返回新对象
|
|
|
|
businessForm.setId(null);
|
|
|
|
})
|
|
|
|
assetBusinessFormService.save(businessForm);
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
}
|
|
|
|
assetBusinessFormService.saveBatch(bussinessNewList);
|
|
|
|
|
|
|
|
//AssetBasicNetworkCpPo
|
|
|
|
//AssetBasicNetworkCpPo
|
|
|
|
List<AssetBasicNetworkCpPo> netWorkList = assetBasicNetworkCpService.findByTaskId(req.getTaskId());
|
|
|
|
AssetBasicNetworkCpPo networkCpPo = assetBasicNetworkCpService.findByTaskId(req.getAssetId());
|
|
|
|
List<Long> netWorkidList = netWorkList.stream()
|
|
|
|
|
|
|
|
.map(AssetBasicNetworkCpPo::getAssetId)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
if (CollectionUtil.isNotEmpty(netWorkidList)) {
|
|
|
|
if (networkCpPo != null) {
|
|
|
|
assetBasicNetworkService.deleteIdList(netWorkidList);
|
|
|
|
assetBasicNetworkService.deleteIdList(Collections.singletonList(networkCpPo.getAssetId()));
|
|
|
|
|
|
|
|
AssetBasicNetwork network = new AssetBasicNetwork();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(networkCpPo, network);
|
|
|
|
|
|
|
|
network.setId(null);
|
|
|
|
|
|
|
|
assetBasicNetworkService.save(network);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//将子表数据复制到主表中
|
|
|
|
|
|
|
|
List<AssetBasicNetwork> netWorkNewList = netWorkList.stream()
|
|
|
|
|
|
|
|
.map(cpPo -> {
|
|
|
|
|
|
|
|
AssetBasicNetwork network = new AssetBasicNetwork();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(cpPo, network); // 复制属性
|
|
|
|
|
|
|
|
return network; // 返回新对象
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.collect(Collectors.toList()); // 收集到列表中
|
|
|
|
|
|
|
|
assetBasicNetworkService.saveBatch(netWorkNewList);
|
|
|
|
|
|
|
|
//AssetSupplyChainCpPo
|
|
|
|
//AssetSupplyChainCpPo
|
|
|
|
List<AssetSupplyChainCpPo> SupplyChainList = assetSupplyChainCpService.findByTaskId(req.getTaskId());
|
|
|
|
AssetSupplyChainCpPo supplyChainCpPo = assetSupplyChainCpService.findByTaskId(req.getAssetId());
|
|
|
|
List<Long> SupplyChainidList = SupplyChainList.stream()
|
|
|
|
|
|
|
|
.map(AssetSupplyChainCpPo::getAssetId)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
if (CollectionUtil.isNotEmpty(SupplyChainidList)) {
|
|
|
|
if (supplyChainCpPo != null) {
|
|
|
|
assetSupplyChainService.deleteIdList(SupplyChainidList);
|
|
|
|
assetSupplyChainService.deleteIdList(Collections.singletonList(supplyChainCpPo.getAssetId()));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AssetSupplyChain> SupplyChainNewList = SupplyChainList.stream()
|
|
|
|
|
|
|
|
.map(cpPo -> {
|
|
|
|
|
|
|
|
AssetSupplyChain supplyChain = new AssetSupplyChain();
|
|
|
|
AssetSupplyChain supplyChain = new AssetSupplyChain();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(supplyChainCpPo, supplyChain);
|
|
|
|
supplyChain.setId(null);
|
|
|
|
supplyChain.setId(null);
|
|
|
|
BeanUtils.copyProperties(cpPo, supplyChain); // 复制属性
|
|
|
|
assetSupplyChainService.save(supplyChain);
|
|
|
|
return supplyChain; // 返回新对象
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
assetSupplyChainService.saveBatch(SupplyChainNewList);
|
|
|
|
|
|
|
|
//UnitOtherConcatCpPo
|
|
|
|
//UnitOtherConcatCpPo
|
|
|
|
List<UnitOtherConcatCpPo> UnitOtherConcatList = unitOtherConcatCpService.findByTaskId(req.getTaskId());
|
|
|
|
UnitOtherConcatCpPo unitOtherConcatCpPo = unitOtherConcatCpService.findByTaskId(req.getAssetId());
|
|
|
|
List<Long> UnitOtherConcatidList = UnitOtherConcatList.stream()
|
|
|
|
|
|
|
|
.map(UnitOtherConcatCpPo::getAssetId)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//删除原有数据
|
|
|
|
//删除原有数据
|
|
|
|
if (CollectionUtil.isNotEmpty(UnitOtherConcatidList)) {
|
|
|
|
if (unitOtherConcatCpPo != null) {
|
|
|
|
unitOtherConcatService.deleteIdList(UnitOtherConcatidList);
|
|
|
|
unitOtherConcatService.deleteIdList(Collections.singletonList(unitOtherConcatCpPo.getAssetId()));
|
|
|
|
}
|
|
|
|
|
|
|
|
List<UnitOtherConcat> UnitOtherConcatNewList = UnitOtherConcatList.stream()
|
|
|
|
|
|
|
|
.map(cpPo -> {
|
|
|
|
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
|
|
|
|
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
|
|
|
|
BeanUtils.copyProperties(unitOtherConcatCpPo, unitOtherConcat); // 复制属性
|
|
|
|
return unitOtherConcat; // 返回新对象
|
|
|
|
unitOtherConcat.setConcatId(null);
|
|
|
|
})
|
|
|
|
unitOtherConcatService.save(unitOtherConcat);
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
}
|
|
|
|
unitOtherConcatService.saveBatch(UnitOtherConcatNewList);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|