From 6127d31e2ce4d374946ce93489a3523cb0f15fa5 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Sun, 23 Jan 2022 10:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/cweb/config/AuthConfig.java | 2 ++ .../cweb/controller/OutRechargeOrderController.java | 13 ++++--------- .../cweb/controller/OutRechargePriceController.java | 9 +++++++-- .../com/cweb/controller/pay/CzOrderController.java | 8 +++----- .../service/impl/OutRechargePriceServiceImpl.java | 4 ++++ 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index b6ce7d39..a5eb2d74 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -132,6 +132,8 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/highGoodsType/*") .excludePathPatterns("/sendSms/*") .excludePathPatterns("/sms/*") + .excludePathPatterns("/outRechargePrice/*") + .excludePathPatterns("/czOrder/*") ; } diff --git a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java index eaf05c11..4c0edb09 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java @@ -69,7 +69,7 @@ public class OutRechargeOrderController { private HighOrderService highOrderService; @Resource - private TelApiService telApiService; + private OutRechargePriceService outRechargePriceService; @Resource private WechatPayUtil wechatPayUtil; @@ -124,14 +124,6 @@ public class OutRechargeOrderController { // 判断充值模式:1 电信 2. 移动 3. 联通 // 拼接内容 remarks = outRechargeOrder.getRechargeContent() + "充值" + outRechargeOrder.getOrderPrice() + "元"; -// JSONObject telObject = telApiService.outApiTel(outRechargeOrder.getRechargeContent()); -// if (telObject.get("status").equals(0)) { -// JSONObject o = telObject.getObject("result",JSONObject.class); -// -// } else { -// log.error("orderToPay error!"); -// throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_IS_ERROR); -// } HighDiscountUserRel highDiscountUserRel = null; if (outRechargeOrder.getMemDiscountId() != null) { @@ -195,6 +187,8 @@ public class OutRechargeOrderController { } } + OutRechargePrice outRechargePrice = outRechargePriceService.findById(outRechargeOrder.getObjectId().longValue()); + HighUserCard highUserCard = highUserCardService.getUserHtlCardNo(userInfoModel.getHighUser().getId()); if (highUserCard != null) { outRechargeOrder.setIdCard(highUserCard.getCardNo()); @@ -204,6 +198,7 @@ public class OutRechargeOrderController { outRechargeOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeOrder.setUserId(userInfoModel.getHighUser().getId()); outRechargeOrder.setUserName(userInfoModel.getHighUser().getName()); + outRechargeOrder.setRechargeType(outRechargePrice.getRechargeType()); outRechargeOrder.setUserPhone(userInfoModel.getHighUser().getPhone()); outRechargeOrder.setCreateTimed(new Date()); diff --git a/hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java b/hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java index 9e5a8ed6..a64a7445 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java @@ -36,7 +36,7 @@ import java.util.List; import java.util.Map; @Controller -@RequestMapping(value = "/outRechargePrice") + @RequestMapping(value = "/outRechargePrice") @Api(value = "查询充值金额接口") public class OutRechargePriceController { @@ -60,7 +60,8 @@ public class OutRechargePriceController { public ResponseData getListOutRechargePrice( @RequestParam(value = "type", required = false) Integer type, @RequestParam(name = "regionId", required = true) String regionId, - @RequestParam(name = "showType", required = true) Integer showType + @RequestParam(name = "showType", required = true) Integer showType, + @RequestParam(name = "rechargeType", required = true) Integer rechargeType ) { try { Map map = new HashMap<>(); @@ -75,6 +76,10 @@ public class OutRechargePriceController { map.put("showType", String.valueOf(showType)); } + if (type != null ) { + map.put("rechargeType", String.valueOf(rechargeType)); + } + if (type != null ) { map.put("type", String.valueOf(type)); } diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java index f5a667c3..5a07b254 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java @@ -39,8 +39,6 @@ public class CzOrderController { @Resource private OutRechargeOrderService outRechargeOrderService; - - @RequestMapping(value = "/orderRefundNotify", method = RequestMethod.POST) @ApiOperation(value = "退款回调") @ResponseBody @@ -58,15 +56,15 @@ public class CzOrderController { highGasOrderRefundMapper.insert(highGasOrderRefund); // 查询订单 - OutRechargeOrder order = outRechargeOrderService.findByOrderNo(object.getString("orderNumber")); + OutRechargeOrder order = outRechargeOrderService.findByOrderNo(object.getString("out_order_id")); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 6.充值失败 if (order != null && order.getStatus() == 5) { // 退单结果 true:成功 false:失败 - if (object.getInteger("rechargeState") == 1 && order != null) { + if (object.getInteger("status") == 3) { order.setStatus(3); outRechargeOrderService.updateOrder(order); - } else if (object.getInteger("rechargeState") == 0 && order != null) { + } else if (object.getInteger("rechargeState") == 4) { order.setStatus(6); outRechargeOrderService.updateOrder(order); } diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java index 5392cc6b..b2f6bc7f 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java @@ -52,6 +52,10 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService { if (StringUtils.isNotBlank(map.get("companyId"))) { criteria.andCompanyIdEqualTo(Long.valueOf(map.get("companyId"))); } + if (StringUtils.isNotBlank(map.get("rechargeType"))) { + criteria.andRechargeTypeEqualTo(Integer.valueOf(map.get("rechargeType"))); + } + example.setOrderByClause("sort asc"); return outRechargePriceMapper.selectByExample(example); }