bug 6722 新卡号不能为空
This commit is contained in:
parent
7b8748024f
commit
f1125e4e0a
|
|
@ -14,6 +14,7 @@ import com.bonus.canteen.core.account.mapper.AccInfoMapper;
|
|||
import com.bonus.canteen.core.account.service.IAccCardService;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -130,6 +131,9 @@ public class AccCardServiceImpl implements IAccCardService {
|
|||
try {
|
||||
// 发卡前校验是否卡号已存在, 卡号不能重复
|
||||
if (CardRecordTypeEnum.CHANGE.getKey().equals(accountCard.getOperationType())) {
|
||||
if (StringUtils.isEmpty(accountCard.getNewSerialNum())) {
|
||||
throw new ServiceException("新卡号不能为空");
|
||||
}
|
||||
int cardCountByCardSerialNum= accCardMapper.selectAccCardCountByCardSerialNum(accountCard.getNewSerialNum());
|
||||
if (cardCountByCardSerialNum > 0) {
|
||||
throw new ServiceException("卡号已存在, 卡号不能重复");
|
||||
|
|
|
|||
Loading…
Reference in New Issue