|
|
@@ -133,6 +133,11 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
|
|
|
//单号赋值
|
|
|
customer.setCu_code(cu_code);
|
|
|
if (StringUtils.isEmpty(cu_id) || "0".equals(cu_id.toString())) {
|
|
|
+ //检查名称和编号
|
|
|
+ int count = getMapper().validNameAndCodeWhenInsert(customer);
|
|
|
+ if (count>0) {
|
|
|
+ throw new BizException(500, "客户名称或编号重复");
|
|
|
+ }
|
|
|
//插入操作
|
|
|
getMapper().insertSelective(customer);
|
|
|
cu_id = customer.getId();
|
|
|
@@ -167,6 +172,12 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
|
|
|
messageLogService.save(baseDTO);
|
|
|
return baseDTO;
|
|
|
}
|
|
|
+ //检查名称和编号
|
|
|
+ int count = getMapper().validNameAndCodeWhenUpdate(customer);
|
|
|
+ if (count>0) {
|
|
|
+ throw new BizException(500, "客户名称或编号重复");
|
|
|
+ }
|
|
|
+
|
|
|
//更新操作
|
|
|
getMapper().updateByPrimaryKeySelective(customer);
|
|
|
//添加从表传输对象
|
|
|
@@ -216,7 +227,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
|
|
|
|
|
|
baseDTO = getBaseDTOById(cu_id);
|
|
|
//日志记录
|
|
|
- messageLogService.save(baseDTO);
|
|
|
+ messageLogService.save(baseDTO);
|
|
|
return baseDTO;
|
|
|
}
|
|
|
|