From 3e6f8056cf01f1da76f87c334443672a16214019 Mon Sep 17 00:00:00 2001 From: liyawei Date: Wed, 22 Jun 2022 18:21:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81-bug=2054807,54777?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParamsManifestEOController.java | 8 ++++--- .../collect/entity/ParamsConfigDataEO.java | 8 ++++--- .../cert/collect/entity/ParamsManifestEO.java | 4 ++++ .../ParamsCollectManifestEOServiceImpl.java | 19 +++++++++++++-- .../impl/ParamsManifestEOServiceImpl.java | 24 +++++++++++++++++-- .../collect/vo/ParamsCollectManifestVO.java | 2 ++ .../cert/collect/vo/ParamsManifestVO.java | 1 + 7 files changed, 56 insertions(+), 10 deletions(-) diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsManifestEOController.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsManifestEOController.java index 22e9effbb..641e43f73 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsManifestEOController.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsManifestEOController.java @@ -19,6 +19,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -276,9 +277,10 @@ public class ParamsManifestEOController extends JeroController copy(ParamsManifestEO paramsManifestEO, - @RequestParam(name="sourceManifestId",required=true) String sourceManifestId) { - ParamsManifestEO manifestEO = paramsManifestEOService.copy(paramsManifestEO, sourceManifestId); + public Result copy(@RequestBody ParamsManifestVO paramsManifestVO) { + ParamsManifestEO paramsManifestEO = new ParamsManifestEO(); + BeanUtils.copyProperties(paramsManifestVO, paramsManifestEO); + ParamsManifestEO manifestEO = paramsManifestEOService.copy(paramsManifestEO, paramsManifestVO.getSourceManifestId()); return Result.OK(manifestEO); } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/entity/ParamsConfigDataEO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/entity/ParamsConfigDataEO.java index 260c49008..7754c385d 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/entity/ParamsConfigDataEO.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/entity/ParamsConfigDataEO.java @@ -3,9 +3,8 @@ package com.jero.modules.cert.collect.entity; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; + +import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; @@ -64,16 +63,19 @@ public class ParamsConfigDataEO implements Serializable { /**文本类型数据*/ @Excel(name = "文本类型数据", width = 15) @ApiModelProperty(value = "文本类型数据") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String textData; /**下拉类型数据*/ @Excel(name = "下拉类型数据", width = 15) @ApiModelProperty(value = "下拉类型数据") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String pullData; /**附件类型数据*/ @Excel(name = "附件类型数据", width = 15) @ApiModelProperty(value = "附件类型数据") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String fileConnectId; /**参数配置id*/ diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/entity/ParamsManifestEO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/entity/ParamsManifestEO.java index ac65946b5..2d619154b 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/entity/ParamsManifestEO.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/entity/ParamsManifestEO.java @@ -101,4 +101,8 @@ public class ParamsManifestEO implements Serializable { @TableField(exist = false) private Boolean configFlag; // true-可添加配置;false-不可添加配置 + + @TableField(exist = false) + private String cut; + } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index ff32910b2..e625b5e2c 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -1232,7 +1232,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsManifestEOList = list(queryWrapper); if (CollectionUtil.isNotEmpty(paramsManifestEOList)) { - throw new JeroBootException("标题已存在!"); + if (CutEnum.EN.getValue().equals(paramsManifestEO.getCut())) { + throw new JeroBootException("Title already exists!"); + } else { + throw new JeroBootException("标题已存在!"); + } } String paramsManifestId = UUID.randomUUID().toString().replace("-",""); @@ -153,7 +157,11 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl paramsManifestEOList = list(queryWrapper); if (CollectionUtil.isNotEmpty(paramsManifestEOList)) { - throw new JeroBootException("标题已存在!"); + if (CutEnum.EN.getValue().equals(paramsManifestEO.getCut())) { + throw new JeroBootException("Title already exists!"); + } else { + throw new JeroBootException("标题已存在!"); + } } } @@ -453,6 +461,18 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ParamsManifestEO::getTitle, paramsManifestEO.getTitle()); + queryWrapper.eq(ParamsManifestEO::getProjectId, paramsManifestEO.getProjectId()); + List paramsManifestEOList = list(queryWrapper); + if (CollectionUtil.isNotEmpty(paramsManifestEOList)) { + if (CutEnum.EN.getValue().equals(paramsManifestEO.getCut())) { + throw new JeroBootException("Title already exists!"); + } else { + throw new JeroBootException("标题已存在!"); + } + } + // 查询所有模板参数项 List paramsInfoPublishEOList = paramsInfoPublishEOService.getListByPublishVersion(paramsTemplateId, paramsTemplatePublishVersion); diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/vo/ParamsCollectManifestVO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/vo/ParamsCollectManifestVO.java index 689c4b438..1564daa81 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/vo/ParamsCollectManifestVO.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/vo/ParamsCollectManifestVO.java @@ -69,4 +69,6 @@ public class ParamsCollectManifestVO { private String sourceConfigId; // 引用参数专用 @ApiModelProperty(value = "引用参数专用-到") private String targetConfigIds; // 引用参数专用 + + private String cut; // 引用参数专用 } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/vo/ParamsManifestVO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/vo/ParamsManifestVO.java index 1772bd5bf..187fe1d54 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/vo/ParamsManifestVO.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/vo/ParamsManifestVO.java @@ -21,4 +21,5 @@ public class ParamsManifestVO { private String ids; private String cut; + private String sourceManifestId; }