diff --git a/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java b/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java index f6010bf07..7de36a3c5 100644 --- a/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java +++ b/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java @@ -277,7 +277,7 @@ public class PosServiceImpl implements PosService { } if (actionType.equals(EnumVerifyActionType.PRE_VERIFY) || actionType.equals(EnumVerifyActionType.VERIFY_PAY)) { - posAmount = Integer.valueOf(posAmount); + posAmount = Integer.valueOf(posAmountStr); } } catch (NumberFormatException e) { logger.error(e.getMessage()); @@ -415,8 +415,11 @@ public class PosServiceImpl implements PosService { posOrderIdStr, posOrderId, posAmount, couponOrderIdStr); coRetArr.add(oneRetMap); + posAmount = Integer.valueOf(oneRetMap.get(WxPayConstant.REMAIN_AMOUNT)); } catch (MallinkException e) { throw new MallinkException(e.getErrorCode(), e.getMessage()); + } catch (Exception e) { + throw new MallinkException(500, e.getMessage()); } } } @@ -608,12 +611,6 @@ public class PosServiceImpl implements PosService { logger.error(ErrorCode.VERIFY_PRE_BUSER_NOT_EQUAL.getMessage() + ": " + buUserIdStr); throw new MallinkException(ErrorCode.VERIFY_PRE_BUSER_NOT_EQUAL); } - if (actionType.equals(EnumVerifyActionType.VERIFY_PAY)) { - if (couponOrderCVo.getPrice() > posAmount) { - logger.error(ErrorCode.VERIFY_PRE_POS_ORDER_PRICE_ISSUE.getMessage()); - throw new MallinkException(ErrorCode.VERIFY_PRE_POS_ORDER_PRICE_ISSUE); - } - } // check pos order是否一致 PosCouponOrderVerify posCouponOrderVerifyQ = new PosCouponOrderVerify(); posCouponOrderVerifyQ.setTenantId(tenantId); @@ -627,12 +624,6 @@ public class PosServiceImpl implements PosService { } blVerify = true; } else if (couponOrderCVo.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode())) { - if (actionType.equals(EnumVerifyActionType.VERIFY_PAY)) { - if (couponOrderCVo.getPrice() > posAmount) { - logger.error(ErrorCode.VERIFY_PRE_POS_ORDER_PRICE_ISSUE.getMessage()); - throw new MallinkException(ErrorCode.VERIFY_PRE_POS_ORDER_PRICE_ISSUE); - } - } logger.info("券可以被核销: " + couponOrderIdStr); blVerify = true; } diff --git a/mallinkPosApi/src/test/java/com/iformall/pos/test/PosAppTest.java b/mallinkPosApi/src/test/java/com/iformall/pos/test/PosAppTest.java index 334afcdee..7021c4211 100644 --- a/mallinkPosApi/src/test/java/com/iformall/pos/test/PosAppTest.java +++ b/mallinkPosApi/src/test/java/com/iformall/pos/test/PosAppTest.java @@ -268,7 +268,7 @@ public class PosAppTest { reqObj.put(WxPayConstant.COUPON_ORDER_ID, "318978990426783744"); reqObj.put(WxPayConstant.NONCE_STR, "1"); reqObj.put(WxPayConstant.POS_ORDER_ID, "1"); - reqObj.put(WxPayConstant.POS_AMOUNT, "100"); + reqObj.put(WxPayConstant.POS_AMOUNT, "200"); reqObj.put(WxPayConstant.SIGN, WxPayment.createSignHMAC(reqObj, devReqKey)); String reqJsonStr = JSONObject.toJSONString(reqObj); RequestBuilder request = MockMvcRequestBuilders.post("/couponOrderPayVerifyOne")