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

master
DongZeLiang 2024-08-05 11:05:02 +08:00
parent aa22d8b4db
commit 9b817e4391
1 changed files with 10 additions and 2 deletions

View File

@ -95,10 +95,18 @@ 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);
}
}