feat():优化增加新增客户支付接口逻辑
parent
8131d03ab9
commit
bec933247a
|
@ -88,9 +88,16 @@ public class OrderPayCustomerServiceImpl extends ServiceImpl<OrderPayCustomerMap
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean save(OrderPayCustomer orderPayCustomer){
|
public boolean save(OrderPayCustomer orderPayCustomer){
|
||||||
|
|
||||||
String appCode = orderPayCustomer.getAppCode();
|
String appCode = orderPayCustomer.getAppCode();
|
||||||
List<String> customerAllList = this.getCustomerAllList();
|
List<String> nacosServerAllList = nacosServerService.nacosServerAllList();
|
||||||
if (!customerAllList.contains(appCode)){
|
if (!nacosServerAllList.contains(appCode)){
|
||||||
|
throw new ServiceException("客户编码违法");
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(OrderPayCustomer::getAppCode, appCode);
|
||||||
|
if (this.count(queryWrapper)>0){
|
||||||
throw new ServiceException("客户编码重复");
|
throw new ServiceException("客户编码重复");
|
||||||
}
|
}
|
||||||
return super.save(orderPayCustomer);
|
return super.save(orderPayCustomer);
|
||||||
|
|
Loading…
Reference in New Issue