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

duhanyu
dongdingding 1 month ago
parent 93ac966e30
commit b16a2ff89f

@ -1,6 +1,7 @@
package com.ruoyi.tc.baseClass; package com.ruoyi.tc.baseClass;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -44,7 +45,7 @@ public class BaseClass {
* *
*/ */
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; private Date updateTime;

@ -27,10 +27,9 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.time.LocalDateTime;
import java.util.Arrays; import java.time.ZoneId;
import java.util.List; import java.util.*;
import java.util.Objects;
/** /**
* (AssetCurrent) * (AssetCurrent)
@ -386,7 +385,7 @@ public class AssetCurrentController extends BaseController {
a1.add(acomma); a1.add(acomma);
}); });
byId.setGlymList(a1); byId.setGlymList(a1);
}else { } else {
byId.setGlymList(new ArrayList<>()); byId.setGlymList(new ArrayList<>());
} }
List<Acomma> a2 = new ArrayList<>(); List<Acomma> a2 = new ArrayList<>();
@ -397,7 +396,7 @@ public class AssetCurrentController extends BaseController {
a2.add(acomma); a2.add(acomma);
}); });
byId.setGlIpList(a2); byId.setGlIpList(a2);
}else { } else {
byId.setGlIpList(new ArrayList<>()); byId.setGlIpList(new ArrayList<>());
} }
return success(byId); return success(byId);
@ -519,25 +518,7 @@ public class AssetCurrentController extends BaseController {
@PreAuthorize("@ss.hasAnyRoles('admin,common')") @PreAuthorize("@ss.hasAnyRoles('admin,common')")
@PutMapping @PutMapping
public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) { public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) {
//根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态
List<AssetCurrentCpPo> currentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId());
if (currentCpPo != null) {
for (AssetCurrentCpPo s:currentCpPo) {
//查询任务是否为进行中
AssetTask assetTask = assetTaskService.findByTaskId(s.getTaskId());
if (assetTask.getTaskStatus().equals(1)){
if (s.getStatus()==5 ){
//修改任务中资产状态
s.setStatus(0);
s.setBfyy(null);
assetTask.setTaskStatus(1);
assetTaskService.update(assetTask);
assetCurrentCpService.updateById(s);
}
}
}
}
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc()).eq(Unit::getDelFlag, 0).list(); List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc()).eq(Unit::getDelFlag, 0).list();
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
throw new ServiceException("请选择已有单位!"); throw new ServiceException("请选择已有单位!");
@ -564,7 +545,9 @@ public class AssetCurrentController extends BaseController {
}); });
} }
assetCurrent.setGlIp(b.toString()); assetCurrent.setGlIp(b.toString());
if (!assetCurrent.getXtzt().equals("7")) {
assetCurrent.setBtgyy(null);
}
assetCurrentService.updateById(assetCurrent); assetCurrentService.updateById(assetCurrent);
@ -684,22 +667,28 @@ public class AssetCurrentController extends BaseController {
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat()); unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
} }
}); });
//根据修改的单位名称查询任务表中是否有此单位的任务如果有修改资产中的任务id如果没有删除 //根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态
AssetTask assetTask = assetTaskService.findByDwmc(assetCurrent.getDwmc()); List<AssetCurrentCpPo> currentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId());
if (assetTask == null) { if (currentCpPo != null) {
delete(assetCurrent); for (AssetCurrentCpPo s : currentCpPo) {
} else { //查询任务是否为进行中
//根据资产id查询旧资产 AssetTask assetTask = assetTaskService.findByTaskId(s.getTaskId());
List<AssetCurrentCpPo> assetCurrentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId()); if (assetTask != null) {
for (AssetCurrentCpPo s:assetCurrentCpPo){ if (assetTask.getTaskStatus().equals(1)) {
if (s!=null){ //修改任务中资产状态
s.setDwmc(assetCurrent.getDwmc()); s.setStatus(0);
s.setTaskId(assetTask.getId()); s.setBfyy(null);
//修改 s.setBtgyy(null);
assetCurrentCpService.updateById(s); assetTask.setTaskStatus(1);
} assetTaskService.update(assetTask);
} s.setCurrentId(s.getCurrentId());
s.setUpdateTime(null);
assetCurrentCpService.updateById(s);
}
}
}
} }

@ -12,16 +12,14 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.AssetEmail; import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.po.AssetEmailCpPo;
import com.ruoyi.tc.entity.po.AssetEmailJyPo; import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest; import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest; import com.ruoyi.tc.entity.request.AssetAuditRequest;
import com.ruoyi.tc.entity.request.AssetEmailPageRequest; import com.ruoyi.tc.entity.request.AssetEmailPageRequest;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.*;
import com.ruoyi.tc.service.AssetEmailJyService;
import com.ruoyi.tc.service.AssetEmailService;
import com.ruoyi.tc.service.UnitService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -32,6 +30,9 @@ import org.springframework.web.multipart.MultipartFile;
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.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -60,6 +61,7 @@ public class AssetEmailController extends BaseController {
private AssetTaskService assetTaskService; private AssetTaskService assetTaskService;
@Resource @Resource
private AssetEmailCpService assetEmailCpService; private AssetEmailCpService assetEmailCpService;
/** /**
* *
* *
@ -83,6 +85,7 @@ public class AssetEmailController extends BaseController {
} }
//================================================= //=================================================
/** /**
* *
*/ */
@ -97,9 +100,8 @@ public class AssetEmailController extends BaseController {
} }
AssetEmailJyPo one = assetEmailJyService.lambdaQuery().eq(AssetEmailJyPo::getSsdw, assetEmailJyPo.getSsdw())
AssetEmailJyPo one = assetEmailJyService.lambdaQuery().eq(AssetEmailJyPo::getSsdw,assetEmailJyPo.getSsdw()) .eq(AssetEmailJyPo::getDzyxhz, assetEmailJyPo.getDzyxhz()).isNull(AssetEmailJyPo::getTaskId).one();
.eq(AssetEmailJyPo::getDzyxhz,assetEmailJyPo.getDzyxhz()).isNull(AssetEmailJyPo::getTaskId).one();
assetEmailJyPo.setAuditState("1"); assetEmailJyPo.setAuditState("1");
assetEmailJyPo.setAuditYy(null); assetEmailJyPo.setAuditYy(null);
if (one != null) { if (one != null) {
@ -107,8 +109,8 @@ public class AssetEmailController extends BaseController {
assetEmailJyPo.setAssetId(one.getAssetId()); assetEmailJyPo.setAssetId(one.getAssetId());
assetEmailJyService.updateById(assetEmailJyPo); assetEmailJyService.updateById(assetEmailJyPo);
} else { } else {
assetEmailJyPo.setAssetId(assetEmailService.lambdaQuery().eq(AssetEmail::getSsdw,assetEmailJyPo.getSsdw()) assetEmailJyPo.setAssetId(assetEmailService.lambdaQuery().eq(AssetEmail::getSsdw, assetEmailJyPo.getSsdw())
.eq(AssetEmail::getDzyxhz,assetEmailJyPo.getDzyxhz()).one().getId()); .eq(AssetEmail::getDzyxhz, assetEmailJyPo.getDzyxhz()).one().getId());
assetEmailJyService.save(assetEmailJyPo); assetEmailJyService.save(assetEmailJyPo);
} }
return success(); return success();
@ -162,7 +164,7 @@ public class AssetEmailController extends BaseController {
//通过数据同步 //通过数据同步
if ("2".equals(as.getAuditState())) { if ("2".equals(as.getAuditState())) {
AssetEmailJyPo byId = assetEmailJyService.getById(as.getCurrentId()); AssetEmailJyPo byId = assetEmailJyService.getById(as.getCurrentId());
AssetEmail aa = new AssetEmail(); AssetEmail aa = new AssetEmail();
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId()); aa.setId(byId.getAssetId());
//修改主表 //修改主表
@ -172,7 +174,7 @@ public class AssetEmailController extends BaseController {
.isNotNull(AssetEmailJyPo::getTaskId) .isNotNull(AssetEmailJyPo::getTaskId)
.ne(AssetEmailJyPo::getStatus, 5) .ne(AssetEmailJyPo::getStatus, 5)
.eq(AssetEmailJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetEmailJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){ if (one != null) {
Integer status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getEmailId(); Long appId = one.getEmailId();
@ -224,23 +226,29 @@ public class AssetEmailController extends BaseController {
@Log(title = "编辑email数据", businessType = BusinessType.UPDATE) @Log(title = "编辑email数据", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody AssetEmail assetEmail) { public AjaxResult edit(@RequestBody AssetEmail assetEmail) {
assetEmailService.edit(assetEmail);
//根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态 //根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态
AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findDwmc(assetEmail.getId()); List<AssetEmailCpPo> assetEmailCpPo = assetEmailCpService.findDwmc(assetEmail.getId());
if (assetEmailCpPo != null) { if (assetEmailCpPo != null) {
//查询任务是否为进行中 for (AssetEmailCpPo s : assetEmailCpPo) {
AssetTask assetTask = assetTaskService.findByTaskId(assetEmailCpPo.getTaskId()); //查询任务是否为进行中
if (assetTask.getTaskStatus().equals(1)) { AssetTask assetTask = assetTaskService.findByTaskId(s.getTaskId());
if (assetEmailCpPo.getStatus()==5 ) { if (assetTask.getTaskStatus().equals(1)) {
//修改任务中资产状态 //修改任务中资产状态
assetEmailCpPo.setStatus(0); s.setStatus(0);
assetEmailCpPo.setBfyy(null); s.setBfyy(null);
s.setBtgyy(null);
assetTask.setTaskStatus(1); assetTask.setTaskStatus(1);
s.setUpdateTime(null);
assetTaskService.update(assetTask); assetTaskService.update(assetTask);
assetEmailCpService.updateById(assetEmailCpPo); s.setEmailId(s.getEmailId());
assetEmailCpService.updateById(s);
} }
} }
} }
return success(assetEmailService.edit(assetEmail)); return success();
} }
/** /**
@ -291,13 +299,13 @@ public class AssetEmailController extends BaseController {
ExcelUtil<AssetEmail> util = new ExcelUtil<>(AssetEmail.class); ExcelUtil<AssetEmail> util = new ExcelUtil<>(AssetEmail.class);
List<AssetEmail> list = util.importExcel(file.getInputStream()); List<AssetEmail> list = util.importExcel(file.getInputStream());
if (list != null) { if (list != null) {
list.forEach(x->{ list.forEach(x -> {
AssetEmail one = assetEmailService.lambdaQuery().eq(AssetEmail::getDzyxhz, x.getDzyxhz()) AssetEmail one = assetEmailService.lambdaQuery().eq(AssetEmail::getDzyxhz, x.getDzyxhz())
.eq(AssetEmail::getSsdw, x.getSsdw()).one(); .eq(AssetEmail::getSsdw, x.getSsdw()).one();
if(one!=null){ if (one != null) {
x.setId(one.getId()); x.setId(one.getId());
assetEmailService.edit(x); assetEmailService.edit(x);
}else { } else {
assetEmailService.add(x); assetEmailService.add(x);
} }
}); });

@ -10,23 +10,15 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.AssetCurrent;
import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.AssetMiniPrograms; import com.ruoyi.tc.entity.AssetMiniPrograms;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppCpPo; import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
import com.ruoyi.tc.entity.po.AssetAppJyPo;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo; import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest; import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest; import com.ruoyi.tc.entity.request.AssetAuditRequest;
import com.ruoyi.tc.entity.request.AssetMiniProgramsPageRequest; import com.ruoyi.tc.entity.request.AssetMiniProgramsPageRequest;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.*;
import com.ruoyi.tc.service.AssetMiniProgramsJyService;
import com.ruoyi.tc.service.AssetMiniProgramsService;
import com.ruoyi.tc.service.UnitService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -37,6 +29,9 @@ import org.springframework.web.multipart.MultipartFile;
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.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -66,6 +61,7 @@ public class AssetMiniProgramsController extends BaseController {
@Resource @Resource
private UnitService unitService; private UnitService unitService;
/** /**
* *
* *
@ -89,6 +85,7 @@ public class AssetMiniProgramsController extends BaseController {
} }
//================================================= //=================================================
/** /**
* *
*/ */
@ -102,10 +99,8 @@ public class AssetMiniProgramsController extends BaseController {
} }
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery().eq(AssetMiniProgramsJyPo::getSsdw, assetMiniProgramsJyPo.getSsdw())
.eq(AssetMiniProgramsJyPo::getXcxmc, assetMiniProgramsJyPo.getXcxmc()).isNull(AssetMiniProgramsJyPo::getTaskId).one();
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery().eq(AssetMiniProgramsJyPo::getSsdw,assetMiniProgramsJyPo.getSsdw())
.eq(AssetMiniProgramsJyPo::getXcxmc,assetMiniProgramsJyPo.getXcxmc()).isNull(AssetMiniProgramsJyPo::getTaskId).one();
assetMiniProgramsJyPo.setAuditState("1"); assetMiniProgramsJyPo.setAuditState("1");
assetMiniProgramsJyPo.setAuditYy(null); assetMiniProgramsJyPo.setAuditYy(null);
if (one != null) { if (one != null) {
@ -113,8 +108,8 @@ public class AssetMiniProgramsController extends BaseController {
assetMiniProgramsJyPo.setAssetId(one.getAssetId()); assetMiniProgramsJyPo.setAssetId(one.getAssetId());
assetMiniProgramsJyService.updateById(assetMiniProgramsJyPo); assetMiniProgramsJyService.updateById(assetMiniProgramsJyPo);
} else { } else {
assetMiniProgramsJyPo.setAssetId(assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getSsdw,assetMiniProgramsJyPo.getSsdw()) assetMiniProgramsJyPo.setAssetId(assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getSsdw, assetMiniProgramsJyPo.getSsdw())
.eq(AssetMiniPrograms::getXcxmc,assetMiniProgramsJyPo.getXcxmc()).one().getId()); .eq(AssetMiniPrograms::getXcxmc, assetMiniProgramsJyPo.getXcxmc()).one().getId());
assetMiniProgramsJyService.save(assetMiniProgramsJyPo); assetMiniProgramsJyService.save(assetMiniProgramsJyPo);
} }
return success(); return success();
@ -168,7 +163,7 @@ public class AssetMiniProgramsController extends BaseController {
//通过数据同步 //通过数据同步
if ("2".equals(as.getAuditState())) { if ("2".equals(as.getAuditState())) {
AssetMiniProgramsJyPo byId = assetMiniProgramsJyService.getById(as.getCurrentId()); AssetMiniProgramsJyPo byId = assetMiniProgramsJyService.getById(as.getCurrentId());
AssetMiniPrograms aa = new AssetMiniPrograms(); AssetMiniPrograms aa = new AssetMiniPrograms();
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId()); aa.setId(byId.getAssetId());
//修改主表 //修改主表
@ -178,7 +173,7 @@ public class AssetMiniProgramsController extends BaseController {
.isNotNull(AssetMiniProgramsJyPo::getTaskId) .isNotNull(AssetMiniProgramsJyPo::getTaskId)
.ne(AssetMiniProgramsJyPo::getStatus, 5) .ne(AssetMiniProgramsJyPo::getStatus, 5)
.eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){ if (one != null) {
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getMiniId(); Long appId = one.getMiniId();
Integer status = one.getStatus(); Integer status = one.getStatus();
@ -233,18 +228,25 @@ public class AssetMiniProgramsController extends BaseController {
public AjaxResult edit(@RequestBody AssetMiniPrograms assetMiniPrograms) { public AjaxResult edit(@RequestBody AssetMiniPrograms assetMiniPrograms) {
//根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态 //根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态
AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findDwmc(assetMiniPrograms.getId()); List<AssetMiniProgramsCpPo> assetMiniProgramsCpPo = assetMiniProgramsCpService.findDwmc(assetMiniPrograms.getId());
if (assetMiniProgramsCpPo != null) { if (assetMiniProgramsCpPo != null) {
//查询任务是否为进行中 for (AssetMiniProgramsCpPo s : assetMiniProgramsCpPo) {
AssetTask assetTask = assetTaskService.findByTaskId(assetMiniProgramsCpPo.getTaskId()); //查询任务是否为进行中
if (assetTask.getTaskStatus().equals(1)) { AssetTask assetTask = assetTaskService.findByTaskId(s.getTaskId());
if (assetMiniProgramsCpPo.getStatus()==5) { if (assetTask != null) {
//修改任务中资产状态 if (assetTask.getTaskStatus().equals(1)) {
assetMiniProgramsCpPo.setStatus(0); //修改任务中资产状态
assetMiniProgramsCpPo.setBfyy(null); s.setStatus(0);
assetTask.setTaskStatus(1); s.setBfyy(null);
assetMiniProgramsCpService.updateById(assetMiniProgramsCpPo); s.setBtgyy(null);
assetTaskService.update(assetTask);
s.setUpdateTime(null);
assetTask.setTaskStatus(1);
s.setMiniId(s.getMiniId());
assetMiniProgramsCpService.updateById(s);
assetTaskService.update(assetTask);
}
} }
} }
} }
@ -299,13 +301,13 @@ public class AssetMiniProgramsController extends BaseController {
ExcelUtil<AssetMiniPrograms> util = new ExcelUtil<>(AssetMiniPrograms.class); ExcelUtil<AssetMiniPrograms> util = new ExcelUtil<>(AssetMiniPrograms.class);
List<AssetMiniPrograms> list = util.importExcel(file.getInputStream()); List<AssetMiniPrograms> list = util.importExcel(file.getInputStream());
if (list != null) { if (list != null) {
list.forEach(x->{ list.forEach(x -> {
AssetMiniPrograms one = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getSsdw, x.getSsdw()) AssetMiniPrograms one = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getSsdw, x.getSsdw())
.eq(AssetMiniPrograms::getXcxmc, x.getXcxmc()).one(); .eq(AssetMiniPrograms::getXcxmc, x.getXcxmc()).one();
if(one!=null){ if (one != null) {
x.setId(one.getId()); x.setId(one.getId());
assetMiniProgramsService.edit(x); assetMiniProgramsService.edit(x);
}else { } else {
assetMiniProgramsService.add(x); assetMiniProgramsService.add(x);
} }
}); });

@ -9,23 +9,16 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.AssetMiniPrograms;
import com.ruoyi.tc.entity.AssetOfficialAccount; import com.ruoyi.tc.entity.AssetOfficialAccount;
import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppJyPo; import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountJyPo; import com.ruoyi.tc.entity.po.AssetOfficialAccountJyPo;
import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest; import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest; import com.ruoyi.tc.entity.request.AssetAuditRequest;
import com.ruoyi.tc.entity.request.AssetOfficialAccountMenu; import com.ruoyi.tc.entity.request.AssetOfficialAccountMenu;
import com.ruoyi.tc.entity.request.AssetOfficialAccountPageRequest; import com.ruoyi.tc.entity.request.AssetOfficialAccountPageRequest;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.*;
import com.ruoyi.tc.service.AssetOfficialAccountJyService;
import com.ruoyi.tc.service.AssetOfficialAccountService;
import com.ruoyi.tc.service.UnitService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -36,8 +29,10 @@ import org.springframework.web.multipart.MultipartFile;
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.security.Security; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -107,13 +102,13 @@ public class AssetOfficialAccountController {
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);
@ -123,6 +118,7 @@ public class AssetOfficialAccountController {
} }
//================================================= //=================================================
/** /**
* *
*/ */
@ -137,20 +133,18 @@ public class AssetOfficialAccountController {
} }
if (ao.getCdList() != null && !ao.getCdList().isEmpty()) { if (ao.getCdList() != null && !ao.getCdList().isEmpty()) {
StringBuilder a = new StringBuilder(); StringBuilder a = new StringBuilder();
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
StringBuilder c = new StringBuilder(); StringBuilder c = new StringBuilder();
ao.getCdList().forEach(x -> { ao.getCdList().forEach(x -> {
if(!Objects.equals(x.getCdmc(), "") &&x.getCdmc()!=null){ if (!Objects.equals(x.getCdmc(), "") && x.getCdmc() != null) {
a.append(x.getCdmc()).append("|"); a.append(x.getCdmc()).append("|");
} }
if(!Objects.equals(x.getCdlj(), "") &&x.getCdlj()!=null){ if (!Objects.equals(x.getCdlj(), "") && x.getCdlj() != null) {
b.append(x.getCdlj()).append("|"); b.append(x.getCdlj()).append("|");
} }
if(!Objects.equals(x.getCdlx(), "") &&x.getCdlx()!=null){ if (!Objects.equals(x.getCdlx(), "") && x.getCdlx() != null) {
c.append(x.getCdlx()).append("|"); c.append(x.getCdlx()).append("|");
} }
}); });
@ -160,8 +154,8 @@ public class AssetOfficialAccountController {
} }
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery().eq(AssetOfficialAccountJyPo::getSsdw,ao.getSsdw()) AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery().eq(AssetOfficialAccountJyPo::getSsdw, ao.getSsdw())
.eq(AssetOfficialAccountJyPo::getGzhmc,ao.getGzhmc()).isNull(AssetOfficialAccountJyPo::getTaskId).one(); .eq(AssetOfficialAccountJyPo::getGzhmc, ao.getGzhmc()).isNull(AssetOfficialAccountJyPo::getTaskId).one();
ao.setAuditState("1"); ao.setAuditState("1");
ao.setAuditYy(null); ao.setAuditYy(null);
if (one != null) { if (one != null) {
@ -169,8 +163,8 @@ public class AssetOfficialAccountController {
ao.setAssetId(one.getAssetId()); ao.setAssetId(one.getAssetId());
assetOfficialAccountJyService.updateById(ao); assetOfficialAccountJyService.updateById(ao);
} else { } else {
ao.setAssetId(assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getSsdw,ao.getSsdw()) ao.setAssetId(assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getSsdw, ao.getSsdw())
.eq(AssetOfficialAccount::getGzhmc,ao.getGzhmc()).one().getId()); .eq(AssetOfficialAccount::getGzhmc, ao.getGzhmc()).one().getId());
assetOfficialAccountJyService.save(ao); assetOfficialAccountJyService.save(ao);
} }
return success(); return success();
@ -211,13 +205,13 @@ public class AssetOfficialAccountController {
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);
@ -243,7 +237,7 @@ public class AssetOfficialAccountController {
//通过数据同步 //通过数据同步
if ("2".equals(as.getAuditState())) { if ("2".equals(as.getAuditState())) {
AssetOfficialAccountJyPo byId = assetOfficialAccountJyService.getById(as.getCurrentId()); AssetOfficialAccountJyPo byId = assetOfficialAccountJyService.getById(as.getCurrentId());
AssetOfficialAccount aa = new AssetOfficialAccount(); AssetOfficialAccount aa = new AssetOfficialAccount();
BeanUtil.copyProperties(byId, aa); BeanUtil.copyProperties(byId, aa);
aa.setId(byId.getAssetId()); aa.setId(byId.getAssetId());
//修改主表 //修改主表
@ -253,7 +247,7 @@ public class AssetOfficialAccountController {
.isNotNull(AssetOfficialAccountJyPo::getTaskId) .isNotNull(AssetOfficialAccountJyPo::getTaskId)
.ne(AssetOfficialAccountJyPo::getStatus, 5) .ne(AssetOfficialAccountJyPo::getStatus, 5)
.eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){ if (one != null) {
Integer status = one.getStatus(); Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getAccountId(); Long appId = one.getAccountId();
@ -294,18 +288,28 @@ public class AssetOfficialAccountController {
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody AssetOfficialAccount assetOfficialAccount) { public AjaxResult edit(@RequestBody AssetOfficialAccount assetOfficialAccount) {
//根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态 //根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态
AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findDwmc(assetOfficialAccount.getId()); List<AssetOfficialAccountCpPo> assetOfficialAccountCpPo = assetOfficialAccountCpService.findDwmc(assetOfficialAccount.getId());
if (assetOfficialAccountCpPo != null) { if (assetOfficialAccountCpPo != null) {
//查询任务是否为进行中 for (AssetOfficialAccountCpPo s : assetOfficialAccountCpPo) {
AssetTask assetTask = assetTaskService.findByTaskId(assetOfficialAccountCpPo.getTaskId());
if (assetTask.getTaskStatus().equals(1)) { //查询任务是否为进行中
if (assetOfficialAccountCpPo.getStatus()==5 ) { AssetTask assetTask = assetTaskService.findByTaskId(s.getTaskId());
//修改任务中资产状态 if (assetTask != null) {
assetOfficialAccountCpPo.setStatus(0);
assetOfficialAccountCpPo.setBtgyy(null); if (assetTask.getTaskStatus().equals(1)) {
assetTask.setTaskStatus(1);
assetTaskService.update(assetTask); //修改任务中资产状态
assetOfficialAccountCpService.updateById(assetOfficialAccountCpPo); s.setStatus(0);
s.setBtgyy(null);
s.setBtgyy(null);
s.setUpdateTime(null);
assetTask.setTaskStatus(1);
assetTaskService.update(assetTask);
s.setAccountId(s.getAccountId());
assetOfficialAccountCpService.updateById(s);
}
} }
} }
} }
@ -360,13 +364,13 @@ public class AssetOfficialAccountController {
ExcelUtil<AssetOfficialAccount> util = new ExcelUtil<>(AssetOfficialAccount.class); ExcelUtil<AssetOfficialAccount> util = new ExcelUtil<>(AssetOfficialAccount.class);
List<AssetOfficialAccount> list = util.importExcel(file.getInputStream()); List<AssetOfficialAccount> list = util.importExcel(file.getInputStream());
if (list != null) { if (list != null) {
list.forEach(x->{ list.forEach(x -> {
AssetOfficialAccount one = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getSsdw, x.getSsdw()) AssetOfficialAccount one = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getSsdw, x.getSsdw())
.eq(AssetOfficialAccount::getGzhmc, x.getGzhmc()).one(); .eq(AssetOfficialAccount::getGzhmc, x.getGzhmc()).one();
if(one!=null){ if (one != null) {
x.setId(one.getId()); x.setId(one.getId());
assetOfficialAccountService.edit(x); assetOfficialAccountService.edit(x);
}else { } else {
assetOfficialAccountService.add(x); assetOfficialAccountService.add(x);
} }
}); });

@ -577,6 +577,8 @@ public class AssetTaskController extends BaseController {
} }
assetCurrent.setGlIp(b.toString()); assetCurrent.setGlIp(b.toString());
assetCurrent.setStatus(1); assetCurrent.setStatus(1);
Date date=new Date();
assetCurrent.setUpdateTime(date);
//当审核状态为带待核查 //当审核状态为带待核查
if (assetCurrent.getStatus().equals(1)) { if (assetCurrent.getStatus().equals(1)) {
assetLc.setXfTime(LocalDateTime.now()); assetLc.setXfTime(LocalDateTime.now());
@ -618,7 +620,7 @@ public class AssetTaskController extends BaseController {
// 获取当前时间 // 获取当前时间
LocalDateTime localDateTime = LocalDateTime.now(); LocalDateTime localDateTime = LocalDateTime.now();
// 转换为 Date // 转换为 Date
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
//新增历史记录 //新增历史记录
StringBuilder c = new StringBuilder(); StringBuilder c = new StringBuilder();
if (CollectionUtil.isNotEmpty(assetCurrent.getGlymList())) { if (CollectionUtil.isNotEmpty(assetCurrent.getGlymList())) {
@ -959,6 +961,10 @@ public class AssetTaskController extends BaseController {
assetLc.setTaskId(assetMiniProgramsJyPo.getTaskId()); assetLc.setTaskId(assetMiniProgramsJyPo.getTaskId());
assetLc.setAssetName(assetMiniProgramsJyPo.getXcxmc()); assetLc.setAssetName(assetMiniProgramsJyPo.getXcxmc());
assetMiniProgramsJyPo.setStatus(1); assetMiniProgramsJyPo.setStatus(1);
// 获取当前时间
LocalDateTime localDateTime = LocalDateTime.now();
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
assetMiniProgramsJyPo.setUpdateTime(date);
//当审核状态为带待核查 //当审核状态为带待核查
if (assetMiniProgramsJyPo.getStatus().equals(1)) { if (assetMiniProgramsJyPo.getStatus().equals(1)) {
assetLc.setXfTime(LocalDateTime.now()); assetLc.setXfTime(LocalDateTime.now());
@ -1018,6 +1024,11 @@ public class AssetTaskController extends BaseController {
assetLc.setAssetName("单位核查完成提交" + assetOfficialAccountJyPo.getGzhmc()); assetLc.setAssetName("单位核查完成提交" + assetOfficialAccountJyPo.getGzhmc());
assetLcService.insert(assetLc); assetLcService.insert(assetLc);
} }
// 获取当前时间
LocalDateTime localDateTime = LocalDateTime.now();
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
assetOfficialAccountJyPo.setUpdateTime(date);
assetOfficialAccountJyService.save(assetOfficialAccountJyPo); assetOfficialAccountJyService.save(assetOfficialAccountJyPo);
//新增历史记录表 //新增历史记录表
AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory(); AssetOfficialAccountHistory assetOfficialAccountHistory = new AssetOfficialAccountHistory();
@ -1052,6 +1063,10 @@ public class AssetTaskController extends BaseController {
assetLc.setAssetName("单位核查完成提交" + assetAppJyPo.getAppName()); assetLc.setAssetName("单位核查完成提交" + assetAppJyPo.getAppName());
assetLcService.insert(assetLc); assetLcService.insert(assetLc);
} }
// 获取当前时间
LocalDateTime localDateTime = LocalDateTime.now();
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
assetAppJyPo.setUpdateTime(date);
assetAppJyService.save(assetAppJyPo); assetAppJyService.save(assetAppJyPo);
//新增历史记录表 //新增历史记录表
AssetAppHistory assetAppHistory = new AssetAppHistory(); AssetAppHistory assetAppHistory = new AssetAppHistory();
@ -1086,6 +1101,10 @@ public class AssetTaskController extends BaseController {
assetLc.setAssetName("单位核查完成提交" + assetEmailJyPo.getDzyxhz()); assetLc.setAssetName("单位核查完成提交" + assetEmailJyPo.getDzyxhz());
assetLcService.insert(assetLc); assetLcService.insert(assetLc);
} }
// 获取当前时间
LocalDateTime localDateTime = LocalDateTime.now();
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
assetEmailJyPo.setUpdateTime(date);
assetEmailJyService.save(assetEmailJyPo); assetEmailJyService.save(assetEmailJyPo);
//新增历史记录表 //新增历史记录表
AssetEmailHistory assetEmailHistory = new AssetEmailHistory(); AssetEmailHistory assetEmailHistory = new AssetEmailHistory();

@ -877,7 +877,7 @@ public class AssetCurrentHistory extends BaseClass implements Serializable {
@ApiModelProperty("数据资产-数据量单位") @ApiModelProperty("数据资产-数据量单位")
@TableField(exist = false)
private String sjzcSjldw; private String sjzcSjldw;
/** /**
* - * -

@ -7,8 +7,6 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import java.util.List;
/** /**
* (asset_app_cp)访 * (asset_app_cp)访
* *
@ -36,15 +34,16 @@ public interface AssetAppCpMapper extends BaseMapper<AssetAppCpPo> {
@Delete("delete from asset_app_cp where asset_id=#{assetId} ") @Delete("delete from asset_app_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
* @return * @return
* @Param taskId id
*/ */
@Select("select * from asset_app_cp where asset_id=#{assetId}") @Select("select * from asset_app_cp where asset_id=#{assetId} and task_id =#{taskId}")
AssetAppCpPo findByTaskId(@Param("assetId") int assetId); AssetAppCpPo findByTaskId(int assetId, int taskId);
/** /**
* *

@ -56,6 +56,6 @@ public interface AssetBusinessFormCpMapper extends BaseMapper<AssetBusinessFormC
* @return * @return
*/ */
@Select("select * from asset_business_form_cp where asset_id=#{assetId} and task_id =#{taskId}") @Select("select * from asset_business_form_cp where asset_id=#{assetId} and task_id =#{taskId}")
List<AssetBusinessFormCpPo> findByTaskId(@Param("assetId") int assetId, @Param("taskId") int taskId); AssetBusinessFormCpPo findByTaskId(@Param("assetId") int assetId, @Param("taskId") int taskId);
} }

@ -72,5 +72,15 @@ public interface AssetCurrentCpMapper extends BaseMapper<AssetCurrentCpPo> {
@Delete("delete from asset_current_cp where id=#{assetId} ") @Delete("delete from asset_current_cp where id=#{assetId} ")
void deletByAssetId(@Param("assetId") Long assetId); void deletByAssetId(@Param("assetId") Long assetId);
/**
*
* @param id
*/
@Delete(" DELETE FROM asset_current_cp " +
" WHERE id =#{id}")
void deleteIdList(@Param("id") Long id);
} }

@ -34,16 +34,17 @@ public interface AssetEmailCpMapper extends BaseMapper<AssetEmailCpPo> {
@Delete("delete from asset_email_cp where asset_id=#{assetId}") @Delete("delete from asset_email_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_email_cp where asset_id=#{assetId}") @Select("select * from asset_email_cp where asset_id=#{assetId} and task_id =#{taskId}")
AssetEmailCpPo findByTaskId(@Param("assetId") int assetId); AssetEmailCpPo findByTaskId(int assetId,int taskId);
/** /**
* *
* *
@ -73,6 +74,6 @@ public interface AssetEmailCpMapper extends BaseMapper<AssetEmailCpPo> {
* @return * @return
*/ */
@Select(" select * from asset_email_cp where asset_id = #{id} ") @Select(" select * from asset_email_cp where asset_id = #{id} ")
AssetEmailCpPo findDwmc(Long id); List<AssetEmailCpPo> findDwmc(Long id);
} }

@ -37,16 +37,16 @@ public interface AssetMiniProgramsCpMapper extends BaseMapper<AssetMiniProgramsC
@Delete("delete from asset_mini_programs_cp where asset_id=#{assetId} ") @Delete("delete from asset_mini_programs_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_mini_programs_cp where asset_id=#{assetId}") @Select("select * from asset_mini_programs_cp where asset_id=#{assetId} and task_id=#{taskId}")
AssetMiniProgramsCpPo findByTaskId(@Param("assetId") int assetId); AssetMiniProgramsCpPo findByTaskId(@Param("assetId") int assetId,@Param("taskId")int taskId);
/** /**
* *
* *
@ -75,6 +75,6 @@ public interface AssetMiniProgramsCpMapper extends BaseMapper<AssetMiniProgramsC
* @return * @return
*/ */
@Select(" select * from asset_mini_programs_cp where asset_id = #{id} ") @Select(" select * from asset_mini_programs_cp where asset_id = #{id} ")
AssetMiniProgramsCpPo findDwmc(Long id); List<AssetMiniProgramsCpPo> findDwmc(Long id);
} }

@ -7,6 +7,8 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import java.util.List;
/** /**
* (asset_official_account_cp)访 * (asset_official_account_cp)访
* *
@ -34,16 +36,17 @@ public interface AssetOfficialAccountCpMapper extends BaseMapper<AssetOfficialAc
void deletByAssetId(@Param("assetId") Long assetId); void deletByAssetId(@Param("assetId") Long assetId);
/** /**
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @return * @return
*/ */
@Select("select * from asset_official_account_cp where asset_id=#{assetId}") @Select("select * from asset_official_account_cp where asset_id=#{assetId} and task_id=#{taskId}")
AssetOfficialAccountCpPo findByTaskId(@Param("assetId") int assetId); AssetOfficialAccountCpPo findByTaskId(@Param("assetId") int assetId,@Param("taskId")int taskId);
/** /**
* *
* *
@ -73,6 +76,6 @@ public interface AssetOfficialAccountCpMapper extends BaseMapper<AssetOfficialAc
* @return * @return
*/ */
@Select(" select * from asset_official_account_cp where asset_id = #{id} ") @Select(" select * from asset_official_account_cp where asset_id = #{id} ")
AssetOfficialAccountCpPo findDwmc(Long id); List<AssetOfficialAccountCpPo> findDwmc(Long id);
} }

@ -2,7 +2,9 @@ package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo; import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo; import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest; import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
@ -315,7 +317,7 @@ public interface AssetTaskMapper extends BaseMapper<AssetTask> {
* @param dwmc * @param dwmc
* @return * @return
*/ */
AssetTask findByDwmc(@Param("dwmc") String dwmc); AssetAppCpPo findByDwmc(@Param("dwmc") String dwmc);

@ -34,12 +34,13 @@ public interface AssetAppCpService extends IService<AssetAppCpPo> {
/** /**
* id * assetId
* *
* @param assetId id * @param assetId id
* @Param taskId id
* @return * @return
*/ */
AssetAppCpPo findByTaskId(int assetId); AssetAppCpPo findByTaskId(int assetId,int taskId);
/** /**

@ -44,7 +44,7 @@ public interface AssetBusinessFormCpService extends IService<AssetBusinessFormCp
* @param taskId id * @param taskId id
* @return * @return
*/ */
List<AssetBusinessFormCpPo> findByTaskId(int assetId, int taskId); AssetBusinessFormCpPo findByTaskId(int assetId, int taskId);
} }

@ -69,5 +69,13 @@ public interface AssetCurrentCpService extends IService<AssetCurrentCpPo> {
* @param assetId id * @param assetId id
*/ */
void deletByAssetId(Long assetId); void deletByAssetId(Long assetId);
/**
*
*
* @param idList
*/
void deleteIdList(Long idList);
} }

@ -47,12 +47,7 @@ public interface AssetCurrentService extends IService<AssetCurrent> {
*/ */
void deleteByUnitIds(Long id); void deleteByUnitIds(Long id);
/**
*
*
* @param idList
*/
void deleteIdList(Long idList);
/** /**
* () * ()

@ -36,9 +36,10 @@ public interface AssetEmailCpService extends IService<AssetEmailCpPo> {
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @Param taskId id
* @return * @return
*/ */
AssetEmailCpPo findByTaskId(int assetId); AssetEmailCpPo findByTaskId(int assetId,int taskId);
/** /**
@ -69,5 +70,5 @@ public interface AssetEmailCpService extends IService<AssetEmailCpPo> {
* @param id * @param id
* @return * @return
*/ */
AssetEmailCpPo findDwmc(Long id); List<AssetEmailCpPo> findDwmc(Long id);
} }

@ -39,9 +39,10 @@ public interface AssetMiniProgramsCpService extends IService<AssetMiniProgramsCp
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @Param taskId id
* @return * @return
*/ */
AssetMiniProgramsCpPo findByTaskId(int assetId); AssetMiniProgramsCpPo findByTaskId(int assetId,int taskId);
/** /**
@ -69,5 +70,5 @@ public interface AssetMiniProgramsCpService extends IService<AssetMiniProgramsCp
* @param id * @param id
* @return * @return
*/ */
AssetMiniProgramsCpPo findDwmc(Long id); List<AssetMiniProgramsCpPo> findDwmc(Long id);
} }

@ -33,13 +33,15 @@ public interface AssetOfficialAccountCpService extends IService<AssetOfficialAcc
void deletByAssetId(Long assetId); void deletByAssetId(Long assetId);
/** /**
* assetId * assetId
* *
* @param assetId id * @param assetId id
* @Param taskId id
* @return * @return
*/ */
AssetOfficialAccountCpPo findByTaskId(int assetId); AssetOfficialAccountCpPo findByTaskId(int assetId,int taskId);
/** /**
* *
@ -67,5 +69,5 @@ public interface AssetOfficialAccountCpService extends IService<AssetOfficialAcc
* @param id * @param id
* @return * @return
*/ */
AssetOfficialAccountCpPo findDwmc(Long id); List<AssetOfficialAccountCpPo> findDwmc(Long id);
} }

@ -2,6 +2,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.AssetApp;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.history.*; import com.ruoyi.tc.entity.history.*;
import com.ruoyi.tc.entity.po.*; import com.ruoyi.tc.entity.po.*;
@ -234,7 +235,7 @@ public interface AssetTaskService extends IService<AssetTask> {
* @param dwmc * @param dwmc
* @return * @return
*/ */
AssetTask findByDwmc(String dwmc); AssetAppCpPo findByDwmc(String dwmc);
/** /**
* id * id

@ -38,8 +38,8 @@ public class AssetAppCpServiceImpl extends ServiceImpl<AssetAppCpMapper, AssetAp
} }
@Override @Override
public AssetAppCpPo findByTaskId(int assetId) { public AssetAppCpPo findByTaskId(int assetId,int taskId) {
return assetAppCpMapper.findByTaskId(assetId); return assetAppCpMapper.findByTaskId(assetId,taskId);
} }
@Override @Override

@ -9,7 +9,6 @@ import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.AssetTask; import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppCpPo; import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo;
import com.ruoyi.tc.entity.request.AssetAppPageRequest; import com.ruoyi.tc.entity.request.AssetAppPageRequest;
import com.ruoyi.tc.mapper.AssetAppMapper; import com.ruoyi.tc.mapper.AssetAppMapper;
import com.ruoyi.tc.service.AssetAppCpService; import com.ruoyi.tc.service.AssetAppCpService;
@ -19,6 +18,9 @@ import com.ruoyi.tc.service.UnitService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -39,7 +41,6 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
private AssetTaskService assetTaskService; private AssetTaskService assetTaskService;
/** /**
* *
* *
@ -101,7 +102,7 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
List<AssetApp> list1 = lambdaQuery().eq(AssetApp::getSsdw, assetApp.getSsdw()) List<AssetApp> list1 = lambdaQuery().eq(AssetApp::getSsdw, assetApp.getSsdw())
.eq(AssetApp::getAppName, assetApp.getAppName()).list(); .eq(AssetApp::getAppName, assetApp.getAppName()).list();
if (list1 != null&& !list1.isEmpty()){ if (list1 != null && !list1.isEmpty()) {
throw new ServiceException("不允许新增重复资产!"); throw new ServiceException("不允许新增重复资产!");
} }
save(assetApp); save(assetApp);
@ -153,21 +154,27 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
assetAppCpService.updateById(x); assetAppCpService.updateById(x);
}); });
//根据修改的单位名称查询任务表中是否有此单位的任务如果有修改资产中的任务id如果没有删除 //根据资产id查询资产子表,判断是否有此资产进行中的任务,如果资产状态是已关停与修改的数据不符,则修改任务中的资产状态
AssetTask assetTask = assetTaskService.findByDwmc(assetApp.getAppName()); AssetAppCpPo assetTask = assetTaskService.findByDwmc(String.valueOf(assetApp.getId()));
if (assetTask == null) { if (assetTask != null) {
assetAppCpService.deletByAssetId(assetApp.getId()); //查询任务是否为进行中
} else { AssetTask s = assetTaskService.findByTaskId(Integer.valueOf(assetTask.getTaskId()));
//根据资产id查询旧资产 if (s.getTaskStatus().equals(1)) {
AssetAppCpPo assetAppCpPo = assetAppCpService.findDwmc(assetApp.getId()); //修改任务中资产状态
if (assetAppCpPo!=null){ assetTask.setStatus(0);
assetAppCpPo.setAppName(assetApp.getAppName()); assetTask.setBfyy(null);
assetAppCpPo.setTaskId(assetTask.getId()); assetTask.setBtgyy(null);
assetAppCpPo.setBfyy(null); LocalDateTime localDateTime = LocalDateTime.now();
//修改 Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
assetAppCpService.updateById(assetAppCpPo); assetTask.setUpdateTime(date);
} s.setTaskStatus(1);
assetTask.setAppId(assetTask.getAppId());
assetAppCpService.updateById(assetTask);
assetTaskService.update(s);
}
} }
return true; return true;
} }

@ -37,7 +37,7 @@ public class AssetBusinessFormCpServiceImpl extends ServiceImpl<AssetBusinessFor
} }
@Override @Override
public List<AssetBusinessFormCpPo> findByTaskId(int assetId,int taskId) { public AssetBusinessFormCpPo findByTaskId(int assetId,int taskId) {
return assetBusinessFormCpMapper.findByTaskId(assetId,taskId); return assetBusinessFormCpMapper.findByTaskId(assetId,taskId);
} }
} }

@ -55,7 +55,10 @@ public class AssetCurrentCpServiceImpl extends ServiceImpl<AssetCurrentCpMapper,
public void deletByAssetId(Long assetId) { public void deletByAssetId(Long assetId) {
baseMapper.deletByAssetId(assetId); baseMapper.deletByAssetId(assetId);
} }
@Override
public void deleteIdList(Long id) {
baseMapper.deleteIdList(id);
}
} }

@ -105,10 +105,7 @@ public class AssetCurrentServiceImpl extends ServiceImpl<AssetCurrentMapper, Ass
baseMapper.deleteByUnitIds(id); baseMapper.deleteByUnitIds(id);
} }
@Override
public void deleteIdList(Long id) {
baseMapper.deleteIdList(id);
}
/** /**
* () * ()

@ -41,8 +41,8 @@ public class AssetEmailCpServiceImpl extends ServiceImpl<AssetEmailCpMapper, Ass
} }
@Override @Override
public AssetEmailCpPo findByTaskId(int assetId) { public AssetEmailCpPo findByTaskId(int assetId,int taskId) {
return assetEmailCpMapper.findByTaskId(assetId); return assetEmailCpMapper.findByTaskId(assetId,taskId);
} }
@ -57,7 +57,7 @@ public class AssetEmailCpServiceImpl extends ServiceImpl<AssetEmailCpMapper, Ass
} }
@Override @Override
public AssetEmailCpPo findDwmc(Long id) { public List<AssetEmailCpPo> findDwmc(Long id) {
return assetEmailCpMapper.findDwmc(id); return assetEmailCpMapper.findDwmc(id);
} }
} }

@ -153,21 +153,21 @@ public class AssetEmailServiceImpl extends ServiceImpl<AssetEmailMapper, AssetEm
assetEmailCpService.updateById(x); assetEmailCpService.updateById(x);
}); });
//根据修改的单位名称查询任务表中是否有此单位的任务如果有修改资产中的任务id如果没有删除 // //根据修改的单位名称查询任务表中是否有此单位的任务如果有修改资产中的任务id如果没有删除
AssetTask assetTask = assetTaskService.findByDwmc(assetEmail.getDzyxhz()); // AssetTask assetTask = assetTaskService.findByDwmc(assetEmail.getDzyxhz());
if (assetTask == null) { // if (assetTask == null) {
assetEmailCpService.deletByAssetId(assetEmail.getId()); // assetEmailCpService.deletByAssetId(assetEmail.getId());
} else { // } else {
//根据资产id查询旧资产 // //根据资产id查询旧资产
AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findDwmc(assetEmail.getId()); // AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findDwmc(assetEmail.getId());
if (assetEmailCpPo!=null){ // if (assetEmailCpPo!=null){
assetEmailCpPo.setDzyxhz(assetEmail.getDzyxhz()); // assetEmailCpPo.setDzyxhz(assetEmail.getDzyxhz());
assetEmailCpPo.setTaskId(assetTask.getId()); // assetEmailCpPo.setTaskId(assetTask.getId());
//修改 // //修改
assetEmailCpService.updateById(assetEmailCpPo); // assetEmailCpService.updateById(assetEmailCpPo);
} // }
} // }
return true; return true;
} }

@ -33,8 +33,8 @@ public class AssetMiniProgramsCpServiceImpl extends ServiceImpl<AssetMiniProgram
} }
@Override @Override
public AssetMiniProgramsCpPo findByTaskId(int assetId) { public AssetMiniProgramsCpPo findByTaskId(int assetId,int taskId) {
return assetMiniProgramsCpMapper.findByTaskId(assetId); return assetMiniProgramsCpMapper.findByTaskId(assetId,taskId);
} }
@Override @Override
@ -49,7 +49,7 @@ public class AssetMiniProgramsCpServiceImpl extends ServiceImpl<AssetMiniProgram
@Override @Override
public AssetMiniProgramsCpPo findDwmc(Long id) { public List<AssetMiniProgramsCpPo> findDwmc(Long id) {
return assetMiniProgramsCpMapper.findDwmc(id); return assetMiniProgramsCpMapper.findDwmc(id);
} }
} }

@ -142,21 +142,21 @@ public class AssetMiniProgramsServiceImpl extends ServiceImpl<AssetMiniProgramsM
assetMiniProgramsCpService.updateById(x); assetMiniProgramsCpService.updateById(x);
}); });
//根据修改的单位名称查询任务表中是否有此单位的任务如果有修改资产中的任务id如果没有删除 //根据修改的单位名称查询任务表中是否有此单位的任务如果有修改资产中的任务id如果没有删除
AssetTask assetTask = assetTaskService.findByDwmc(assetMiniPrograms.getXcxmc()); // AssetTask assetTask = assetTaskService.findByDwmc(assetMiniPrograms.getXcxmc());
if (assetTask == null) { // if (assetTask == null) {
assetMiniProgramsCpService.deletByAssetId(assetMiniPrograms.getId()); // assetMiniProgramsCpService.deletByAssetId(assetMiniPrograms.getId());
} else { // } else {
//根据资产id查询旧资产 // //根据资产id查询旧资产
AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findDwmc(assetMiniPrograms.getId()); // AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findDwmc(assetMiniPrograms.getId());
if (assetMiniProgramsCpPo!=null){ // if (assetMiniProgramsCpPo!=null){
assetMiniProgramsCpPo.setXcxmc(assetMiniPrograms.getXcxmc()); // assetMiniProgramsCpPo.setXcxmc(assetMiniPrograms.getXcxmc());
assetMiniProgramsCpPo.setTaskId(assetTask.getId()); // assetMiniProgramsCpPo.setTaskId(assetTask.getId());
assetMiniProgramsCpService.updateById(assetMiniProgramsCpPo); // assetMiniProgramsCpService.updateById(assetMiniProgramsCpPo);
} // }
//
//修改 // //修改
//
} // }
return true; return true;
} }

@ -42,8 +42,8 @@ public class AssetOfficialAccountCpServiceImpl extends ServiceImpl<AssetOfficial
} }
@Override @Override
public AssetOfficialAccountCpPo findByTaskId(int assetId) { public AssetOfficialAccountCpPo findByTaskId(int assetId,int taskId) {
return assetOfficialAccountCpMapper.findByTaskId(assetId); return assetOfficialAccountCpMapper.findByTaskId(assetId,taskId);
} }
@Override @Override
@ -58,7 +58,7 @@ public class AssetOfficialAccountCpServiceImpl extends ServiceImpl<AssetOfficial
@Override @Override
public AssetOfficialAccountCpPo findDwmc(Long id) { public List<AssetOfficialAccountCpPo> findDwmc(Long id) {
return assetOfficialAccountCpMapper.findDwmc(id); return assetOfficialAccountCpMapper.findDwmc(id);
} }
} }

@ -198,21 +198,21 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl<AssetOfficialAc
assetOfficialAccountCpService.updateById(x); assetOfficialAccountCpService.updateById(x);
}); });
//根据修改的单位名称查询任务表中是否有此单位的任务如果有修改资产中的任务id如果没有删除 // //根据修改的单位名称查询任务表中是否有此单位的任务如果有修改资产中的任务id如果没有删除
AssetTask assetTask = assetTaskService.findByDwmc(assetOfficialAccount.getGzhmc()); // AssetTask assetTask = assetTaskService.findByDwmc(assetOfficialAccount.getGzhmc());
if (assetTask == null) { // if (assetTask == null) {
assetOfficialAccountCpService.deletByAssetId(assetOfficialAccount.getId()); // assetOfficialAccountCpService.deletByAssetId(assetOfficialAccount.getId());
} else { // } else {
//根据资产id查询旧资产 // //根据资产id查询旧资产
AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findDwmc(assetOfficialAccount.getId()); // AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findDwmc(assetOfficialAccount.getId());
if (assetOfficialAccountCpPo!=null){ // if (assetOfficialAccountCpPo!=null){
assetOfficialAccountCpPo.setGzhmc(assetOfficialAccount.getGzhmc()); // assetOfficialAccountCpPo.setGzhmc(assetOfficialAccount.getGzhmc());
assetOfficialAccountCpPo.setTaskId(assetTask.getId()); // assetOfficialAccountCpPo.setTaskId(assetTask.getId());
//修改 // //修改
assetOfficialAccountCpService.updateById(assetOfficialAccountCpPo); // assetOfficialAccountCpService.updateById(assetOfficialAccountCpPo);
} // }
//
} // }
return true; return true;
} }

@ -193,10 +193,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetCurrentResponse.setStatus(5); assetCurrentResponse.setStatus(5);
assetCurrentResponse.setBfyy(null); assetCurrentResponse.setBfyy(null);
assetCurrentResponse.setBtgyy(null); assetCurrentResponse.setBtgyy(null);
assetCurrentResponse.setUpdateTime(null);
} else { } else {
assetCurrentResponse.setStatus(0); assetCurrentResponse.setStatus(0);
assetCurrentResponse.setBfyy(null); assetCurrentResponse.setBfyy(null);
assetCurrentResponse.setBtgyy(null); assetCurrentResponse.setBtgyy(null);
assetCurrentResponse.setUpdateTime(null);
} }
}); });
@ -233,10 +235,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetMiniProgramsCpPo.setStatus(5); assetMiniProgramsCpPo.setStatus(5);
assetMiniProgramsCpPo.setBfyy(null); assetMiniProgramsCpPo.setBfyy(null);
assetMiniProgramsCpPo.setBtgyy(null); assetMiniProgramsCpPo.setBtgyy(null);
assetMiniProgramsCpPo.setUpdateTime(null);
} else { } else {
assetMiniProgramsCpPo.setStatus(0); assetMiniProgramsCpPo.setStatus(0);
assetMiniProgramsCpPo.setBfyy(null); assetMiniProgramsCpPo.setBfyy(null);
assetMiniProgramsCpPo.setBtgyy(null); assetMiniProgramsCpPo.setBtgyy(null);
assetMiniProgramsCpPo.setUpdateTime(null);
} }
return assetMiniProgramsCpPo; // 返回新对象 return assetMiniProgramsCpPo; // 返回新对象
@ -262,10 +266,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetOfficialAccountCpPo.setStatus(5); assetOfficialAccountCpPo.setStatus(5);
assetOfficialAccountCpPo.setBfyy(null); assetOfficialAccountCpPo.setBfyy(null);
assetOfficialAccountCpPo.setBtgyy(null); assetOfficialAccountCpPo.setBtgyy(null);
assetOfficialAccountCpPo.setUpdateTime(null);
} else { } else {
assetOfficialAccountCpPo.setStatus(0); assetOfficialAccountCpPo.setStatus(0);
assetOfficialAccountCpPo.setBfyy(null); assetOfficialAccountCpPo.setBfyy(null);
assetOfficialAccountCpPo.setBtgyy(null); assetOfficialAccountCpPo.setBtgyy(null);
assetOfficialAccountCpPo.setUpdateTime(null);
} }
return assetOfficialAccountCpPo; // 返回新对象 return assetOfficialAccountCpPo; // 返回新对象
@ -292,10 +298,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
emailCpPo.setStatus(5); emailCpPo.setStatus(5);
emailCpPo.setBfyy(null); emailCpPo.setBfyy(null);
emailCpPo.setBtgyy(null); emailCpPo.setBtgyy(null);
emailCpPo.setUpdateTime(null);
} else { } else {
emailCpPo.setStatus(0); emailCpPo.setStatus(0);
emailCpPo.setBfyy(null); emailCpPo.setBfyy(null);
emailCpPo.setBtgyy(null); emailCpPo.setBtgyy(null);
emailCpPo.setUpdateTime(null);
} }
return emailCpPo; // 返回新对象 return emailCpPo; // 返回新对象
}).collect(Collectors.toList()); // 收集到列表中 }).collect(Collectors.toList()); // 收集到列表中
@ -321,10 +329,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
appCpPo.setStatus(5); appCpPo.setStatus(5);
appCpPo.setBfyy(null); appCpPo.setBfyy(null);
appCpPo.setBtgyy(null); appCpPo.setBtgyy(null);
appCpPo.setUpdateTime(null);
} else { } else {
appCpPo.setStatus(0); appCpPo.setStatus(0);
appCpPo.setBfyy(null); appCpPo.setBfyy(null);
appCpPo.setBtgyy(null); appCpPo.setBtgyy(null);
appCpPo.setUpdateTime(null);
} }
return appCpPo; // 返回新对象 return appCpPo; // 返回新对象
}).collect(Collectors.toList()); // 收集到列表中 }).collect(Collectors.toList()); // 收集到列表中
@ -545,8 +555,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
@Override @Override
public int sh(AssetCurrentShRequest req) throws ParseException { public int sh(AssetCurrentShRequest req) throws ParseException {
//根据taskid获取当前任务的count数量
AssetTask assetTask = assetTaskDao.getByTaskId(req.getTaskId());
// 获取当前时间 // 获取当前时间
LocalDateTime localDateTime = LocalDateTime.now(); LocalDateTime localDateTime = LocalDateTime.now();
// 转换为 Date // 转换为 Date
@ -561,11 +570,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetTaskDao.sh(req); assetTaskDao.sh(req);
// //修改子表和新增历史表 // //修改子表和新增历史表
updateZiandHistory(req, date); updateZiandHistory(req, date);
//同步主表
taskSaveOrDelete(req);
} else { } else {
//修改子表和新增历史表 //修改子表和新增历史表
updateZiandHistory(req, date); updateZiandHistory(req, date);
//同步主表
taskSaveOrDelete(req);
} }
} else if (req.getType() == 1) { } else if (req.getType() == 1) {
@ -578,12 +588,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetTaskDao.xcxsh(req); assetTaskDao.xcxsh(req);
// //修改子表和新增历史表 // //修改子表和新增历史表
updateMinZiandHistory(req, date); updateMinZiandHistory(req, date);
//同步主表
syb(req);
} else { } else {
//修改子表和新增历史表 //修改子表和新增历史表
updateMinZiandHistory(req, date); updateMinZiandHistory(req, date);
//同步主表
syb(req);
} }
} else if (req.getType() == 2) { } else if (req.getType() == 2) {
@ -596,12 +606,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetTaskDao.gzhsh(req); assetTaskDao.gzhsh(req);
// //修改子表和历史表新增 // //修改子表和历史表新增
updateGzhZiandHistory(req, date); updateGzhZiandHistory(req, date);
//同步主表
syb(req);
} else { } else {
//修改子表和历史表新增 //修改子表和历史表新增
updateGzhZiandHistory(req, date); updateGzhZiandHistory(req, date);
//同步主表
syb(req);
} }
} else if (req.getType() == 3) { } else if (req.getType() == 3) {
@ -631,12 +641,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetTaskDao.appsh(req); assetTaskDao.appsh(req);
// //修改子表和历史表新增 // //修改子表和历史表新增
updateAppZiandHistory(req, date); updateAppZiandHistory(req, date);
//同步主表
syb(req);
} else { } else {
//修改子表和历史表新增 //修改子表和历史表新增
updateAppZiandHistory(req, date); updateAppZiandHistory(req, date);
//同步主表
syb(req);
} }
} }
@ -764,7 +774,6 @@ 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) {
@ -772,7 +781,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
req.getAssetCurrentCpPo().getXjgywxt().setTaskId(req.getAssetCurrentCpPo().getTaskId()); req.getAssetCurrentCpPo().getXjgywxt().setTaskId(req.getAssetCurrentCpPo().getTaskId());
assetBusinessFormCpService.save(req.getAssetCurrentCpPo().getXjgywxt()); assetBusinessFormCpService.save(req.getAssetCurrentCpPo().getXjgywxt());
} }
if (!req.getAssetCurrentCpPo().getGylxxList().isEmpty()) { if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getGylxxList())) {
for (AssetSupplyChainCpPo items : req.getAssetCurrentCpPo().getGylxxList()) { for (AssetSupplyChainCpPo items : req.getAssetCurrentCpPo().getGylxxList()) {
items.setAssetId(req.getAssetCurrentCpPo().getId()); items.setAssetId(req.getAssetCurrentCpPo().getId());
items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); items.setTaskId(req.getAssetCurrentCpPo().getTaskId());
@ -781,7 +790,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//新增供应链 //新增供应链
assetSupplyChainCpService.saveBatch(req.getAssetCurrentCpPo().getGylxxList()); assetSupplyChainCpService.saveBatch(req.getAssetCurrentCpPo().getGylxxList());
} }
if (!req.getAssetCurrentCpPo().getJcwlList().isEmpty()) { if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getJcwlList())) {
for (AssetBasicNetworkCpPo items : req.getAssetCurrentCpPo().getJcwlList()) { for (AssetBasicNetworkCpPo items : req.getAssetCurrentCpPo().getJcwlList()) {
items.setAssetId(req.getAssetCurrentCpPo().getId()); items.setAssetId(req.getAssetCurrentCpPo().getId());
items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); items.setTaskId(req.getAssetCurrentCpPo().getTaskId());
@ -790,7 +799,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//新增基础网络 //新增基础网络
assetBasicNetworkCpService.saveBatch(req.getAssetCurrentCpPo().getJcwlList()); assetBasicNetworkCpService.saveBatch(req.getAssetCurrentCpPo().getJcwlList());
} }
if (!req.getAssetCurrentCpPo().getOtherConcat().isEmpty()) { if (CollectionUtil.isNotEmpty(req.getAssetCurrentCpPo().getOtherConcat())) {
for (UnitOtherConcatCpPo items : req.getAssetCurrentCpPo().getOtherConcat()) { for (UnitOtherConcatCpPo items : req.getAssetCurrentCpPo().getOtherConcat()) {
items.setAssetId(req.getAssetCurrentCpPo().getId()); items.setAssetId(req.getAssetCurrentCpPo().getId());
items.setTaskId(req.getAssetCurrentCpPo().getTaskId()); items.setTaskId(req.getAssetCurrentCpPo().getTaskId());
@ -895,7 +904,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
private void syb(AssetCurrentShRequest req) { private void syb(AssetCurrentShRequest req) {
if (req.getType() == 1) { if (req.getType() == 1) {
//小程序 //小程序
AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByTaskId(req.getAssetId()); AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByTaskId(req.getAssetId(),req.getTaskId());
//删除原有数据 //删除原有数据
if (assetMiniProgramsCpPo != null) { if (assetMiniProgramsCpPo != null) {
assetMiniProgramsService.deleteIdList(Collections.singletonList(assetMiniProgramsCpPo.getAssetId())); assetMiniProgramsService.deleteIdList(Collections.singletonList(assetMiniProgramsCpPo.getAssetId()));
@ -909,8 +918,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
if (req.getType() == 2) { if (req.getType() == 2) {
//公众号资产 //公众号资产
AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByTaskId(req.getAssetId()); AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByTaskId(req.getAssetId(),req.getTaskId());
//删除原有数据 //删除原有数据
if (assetOfficialAccountCpPo != null) { if (assetOfficialAccountCpPo != null) {
assetOfficialAccountService.deleteIdList(Collections.singletonList(assetOfficialAccountCpPo.getAssetId())); assetOfficialAccountService.deleteIdList(Collections.singletonList(assetOfficialAccountCpPo.getAssetId()));
@ -926,7 +934,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
if (req.getType() == 3) { if (req.getType() == 3) {
//电子邮件资产 //电子邮件资产
//根据assetId查询查询数据 //根据assetId查询查询数据
AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByTaskId(req.getAssetId()); AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByTaskId(req.getAssetId(),req.getTaskId());
//删除原有数据 //删除原有数据
if (assetEmailCpPo != null) { if (assetEmailCpPo != null) {
assetEmailService.deleteIdList(Collections.singletonList(assetEmailCpPo.getAssetId())); assetEmailService.deleteIdList(Collections.singletonList(assetEmailCpPo.getAssetId()));
@ -940,7 +948,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
if (req.getType() == 4) { if (req.getType() == 4) {
//移动应用程序资产 //移动应用程序资产
//根据资产id查询 //根据资产id查询
AssetAppCpPo assetAppCpPo = assetAppCpService.findByTaskId(req.getAssetId()); AssetAppCpPo assetAppCpPo = assetAppCpService.findByTaskId(req.getAssetId(),req.getTaskId());
//删除原有数据 //删除原有数据
if (assetAppCpPo != null) { if (assetAppCpPo != null) {
assetAppService.deleteIdList(Collections.singletonList(assetAppCpPo.getAssetId())); assetAppService.deleteIdList(Collections.singletonList(assetAppCpPo.getAssetId()));
@ -1009,42 +1017,48 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
AssetCurrentCpPo currentCpPo = assetCurrentCpService.findByTaskId(req.getAssetId(), req.getTaskId()); AssetCurrentCpPo currentCpPo = assetCurrentCpService.findByTaskId(req.getAssetId(), req.getTaskId());
//删除主表原有数据 //删除主表原有数据
if (currentCpPo != null) { if (currentCpPo != null) {
assetCurrentService.deleteIdList(currentCpPo.getId());
//将子表数据复制到主表中 //将子表数据复制到主表中
AssetCurrent current = new AssetCurrent(); AssetCurrent current = new AssetCurrent();
BeanUtils.copyProperties(currentCpPo, current); // 复制属性 BeanUtils.copyProperties(currentCpPo, current); // 复制属性
current.setId(null); assetCurrentService.updateById(current);
assetCurrentService.save(current);
} }
//AssetBusinessFormCpPo //AssetBusinessFormCpPo
List<AssetBusinessFormCpPo> businessFormCpPo = assetBusinessFormCpService.findByTaskId(req.getAssetId(), req.getTaskId()); AssetBusinessFormCpPo businessFormCpPo = assetBusinessFormCpService.findByTaskId(req.getAssetId(), req.getTaskId());
List<Long> businessList = businessFormCpPo.stream().map(AssetBusinessFormCpPo::getAssetId).collect(Collectors.toList());
//删除原有数据 //删除原有数据
if (CollectionUtil.isNotEmpty(businessList)) { if (businessFormCpPo!=null) {
assetBusinessFormService.deleteIdList(businessList); assetBusinessFormService.deleteIdList(Collections.singletonList(businessFormCpPo.getAssetId()));
//将子表数据复制到主表中
AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
BeanUtils.copyProperties(businessFormCpPo, assetBusinessForm); // 复制属性
assetBusinessForm.setId(null);
assetBusinessFormService.save(assetBusinessForm);
}else{ }else{
//将子表数据复制到主表中 //将子表数据复制到主表中
List<AssetBusinessForm> businessFormCpPoList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> { AssetBusinessForm assetBusinessForm = new AssetBusinessForm();
AssetBusinessForm assetBusinessForm = new AssetBusinessForm(); BeanUtils.copyProperties(businessFormCpPo, assetBusinessForm); // 复制属性
BeanUtils.copyProperties(cpPo, assetBusinessForm); // 复制属性 assetBusinessForm.setId(null);
assetBusinessForm.setId(null); assetBusinessFormService.save(assetBusinessForm);
return assetBusinessForm; // 返回新对象
}).collect(Collectors.toList());
assetBusinessFormService.saveBatch(businessFormCpPoList);
} }
//AssetBasicNetworkCpPo //AssetBasicNetworkCpPo
List<AssetBasicNetworkCpPo> networkCpPo = assetBasicNetworkCpService.findByTaskId(req.getAssetId(), req.getTaskId()); List<AssetBasicNetworkCpPo> networkCpPo = assetBasicNetworkCpService.findByTaskId(req.getAssetId(), req.getTaskId());
List<Long> netWorkList = networkCpPo.stream().map(AssetBasicNetworkCpPo::getAssetId).collect(Collectors.toList()); List<Long> netWorkList = networkCpPo.stream().map(AssetBasicNetworkCpPo::getAssetId).collect(Collectors.toList());
//删除原有数据 //删除原有数据
if (CollectionUtil.isNotEmpty(netWorkList)) { if (CollectionUtil.isNotEmpty(netWorkList)) {
assetBasicNetworkService.deleteIdList(netWorkList); assetBasicNetworkService.deleteIdList(netWorkList);
List<AssetBasicNetwork> networksCpPoList = req.getAssetCurrentCpPo().getJcwlList().stream().map(cpPo -> {
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
assetBasicNetwork.setId(null);
return assetBasicNetwork; // 返回新对象
}).collect(Collectors.toList());
assetBasicNetworkService.saveBatch(networksCpPoList);
}else{ }else{
List<AssetBasicNetwork> networksCpPoList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> { List<AssetBasicNetwork> networksCpPoList = req.getAssetCurrentCpPo().getJcwlList().stream().map(cpPo -> {
AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork(); AssetBasicNetwork assetBasicNetwork = new AssetBasicNetwork();
BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性 BeanUtils.copyProperties(cpPo, assetBasicNetwork); // 复制属性
assetBasicNetwork.setId(null); assetBasicNetwork.setId(null);
@ -1053,15 +1067,22 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetBasicNetworkService.saveBatch(networksCpPoList); assetBasicNetworkService.saveBatch(networksCpPoList);
} }
//AssetSupplyChainCpPo //AssetSupplyChainCpPo
List<AssetSupplyChainCpPo> supplyChainCpPo = assetSupplyChainCpService.findByTaskId(req.getAssetId(), req.getTaskId()); List<AssetSupplyChainCpPo> supplyChainCpPo = assetSupplyChainCpService.findByTaskId(req.getAssetId(), req.getTaskId());
List<Long> supplyList = supplyChainCpPo.stream().map(AssetSupplyChainCpPo::getAssetId).collect(Collectors.toList()); List<Long> supplyList = supplyChainCpPo.stream().map(AssetSupplyChainCpPo::getAssetId).collect(Collectors.toList());
//删除原有数据 //删除原有数据
if (CollectionUtil.isNotEmpty(supplyList)) { if (CollectionUtil.isNotEmpty(supplyList)) {
assetSupplyChainService.deleteIdList(supplyList); assetSupplyChainService.deleteIdList(supplyList);
List<AssetSupplyChain> supplyChainList = req.getAssetCurrentCpPo().getGylxxList().stream().map(cpPo -> {
}else{ AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
List<AssetSupplyChain> supplyChainList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> { BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
assetSupplyChain.setId(null);
return assetSupplyChain; // 返回新对象
}).collect(Collectors.toList());
assetSupplyChainService.saveBatch(supplyChainList);
} else {
List<AssetSupplyChain> supplyChainList = req.getAssetCurrentCpPo().getGylxxList().stream().map(cpPo -> {
AssetSupplyChain assetSupplyChain = new AssetSupplyChain(); AssetSupplyChain assetSupplyChain = new AssetSupplyChain();
BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性 BeanUtils.copyProperties(cpPo, assetSupplyChain); // 复制属性
assetSupplyChain.setId(null); assetSupplyChain.setId(null);
@ -1075,8 +1096,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//删除原有数据 //删除原有数据
if (CollectionUtil.isNotEmpty(unitList)) { if (CollectionUtil.isNotEmpty(unitList)) {
unitOtherConcatService.deleteIdList(unitList); unitOtherConcatService.deleteIdList(unitList);
List<UnitOtherConcat> unitOtherConcatList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> {
}else{ UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
unitOtherConcat.setConcatId(null);
return unitOtherConcat; // 返回新对象
}).collect(Collectors.toList());
unitOtherConcatService.saveBatch(unitOtherConcatList);
} else {
List<UnitOtherConcat> unitOtherConcatList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> { List<UnitOtherConcat> unitOtherConcatList = req.getAssetCurrentCpPo().getOtherConcat().stream().map(cpPo -> {
UnitOtherConcat unitOtherConcat = new UnitOtherConcat(); UnitOtherConcat unitOtherConcat = new UnitOtherConcat();
BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性 BeanUtils.copyProperties(cpPo, unitOtherConcat); // 复制属性
@ -1119,7 +1146,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
@Override @Override
public AssetTask findByDwmc(String dwmc) { public AssetAppCpPo findByDwmc(String dwmc) {
return assetTaskDao.findByDwmc(dwmc); return assetTaskDao.findByDwmc(dwmc);
} }

@ -916,9 +916,7 @@
taskStatus taskStatus
)f group by taskStatus )f group by taskStatus
</select> </select>
<select id="findByDwmc" resultType="com.ruoyi.tc.entity.AssetTask" parameterType="java.lang.String">
select * from asset_task where dwmc like concat('%', #{dwmc}, '%') and task_status=1
</select>
<select id="getByTaskId" resultType="com.ruoyi.tc.entity.AssetTask" parameterType="int"> <select id="getByTaskId" resultType="com.ruoyi.tc.entity.AssetTask" parameterType="int">
select * from asset_task where id =#{taskId} select * from asset_task where id =#{taskId}
</select> </select>
@ -971,7 +969,10 @@
) AS latest_update_time; ) AS latest_update_time;
</select> </select>
<select id="findBytaskId" resultType="com.ruoyi.tc.entity.AssetTask" parameterType="java.lang.Integer"> <select id="findBytaskId" resultType="com.ruoyi.tc.entity.AssetTask" parameterType="java.lang.Integer">
select * from asset_task where id=#{taskId} select * from asset_task where id=#{taskId} and task_status=1
</select>
<select id="findByDwmc" resultType="com.ruoyi.tc.entity.po.AssetAppCpPo" parameterType="java.lang.String">
select * from asset_email_cp where asset_id = #{id}
</select> </select>

Loading…
Cancel
Save