From 5a56fe238e5f51efe5221b5a376f109cda4b4b72 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 01 六月 2023 23:29:11 +0800 Subject: [PATCH] Merge branch '1.1' of http://sinata.cn:10101/gitblit/r/java/SuperSaveDriving into 1.1 --- driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/DriverController.java | 143 +++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 136 insertions(+), 7 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 271b146..aaee0c0 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 @@ -1,9 +1,14 @@ package com.supersavedriving.driver.modular.system.api; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.supersavedriving.driver.modular.system.model.Driver; +import com.supersavedriving.driver.modular.system.model.DriverBank; import com.supersavedriving.driver.modular.system.model.Edition; import com.supersavedriving.driver.modular.system.model.JoiningRequirements; import com.supersavedriving.driver.modular.system.service.*; +import com.supersavedriving.driver.modular.system.util.MallBook.model.Register; +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; @@ -21,10 +26,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; @@ -80,6 +82,12 @@ @Autowired private IEditionService editionService; + @Autowired + private IDriverBankService driverBankService; + + @Autowired + private IAgentService agentService; + @@ -92,7 +100,7 @@ }) public ResponseWarpper<List<OpenCityWarpper>> queryCityList(){ try { - List<OpenCityWarpper> list = branchOfficeService.queryOpenCity(); + List<OpenCityWarpper> list = agentService.queryOpenCity(); return ResponseWarpper.success(list); }catch (Exception e){ e.printStackTrace(); @@ -152,8 +160,9 @@ @ApiImplicitParams({ @ApiImplicitParam(value = "国家代码+86", name = "receiver", required = true, dataType = "string"), @ApiImplicitParam(value = "电话号码", name = "phone", required = true, dataType = "string"), + @ApiImplicitParam(value = "1=登录,2=注册", name = "type", required = true, dataType = "int"), }) - public ResponseWarpper getVerificationCode(String receiver, String phone){ + public ResponseWarpper getVerificationCode(String receiver, String phone, Integer type){ if(ToolUtil.isEmpty(receiver)){ return ResponseWarpper.success(ResultUtil.paranErr("receiver")); } @@ -161,6 +170,21 @@ return ResponseWarpper.success(ResultUtil.paranErr("phone")); } try { + if(type == 1){ + Driver driver = driverService.selectOne(new EntityWrapper<Driver>().eq("phone", phone).ne("status", 3)); + if(null == driver){ + return ResponseWarpper.success(ResultUtil.error("账号未注册")); + } + if(driver.getApprovalStatus() == 1){ + return ResponseWarpper.success(ResultUtil.error("账号正在审核中")); + } + if(driver.getApprovalStatus() == 3){ + return ResponseWarpper.success(ResultUtil.error("账号审核未通过")); + } + if(driver.getStatus() == 2){ + return ResponseWarpper.success(ResultUtil.error("账号已冻结")); + } + } String numberRandom = UUIDUtil.getNumberRandom(5); SMSUtil.send(phone, "1d0f0cbe5b214b0d8efa891730eb532a", "[\"" + numberRandom + "\"]"); redisUtil.setStrValue(receiver + phone, numberRandom, 300);//5分钟有效期 @@ -365,7 +389,7 @@ @ResponseBody @PostMapping("/api/driver/queryDriverInfo") // @ServiceLog(name = "获取司机个人信息", url = "/api/driver/queryDriverInfo") - @ApiOperation(value = "获取司机个人信息", tags = {"司机端-个人中心"}, notes = "") + @ApiOperation(value = "获取司机个人信息【1.1】", tags = {"司机端-个人中心"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) @@ -870,4 +894,109 @@ return new ResponseWarpper(500, e.getMessage()); } } + + + + @ResponseBody + @PostMapping("/api/driver/microenterprise") +// @ServiceLog(name = "绑定商户", url = "/api/driver/microenterprise") + @ApiOperation(value = "绑定商户【1.1】", tags = {"司机端-个人中心"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(value = "姓名", name = "name", required = true, dataType = "String"), + @ApiImplicitParam(value = "身份证号码", name = "IDCode", required = true, dataType = "String"), + @ApiImplicitParam(value = "手机号", name = "phone", required = true, dataType = "String"), + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResponseWarpper microenterprise(String name, String IDCode, String phone){ + try { + Integer uid = driverService.getUserByRequest(); + if(null == uid){ + return ResponseWarpper.tokenErr(); + } + ResultUtil resultUtil = driverService.microenterprise(uid, name, IDCode, phone, "/base/driver/microenterpriseCallback"); + return ResponseWarpper.success(resultUtil); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } + + + @ResponseBody + @PostMapping("/base/driver/microenterpriseCallback") + public void microenterpriseCallback(@RequestBody JSONObject jsonObject){ + System.err.println(jsonObject.toJSONString()); + } + + + + @ResponseBody + @PostMapping("/api/driver/queryBank") +// @ServiceLog(name = "获取绑定的银行卡", url = "/api/driver/queryBank") + @ApiOperation(value = "获取绑定的银行卡【1.1】", tags = {"司机端-个人中心"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResponseWarpper<DriverBank> queryBank(){ + try { + Integer uid = driverService.getUserByRequest(); + if(null == uid){ + return ResponseWarpper.tokenErr(); + } + DriverBank driverId = driverBankService.selectOne(new EntityWrapper<DriverBank>().eq("driverId", uid)); + return ResponseWarpper.success(driverId); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } + + + @ResponseBody + @PostMapping("/api/driver/addDriverBank") +// @ServiceLog(name = "绑定银行卡", url = "/api/driver/addDriverBank") + @ApiOperation(value = "绑定银行卡【1.1】", tags = {"司机端-个人中心"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(value = "姓名", name = "name", required = true, dataType = "String"), + @ApiImplicitParam(value = "身份证号码", name = "IDCode", required = true, dataType = "String"), + @ApiImplicitParam(value = "手机号", name = "phone", required = true, dataType = "String"), + @ApiImplicitParam(value = "银行卡号", name = "bankNumber", required = true, dataType = "String"), + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResponseWarpper addDriverBank(String name, String phone, String IDCode, String bankNumber){ + try { + Integer uid = driverService.getUserByRequest(); + if(null == uid){ + return ResponseWarpper.tokenErr(); + } + ResultUtil resultUtil = driverBankService.addDriverBank(uid, name, phone, IDCode, bankNumber); + return ResponseWarpper.success(resultUtil); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } + + + @ResponseBody + @PostMapping("/api/driver/delDriverBank") +// @ServiceLog(name = "解绑银行卡", url = "/api/driver/delDriverBank") + @ApiOperation(value = "解绑银行卡【1.1】", tags = {"司机端-个人中心"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(value = "银行卡id", name = "id", required = true, dataType = "int"), + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResponseWarpper delDriverBank(Integer id){ + try { + Integer uid = driverService.getUserByRequest(); + if(null == uid){ + return ResponseWarpper.tokenErr(); + } + ResultUtil resultUtil = driverBankService.delDriverBank(uid, id); + return ResponseWarpper.success(resultUtil); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } } -- Gitblit v1.7.1