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