| | |
| | | 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 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; |
| | |
| | | @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.....") |
| | | }) |
| | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/microenterprise") |
| | | // @ServiceLog(name = "绑定商户", url = "/api/driver/microenterprise") |
| | | @ApiOperation(value = "绑定商户", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "绑定商户【1.1】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "姓名", name = "name", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "身份证号码", name = "IDCode", required = true, dataType = "String"), |
| | |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = driverService.microenterprise(uid, name, IDCode, phone); |
| | | ResultUtil resultUtil = driverService.microenterprise(uid, name, IDCode, phone, "/base/driver/microenterpriseCallback"); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | |
| | | |
| | | @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 = "获取绑定的银行卡", 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.....") |
| | | }) |
| | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/addDriverBank") |
| | | // @ServiceLog(name = "绑定银行卡", url = "/api/driver/addDriverBank") |
| | | @ApiOperation(value = "绑定银行卡", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "绑定银行卡【1.1】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "姓名", name = "name", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "身份证号码", name = "IDCode", required = true, dataType = "String"), |
| | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/delDriverBank") |
| | | // @ServiceLog(name = "解绑银行卡", url = "/api/driver/delDriverBank") |
| | | @ApiOperation(value = "解绑银行卡", tags = {"司机端-个人中心"}, notes = "") |
| | | @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.....") |
| | |
| | | * @return |
| | | */ |
| | | List<DriverYouTuiWarpper> queryAllYouTui(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize); |
| | | |
| | | |
| | | /** |
| | | * 修改状态 |
| | | */ |
| | | void editState(); |
| | | } |
| | |
| | | UNIX_TIMESTAMP(createTime) * 1000 as createTime, |
| | | (newData - oldData) as money, |
| | | newData as balance |
| | | from t_account_change_detail where userType = 2 and userId = #{driverId} |
| | | from t_account_change_detail where changeType = 5 and userType = 2 and userId = #{driverId} |
| | | <if test="null != time and '' != time"> |
| | | and DATE_FORMAT(createTime, '%Y年%m月') = #{time} |
| | | </if> |
| | |
| | | from ( |
| | | select |
| | | (newData - oldData) as money |
| | | from t_account_change_detail where userType = 2 and userId = #{driverId} |
| | | from t_account_change_detail where changeType = 5 and userType = 2 and userId = #{driverId} |
| | | <if test="null != time and '' != time"> |
| | | and DATE_FORMAT(createTime, '%Y年%m月') = #{time} |
| | | </if> |
| | |
| | | content |
| | | from t_you_tui where status = 1 order by createTime desc limit #{pageNum}, #{pageSize} |
| | | </select> |
| | | |
| | | |
| | | <update id="editState"> |
| | | update t_you_tui_driver set state = 3 where failureTime <= now() and state != 3 |
| | | </update> |
| | | </mapper> |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil microenterprise(Integer uid, String name, String number, String phone) throws Exception; |
| | | ResultUtil microenterprise(Integer uid, String name, String number, String phone, String notifyUrl) throws Exception; |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil redeemBenefits(Integer driverId, Integer id) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * @throws Exception |
| | | */ |
| | | void editState() throws Exception; |
| | | } |
| | |
| | | bindAccount.setPhone(phone); |
| | | TrhRequest<BindAccount> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(bindAccount, BindAccount.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | if(!"0000".equals(execute.getCode())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | |
| | | |
| | | TrhRequest<UnbindAccount> request = new TrhRequest<>(); |
| | | InterfaceResponse execute = request.execute(unbindAccount, UnbindAccount.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | if(!"0000".equals(execute.getCode())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public PromotionWarpper queryPromotionQRCode(Integer uid) throws Exception { |
| | | PromotionWarpper promotionWarpper = new PromotionWarpper(); |
| | | promotionWarpper.setUrl("http://121.37.15.157/share/driverShare/index.html?inviterId=" + uid); |
| | | promotionWarpper.setUrl("https://chaoshengdaijia.com/share/driverShare/index.html?inviterId=" + uid); |
| | | int user = appUserService.selectCount(new EntityWrapper<AppUser>().eq("inviterType", 2).eq("inviterId", uid).eq("status", 1)); |
| | | int driver = this.selectCount(new EntityWrapper<Driver>().eq("inviterType", 2).eq("inviterId", uid).eq("approvalStatus", 2).eq("status", 1)); |
| | | promotionWarpper.setTotal(user + driver); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil microenterprise(Integer uid, String name, String number, String phone) throws Exception { |
| | | public ResultUtil microenterprise(Integer uid, String name, String number, String phone, String notifyUrl) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | Register registerVO = new Register(); |
| | | registerVO.setMerUserId("driver_" + uid); |
| | |
| | | registerVO.setUserType("0"); |
| | | registerVO.setUserName(name); |
| | | registerVO.setCertId(number); |
| | | registerVO.setNotifyUrl(""); |
| | | registerVO.setNotifyUrl(callbackPath + notifyUrl); |
| | | TrhRequest<Register> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(registerVO, Register.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | if(!"0000".equals(execute.getCode())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | |
| | | this.insert(youTuiDriver); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public void editState() throws Exception { |
| | | this.baseMapper.editState(); |
| | | } |
| | | } |
| | |
| | | |
| | | static { |
| | | YamlPropertiesFactoryBean yamlProFb = new YamlPropertiesFactoryBean(); |
| | | yamlProFb.setResources(new ClassPathResource("application.yaml")); |
| | | yamlProFb.setResources(new ClassPathResource("application.yml")); |
| | | Properties properties = yamlProFb.getObject(); |
| | | System.out.println("mallbook 参数配置初始化"); |
| | | System.out.println("--------------------------------"); |
| | |
| | | import com.supersavedriving.driver.modular.system.service.IAccountChangeDetailService; |
| | | import com.supersavedriving.driver.modular.system.service.IDriverService; |
| | | import com.supersavedriving.driver.modular.system.service.IOrderService; |
| | | import com.supersavedriving.driver.modular.system.service.IYouTuiDriverService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | @Autowired |
| | | private IYouTuiDriverService youTuiDriverService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | public void taskMinute(){ |
| | | try { |
| | | orderService.completeCollection(); |
| | | youTuiDriverService.editState(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | private String merchantName; |
| | | @ApiModelProperty("商户电话") |
| | | private String merchantPhone; |
| | | @ApiModelProperty("商户身份证号码") |
| | | @ApiModelProperty("商户身份证号码【1.1】") |
| | | private String merchantIDCode; |
| | | } |
| | |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | # active: dev |
| | | active: produce |
| | | active: dev |
| | | # active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/super_save_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | # password: 123456 |
| | | # password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://root:CEtyLdKjPk0yeHNo@127.0.0.1:27017/admin |
| | | # uri: mongodb://127.0.0.1:27017/admin |
| | | # uri: mongodb://root:CEtyLdKjPk0yeHNo@127.0.0.1:27017/admin |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | |
| | | --- |
| | | |
| | |
| | | |
| | | # mallbook 调起接口参数配置 |
| | | mallbook: |
| | | # pay_url:mallbook接口地址 测试环境: http://ld.mallbook.cn:12000/api 生产环境:https://cloudpay.mallbook.cn/api |
| | | pay_url: http://ld.mallbook.cn:12000/api |
| | | # pay_url:mallbook接口地址 测试环境: https://uat.mallbook.cn/api 生产环境:https://cloudpay.mallbook.cn/api |
| | | pay_url: https://uat.mallbook.cn/api |
| | | # merchant_no 业务系统商户平台编号,需替换为mallbook工作人员提供的商户编号 |
| | | merchant_no: 需要替换内容 |
| | | merchant_no: HF2023041901 |
| | | # version 接口版本号 |
| | | version: 1.0.0 |
| | | # channel_type 渠道类型 HF:汇付 |
| | | channel_type: HF |
| | | # merchant_private_key 商户平台私钥,需要替换成商户平台自己生成的私钥 |
| | | merchant_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIoGARvX6k6rVwuUW6HjAPkzXVntCtDI8q/niGZbeILc5T/noer+UNDECSy9f8T6ENw7tEKWaHOFcicrqgRv+wXeo2hPiJI2iYsUNs6I8ckd8i4uy/PBEDMW78GlnQLAatk0NC44HKjn8cuIHaETKNG2Vk3rwGBzNgDZ/God1L6JAgMBAAECgYBhCsOwzehBk5pJ2+9pLO+8Rm72EQGvtflb0BBI1zst1x2gBr4DOPedMJe6yymQVrmP/rJItvONdV/DRqHtKMZ2Wa4ul/U1mDnAtS/FkpRYBA5FaXV2hNEW11xBLhL5iGk35P23Bzaa0MJw9Vsd0vjeykridIw/PweDyTdeRBwC2QJBANS+iOaKRuf6BRwCKDmBSHOiZmc/kKnpx2f5BD3h+LWEX3JsNxObMbW1SxQIf2/qwqzIoEm/WbWaOyuwtRZkXQ8CQQCmFjTm5l+Ws2LoQgM+5+eLmPyMyRFOu4G8yqsUkhKuANHK/qrsS1GTbv6SN341NijjNYl05e0h6Jq1T9UZmtrnAkEAwTfzmn7H+3RmI5QJ+IBkzzEWFHv05X0/8DyID7QmcKWzEncaZqIzObdYYu983qa2/LqSaahyz68uQnYRYi7xHQJATr3SgPIRuaH8r360iTtrRHzYp2qgYQJ25On1KECEyKgszp/kqzieSVbjLLFQjavKwMXeEGT+AwiDaJibwJLxWwJAXZApORsqGqdxc9FTxt5iiqG2ZP5DTXxc6E+ihmlmoVl9KncgTf9ez0Q0Qz/4KUTPTHNVgzt1nyBxiLtnyzFavA== |
| | | merchant_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIDGadl1oxP7EJg+/o32vpAMa8cwFevD6xu3FjIh04TOuVTpC9hbAwiyX/9OKQi3nHEISyrtnF6Y49tkmb7X8nDwOahvsyOjgNYp+NtSLAdgPAbd6lv2DPC1lVYYu5IkMz7PRifntROFH6OvE5fpj6GinaFY3TYBjyDcC2VVbq/LAgMBAAECgYATdmlvDWF9Vpe2eubcK+u3N7leXH0jqfOxt6UqJISkcN3/4E0DARZfTR5HJtf60k1ZpAhAT7MvdOoTMYwvFNI2WEFRwND5wBl+OdEN/lyWeISjjg1EnnTLj/azGLgE8Z2q/FodGikqrGrc2tSNIy75afeW2gUTF3DHiwcG76SYeQJBAPOyIzpT3yMfM7iVhjaPfmyxvDXq0cLwiAF0eUbrebPO0EevI+PKYhmN2oRMis6wSJbv+sbkElOXQzDefjw0ieUCQQCHRuFlX9JQYUOoyyirKxpu30uys+ygZqmo4PiKgIaaJJPm2p2o7vzZJANGmkmdwFf2LLzij70InKGvqGTEnvfvAkEAnJOMRuG0sOBPXv3TaiLwW+4mu43QkKvy9txbP9H0NC9ha22AZc+XEEwwZmi3lu109mXifv/zNnot1axe91facQJALExcwQqo32OKeXrVvX+m70m2CzX6NeiIhGHvYcOG0HFL8ZwDZu+j4yN04yjhFISJCXdK/1Icj/ZiyBf3r59zBwJACl7Sya9BcqRo5XJ/A7+T2E3VQT2nIopy0hPRLKWFaOzrCIsn3gcC58KSACXl2QMiG5kp1192QOC26b3o57ZecA== |
| | | # mall_book_public_key mallbook测试环境公钥 不需要替换 |
| | | mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD0L2DaHOO8ekhktB6RoHxIcki/0v7OUeOn9tX9VBE+jv6PRjqlZRWL3Qezxz5ADtHEyLv+RFFaceXSep6rWyoQ6DRlvLv5CySUAxAM42LLVe4DI3l/0ccEAIuU5NCpwAAj1zkm2X01DwUCZwymLjlqbDlBvQhpq+1fddtTtA/QLQIDAQAB |
| | | # mall_book_public_key mallbook生产环境公钥 不需要替换 |
| | |
| | | //package com.supersavedriving.driver; |
| | | // |
| | | //import com.supersavedriving.driver.modular.system.model.WeatherCity; |
| | | //import com.supersavedriving.driver.modular.system.service.IAccountChangeDetailService; |
| | | //import com.supersavedriving.driver.modular.system.service.IOrderService; |
| | | //import com.supersavedriving.driver.modular.system.service.IWeatherCityService; |
| | | //import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | //import com.supersavedriving.driver.modular.system.util.juhe.WeatherCityInfo; |
| | | //import com.supersavedriving.driver.modular.system.util.juhe.WeatherUtil; |
| | | //import com.supersavedriving.driver.modular.system.warpper.PerformanceSummaryWarpper; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.BeanUtils; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | | // |
| | | //@RunWith(SpringRunner.class) |
| | | //@SpringBootTest |
| | | //public class GunsApplicationTest { |
| | | // |
| | | // @Autowired |
| | | // private IOrderService orderService; |
| | | // |
| | | // |
| | | // @Test |
| | | // public void test() throws Exception { |
| | | // PerformanceSummaryWarpper performanceSummaryWarpper = orderService.queryPerformanceSummary(1, 1, "2023年", 3); |
| | | // } |
| | | //} |
| | | package com.supersavedriving.driver; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.supersavedriving.driver.modular.system.model.DriverBank; |
| | | import com.supersavedriving.driver.modular.system.model.WeatherCity; |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.util.juhe.WeatherCityInfo; |
| | | import com.supersavedriving.driver.modular.system.util.juhe.WeatherUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.PerformanceSummaryWarpper; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest |
| | | public class GunsApplicationTest { |
| | | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | | private IDriverBankService driverBankService; |
| | | |
| | | |
| | | @Test |
| | | public void test() throws Exception { |
| | | // ResultUtil resultUtil = driverService.microenterprise(1, "蒲芝兵", "510823198911154858" |
| | | // , "15828353127", "https://10pz685243.zicp.fun/supersavedriving/base/driver/microenterpriseCallback"); |
| | | // System.err.println(JSON.toJSONString(resultUtil)); |
| | | |
| | | |
| | | // DriverBank driverId = driverBankService.selectOne(new EntityWrapper<DriverBank>().eq("driverId", 1)); |
| | | // System.err.println(JSON.toJSONString(driverId)); |
| | | |
| | | |
| | | ResultUtil resultUtil = driverBankService.addDriverBank(1, "蒲芝兵", "15828353127" |
| | | , "510823198911154858", "6212264402094114687"); |
| | | System.err.println(JSON.toJSONString(resultUtil)); |
| | | } |
| | | } |