|
...
|
...
|
@@ -113,6 +113,10 @@ public class CustomerServiceImpl extends BaseMpServiceImpl<CustomerMapper, Custo |
|
113
|
113
|
if (getBaseMapper().selectCount(checkWrapper) > 0) {
|
|
114
|
114
|
throw new DefaultClientException("编号重复,请重新输入!");
|
|
115
|
115
|
}
|
|
|
116
|
+ Customer customer = this.getByName(vo.getName());
|
|
|
117
|
+ if (customer != null) {
|
|
|
118
|
+ throw new DefaultClientException("名称重复,请重新输入!");
|
|
|
119
|
+ }
|
|
116
|
120
|
|
|
117
|
121
|
Customer data = new Customer();
|
|
118
|
122
|
data.setId(IdUtil.getId());
|
|
...
|
...
|
@@ -191,6 +195,10 @@ public class CustomerServiceImpl extends BaseMpServiceImpl<CustomerMapper, Custo |
|
191
|
195
|
if (getBaseMapper().selectCount(checkWrapper) > 0) {
|
|
192
|
196
|
throw new DefaultClientException("编号重复,请重新输入!");
|
|
193
|
197
|
}
|
|
|
198
|
+ Customer customer = this.getByName(vo.getName());
|
|
|
199
|
+ if (customer != null && !customer.getId().equals(vo.getId())) {
|
|
|
200
|
+ throw new DefaultClientException("名称重复,请重新输入!");
|
|
|
201
|
+ }
|
|
194
|
202
|
|
|
195
|
203
|
LambdaUpdateWrapper<Customer> updateWrapper = Wrappers.lambdaUpdate(Customer.class)
|
|
196
|
204
|
.set(Customer::getCode, vo.getCode()).set(Customer::getName, vo.getName())
|
...
|
...
|
|