diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/storeCertificate/StoreCertUpdateVO.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/storeCertificate/StoreCertUpdateVO.java index 464355892..1fa91cf18 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/storeCertificate/StoreCertUpdateVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/storeCertificate/StoreCertUpdateVO.java @@ -28,6 +28,9 @@ public class StoreCertUpdateVO { @ApiModelProperty(value = "档口ID", required = true) @NotNull(message = "档口ID不能为空!") private Long storeId; + @ApiModelProperty(value = "档口认证ID") + @NotNull(message = "档口认证ID不能为空!") + private Long storeCertId; @Valid @ApiModelProperty(value = "档口认证信息", required = true) @NotNull(message = "档口认证信息不能为空!") @@ -69,8 +72,6 @@ public class StoreCertUpdateVO { @Data @ApiModel public static class SCStoreCertVO { - @ApiModelProperty(value = "档口认证ID(新增时不传,编辑必传)") - private Long storeCertId; @ApiModelProperty(value = "真实姓名", required = true) @NotBlank(message = "真实姓名不能为空") @Size(min = 0, max = 30, message = "真实姓名长度必须在1到30个字之间") diff --git a/xkt/src/main/java/com/ruoyi/xkt/dto/storeCertificate/StoreCertDTO.java b/xkt/src/main/java/com/ruoyi/xkt/dto/storeCertificate/StoreCertDTO.java index 0aa91f53f..7ed785674 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/dto/storeCertificate/StoreCertDTO.java +++ b/xkt/src/main/java/com/ruoyi/xkt/dto/storeCertificate/StoreCertDTO.java @@ -21,6 +21,8 @@ public class StoreCertDTO { @ApiModelProperty(value = "档口ID", required = true) private Long storeId; + @ApiModelProperty(value = "档口认证ID(新增时不传,编辑必传)") + private Long storeCertId; @ApiModelProperty(value = "档口认证信息", required = true) private SCStoreCertDTO storeCert; @ApiModelProperty(value = "档口基础信息", required = true) @@ -52,8 +54,6 @@ public class StoreCertDTO { @Data public static class SCStoreCertDTO { - @ApiModelProperty(value = "档口认证ID(新增时不传,编辑必传)") - private Long storeCertId; @ApiModelProperty(value = "真实姓名", required = true) private String realName; @ApiModelProperty(value = "联系电话", required = true) diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreCertificateServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreCertificateServiceImpl.java index 682cd3f07..a84798342 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreCertificateServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreCertificateServiceImpl.java @@ -120,10 +120,8 @@ public class StoreCertificateServiceImpl implements IStoreCertificateService { @Override @Transactional public Integer update(StoreCertDTO certDTO) { - // 档口认证ID不能为空 - Optional.ofNullable(certDTO.getStoreCert().getStoreCertId()).orElseThrow(() -> new ServiceException("档口认证ID不能为空!", HttpStatus.ERROR)); StoreCertificate storeCert = Optional.ofNullable(this.storeCertMapper.selectOne(new LambdaQueryWrapper() - .eq(StoreCertificate::getId, certDTO.getStoreCert().getStoreCertId()).eq(StoreCertificate::getDelFlag, Constants.UNDELETED) + .eq(StoreCertificate::getId, certDTO.getStoreCertId()).eq(StoreCertificate::getDelFlag, Constants.UNDELETED) .eq(StoreCertificate::getStoreId, certDTO.getStoreId()))) .orElseThrow(() -> new ServiceException("档口认证不存在!", HttpStatus.ERROR)); // 先将旧的档口认证相关文件置为无效