Commit 2b10a205 authored by cy's avatar cy

充值卡重复提示

parent 07129a4a
...@@ -48,11 +48,7 @@ public interface CardMapper extends BaseMapper<CardInfo> { ...@@ -48,11 +48,7 @@ public interface CardMapper extends BaseMapper<CardInfo> {
*/ */
List<CardInfo> getListByCardNo(@Param("cardNo")String cardNo); List<CardInfo> getListByCardNo(@Param("cardNo")String cardNo);
/**
* 获取所以卡片信息
* @return CardInfo
*/
List<String> getAllCarInfo();
......
...@@ -56,4 +56,12 @@ public interface RefillCardMapper extends BaseMapper<RefillCardMapper> { ...@@ -56,4 +56,12 @@ public interface RefillCardMapper extends BaseMapper<RefillCardMapper> {
* @return 充值卡信息 * @return 充值卡信息
*/ */
List<RefillCard> getByCardNo(@Param("cardNo") String cardNo); List<RefillCard> getByCardNo(@Param("cardNo") String cardNo);
/**
* 通过初始号号模糊查询充值卡信息
* @return 充值卡信息
*/
List<RefillCard> infoByCardNo(@Param("cardNo") String cardNo);
} }
...@@ -116,14 +116,6 @@ ...@@ -116,14 +116,6 @@
</where> </where>
</select> </select>
<select id="getAllCarInfo" resultType="java.lang.String">
select
card_number
from
<include refid="table"/>
<where>
is_delete=0
</where>
</select>
</mapper> </mapper>
...@@ -126,6 +126,14 @@ ...@@ -126,6 +126,14 @@
where batch_number=#{batchNumber} where batch_number=#{batchNumber}
</select> </select>
<select id="infoByCardNo" resultMap="refillCardMap" parameterType="string">
select
<include refid="cols_all"/>
from
<include refid="table"/>
where card_no like #{cardNo}
</select>
<select id="getByCardNo" resultMap="refillCardMap" parameterType="string"> <select id="getByCardNo" resultMap="refillCardMap" parameterType="string">
select select
<include refid="cols_all"/> <include refid="cols_all"/>
......
...@@ -53,15 +53,14 @@ public class RefillCardServiceImpl implements RefillCardService { ...@@ -53,15 +53,14 @@ public class RefillCardServiceImpl implements RefillCardService {
if (byCardNo.size() > 0) { if (byCardNo.size() > 0) {
return R.error("该初始卡号已经存在,请重新添加"); return R.error("该初始卡号已经存在,请重新添加");
} }
List<String> allCarInfo = cardMapper.getAllCarInfo();
BigInteger finalCardNumber = refillCard.getCardNo(); String cardNumber = refillCard.getCardNo().toString().substring(0,6) + "%";
BigInteger num = new BigInteger("1"); List<RefillCard> refillCards = refillCardMapper.infoByCardNo(cardNumber);
for (int i = 0; i < refillCard.getCardNumber() - 1; i++) { if(refillCards.size()>0){
finalCardNumber = finalCardNumber.add(num); RefillCard card = refillCards.stream().max(Comparator.comparing(RefillCard::getCardNo)).get();
BigInteger finalCardNumber1 = finalCardNumber; BigInteger maxNo = refillCard.getCardNo().add(new BigInteger(card.getCardNumber().toString()));
boolean present = allCarInfo.stream().filter(m -> m.equals(finalCardNumber1.toString())).findAny().isPresent(); if (maxNo.compareTo(refillCard.getCardNo()) > 0) {
if (present) { return R.error("该初始卡区间有可能存在相同的卡号,请重新添加");
return R.error("该数量区间内存在相同卡号,请重新添加");
} }
} }
......
...@@ -39,24 +39,24 @@ public class Common { ...@@ -39,24 +39,24 @@ public class Common {
* 支付宝--回调地址 * 支付宝--回调地址
*/ */
//测试 //测试
public static final String NOTIFY_URL = "http://111.203.232.171:8997/pay/aliPayCallBack.do"; //public static final String NOTIFY_URL = "http://111.203.232.171:8997/pay/aliPayCallBack.do";
//线上 //线上
//public static final String NOTIFY_URL = "https://jygkzy.com/api/pay/aliPayCallBack.do"; public static final String NOTIFY_URL = "https://jygkzy.com/api/pay/aliPayCallBack.do";
/*** /***
* 支付宝--pc端支付成功跳转地址 * 支付宝--pc端支付成功跳转地址
*/ */
//测试 //测试
public static final String RETURN_URL_PC = "http://111.203.232.171:8999/#/wallet"; //public static final String RETURN_URL_PC = "http://111.203.232.171:8999/#/wallet";
//线上 //线上
//public static final String RETURN_URL_PC = "https://jygkzy.com/#/wallet"; public static final String RETURN_URL_PC = "https://jygkzy.com/#/wallet";
/*** /***
* 支付宝--手机网页支付成功跳转地址 * 支付宝--手机网页支付成功跳转地址
*/ */
//测试 //测试
public static final String RETURN_URL_WAP = "http://111.203.232.171:8999/#/history"; //public static final String RETURN_URL_WAP = "http://111.203.232.171:8999/#/history";
//线上 //线上
//public static final String RETURN_URL_WAP = "https://jygkzy.com/#/history"; public static final String RETURN_URL_WAP = "https://jygkzy.com/#/history";
/** /**
......
...@@ -9,9 +9,9 @@ package cn.wisenergy.service.wxpay; ...@@ -9,9 +9,9 @@ package cn.wisenergy.service.wxpay;
public class WxCommon { public class WxCommon {
//测试 //测试
public static final String NOTIFY_URL = "http://111.203.232.171:8997/pay/wxPayCallBack.do"; //public static final String NOTIFY_URL = "http://111.203.232.171:8997/pay/wxPayCallBack.do";
//线上 //线上
//public static final String NOTIFY_URL = "https://jygkzy.com/api/pay/wxPayCallBack.do"; public static final String NOTIFY_URL = "https://jygkzy.com/api/pay/wxPayCallBack.do";
......
...@@ -207,4 +207,9 @@ public class UserController { ...@@ -207,4 +207,9 @@ public class UserController {
return userService.getUserKnown(); return userService.getUserKnown();
} }
@ApiOperation(value = "jenkins测试",notes = "jenkins测试",httpMethod = "POST")
@PostMapping("/jenkins")
public boolean jenkins(){
return true;
}
} }
...@@ -3,8 +3,8 @@ spring: ...@@ -3,8 +3,8 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
druid: druid:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
#url: jdbc:mysql://192.168.110.165:3306/volunteer?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8 #url: jdbc:mysql://192.168.110.165:3306/volunteer?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false&serverTimezone=UTC
url: jdbc:mysql://localhost:3306/volunteer?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8 url: jdbc:mysql://localhost:3306/volunteer?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false&serverTimezone=UTC
#url: jdbc:mysql://rm-bp1i44rtb091fk06coo.mysql.rds.aliyuncs.com:3306/volunteer?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false #url: jdbc:mysql://rm-bp1i44rtb091fk06coo.mysql.rds.aliyuncs.com:3306/volunteer?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false
username: root username: root
password: adm4HYservice$ password: adm4HYservice$
......
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