From 96b3a7235516f0ad6e614b7413517db649ad1c5b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 9 Apr 2020 12:47:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=85=B3=E4=BA=8E=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E5=AF=B9=E8=B1=A1=E5=B5=8C=E5=A5=97=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiRegisterServiceImpl.java | 5 +- .../com/epmet/dto/form/InfoSubmitFromDTO.java | 84 +++++++++++++++++++ .../epmet/dto/form/ResiInfoSubmitFormDTO.java | 4 +- 3 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/service/impl/ResiRegisterServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/service/impl/ResiRegisterServiceImpl.java index 7b48c66926..25f9def7c8 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/service/impl/ResiRegisterServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/resiregister/service/impl/ResiRegisterServiceImpl.java @@ -1,8 +1,10 @@ package com.epmet.modules.resiregister.service.impl; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; +import com.epmet.dto.form.InfoSubmitFromDTO; import com.epmet.dto.form.ResiInfoSubmitFormDTO; import com.epmet.dto.form.ResiRegisterFormDTO; import com.epmet.dto.form.VerificationCodeFormDTO; @@ -46,7 +48,8 @@ public class ResiRegisterServiceImpl implements ResiRegisterService { **/ @Override public Result submit(TokenDto tokenDTO, ResiInfoSubmitFormDTO resiInfoSubmitFormDTO) { - UserResiInfoDTO userResiInfoDTO = resiInfoSubmitFormDTO.getResiInfo(); + InfoSubmitFromDTO infoSubmitFromDTO = resiInfoSubmitFormDTO.getResiInfo(); + UserResiInfoDTO userResiInfoDTO = ConvertUtils.sourceToTarget(infoSubmitFromDTO, UserResiInfoDTO.class); userResiInfoDTO.setUserId(tokenDTO.getUserId()); userResiInfoDTO.setApp(tokenDTO.getApp()); userResiInfoDTO.setCustomerId(resiInfoSubmitFormDTO.getCustomerId()); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java new file mode 100644 index 0000000000..3f61da4667 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户居民端注册信息表 用户在居民端完善的个人信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-30 + */ +@Data +public class InfoSubmitFromDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 手机号(注册手机号) + */ + @NotBlank(message = "手机号不能为空") + private String regMobile; + + /** + * 姓氏 + */ + @NotBlank(message = "姓氏不能为空") + private String surname; + + /** + * 名称 + */ + @NotBlank(message = "名称不能为空") + private String name; + + /** + * 街道 + */ + @NotBlank(message = "所在街道不能为空") + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 居民注册行为记录表Id resi_visit.id + */ + private String resiVisitId; + + /** + * 手机验证码 + */ + @NotBlank(message = "手机验证码不能为空") + private String mobileCode; + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiInfoSubmitFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiInfoSubmitFormDTO.java index 8229b7913e..c675b309dc 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiInfoSubmitFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiInfoSubmitFormDTO.java @@ -20,6 +20,7 @@ package com.epmet.dto.form; import com.epmet.dto.UserResiInfoDTO; import lombok.Data; +import javax.validation.Valid; import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; @@ -58,7 +59,8 @@ public class ResiInfoSubmitFormDTO implements Serializable { /** * 用户在居民端完善的个人信息 */ - private UserResiInfoDTO resiInfo; + @Valid + private InfoSubmitFromDTO resiInfo; }