From 06057d33c65653f80ccf716a396b89052e2d8eb6 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期六, 03 六月 2023 02:06:31 +0800 Subject: [PATCH] 更新部分代码 --- driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/DriverController.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 49 insertions(+), 8 deletions(-) diff --git a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/DriverController.java b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/DriverController.java index c33c28e..2e95e94 100644 --- a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/DriverController.java +++ b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/DriverController.java @@ -712,7 +712,6 @@ /** * 账户余额充值支付回调 - * @param request * @param response */ @ResponseBody @@ -968,12 +967,36 @@ /** * 注册商户回调 - * @param jsonObject */ @ResponseBody @PostMapping("/base/driver/microenterpriseCallback") - public void microenterpriseCallback(@RequestBody JSONObject jsonObject){ - System.err.println(jsonObject.toJSONString()); + public void microenterpriseCallback(@RequestBody InterfaceResponse interfaceResponse, HttpServletResponse response){ + try { + if("0000".equals(interfaceResponse.getCode())) { + JSONObject jsonObject = JSON.parseObject(interfaceResponse.getResult()); + String status = jsonObject.getString("status"); + String parameter1 = jsonObject.getString("parameter1"); + Driver driver = driverService.selectById(parameter1); + if ("2".equals(status)) { + System.err.println("注册代理商子商户失败"); + } + if ("0".equals(status)) { + System.err.println("注册代理商子商户处理中"); + } + if ("1".equals(status)) { + String userId = jsonObject.getString("userId"); + driver.setMerchantNumber(userId); + driverService.updateById(driver); + response.setStatus(200); + PrintWriter out = response.getWriter(); + out.print("OK"); + out.flush(); + out.close(); + } + } + }catch (Exception e){ + e.printStackTrace(); + } } @@ -1054,8 +1077,17 @@ */ @ResponseBody @PostMapping("/base/driver/withdrawCashFZCallback") - public void withdrawCashFZCallback(@RequestBody InterfaceResponse interfaceResponse){ - cashWithdrawalService.withdrawCashFZCallback(interfaceResponse); + public void withdrawCashFZCallback(@RequestBody InterfaceResponse interfaceResponse, HttpServletResponse response){ + try { + cashWithdrawalService.withdrawCashFZCallback(interfaceResponse); + response.setStatus(200); + PrintWriter out = response.getWriter(); + out.print("OK"); + out.flush(); + out.close(); + }catch (Exception e){ + e.printStackTrace(); + } } @@ -1066,7 +1098,16 @@ */ @ResponseBody @PostMapping("/base/driver/withdrawCashCallback") - public void withdrawCashCallback(@RequestBody InterfaceResponse interfaceResponse){ - cashWithdrawalService.withdrawCashCallback(interfaceResponse); + public void withdrawCashCallback(@RequestBody InterfaceResponse interfaceResponse, HttpServletResponse response){ + try { + cashWithdrawalService.withdrawCashCallback(interfaceResponse); + response.setStatus(200); + PrintWriter out = response.getWriter(); + out.print("OK"); + out.flush(); + out.close(); + }catch (Exception e){ + e.printStackTrace(); + } } } -- Gitblit v1.7.1