From ab4a656016e03289f1a222760f42d6de51ac6549 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 9 Nov 2021 13:09:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E5=A4=87=E6=B3=A8=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/IcNeighborHoodFormDTO.java | 31 ++++++++----------- .../controller/NeighborHoodController.java | 6 ++-- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java index 98a6ad0fde..97d196e60d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java @@ -17,9 +17,7 @@ package com.epmet.dto.form; -import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -35,59 +33,56 @@ public class IcNeighborHoodFormDTO implements Serializable { public interface DeleteGroup extends CustomerClientShowGroup { } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + public interface UpdateShowGroup extends CustomerClientShowGroup { + } /** * 小区id */ - @NotBlank(message = "小区id不能为空", groups = {UpdateGroup.class,DeleteGroup.class}) + @NotBlank(message = "小区id不能为空", groups = {UpdateShowGroup.class,DeleteGroup.class}) private String neighborHoodId; /** * 小区名称 */ - @NotBlank(message = "小区名称不能为空", groups = {AddGroup.class, UpdateGroup.class}) - @Length(max=50,message = "小区名称不能超过50个字", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "小区名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @Length(max=50,message = "小区名称不能超过50个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String neighborHoodName; - /** - * 客户id - */ - /* @NotBlank(message = "客户id不能为空", groups = {AddGroup.class, UpdateGroup.class}) - private String customerId;*/ - /** * 组织id */ - @NotBlank(message = "组织id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "组织id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String agencyId; /** * 网格id */ - @NotBlank(message = "网格id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "网格id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String gridId; /** * 关联物业id */ - @NotBlank(message = "关联物业ID不能为空", groups = {UpdateGroup.class}) + @NotBlank(message = "关联物业ID不能为空", groups = {AddShowGroup.class,UpdateShowGroup.class}) private String propertyId; /** * 详细地址 */ - @NotBlank(message = "详细地址不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "详细地址不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String address; /** * 备注 */ - @NotBlank(message = "备注不能为空", groups = {UpdateGroup.class}) - @Length(max=500,message = "备注不能超过500个字", groups = {AddGroup.class, UpdateGroup.class}) + @Length(max=500,message = "备注不能超过500个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String remark; /** * 坐标位置 */ - //@NotBlank(message = "坐标位置不能为空", groups = {AddGroup.class, UpdateGroup.class}) private String location; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java index 823363814a..6bbab45e12 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java @@ -24,8 +24,6 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dao.IcBuildingDao; import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; @@ -89,7 +87,7 @@ public class NeighborHoodController { @PostMapping("neighborhoodadd") public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, AddGroup.class); + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.AddShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; @@ -100,7 +98,7 @@ public class NeighborHoodController { @PostMapping("neighborhoodupdate") public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.UpdateShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; neighborHoodService.UpdateNeighborhood(customerId,formDTO);