feat():优化新增客户支付接口逻辑
parent
2761e77985
commit
0ef21b8fe0
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.cloud.pay.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.cloud.pay.domain.OrderPayCustomer;
|
||||
import com.muyu.cloud.pay.domain.OrderPayInfo;
|
||||
|
@ -109,15 +110,17 @@ public class OrderPayCustomerServiceImpl
|
|||
|
||||
String appCode = orderPayCustomer.getAppCode();
|
||||
|
||||
List<String> customerAllList = this.getCustomerAllList();
|
||||
|
||||
if(!customerAllList.contains(appCode)){
|
||||
|
||||
|
||||
throw new ServiceException("客户编码重复");
|
||||
List<String> nacosServerAllList = nacosServerService.nacosServerAllList();
|
||||
|
||||
if(!nacosServerAllList.contains(appCode)){
|
||||
throw new ServiceException("客户编码违法");
|
||||
}
|
||||
LambdaUpdateWrapper<OrderPayCustomer> queryWrapper = new LambdaUpdateWrapper<>();
|
||||
queryWrapper.eq(OrderPayCustomer::getAppCode, appCode);
|
||||
List<String> customerAllList = this.getCustomerAllList();
|
||||
if(this.count(queryWrapper)>0){
|
||||
throw new ServiceException("客户编码重复");
|
||||
}
|
||||
|
||||
return super.save(orderPayCustomer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue