From cd5ab4a3a6c23e6e5f281d21eba6dd226a6dee1c Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 9 Nov 2021 12:40:36 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=20pc=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=AB=AF=E7=99=BB=E5=BD=95=E7=BC=93=E5=AD=98=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=83=A8=E5=88=86=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/GovWebServiceImpl.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 965869be12..8b1a2b521a 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -3,7 +3,7 @@ package com.epmet.service.impl; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; @@ -45,6 +45,8 @@ public class GovWebServiceImpl implements GovWebService { private CpUserDetailRedis cpUserDetailRedis; @Autowired private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private ThirdLoginServiceImpl thirdLoginService; /** * @param formDTO @@ -60,12 +62,12 @@ public class GovWebServiceImpl implements GovWebService { throw new RenException("当前接口只适用于PC工作端运营管理后台"); } //2.验证码校验 - boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); - if (!flag) { - logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone())); - //开启验证码校验 - throw new RenException(EpmetErrorCode.ERR10019.getCode()); - } + //boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); + //if (!flag) { + // logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone())); + // //开启验证码校验 + // throw new RenException(EpmetErrorCode.ERR10019.getCode()); + //} //3.校验登陆账号是否存在 //根据客户Id和手机号查询登陆用户信息(此处不需要判断登陆人是否是有效客户以及是否是客户的根管理员,前一接口获取登陆手机号对应客户列表已经判断了) GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO(); @@ -105,7 +107,11 @@ public class GovWebServiceImpl implements GovWebService { String token = jwtTokenUtils.createToken(map); logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]"); int expire = jwtTokenProperties.getExpire(); - TokenDto tokenDto = new TokenDto(); + + String orgIdPath = thirdLoginService.getOrgIdPath(userId); + String[] orgIdPathParts = orgIdPath.split(":"); + + GovTokenDto tokenDto = new GovTokenDto(); tokenDto.setCustomerId(formDTO.getCustomerId()); tokenDto.setApp(formDTO.getApp()); tokenDto.setClient(formDTO.getClient()); @@ -113,6 +119,13 @@ public class GovWebServiceImpl implements GovWebService { tokenDto.setToken(token); tokenDto.setUpdateTime(System.currentTimeMillis()); tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + tokenDto.setAgencyId(orgIdPathParts[orgIdPathParts.length - 1]); + tokenDto.setRootAgencyId(orgIdPathParts[0]); + tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId)); + tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId)); + tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, orgIdPathParts[orgIdPathParts.length - 1])); + tokenDto.setOrgIdPath(orgIdPath); + cpUserDetailRedis.set(tokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); return token; From b8391e99658b1940eb6fa795902fd5d2964545ea Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 9 Nov 2021 12:57:26 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=20pc=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=AB=AF=E7=99=BB=E5=BD=95=E7=BC=93=E5=AD=98=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=83=A8=E5=88=86=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/GovWebServiceImpl.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 965869be12..0bc1a8f7a0 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.impl; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; @@ -45,6 +46,8 @@ public class GovWebServiceImpl implements GovWebService { private CpUserDetailRedis cpUserDetailRedis; @Autowired private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private ThirdLoginServiceImpl thirdLoginService; /** * @param formDTO @@ -105,7 +108,11 @@ public class GovWebServiceImpl implements GovWebService { String token = jwtTokenUtils.createToken(map); logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]"); int expire = jwtTokenProperties.getExpire(); - TokenDto tokenDto = new TokenDto(); + + String orgIdPath = thirdLoginService.getOrgIdPath(userId); + String[] orgIdPathParts = orgIdPath.split(":"); + + GovTokenDto tokenDto = new GovTokenDto(); tokenDto.setCustomerId(formDTO.getCustomerId()); tokenDto.setApp(formDTO.getApp()); tokenDto.setClient(formDTO.getClient()); @@ -113,6 +120,13 @@ public class GovWebServiceImpl implements GovWebService { tokenDto.setToken(token); tokenDto.setUpdateTime(System.currentTimeMillis()); tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + tokenDto.setAgencyId(orgIdPathParts[orgIdPathParts.length - 1]); + tokenDto.setRootAgencyId(orgIdPathParts[0]); + tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId)); + tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId)); + tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, orgIdPathParts[orgIdPathParts.length - 1])); + tokenDto.setOrgIdPath(orgIdPath); + cpUserDetailRedis.set(tokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); return token; 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 3/4] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=E4=B8=8D=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); From bf56b809662777f12dcc712eb9abe1eb7ab4a8b5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 9 Nov 2021 13:23:47 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=BB=99=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/IcBulidingFormDTO.java | 31 ++++++++++--------- .../com/epmet/dto/form/IcHouseFormDTO.java | 30 ++++++++++-------- .../epmet/controller/BuildingController.java | 5 ++- .../com/epmet/controller/HouseController.java | 6 ++-- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java index 8ce4e063b9..b14c58b47c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.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; @@ -36,70 +34,75 @@ public class IcBulidingFormDTO implements Serializable { public interface DeleteGroup extends CustomerClientShowGroup { } - @NotBlank(message = "楼栋ID不能为空", groups = { UpdateGroup.class,DeleteGroup.class}) + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "楼栋ID不能为空", groups = { UpdateShowGroup.class,DeleteGroup.class}) private String buildingId; /** * 组织id */ - @NotBlank(message = "组织id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "组织id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String agencyId; /** * 网格id */ - @NotBlank(message = "网格不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "网格不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String gridId; /** * 小区id */ - @NotBlank(message = "小区id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "小区id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String neighborHoodId; /** * 楼栋名称 */ - @NotBlank(message = "楼栋名称不能为空", groups = {AddGroup.class, UpdateGroup.class}) - @Length(max=10,message = "楼栋名称不能超过10个字", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "楼栋名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @Length(max=10,message = "楼栋名称不能超过10个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String buildingName; /** * 楼栋类型 */ - @NotBlank(message = "楼栋类型不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "楼栋类型不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String type=""; /** * 客户id */ - /* @NotBlank(message = "客户id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + /* @NotBlank(message = "客户id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String customerId;*/ /** * 排序 */ - @NotNull(message = "排序不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotNull(message = "排序不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private Integer sort = 0; /** * 总单元数 */ - @NotNull(message = "总单元数不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotNull(message = "总单元数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private Integer totalUnitNum=1; /** * 总楼层总数 */ - @NotNull(message = "总楼层总数不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotNull(message = "总楼层总数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private Integer totalFloorNum; /** * 总户数 */ - @NotNull(message = "总户数不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotNull(message = "总户数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private Integer totalHouseNum; /** * 坐标位置 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java index cb557aa572..58376e2032 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.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 javax.validation.constraints.NotBlank; @@ -35,23 +33,29 @@ public class IcHouseFormDTO implements Serializable { public interface DeleteGroup extends CustomerClientShowGroup { } - @NotBlank(message = "房屋ID不能为空", groups = { UpdateGroup.class,DeleteGroup.class}) + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "房屋ID不能为空", groups = { UpdateShowGroup.class,DeleteGroup.class}) private String houseId; /** * 小区id */ - @NotBlank(message = "小区id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "小区id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String neighborHoodId; - @NotBlank(message = "所属楼栋ID不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "所属楼栋ID不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String buildingId; /** * 所属单元id */ - @NotBlank(message = "所属单元id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "所属单元id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String buildingUnitId; @@ -59,43 +63,43 @@ public class IcHouseFormDTO implements Serializable { /** * 门牌号 */ - @NotBlank(message = "门牌号不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "门牌号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String doorName; /** * 房屋类型,这里存储字典value就可以 */ - @NotBlank(message = "房屋类型不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "房屋类型不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String houseType; /** * 存储字典value */ - @NotBlank(message = "房屋用途不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "房屋用途不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String purpose; /** * 1出租;0未出租 */ - @NotNull(message = "是否出租不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotNull(message = "是否出租不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private Integer rentFlag; /** * 房主姓名 */ - @NotBlank(message = "房主姓名不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "房主姓名不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String ownerName; /** * 房主电话 */ - @NotBlank(message = "房主电话不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "房主电话不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String ownerPhone; /** * 房主身份证号 */ - @NotBlank(message = "房主身份证号不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "房主身份证号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private String ownerIdCard; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java index 763abf8efc..f3edc781e1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -25,7 +25,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.IcBuildingUnitDao; import com.epmet.dto.BuildingTreeLevelDTO; @@ -90,7 +89,7 @@ public class BuildingController { @PostMapping("buildingadd") public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, AddGroup.class); + ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.AddShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; @@ -101,7 +100,7 @@ public class BuildingController { @PostMapping("buildingupdate") public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.UpdateShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; buildingService.UpdateBuilding(customerId,formDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 8bc4378e8f..12295301a1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -23,8 +23,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.dto.form.IcHouseFormDTO; import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; @@ -76,7 +74,7 @@ public class HouseController { @PostMapping("houseadd") public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, AddGroup.class); + ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.AddShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; @@ -87,7 +85,7 @@ public class HouseController { @PostMapping("houseupdate") public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.UpdateShowGroup.class); String customerId = tokenDTO.getCustomerId(); // String customerId = "123123"; houseService.updateHouse(customerId,formDTO);