From db8bd443faa40789e3b82a75ccebeb744d55a5ae Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 12 十二月 2024 11:45:59 +0800 Subject: [PATCH] 漏损日统计实现 --- pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java | 33 +++------------------------------ 1 files changed, 3 insertions(+), 30 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java index bb69aa9..af8e887 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java @@ -218,7 +218,7 @@ // 鎺ユ敹鍙傛暟锛氱櫥褰曟�両D銆佽櫄鎷熷崱ID銆佸厖鍊奸噾棰濓紙鍒嗭級 Long sessionId = order.getSessionId(); Long virtualId = order.getVcId(); - Integer rechargeAmount = order.getRechargeAmount(); + //Integer rechargeAmount = order.getRechargeAmount(); String prepayId = ""; @@ -240,7 +240,7 @@ virtualCard.setOrderNumber(orderNumber); virtualCard.setClientId(clientId); virtualCard.setVirtualId(virtualId); - virtualCard.setRechargeAmount(rechargeAmount); + virtualCard.setRechargeAmount(order.getRechargeAmount()); BaseResponse result = virtualCardSv.insertVCRecharge(virtualCard); if(!result.getCode().equals("0001")) { return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_ADD_FAIL.getMessage()); @@ -255,7 +255,7 @@ //璁㈠崟閲戦 JSONObject job_amount = new JSONObject(); - job_amount.put("total", rechargeAmount); + job_amount.put("total", (int)(order.getRechargeAmount()*100)); job_amount.put("currency", "CNY"); job_body.put("amount", job_amount); @@ -517,31 +517,4 @@ return result; } - @PostMapping(path = "add_wechatpay", consumes = MediaType.APPLICATION_JSON_VALUE) - @Transactional(rollbackFor = Exception.class) - @SsoAop() - public BaseResponse<Boolean> addWechatpay(@RequestBody @Valid Wechatpay po, BindingResult bindingResult) { - if(bindingResult != null && bindingResult.hasErrors()){ - return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); - } - - if(paymentSv.getWechatpayByAppId(po.getAppId()) != null) { - return BaseResponseUtils.buildErrorMsg("璇ュ井淇℃敮浠樹俊鎭凡缁忓瓨鍦�"); - } - - SeWechatpay seWechatpay = new SeWechatpay(); - seWechatpay.setAppId(po.getAppId()); - seWechatpay.setAppSecret(po.getAppSecret()); - seWechatpay.setMchId(po.getMchId()); - seWechatpay.setMchKey(po.getMchKey()); - seWechatpay.setSerialNo(po.getSerialNo()); - seWechatpay.setNotifyUrl(po.getNotifyUrl()); - seWechatpay.setRemarks(po.getRemarks()); - - Long rec = Optional.ofNullable(paymentSv.addWechatpay(seWechatpay)).orElse(0L); - if(rec == 0) { - return BaseResponseUtils.buildFail("娣诲姞寰俊鏀粯淇℃伅澶辫触"); - } - return BaseResponseUtils.buildSuccess(true) ; - } } -- Gitblit v1.8.0