|
@@ -3,6 +3,7 @@ package org.dromara.backstage.basics.service.impl;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import org.dromara.backstage.payment.domain.vo.PtUserAccountVo;
|
|
import org.dromara.backstage.payment.domain.vo.PtUserAccountVo;
|
|
|
|
|
+import org.dromara.common.core.exception.ServiceException;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.SpringUtils;
|
|
import org.dromara.common.core.utils.SpringUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
@@ -116,7 +117,12 @@ public class PtCardtypeServiceImpl implements IPtCardtypeService {
|
|
|
* 保存前的数据校验
|
|
* 保存前的数据校验
|
|
|
*/
|
|
*/
|
|
|
private void validEntityBeforeSave(PtCardtype entity){
|
|
private void validEntityBeforeSave(PtCardtype entity){
|
|
|
- //TODO 做一些数据校验,如唯一约束
|
|
|
|
|
|
|
+ LambdaQueryWrapper<PtCardtype> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
|
+ queryWrapper.ne(entity.getTypeId()!=null, PtCardtype::getTypeId, entity.getTypeId())
|
|
|
|
|
+ .and(e -> e.eq(PtCardtype::getTypeName, entity.getTypeName()).or().eq(PtCardtype::getCode, entity.getCode()));
|
|
|
|
|
+ if(baseMapper.selectCount(queryWrapper) > 0){
|
|
|
|
|
+ throw new ServiceException("卡片类别名称或编号已存在");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|