卡号不应重复发放
This commit is contained in:
parent
5fd28c60c8
commit
7afa5bacb9
|
|
@ -78,6 +78,10 @@ public class AccCardServiceImpl implements IAccCardService {
|
||||||
if (cardCountByUserId > 0) {
|
if (cardCountByUserId > 0) {
|
||||||
throw new ServiceException("此用户已有卡, 不能再次发放");
|
throw new ServiceException("此用户已有卡, 不能再次发放");
|
||||||
}
|
}
|
||||||
|
int cardCountByCardSerialNum= accCardMapper.selectAccCardCountByCardSerialNum(accountCard.getSerialNum());
|
||||||
|
if (cardCountByCardSerialNum > 0) {
|
||||||
|
throw new ServiceException("卡号已存在, 卡号不能重复");
|
||||||
|
}
|
||||||
int count = accCardMapper.insertAccCard(accountCard);
|
int count = accCardMapper.insertAccCard(accountCard);
|
||||||
saveAccCardChangeRecord(accountCard);
|
saveAccCardChangeRecord(accountCard);
|
||||||
return count;
|
return count;
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectAccCardCountByCardSerialNum" parameterType="String" resultType="Integer">
|
<select id="selectAccCardCountByCardSerialNum" parameterType="String" resultType="Integer">
|
||||||
select count(1)
|
select count(1)
|
||||||
from account_card
|
from account_card
|
||||||
where serial_num = #{serialNum}
|
where serial_num = #{serialNum} and card_status in (1,4,5)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAccCardById" parameterType="Long" resultMap="AccCardResult">
|
<select id="selectAccCardById" parameterType="Long" resultMap="AccCardResult">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue