diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index 570d103..223d119 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -40,10 +40,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.io.File; import java.math.BigDecimal; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Controller @RequestMapping(value = "/test") diff --git a/cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java b/cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java index c7c2e88..0bc1e84 100644 --- a/cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java +++ b/cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java @@ -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) {