fix(): 优化新增支付客户接口逻辑

master
LQS 2024-08-08 22:25:19 +08:00
parent 73ca55cf68
commit 6b26990c1b
1 changed files with 9 additions and 2 deletions

View File

@ -132,8 +132,15 @@ public class OrderPayCustomerServiceImpl
@Override
public boolean save(OrderPayCustomer orderPayCustomer) {
String appCode = orderPayCustomer.getAppCode();
List<String> customerAllList=this.getCustomerAllList();
if(!customerAllList.contains(appCode)){
List<String> nacosServerAllList=nacosServerService.nacosServerAllList();
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("客户编码重复");
}
return super.save(orderPayCustomer);