Commit 644a26ad by zhangxingmin

push

parent 96180e85
......@@ -104,6 +104,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
if (ValidateUtil.isAllFieldsNull(customerAddRequest)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR.getCode(), ErrorCode.PARAMS_ERROR.getMessage());
}
String customerBizId = customerAddRequest.getCustomerBizId();
Customer customer = null;
if (StringUtils.isNotBlank(customerAddRequest.getCustomerBizId())) {
customer = customerService.queryOneByCustomerBizId(customerAddRequest.getCustomerBizId());
......@@ -114,7 +115,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
if (customer == null) {
customer = new Customer();
// 客户主表业务唯一id
customer.setCustomerBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_CUSTOMER.getCode()));
customerBizId = RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_CUSTOMER.getCode());
}
}
......@@ -135,6 +136,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
// 校验客户主表信息
validCustomer(customer);
customer.setCustomerBizId(customerBizId);
boolean result = customerService.saveOrUpdate(customer);
if (!result) {
throw new BusinessException(ErrorCode.OPERATION_ERROR.getCode(), ErrorCode.OPERATION_ERROR.getMessage());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment