puzhibing
2023-08-16 d5b3e5a413bcfccba294793ee093722f31b2448a
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/DriverController.java
@@ -9,9 +9,7 @@
import com.supersavedriving.driver.modular.system.model.JoiningRequirements;
import com.supersavedriving.driver.modular.system.service.*;
import com.supersavedriving.driver.modular.system.util.MallBook.model.InterfaceResponse;
import com.supersavedriving.driver.modular.system.util.MallBook.model.Register;
import com.supersavedriving.driver.modular.system.util.MallBook.util.RSASignature;
import com.supersavedriving.driver.modular.system.util.MallBook.util.TrhRequest;
import com.supersavedriving.driver.modular.system.util.PayMoneyUtil;
import com.supersavedriving.driver.modular.system.util.huawei.OBSUtil;
import com.supersavedriving.driver.modular.system.util.huawei.SMSUtil;
@@ -492,8 +490,8 @@
    @ResponseBody
    @PostMapping("/api/driver/queryCommissionList")
//    @ServiceLog(name = "获取佣金记录", url = "/api/driver/queryCommissionList")
    @ApiOperation(value = "获取佣金记录", tags = {"司机端-个人中心"}, notes = "")
//    @ServiceLog(name = "获取收入记录", url = "/api/driver/queryCommissionList")
    @ApiOperation(value = "获取收入记录", tags = {"司机端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "日期", name = "time", required = true, dataType = "string"),
            @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"),
@@ -623,7 +621,7 @@
    @ApiOperation(value = "获取司机钱包明细", tags = {"司机端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "日期", name = "time", required = true, dataType = "string"),
            @ApiImplicitParam(value = "类型(1=收入,3=充值,4=支出,7=优惠券,8=保险)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "类型(3=充值,8=保险,9=订单信息费)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"),
            @ApiImplicitParam(value = "页条数", name = "pageSize", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
@@ -712,7 +710,6 @@
    /**
     * 账户余额充值支付回调
     * @param request
     * @param response
     */
    @ResponseBody
@@ -883,6 +880,7 @@
            }
            ResultUtil resultUtil = ResultUtil.success();
            phone = phone.indexOf("+86") < 0 ? "+86" + phone : phone;
            phone = phone.indexOf("+") < 0 ? "+" + phone : phone;
            String value = redisUtil.getValue(phone);
            if(ToolUtil.isEmpty(value) || !value.equals(code)){
                resultUtil = ResultUtil.error("验证码无效");
@@ -968,12 +966,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 +1076,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 +1097,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();
        }
    }
}