提交代码

yy_dev
胡锐 1 year ago
parent e36cf90595
commit 6c3364037e
  1. 5
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 14
      cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java

@ -40,10 +40,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File; import java.io.File;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller @Controller
@RequestMapping(value = "/test") @RequestMapping(value = "/test")

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

Loading…
Cancel
Save