Showing
11 changed files
with
55 additions
and
19 deletions
| @@ -22,6 +22,12 @@ public class GetCorePersonnelBo extends BaseBo<CorePersonnel> { | @@ -22,6 +22,12 @@ public class GetCorePersonnelBo extends BaseBo<CorePersonnel> { | ||
| 22 | private String id; | 22 | private String id; |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | + * personId前端自用id | ||
| 26 | + */ | ||
| 27 | + @ApiModelProperty("personId") | ||
| 28 | + private String personId; | ||
| 29 | + | ||
| 30 | + /** | ||
| 25 | * 姓名 | 31 | * 姓名 |
| 26 | */ | 32 | */ |
| 27 | @ApiModelProperty("姓名") | 33 | @ApiModelProperty("姓名") |
| @@ -7,6 +7,8 @@ import com.lframework.xingyun.sc.entity.CustomerCredit; | @@ -7,6 +7,8 @@ import com.lframework.xingyun.sc.entity.CustomerCredit; | ||
| 7 | import java.math.BigDecimal; | 7 | import java.math.BigDecimal; |
| 8 | import com.lframework.starter.common.constants.StringPool; | 8 | import com.lframework.starter.common.constants.StringPool; |
| 9 | import com.lframework.starter.web.core.bo.BaseBo; | 9 | import com.lframework.starter.web.core.bo.BaseBo; |
| 10 | + | ||
| 11 | +import java.time.LocalDate; | ||
| 10 | import java.time.LocalDateTime; | 12 | import java.time.LocalDateTime; |
| 11 | import java.util.List; | 13 | import java.util.List; |
| 12 | 14 | ||
| @@ -47,7 +49,7 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> { | @@ -47,7 +49,7 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> { | ||
| 47 | */ | 49 | */ |
| 48 | @ApiModelProperty("登记日期") | 50 | @ApiModelProperty("登记日期") |
| 49 | @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | 51 | @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) |
| 50 | - private LocalDateTime registerDate; | 52 | + private LocalDate registerDate; |
| 51 | 53 | ||
| 52 | /** | 54 | /** |
| 53 | * 客户简称 | 55 | * 客户简称 |
| @@ -114,7 +116,7 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> { | @@ -114,7 +116,7 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> { | ||
| 114 | */ | 116 | */ |
| 115 | @ApiModelProperty("注册时间") | 117 | @ApiModelProperty("注册时间") |
| 116 | @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | 118 | @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) |
| 117 | - private LocalDateTime registrationTime; | 119 | + private LocalDate registrationTime; |
| 118 | 120 | ||
| 119 | /** | 121 | /** |
| 120 | * 经营年限(年) | 122 | * 经营年限(年) |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/customer/CustomerCreditController.java
| 1 | package com.lframework.xingyun.sc.controller.customer; | 1 | package com.lframework.xingyun.sc.controller.customer; |
| 2 | 2 | ||
| 3 | import com.lframework.starter.web.core.annotations.security.HasPermission; | 3 | import com.lframework.starter.web.core.annotations.security.HasPermission; |
| 4 | -import com.lframework.starter.web.core.components.security.AbstractUserDetails; | ||
| 5 | -import com.lframework.starter.web.core.components.security.SecurityUtil; | ||
| 6 | import com.lframework.starter.web.core.controller.DefaultBaseController; | 4 | import com.lframework.starter.web.core.controller.DefaultBaseController; |
| 7 | import com.lframework.xingyun.basedata.service.customer.CustomerService; | 5 | import com.lframework.xingyun.basedata.service.customer.CustomerService; |
| 8 | import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditBo; | 6 | import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditBo; |
| @@ -95,7 +93,7 @@ public class CustomerCreditController extends DefaultBaseController { | @@ -95,7 +93,7 @@ public class CustomerCreditController extends DefaultBaseController { | ||
| 95 | @ApiOperation("新增") | 93 | @ApiOperation("新增") |
| 96 | @HasPermission({"customerCredit:customercredit:add"}) | 94 | @HasPermission({"customerCredit:customercredit:add"}) |
| 97 | @PostMapping("/add") | 95 | @PostMapping("/add") |
| 98 | - public InvokeResult<Void> create(@Valid CreateCustomerCreditVo vo) { | 96 | + public InvokeResult<Void> create(@RequestBody @Valid CreateCustomerCreditVo vo) { |
| 99 | 97 | ||
| 100 | customerCreditService.create(vo); | 98 | customerCreditService.create(vo); |
| 101 | 99 | ||
| @@ -108,7 +106,7 @@ public class CustomerCreditController extends DefaultBaseController { | @@ -108,7 +106,7 @@ public class CustomerCreditController extends DefaultBaseController { | ||
| 108 | @ApiOperation("修改") | 106 | @ApiOperation("修改") |
| 109 | @HasPermission({"customerCredit:customercredit:modify"}) | 107 | @HasPermission({"customerCredit:customercredit:modify"}) |
| 110 | @PutMapping("/update") | 108 | @PutMapping("/update") |
| 111 | - public InvokeResult<Void> update(@Valid UpdateCustomerCreditVo vo) { | 109 | + public InvokeResult<Void> update(@RequestBody @Valid UpdateCustomerCreditVo vo) { |
| 112 | 110 | ||
| 113 | customerCreditService.update(vo); | 111 | customerCreditService.update(vo); |
| 114 | 112 |
| @@ -28,6 +28,11 @@ public class CorePersonnel extends BaseEntity implements BaseDto { | @@ -28,6 +28,11 @@ public class CorePersonnel extends BaseEntity implements BaseDto { | ||
| 28 | private String id; | 28 | private String id; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | + * 前端自用id | ||
| 32 | + */ | ||
| 33 | + private String personId; | ||
| 34 | + | ||
| 35 | + /** | ||
| 31 | * 客户资信 | 36 | * 客户资信 |
| 32 | */ | 37 | */ |
| 33 | private String creditId; | 38 | private String creditId; |
| @@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.entity; | @@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.entity; | ||
| 3 | import com.baomidou.mybatisplus.annotation.TableName; | 3 | import com.baomidou.mybatisplus.annotation.TableName; |
| 4 | import java.math.BigDecimal; | 4 | import java.math.BigDecimal; |
| 5 | import com.lframework.starter.web.core.dto.BaseDto; | 5 | import com.lframework.starter.web.core.dto.BaseDto; |
| 6 | + | ||
| 7 | +import java.time.LocalDate; | ||
| 6 | import java.time.LocalDateTime; | 8 | import java.time.LocalDateTime; |
| 7 | import com.baomidou.mybatisplus.annotation.FieldFill; | 9 | import com.baomidou.mybatisplus.annotation.FieldFill; |
| 8 | import com.lframework.starter.web.core.entity.BaseEntity; | 10 | import com.lframework.starter.web.core.entity.BaseEntity; |
| @@ -41,7 +43,7 @@ public class CustomerCredit extends BaseEntity implements BaseDto { | @@ -41,7 +43,7 @@ public class CustomerCredit extends BaseEntity implements BaseDto { | ||
| 41 | /** | 43 | /** |
| 42 | * 登记日期 | 44 | * 登记日期 |
| 43 | */ | 45 | */ |
| 44 | - private LocalDateTime registerDate; | 46 | + private LocalDate registerDate; |
| 45 | 47 | ||
| 46 | /** | 48 | /** |
| 47 | * 客户简称 | 49 | * 客户简称 |
| @@ -96,7 +98,7 @@ public class CustomerCredit extends BaseEntity implements BaseDto { | @@ -96,7 +98,7 @@ public class CustomerCredit extends BaseEntity implements BaseDto { | ||
| 96 | /** | 98 | /** |
| 97 | * 注册时间 | 99 | * 注册时间 |
| 98 | */ | 100 | */ |
| 99 | - private LocalDateTime registrationTime; | 101 | + private LocalDate registrationTime; |
| 100 | 102 | ||
| 101 | /** | 103 | /** |
| 102 | * 经营年限(年) | 104 | * 经营年限(年) |
| @@ -65,6 +65,9 @@ public class CorePersonnelServiceImpl extends BaseMpServiceImpl<CorePersonnelMap | @@ -65,6 +65,9 @@ public class CorePersonnelServiceImpl extends BaseMpServiceImpl<CorePersonnelMap | ||
| 65 | CorePersonnel data = new CorePersonnel(); | 65 | CorePersonnel data = new CorePersonnel(); |
| 66 | data.setId(IdUtil.getId()); | 66 | data.setId(IdUtil.getId()); |
| 67 | data.setCreditId(vo.getCreditId()); | 67 | data.setCreditId(vo.getCreditId()); |
| 68 | + if (!StringUtil.isBlank(vo.getPersonId())) { | ||
| 69 | + data.setPersonId(vo.getPersonId()); | ||
| 70 | + } | ||
| 68 | if (!StringUtil.isBlank(vo.getName())) { | 71 | if (!StringUtil.isBlank(vo.getName())) { |
| 69 | data.setName(vo.getName()); | 72 | data.setName(vo.getName()); |
| 70 | } | 73 | } |
| @@ -112,6 +115,7 @@ public class CorePersonnelServiceImpl extends BaseMpServiceImpl<CorePersonnelMap | @@ -112,6 +115,7 @@ public class CorePersonnelServiceImpl extends BaseMpServiceImpl<CorePersonnelMap | ||
| 112 | } | 115 | } |
| 113 | 116 | ||
| 114 | LambdaUpdateWrapper<CorePersonnel> updateWrapper = Wrappers.lambdaUpdate(CorePersonnel.class) | 117 | LambdaUpdateWrapper<CorePersonnel> updateWrapper = Wrappers.lambdaUpdate(CorePersonnel.class) |
| 118 | + .set(CorePersonnel::getPersonId, vo.getPersonId()) | ||
| 115 | .set(CorePersonnel::getCreditId, vo.getCreditId()) | 119 | .set(CorePersonnel::getCreditId, vo.getCreditId()) |
| 116 | .set(CorePersonnel::getName, StringUtil.isBlank(vo.getName()) ? null : vo.getName()) | 120 | .set(CorePersonnel::getName, StringUtil.isBlank(vo.getName()) ? null : vo.getName()) |
| 117 | .set(CorePersonnel::getSex, StringUtil.isBlank(vo.getSex()) ? null : vo.getSex()) | 121 | .set(CorePersonnel::getSex, StringUtil.isBlank(vo.getSex()) ? null : vo.getSex()) |
| @@ -13,6 +13,14 @@ public class CreateCorePersonnelVo implements BaseVo, Serializable { | @@ -13,6 +13,14 @@ public class CreateCorePersonnelVo implements BaseVo, Serializable { | ||
| 13 | private static final long serialVersionUID = 1L; | 13 | private static final long serialVersionUID = 1L; |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
| 16 | + * personId前端自用id | ||
| 17 | + */ | ||
| 18 | + @ApiModelProperty("personId") | ||
| 19 | + @NotBlank(message = "personId不能为空!") | ||
| 20 | + @Length(message = "personId最多允许50个字符!") | ||
| 21 | + private String personId; | ||
| 22 | + | ||
| 23 | + /** | ||
| 16 | * 客户资信 | 24 | * 客户资信 |
| 17 | */ | 25 | */ |
| 18 | @ApiModelProperty(value = "客户资信", required = true) | 26 | @ApiModelProperty(value = "客户资信", required = true) |
| @@ -24,6 +32,7 @@ public class CreateCorePersonnelVo implements BaseVo, Serializable { | @@ -24,6 +32,7 @@ public class CreateCorePersonnelVo implements BaseVo, Serializable { | ||
| 24 | * 姓名 | 32 | * 姓名 |
| 25 | */ | 33 | */ |
| 26 | @ApiModelProperty("姓名") | 34 | @ApiModelProperty("姓名") |
| 35 | + @NotBlank(message = "请输入姓名!") | ||
| 27 | @Length(message = "姓名最多允许50个字符!") | 36 | @Length(message = "姓名最多允许50个字符!") |
| 28 | private String name; | 37 | private String name; |
| 29 | 38 |
| @@ -2,9 +2,8 @@ package com.lframework.xingyun.sc.vo.customer.credit; | @@ -2,9 +2,8 @@ package com.lframework.xingyun.sc.vo.customer.credit; | ||
| 2 | 2 | ||
| 3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
| 4 | import javax.validation.constraints.NotBlank; | 4 | import javax.validation.constraints.NotBlank; |
| 5 | -import java.time.LocalDateTime; | 5 | +import java.time.LocalDate; |
| 6 | import com.lframework.starter.web.core.vo.BaseVo; | 6 | import com.lframework.starter.web.core.vo.BaseVo; |
| 7 | -import com.lframework.xingyun.sc.entity.CorePersonnel; | ||
| 8 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
| 9 | import com.lframework.starter.web.core.components.validation.TypeMismatch; | 8 | import com.lframework.starter.web.core.components.validation.TypeMismatch; |
| 10 | import org.hibernate.validator.constraints.Length; | 9 | import org.hibernate.validator.constraints.Length; |
| @@ -37,7 +36,7 @@ public class CreateCustomerCreditVo implements BaseVo, Serializable { | @@ -37,7 +36,7 @@ public class CreateCustomerCreditVo implements BaseVo, Serializable { | ||
| 37 | */ | 36 | */ |
| 38 | @ApiModelProperty("登记日期") | 37 | @ApiModelProperty("登记日期") |
| 39 | @TypeMismatch(message = "登记日期格式有误!") | 38 | @TypeMismatch(message = "登记日期格式有误!") |
| 40 | - private LocalDateTime registerDate; | 39 | + private LocalDate registerDate; |
| 41 | 40 | ||
| 42 | /** | 41 | /** |
| 43 | * 客户简称 | 42 | * 客户简称 |
| @@ -49,9 +48,9 @@ public class CreateCustomerCreditVo implements BaseVo, Serializable { | @@ -49,9 +48,9 @@ public class CreateCustomerCreditVo implements BaseVo, Serializable { | ||
| 49 | /** | 48 | /** |
| 50 | * 企业类型:经销商(distributor)、终端(terminal) | 49 | * 企业类型:经销商(distributor)、终端(terminal) |
| 51 | */ | 50 | */ |
| 52 | - @ApiModelProperty(value = "企业类型:经销商(distributor)、终端(terminal)", required = true) | ||
| 53 | - @NotBlank(message = "请输入企业类型:经销商(distributor)、终端(terminal)!") | ||
| 54 | - @Length(message = "企业类型:经销商(distributor)、终端(terminal)最多允许100个字符!") | 51 | + @ApiModelProperty(value = "企业类型:经销商(DEALER)、终端(TERMINAL)", required = true) |
| 52 | + @NotBlank(message = "请输入企业类型:经销商(DEALER)、终端(TERMINAL)!") | ||
| 53 | + @Length(message = "企业类型:经销商(DEALER)、终端(TERMINAL)最多允许100个字符!") | ||
| 55 | private String enterpriseType; | 54 | private String enterpriseType; |
| 56 | 55 | ||
| 57 | /** | 56 | /** |
| @@ -109,7 +108,7 @@ public class CreateCustomerCreditVo implements BaseVo, Serializable { | @@ -109,7 +108,7 @@ public class CreateCustomerCreditVo implements BaseVo, Serializable { | ||
| 109 | */ | 108 | */ |
| 110 | @ApiModelProperty("注册时间") | 109 | @ApiModelProperty("注册时间") |
| 111 | @TypeMismatch(message = "注册时间格式有误!") | 110 | @TypeMismatch(message = "注册时间格式有误!") |
| 112 | - private LocalDateTime registrationTime; | 111 | + private LocalDate registrationTime; |
| 113 | 112 | ||
| 114 | /** | 113 | /** |
| 115 | * 经营年限(年) | 114 | * 经营年限(年) |
| @@ -387,7 +386,7 @@ public class CreateCustomerCreditVo implements BaseVo, Serializable { | @@ -387,7 +386,7 @@ public class CreateCustomerCreditVo implements BaseVo, Serializable { | ||
| 387 | private String status; | 386 | private String status; |
| 388 | 387 | ||
| 389 | /** | 388 | /** |
| 390 | - * 核心人员 | 389 | + * 核心人员(非持久化字段) |
| 391 | */ | 390 | */ |
| 392 | @ApiModelProperty("核心人员") | 391 | @ApiModelProperty("核心人员") |
| 393 | private List<CreateCorePersonnelVo> corePersonnelList; | 392 | private List<CreateCorePersonnelVo> corePersonnelList; |
| @@ -23,6 +23,15 @@ public class UpdateCorePersonnelVo implements BaseVo, Serializable { | @@ -23,6 +23,15 @@ public class UpdateCorePersonnelVo implements BaseVo, Serializable { | ||
| 23 | private String id; | 23 | private String id; |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | + * personId前端自用id | ||
| 27 | + */ | ||
| 28 | + @ApiModelProperty("personId") | ||
| 29 | + @NotBlank(message = "personId不能为空!") | ||
| 30 | + @Length(message = "personId最多允许50个字符!") | ||
| 31 | + private String personId; | ||
| 32 | + | ||
| 33 | + | ||
| 34 | + /** | ||
| 26 | * 客户资信 | 35 | * 客户资信 |
| 27 | */ | 36 | */ |
| 28 | @ApiModelProperty(value = "客户资信", required = true) | 37 | @ApiModelProperty(value = "客户资信", required = true) |
| @@ -3,7 +3,7 @@ package com.lframework.xingyun.sc.vo.customer.credit; | @@ -3,7 +3,7 @@ package com.lframework.xingyun.sc.vo.customer.credit; | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | import java.math.BigDecimal; | 4 | import java.math.BigDecimal; |
| 5 | import javax.validation.constraints.NotBlank; | 5 | import javax.validation.constraints.NotBlank; |
| 6 | -import java.time.LocalDateTime; | 6 | +import java.time.LocalDate; |
| 7 | import com.lframework.starter.web.core.vo.BaseVo; | 7 | import com.lframework.starter.web.core.vo.BaseVo; |
| 8 | import com.lframework.starter.web.core.components.validation.TypeMismatch; | 8 | import com.lframework.starter.web.core.components.validation.TypeMismatch; |
| 9 | import io.swagger.annotations.ApiModelProperty; | 9 | import io.swagger.annotations.ApiModelProperty; |
| @@ -35,7 +35,7 @@ public class UpdateCustomerCreditVo implements BaseVo, Serializable { | @@ -35,7 +35,7 @@ public class UpdateCustomerCreditVo implements BaseVo, Serializable { | ||
| 35 | */ | 35 | */ |
| 36 | @ApiModelProperty("登记日期") | 36 | @ApiModelProperty("登记日期") |
| 37 | @TypeMismatch(message = "登记日期格式有误!") | 37 | @TypeMismatch(message = "登记日期格式有误!") |
| 38 | - private LocalDateTime registerDate; | 38 | + private LocalDate registerDate; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * 客户简称 | 41 | * 客户简称 |
| @@ -107,7 +107,7 @@ public class UpdateCustomerCreditVo implements BaseVo, Serializable { | @@ -107,7 +107,7 @@ public class UpdateCustomerCreditVo implements BaseVo, Serializable { | ||
| 107 | */ | 107 | */ |
| 108 | @ApiModelProperty("注册时间") | 108 | @ApiModelProperty("注册时间") |
| 109 | @TypeMismatch(message = "注册时间格式有误!") | 109 | @TypeMismatch(message = "注册时间格式有误!") |
| 110 | - private LocalDateTime registrationTime; | 110 | + private LocalDate registrationTime; |
| 111 | 111 | ||
| 112 | /** | 112 | /** |
| 113 | * 经营年限(年) | 113 | * 经营年限(年) |
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <resultMap id="CorePersonnel" type="com.lframework.xingyun.sc.entity.CorePersonnel"> | 5 | <resultMap id="CorePersonnel" type="com.lframework.xingyun.sc.entity.CorePersonnel"> |
| 6 | <id column="id" property="id"/> | 6 | <id column="id" property="id"/> |
| 7 | + <result column="person_id" property="personId"/> | ||
| 7 | <result column="credit_id" property="creditId"/> | 8 | <result column="credit_id" property="creditId"/> |
| 8 | <result column="name" property="name"/> | 9 | <result column="name" property="name"/> |
| 9 | <result column="sex" property="sex"/> | 10 | <result column="sex" property="sex"/> |
| @@ -25,6 +26,7 @@ | @@ -25,6 +26,7 @@ | ||
| 25 | <sql id="CorePersonnel_sql"> | 26 | <sql id="CorePersonnel_sql"> |
| 26 | SELECT | 27 | SELECT |
| 27 | tb.id, | 28 | tb.id, |
| 29 | + tb.person_id, | ||
| 28 | tb.credit_id, | 30 | tb.credit_id, |
| 29 | tb.name, | 31 | tb.name, |
| 30 | tb.sex, | 32 | tb.sex, |