feat():监听
parent
b3e7c9913f
commit
e6a3ccba69
|
@ -11,6 +11,7 @@ import com.muyu.cloud.pay.mapper.OrderPayCustomerMapper;
|
||||||
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
||||||
import com.muyu.cloud.pay.service.OrderPayService;
|
import com.muyu.cloud.pay.service.OrderPayService;
|
||||||
import com.muyu.common.core.enums.SysPayType;
|
import com.muyu.common.core.enums.SysPayType;
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.nacos.service.NacosServerService;
|
import com.muyu.common.nacos.service.NacosServerService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
@ -91,4 +92,18 @@ public class OrderPayCustomerServiceImpl
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean save(OrderPayCustomer orderPayCustomer) {
|
||||||
|
String appCode = orderPayCustomer.getAppCode();
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue