From b49ba0e06f75c5c1b439cae8aa1292848e3a6965 Mon Sep 17 00:00:00 2001 From: chendaofei <857448963@qq.com> Date: Fri, 1 Nov 2024 16:31:25 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=85=A8=E8=BF=87=E7=A8=8B=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=B8=8A=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/process/pojo/po/SupvFile.java | 2 +- .../com/njcn/process/pojo/po/SupvPlanRel.java | 9 ++++ .../controller/SupvPlanController.java | 36 +++++++++++++++- .../process/service/ISupvPlanService.java | 9 ++++ .../service/impl/SupvPlanServiceImpl.java | 42 +++++++++++++++---- .../service/impl/SupvPushGwServiceImpl.java | 2 +- 6 files changed, 89 insertions(+), 11 deletions(-) diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvFile.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvFile.java index 771d19c51..d04680738 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvFile.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvFile.java @@ -43,7 +43,7 @@ public class SupvFile { @ApiModelProperty("附件名称") private String attachmentName; - @ApiModelProperty("0.计划 1.问题") + @ApiModelProperty("0.计划 1.问题 2.全过程") private Integer type; @ApiModelProperty("附件分类") diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java index e2c62ab79..29c897b53 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java @@ -1,6 +1,7 @@ package com.njcn.process.pojo.po; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -16,6 +17,8 @@ import lombok.Data; import lombok.Getter; import lombok.Setter; +import javax.validation.constraints.NotBlank; + /** *

* @@ -30,17 +33,21 @@ public class SupvPlanRel { private static final long serialVersionUID = 1L; + @TableId private String objId; + @NotBlank(message = "计划id不可为空") private String planId; /** * 关联对象类型 */ + @NotBlank(message = "关联对象类型不可为空") private String relObjType; private String relObjId; + @NotBlank(message = "对象名称不可为空") private String relObjName; private Timestamp createTimes; @@ -49,12 +56,14 @@ public class SupvPlanRel { private Long createTime; private Timestamp updateTimes; + @TableField(exist = false) private Long updateTime; private String isDelete; private Timestamp deleteTimes; + @TableField(exist = false) private Long deleteTime; diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvPlanController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvPlanController.java index 992d73f03..3f24ffcc6 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvPlanController.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvPlanController.java @@ -10,6 +10,7 @@ import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; import com.njcn.process.pojo.param.SupvPlanParam; import com.njcn.process.pojo.po.SupvPlan; +import com.njcn.process.pojo.po.SupvPlanRel; import com.njcn.process.pojo.vo.SupvPlanVO; import com.njcn.process.service.ISupvPlanService; import io.swagger.annotations.Api; @@ -65,7 +66,7 @@ public class SupvPlanController extends BaseController { } @PostMapping("delPlan") - @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE) @ApiOperation("删除监督计划") @ApiImplicitParam(name = "planIds",value = "监督计划索引集合",required = true) public HttpResult delPlan(@RequestBody List planIds){ @@ -86,6 +87,39 @@ public class SupvPlanController extends BaseController { + @PostMapping("saveOrUpdatePlanRel") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @ApiOperation("新增变容器组关联对象") + @ApiImplicitParam(name = "supvPlanRel",value = "请求体",required = true) + public HttpResult saveOrUpdatePlanRel(@RequestBody @Validated SupvPlanRel supvPlanRel){ + String methodDescribe = getMethodDescribe("saveOrUpdatePlanRel"); + iSupvPlanService.saveOrUpdatePlanRel(supvPlanRel); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + + @PostMapping("delPlanRel") + @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE) + @ApiOperation("删除变容器组关联对象") + @ApiImplicitParam(name = "planRelIds",value = "监督计划索引集合",required = true) + public HttpResult delPlanRel(@RequestBody List planRelIds){ + String methodDescribe = getMethodDescribe("delPlanRel"); + iSupvPlanService.delPlanRel(planRelIds); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + @PostMapping("planRelList") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("查询变容器组关联对象") + @ApiImplicitParam(name = "supvPlanRel",value = "请求体",required = true) + public HttpResult> planRelList(@RequestBody SupvPlanRel supvPlanRel){ + String methodDescribe = getMethodDescribe("planRelList"); + List result = iSupvPlanService.planList(supvPlanRel); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); + } + + + } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvPlanService.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvPlanService.java index 1f5738eab..55fa84b75 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvPlanService.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/ISupvPlanService.java @@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.njcn.common.pojo.response.HttpResult; import com.njcn.process.pojo.param.SupvPlanParam; import com.njcn.process.pojo.po.SupvPlan; +import com.njcn.process.pojo.po.SupvPlanRel; import com.njcn.process.pojo.vo.SupvPlanVO; +import liquibase.pro.packaged.S; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.multipart.MultipartFile; @@ -54,5 +56,12 @@ public interface ISupvPlanService extends IService { + boolean saveOrUpdatePlanRel(SupvPlanRel supvPlanRel); + + boolean delPlanRel(List planRelIds); + + + List planList(SupvPlanRel supvPlanRel); + } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java index 172a8a849..56ab75d0a 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java @@ -21,12 +21,10 @@ import com.njcn.oss.utils.FileStorageUtil; import com.njcn.process.enums.ProcessResponseEnum; import com.njcn.process.mapper.SupvFileMapper; import com.njcn.process.mapper.SupvPlanMapper; +import com.njcn.process.mapper.SupvPlanRelMapper; import com.njcn.process.mapper.SupvProblemMapper; import com.njcn.process.pojo.param.SupvPlanParam; -import com.njcn.process.pojo.po.SupvFile; -import com.njcn.process.pojo.po.SupvPlan; -import com.njcn.process.pojo.po.SupvPlanHis; -import com.njcn.process.pojo.po.SupvProblem; +import com.njcn.process.pojo.po.*; import com.njcn.process.pojo.vo.SupvPlanVO; import com.njcn.process.service.ISupvFileService; import com.njcn.process.service.ISupvPlanHisService; @@ -52,13 +50,11 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import java.sql.Timestamp; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -88,6 +84,8 @@ public class SupvPlanServiceImpl extends ServiceImpl i private final FileStorageUtil fileStorageUtil; private final ISupvPlanHisService supvPlanHisService; + private final SupvPlanRelMapper supvPlanRelMapper; + @Override @Transactional(rollbackFor = Exception.class) @@ -365,6 +363,34 @@ public class SupvPlanServiceImpl extends ServiceImpl i return pageVo; } + @Override + public boolean saveOrUpdatePlanRel(SupvPlanRel supvPlanRel) { + if(StrUtil.isBlank(supvPlanRel.getObjId())){ + supvPlanRel.setRelObjId(IdUtil.simpleUUID()); + supvPlanRel.setCreateTimes(new Timestamp(new Date().getTime())); + supvPlanRel.setUpdateTimes(new Timestamp(new Date().getTime())); + supvPlanRel.setIsDelete("0"); + supvPlanRelMapper.insert(supvPlanRel); + }else { + supvPlanRel.setUpdateTimes(new Timestamp(new Date().getTime())); + supvPlanRelMapper.updateById(supvPlanRel); + } + return true; + } + + @Override + public boolean delPlanRel(List planRelIds) { + int res = supvPlanRelMapper.deleteBatchIds(planRelIds); + return res == planRelIds.size(); + } + + @Override + public List planList(SupvPlanRel supvPlanRel) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(SupvPlanRel::getPlanId,supvPlanRel.getPlanId()).orderByDesc(SupvPlanRel::getCreateTimes); + return supvPlanRelMapper.selectList(lambdaQueryWrapper); + } + private void checkParam(SupvPlanParam supvPlanParam, Boolean updateFlag) { diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java index 6042ec995..b72d41ad2 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java @@ -758,8 +758,8 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { otherParams.put("fileCount", (int) Math.ceil(s.length() / (1365000 * 1.0)) + ""); otherParams.put("fileCurrentNum", m + ""); - str = requestCommon("pqFileFromHyCreate", url, otherParams); otherParams.put("fileByte", s.substring(i, Math.min(i + 1365000, s.length()))); + str = requestCommon("pqFileFromHyCreate", url, otherParams); m++; }