|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.chanko.yunxi.mes.module.heli.service.customer;
|
|
|
|
package com.chanko.yunxi.mes.module.heli.service.customer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
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 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.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.*;
|
|
|
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -33,7 +36,10 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
|
public Long createCustomer(CustomerSaveReqVO createReqVO) {
|
|
|
|
public Long createCustomer(CustomerSaveReqVO createReqVO) {
|
|
|
|
// 插入
|
|
|
|
// 插入
|
|
|
|
CustomerDO customer = BeanUtils.toBean(createReqVO, CustomerDO.class);
|
|
|
|
CustomerDO customer = BeanUtils.toBean(createReqVO, CustomerDO.class);
|
|
|
|
|
|
|
|
customer.setCode(UUID.fastUUID().toString(true));
|
|
|
|
customerMapper.insert(customer);
|
|
|
|
customerMapper.insert(customer);
|
|
|
|
|
|
|
|
customer.setCode(CUSTOMER.getCode(customer.getId().toString()));
|
|
|
|
|
|
|
|
customerMapper.updateById(customer);
|
|
|
|
// 返回
|
|
|
|
// 返回
|
|
|
|
return customer.getId();
|
|
|
|
return customer.getId();
|
|
|
|
}
|
|
|
|
}
|
|
|
|