|
@@ -2,6 +2,7 @@ package com.bz.smart_city.service.impl;
|
|
|
|
|
|
import com.bz.smart_city.commom.exception.ServiceException;
|
|
|
import com.bz.smart_city.commom.model.Pagination;
|
|
|
+import com.bz.smart_city.commom.model.ResultStatus;
|
|
|
import com.bz.smart_city.commom.util.TreeUtil;
|
|
|
import com.bz.smart_city.commom.util.UserUtil;
|
|
|
import com.bz.smart_city.commom.util.Util;
|
|
@@ -133,7 +134,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
customerDto.setCustomerNo(customerNo);
|
|
|
int resultName = customerMapper.findByNameUnique(loginUser.getSiteId(),null, customerDto.getCustomerName());
|
|
|
if(resultName > 0) {
|
|
|
- throw new ServiceException(-900, "客户名称已经存在");
|
|
|
+ throw new ServiceException(ResultStatus.CUSTOMER_IS_EXISTED);
|
|
|
}
|
|
|
this.insertSelective(customerDto);
|
|
|
|
|
@@ -149,7 +150,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
int resultName = customerMapper.findByNameUnique(loginUser.getSiteId(), customer.getId(), customer.getCustomerName());
|
|
|
if(resultName > 0) {
|
|
|
- throw new ServiceException(-900, "客户名称已经存在");
|
|
|
+ throw new ServiceException(ResultStatus.CUSTOMER_IS_EXISTED);
|
|
|
}
|
|
|
Integer oldParentId = customerMapper.findById(customer.getId()).getParentId();
|
|
|
this.updateByPrimaryKeySelective(customer);
|