|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package com.cweb.controller; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.alipay.api.domain.PayModeModel; |
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
|
import com.hfkj.channel.lakala.LaKaLaTradeService; |
|
|
|
@ -189,6 +190,10 @@ public class BsTradeOrderController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
System.out.println(new BigDecimal("50").compareTo(new BigDecimal("1000"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/createJSAPIOrder",method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "创建交易【JSAPI】订单") |
|
|
|
@ -197,6 +202,7 @@ public class BsTradeOrderController { |
|
|
|
|
if (body == null |
|
|
|
|
|| StringUtils.isBlank(body.getString("qrCodeSN")) |
|
|
|
|
|| StringUtils.isBlank(body.getString("payMode")) |
|
|
|
|
|| StringUtils.isBlank(body.getString("payUserId")) |
|
|
|
|
|| body.getBigDecimal("totalAmount") == null |
|
|
|
|
) { |
|
|
|
|
log.error("configStore error!", "参数错误"); |
|
|
|
@ -208,11 +214,9 @@ public class BsTradeOrderController { |
|
|
|
|
log.error("configStore error!", "未知支付方式"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知支付方式"); |
|
|
|
|
} |
|
|
|
|
if ((TradeOrderPayModeEnum.ALIPAY.getCode().equals(payMode.getCode()) |
|
|
|
|
|| TradeOrderPayModeEnum.WECHAT.getCode().equals(payMode.getCode())) |
|
|
|
|
&& StringUtils.isBlank(body.getString("payUserId"))) { |
|
|
|
|
log.error("configStore error!", "参数错误"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
if (payMode.getCode().equals(TradeOrderPayModeEnum.UQRCODEPAY.getCode()) && |
|
|
|
|
body.getBigDecimal("totalAmount").compareTo(new BigDecimal("1000")) == 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "云闪付单笔交易限额1000元"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (body.getBigDecimal("totalAmount").compareTo(new BigDecimal("0.01")) == -1) { |
|
|
|
|