Explorar el Código

[POS][修改]:支付核销修改

release_toaliyun_real
Stormeye Wu hace 6 años
padre
commit
e6dfab2271
Se han modificado 2 ficheros con 5 adiciones y 14 borrados
  1. +4
    -13
      mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java
  2. +1
    -1
      mallinkPosApi/src/test/java/com/iformall/pos/test/PosAppTest.java

+ 4
- 13
mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java Ver fichero

@@ -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;
}


+ 1
- 1
mallinkPosApi/src/test/java/com/iformall/pos/test/PosAppTest.java Ver fichero

@@ -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")


Cargando…
Cancelar
Guardar