From 95f698dbd90be876cbeefae9b241252462617db5 Mon Sep 17 00:00:00 2001 From: dimengzhe Date: Fri, 19 Jan 2024 14:15:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E4=BF=A1=E6=81=AF=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/lpkcustomer/CustomerInfoVo.java | 3 ++ .../yythmall/api/lpkcustomer/LpkCustomer.java | 9 ++++ .../yythmall/api/lpkcustomer/RealInfoDto.java | 25 +++++++++++ .../yythmall/api/lpkcustomer/RealInfoVo.java | 24 ++++++++++ .../com/yxt/yythmall/api/region/Region.java | 38 ++++++++++++++++ .../biz/lpkcustomer/LpkCustomerRest.java | 16 +++++-- .../biz/lpkcustomer/LpkCustomerService.java | 45 ++++++++++++++++++- .../yxt/yythmall/biz/region/RegionRest.java | 19 ++++++++ .../yxt/yythmall/config/SaTokenConfigure.java | 2 + 9 files changed, 175 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/yxt/yythmall/api/lpkcustomer/RealInfoDto.java create mode 100644 src/main/java/com/yxt/yythmall/api/lpkcustomer/RealInfoVo.java create mode 100644 src/main/java/com/yxt/yythmall/api/region/Region.java create mode 100644 src/main/java/com/yxt/yythmall/biz/region/RegionRest.java diff --git a/src/main/java/com/yxt/yythmall/api/lpkcustomer/CustomerInfoVo.java b/src/main/java/com/yxt/yythmall/api/lpkcustomer/CustomerInfoVo.java index b83f2d5..e79f178 100644 --- a/src/main/java/com/yxt/yythmall/api/lpkcustomer/CustomerInfoVo.java +++ b/src/main/java/com/yxt/yythmall/api/lpkcustomer/CustomerInfoVo.java @@ -18,5 +18,8 @@ public class CustomerInfoVo { private String phone; + @ApiModelProperty("是否实名:已实名或未实名") + private String realAttestationExplain; + } diff --git a/src/main/java/com/yxt/yythmall/api/lpkcustomer/LpkCustomer.java b/src/main/java/com/yxt/yythmall/api/lpkcustomer/LpkCustomer.java index 4abc2cb..fde917e 100644 --- a/src/main/java/com/yxt/yythmall/api/lpkcustomer/LpkCustomer.java +++ b/src/main/java/com/yxt/yythmall/api/lpkcustomer/LpkCustomer.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; @@ -34,4 +35,12 @@ public class LpkCustomer { private String photo; @TableField(exist = false) private String token; + @ApiModelProperty("性别") + private String sex; + @ApiModelProperty("生日") + private String birthDay; + @ApiModelProperty("所在区域code") + private String regionCode; + @ApiModelProperty("所在区域名称") + private String regionName; } diff --git a/src/main/java/com/yxt/yythmall/api/lpkcustomer/RealInfoDto.java b/src/main/java/com/yxt/yythmall/api/lpkcustomer/RealInfoDto.java new file mode 100644 index 0000000..a92e14b --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/lpkcustomer/RealInfoDto.java @@ -0,0 +1,25 @@ +package com.yxt.yythmall.api.lpkcustomer; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/1/19 + **/ +@Data +public class RealInfoDto { + + private String userSid; + @ApiModelProperty("所在区县code") + private String regionCode; + @ApiModelProperty("所在区域名称:拼接省/市/县区") + private String regionName; + @ApiModelProperty("生日") + private String birthDay; + @ApiModelProperty("真实姓名") + private String realName; + @ApiModelProperty("性别:男/女") + private String sex; +} diff --git a/src/main/java/com/yxt/yythmall/api/lpkcustomer/RealInfoVo.java b/src/main/java/com/yxt/yythmall/api/lpkcustomer/RealInfoVo.java new file mode 100644 index 0000000..ccaa9d3 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/lpkcustomer/RealInfoVo.java @@ -0,0 +1,24 @@ +package com.yxt.yythmall.api.lpkcustomer; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/1/19 + **/ +@Data +public class RealInfoVo { + + @ApiModelProperty("所在区域code") + private String regionCode; + @ApiModelProperty("所在区域名称") + private String regionName; + @ApiModelProperty("真实姓名") + private String realName; + @ApiModelProperty("性别") + private String sex; + @ApiModelProperty("生日") + private String birthDay; +} diff --git a/src/main/java/com/yxt/yythmall/api/region/Region.java b/src/main/java/com/yxt/yythmall/api/region/Region.java new file mode 100644 index 0000000..425d651 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/region/Region.java @@ -0,0 +1,38 @@ +package com.yxt.yythmall.api.region; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/1/19 + **/ +@Data +public class Region extends BaseEntity { + + /** + * 名称,区域名称 + */ + private String name; + /** + * 级别 + */ + private Integer level; + /** + * 行政区划代码 + */ + private String districtCode; + /** + * 上级sid + */ + private String pSid; + /** + * sid全路径Id(provincesid/citysid/countysid/townsid) + */ + private String sidPath; + /** + * 排序号 + */ + private String sortNo; +} diff --git a/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerRest.java b/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerRest.java index 6c7585e..ac7f43d 100644 --- a/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerRest.java +++ b/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerRest.java @@ -4,10 +4,7 @@ import cn.hutool.core.util.IdUtil; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; -import com.yxt.yythmall.api.lpkcustomer.CustomerInfoVo; -import com.yxt.yythmall.api.lpkcustomer.LpkCustomerQuery; -import com.yxt.yythmall.api.lpkcustomer.LpkCustomerVo; -import com.yxt.yythmall.api.lpkcustomer.WxBindMobileDto; +import com.yxt.yythmall.api.lpkcustomer.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.junit.Test; @@ -81,4 +78,15 @@ public class LpkCustomerRest { return lpkCustomerService.getPhoneNumber(code,userSid); } + @ApiOperation("获取实名信息") + @GetMapping("/getRealInfo/{userSid}") + ResultBean getRealInfo(@PathVariable("userSid")String userSid){ + return lpkCustomerService.getRealInfo(userSid); + } + @ApiOperation("保存实名信息") + @PostMapping("/saveRealInfo") + ResultBean saveRealInfo(@RequestBody RealInfoDto dto){ + return lpkCustomerService.saveRealInfo(dto); + } + } diff --git a/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerService.java b/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerService.java index 2325f4c..2e0964f 100644 --- a/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerService.java +++ b/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerService.java @@ -101,7 +101,7 @@ public class LpkCustomerService extends MybatisBaseService getRealInfo(String userSid) { + ResultBean rb = ResultBean.fireFail(); + LpkCustomer lpkCustomer = fetchBySid(userSid); + if(lpkCustomer == null){ + return rb.setMsg("该客户不存在"); + } + RealInfoVo realInfoVo = new RealInfoVo(); + realInfoVo.setRealName(lpkCustomer.getRealName()); + realInfoVo.setRegionCode(lpkCustomer.getRegionCode()); + realInfoVo.setBirthDay(lpkCustomer.getBirthDay()); + realInfoVo.setRegionName(lpkCustomer.getRegionName()); + realInfoVo.setSex(lpkCustomer.getSex()); + return rb.success().setData(realInfoVo); + } + + public ResultBean saveRealInfo(RealInfoDto dto) { + ResultBean rb = ResultBean.fireFail(); + LpkCustomer lpkCustomer = fetchBySid(dto.getUserSid()); + if(lpkCustomer == null){ + return rb.setMsg("该客户不存在"); + } + if(StringUtils.isBlank(dto.getRealName())){ + return rb.setMsg("真实姓名是必填项"); + } + lpkCustomer.setRealName(dto.getRealName()); + lpkCustomer.setBirthDay(dto.getBirthDay()); + if(StringUtils.isBlank(dto.getRegionCode())){ + return rb.setMsg("所在区域是必填项"); + } + lpkCustomer.setRegionCode(dto.getRegionCode()); + lpkCustomer.setRegionName(dto.getRegionName()); + lpkCustomer.setSex(dto.getSex()); + baseMapper.updateById(lpkCustomer); + return rb.success(); + } } diff --git a/src/main/java/com/yxt/yythmall/biz/region/RegionRest.java b/src/main/java/com/yxt/yythmall/biz/region/RegionRest.java new file mode 100644 index 0000000..f678898 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/region/RegionRest.java @@ -0,0 +1,19 @@ +package com.yxt.yythmall.biz.region; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/1/19 + **/ +@Api(tags = "区域信息") +@RestController +@RequestMapping("Region") +public class RegionRest { + + + +} diff --git a/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java b/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java index 2649148..3efc367 100644 --- a/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java +++ b/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java @@ -78,6 +78,8 @@ public class SaTokenConfigure implements WebMvcConfigurer { .excludePathPatterns("/lpkcustomer/modifyHeadImage") .excludePathPatterns("/upload/**") .excludePathPatterns("/lpkcustomer/getPhoneNumber") + .excludePathPatterns("/lpkcustomer/getRealInfo/**") + .excludePathPatterns("/lpkcustomer/saveRealInfo") ; } }