feat():增加代码的日志输入
parent
9da7c44f44
commit
bdf408f73c
|
@ -82,12 +82,15 @@ public class OrderPayCustomerServiceImpl extends ServiceImpl<OrderPayCustomerMap
|
||||||
public boolean save(OrderPayCustomer orderPayCustomer) {
|
public boolean save(OrderPayCustomer orderPayCustomer) {
|
||||||
String appCode = orderPayCustomer.getAppCode();
|
String appCode = orderPayCustomer.getAppCode();
|
||||||
List<String> nacosServerAllList = nacosService.nacosServerAllList();
|
List<String> nacosServerAllList = nacosService.nacosServerAllList();
|
||||||
|
log.info("进行服务合法性判断:[{}→{}]",appCode,nacosServerAllList);
|
||||||
if (!nacosServerAllList.contains(appCode)){
|
if (!nacosServerAllList.contains(appCode)){
|
||||||
throw new ServiceException("客户编码违法");
|
throw new ServiceException("客户编码违法");
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(OrderPayCustomer::getAppCode, appCode);
|
queryWrapper.eq(OrderPayCustomer::getAppCode, appCode);
|
||||||
if (this.count(queryWrapper) > 0) {
|
long isAppCodeOnly = this.count(queryWrapper);
|
||||||
|
log.info("进行服务code唯一性校验:[{}-{}]",appCode,isAppCodeOnly);
|
||||||
|
if (isAppCodeOnly > 0) {
|
||||||
throw new ServiceException("该客户已接入");
|
throw new ServiceException("该客户已接入");
|
||||||
}
|
}
|
||||||
return super.save(orderPayCustomer);
|
return super.save(orderPayCustomer);
|
||||||
|
|
Loading…
Reference in New Issue