Skip to content

Commit 06c50f4

Browse files
committed
V1.2
1 parent f7174ca commit 06c50f4

File tree

4 files changed

+36
-17
lines changed

4 files changed

+36
-17
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,16 @@ V免签 是基于SpringBoot 2.1.1 实现的一套免签支付程序,主要包
4040
+ 本系统原理为监控收款后手机的通知栏推送消息,所以请保持微信/支付宝/V免签监控端后台正常运行,且添加到内存清理白名单!
4141

4242
## 更新记录
43-
44-
+ v1.0(2019.01.31)
45-
+ 初版发布
43+
+ v1.2(2019.02.25)
44+
+ 修复收款金额为整数时校验错误的问题
45+
+ 再次修复部分用户无法上传通用收款码问题
46+
4647
+ v1.1(2019.02.10)
4748
+ 修复部分用户无法上传通用收款码问题
49+
50+
+ v1.0(2019.01.31)
51+
+ 初版发布
52+
4853

4954
## 版权信息
5055

src/main/java/com/vone/mq/controller/WebController.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public CommonRes deQrcode2(@RequestParam("file") MultipartFile file) {
117117
* @return
118118
*/
119119
@RequestMapping("/createOrder")
120-
public String createOrder(String payId, String param, Integer type, Double price, String notifyUrl, String returnUrl, String sign, Integer isHtml) {
120+
public String createOrder(String payId, String param, Integer type, String price, String notifyUrl, String returnUrl, String sign, Integer isHtml) {
121121
if (payId == null || payId.equals("")) {
122122
return new Gson().toJson(ResUtil.error("请传入商户订单号"));
123123
}
@@ -127,12 +127,23 @@ public String createOrder(String payId, String param, Integer type, Double price
127127
if (type != 1 && type != 2) {
128128
return new Gson().toJson(ResUtil.error("支付方式错误=>1|微信 2|支付宝"));
129129
}
130-
if (price == null) {
130+
131+
132+
Double priceD;
133+
try {
134+
priceD = Double.valueOf(price);
135+
} catch (Exception e){
131136
return new Gson().toJson(ResUtil.error("请传入订单金额"));
132137
}
133-
if (price < 0) {
138+
139+
if (priceD == null) {
140+
return new Gson().toJson(ResUtil.error("请传入订单金额"));
141+
}
142+
if (priceD < 0) {
134143
return new Gson().toJson(ResUtil.error("订单金额必须大于0"));
135144
}
145+
146+
136147
if (sign == null || sign.equals("")) {
137148
return new Gson().toJson(ResUtil.error("请传入签名"));
138149
}
@@ -173,7 +184,7 @@ public CommonRes appHeart(String t, String sign) {
173184
}
174185

175186
@RequestMapping("/appPush")
176-
public CommonRes appPush(Integer type, Double price, String t, String sign) {
187+
public CommonRes appPush(Integer type, String price, String t, String sign) {
177188
return webService.appPush(type, price, t, sign);
178189
}
179190

src/main/java/com/vone/mq/service/WebService.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ public class WebService {
3232
@Autowired
3333
private PayQrcodeDao payQrcodeDao;
3434

35-
public CommonRes createOrder(String payId, String param, Integer type, Double price, String notifyUrl, String returnUrl, String sign){
35+
public CommonRes createOrder(String payId, String param, Integer type, String price, String notifyUrl, String returnUrl, String sign){
3636
String key = settingDao.findById("key").get().getVvalue();
3737
String jsSign = md5(payId+param+type+price+key);
3838
if (!sign.equals(jsSign)){
3939
return ResUtil.error("签名校验不通过");
4040
}
4141

42+
Double priceD = Double.valueOf(price);
43+
44+
4245
Date currentTime = new Date();
4346

4447
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
@@ -47,7 +50,7 @@ public CommonRes createOrder(String payId, String param, Integer type, Double pr
4750

4851
int payQf = Integer.parseInt(settingDao.findById("payQf").get().getVvalue());
4952
//实际支付价格
50-
double reallyPrice = price;
53+
double reallyPrice = priceD;
5154

5255
int row = 0;
5356
while (row == 0){
@@ -106,7 +109,7 @@ public CommonRes createOrder(String payId, String param, Integer type, Double pr
106109
payOrder.setCloseDate(0);
107110
payOrder.setParam(param);
108111
payOrder.setType(type);
109-
payOrder.setPrice(price);
112+
payOrder.setPrice(priceD);
110113
payOrder.setReallyPrice(reallyPrice);
111114
payOrder.setNotifyUrl(notifyUrl);
112115
payOrder.setReturnUrl(returnUrl);
@@ -119,7 +122,7 @@ public CommonRes createOrder(String payId, String param, Integer type, Double pr
119122

120123

121124
String timeOut = settingDao.findById("close").get().getVvalue();
122-
CreateOrderRes createOrderRes = new CreateOrderRes(payId,orderId,type,price,reallyPrice,payUrl,isAuto,0,Integer.valueOf(timeOut),payOrder.getCreateDate());
125+
CreateOrderRes createOrderRes = new CreateOrderRes(payId,orderId,type,priceD,reallyPrice,payUrl,isAuto,0,Integer.valueOf(timeOut),payOrder.getCreateDate());
123126

124127
return ResUtil.success(createOrderRes);
125128
}
@@ -172,7 +175,7 @@ public CommonRes appHeart(String t,String sign){
172175
return ResUtil.success();
173176
}
174177

175-
public CommonRes appPush(Integer type,Double price,String t,String sign){
178+
public CommonRes appPush(Integer type,String price,String t,String sign){
176179
String key = settingDao.findById("key").get().getVvalue();
177180
long cz = Long.valueOf(t)-new Date().getTime();
178181

@@ -196,7 +199,7 @@ public CommonRes appPush(Integer type,Double price,String t,String sign){
196199
return ResUtil.error("重复推送");
197200
}
198201

199-
PayOrder payOrder = payOrderDao.findByReallyPriceAndStateAndType(price,0,type);
202+
PayOrder payOrder = payOrderDao.findByReallyPriceAndStateAndType(Double.valueOf(price),0,type);
200203

201204
if (payOrder==null){
202205

@@ -208,8 +211,8 @@ public CommonRes appPush(Integer type,Double price,String t,String sign){
208211
payOrder.setCloseDate(new Date().getTime());
209212
payOrder.setParam("无订单转账");
210213
payOrder.setType(type);
211-
payOrder.setPrice(price);
212-
payOrder.setReallyPrice(price);
214+
payOrder.setPrice(Double.valueOf(price));
215+
payOrder.setReallyPrice(Double.valueOf(price));
213216
payOrder.setState(1);
214217
payOrder.setPayUrl("无订单转账");
215218
payOrderDao.save(payOrder);

src/main/webapp/admin/setting.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
if (res.code == -1) {
123123
return layer.msg('上传失败');
124124
}
125-
if (res.data=="" || res.data.substr(0,6)!="wxp://"){
125+
if (res.data==""){
126126
return layer.msg('请上传微信无金额收款二维码');
127127
}
128128
$('#wximg').attr('src', "enQrcode?url="+res.data);
@@ -148,7 +148,7 @@
148148
if (res.code == -1) {
149149
return layer.msg('上传失败');
150150
}
151-
if (res.data=="" || res.data.substr(0,22).toUpperCase()!="HTTPS://QR.ALIPAY.COM/"){
151+
if (res.data=="" ){
152152
return layer.msg('请上传支付宝无金额收款二维码');
153153
}
154154
$('#zfbimg').attr('src', "enQrcode?url="+res.data);

0 commit comments

Comments
 (0)