Commit cbd95f25 authored by cy's avatar cy

添加充值卡判断

parent 68e4e8f4
......@@ -58,7 +58,8 @@ public class RefillCardServiceImpl implements RefillCardService {
List<RefillCard> refillCards = refillCardMapper.infoByCardNo(cardNumber);
if(refillCards.size()>0){
RefillCard card = refillCards.stream().max(Comparator.comparing(RefillCard::getCardNo)).get();
BigInteger maxNo = refillCard.getCardNo().add(new BigInteger((card.getCardNumber()-1)+""));
int num=card.getCardNumber()-1;
BigInteger maxNo = card.getCardNo().add(new BigInteger(String.valueOf(num)));
if (maxNo.compareTo(refillCard.getCardNo()) > 0) {
return R.error("该初始卡区间有可能存在相同的卡号,请重新添加");
}
......
......@@ -13,7 +13,7 @@ spring:
allow-bean-definition-overriding: true
# 环境 dev|test|prod
profiles:
active: prod
active: dev
# jackson时间格式化
jackson:
time-zone: GMT+8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment