客户信息编码规范对接

客户信息编码规范对接
master
siontion 10 months ago
parent 10d76692fd
commit ad2456479e

@ -14,7 +14,6 @@ public class CustomerSaveReqVO {
private Long id;
@Schema(description = "客户编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "客户编码不能为空")
private String code;
@Schema(description = "客户简称", requiredMode = Schema.RequiredMode.REQUIRED)
@ -29,7 +28,6 @@ public class CustomerSaveReqVO {
private String industry;
@Schema(description = "客户级别.字典", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "客户级别.字典不能为空")
private Integer level;
@Schema(description = "业务员,对应用户ID", example = "5426")

@ -1,5 +1,6 @@
package com.chanko.yunxi.mes.module.heli.service.customer;
import cn.hutool.core.lang.UUID;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -15,6 +16,8 @@ import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
import com.chanko.yunxi.mes.module.heli.dal.mysql.customer.CustomerMapper;
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.CUSTOMER;
import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.WORKSHOP;
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
/**
@ -33,7 +36,10 @@ public class CustomerServiceImpl implements CustomerService {
public Long createCustomer(CustomerSaveReqVO createReqVO) {
// 插入
CustomerDO customer = BeanUtils.toBean(createReqVO, CustomerDO.class);
customer.setCode(UUID.fastUUID().toString(true));
customerMapper.insert(customer);
customer.setCode(CUSTOMER.getCode(customer.getId().toString()));
customerMapper.updateById(customer);
// 返回
return customer.getId();
}

@ -19,7 +19,7 @@
<el-col :span="8">
<el-row>
<el-col :span="24">
<el-form-item prop="code" label="客户编码" required>
<el-form-item prop="code" label="客户编码">
<el-input v-model="formData.code" />
</el-form-item>
</el-col>
@ -326,7 +326,7 @@ const formData = ref({
taxNo: undefined,
})
const formRules = reactive({
code: [{ required: true, message: '客户编码不能为空', trigger: 'blur' }],
// code: [{ required: true, message: '', trigger: 'blur' }],
brief: [{ required: true, message: '客户简称不能为空', trigger: 'blur' }],
name: [{ required: true, message: '客户全称不能为空', trigger: 'blur' }],
// status: [{ required: true, message: ',1 2 ', trigger: 'blur' }],

Loading…
Cancel
Save