25个文件已修改
2个文件已删除
28个文件已添加
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<PromotionWarpper> queryPromotionQRCode(HttpServletRequest request){ |
| | | public ResponseWarpper<PromotionWarpper> queryPromotionQRCode(HttpServletRequest request) { |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | if(null == uid){ |
| | | if (null == uid) { |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | PromotionWarpper promotionWarpper = driverService.queryPromotionQRCode(uid); |
| | | return ResponseWarpper.success(promotionWarpper); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.supersavedriving.driver.core.common.annotion.ServiceLog; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.model.Img; |
| | | import com.supersavedriving.driver.modular.system.service.IImgService; |
| | |
| | | @RequestMapping("") |
| | | public class ImgController { |
| | | |
| | | Logger logger = LoggerFactory.getLogger("ServiceLog"); |
| | | |
| | | @Autowired |
| | | private IImgService imgService; |
| | | |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/img/querySysImg") |
| | | @ServiceLog(name = "获取系统图片", url = "/base/img/querySysImg") |
| | | @ApiOperation(value = "获取系统图片", tags = {"司机端-公共接口"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "数据类型(1=启动页)", name = "type", required = true, dataType = "int"), |
| | | }) |
| | | public ResponseWarpper<List<BaseWarpper>> querySysImg(@RequestParam("type") Integer type){ |
| | | ResponseWarpper responseWarpper = null; |
| | | if(ToolUtil.isEmpty(type)){ |
| | | responseWarpper = ResponseWarpper.success(ResultUtil.paranErr()); |
| | | return ResponseWarpper.success(ResultUtil.paranErr("type")); |
| | | } |
| | | |
| | | if(ToolUtil.isNotEmpty(type)){ |
| | | try { |
| | | List<Img> imgs = imgService.selectList(new EntityWrapper<Img>().eq("type", type)); |
| | | List<BaseWarpper> list = new ArrayList<>(); |
| | | for (Img img : imgs) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(img.getId()); |
| | | baseWarpper.setPath(img.getImg()); |
| | | list.add(baseWarpper); |
| | | } |
| | | responseWarpper = ResponseWarpper.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | responseWarpper = new ResponseWarpper(500, e.getMessage()); |
| | | try { |
| | | List<Img> imgs = imgService.selectList(new EntityWrapper<Img>().eq("type", type)); |
| | | List<BaseWarpper> list = new ArrayList<>(); |
| | | for (Img img : imgs) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(img.getId().longValue()); |
| | | baseWarpper.setPath(img.getImg()); |
| | | list.add(baseWarpper); |
| | | } |
| | | return ResponseWarpper.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | logger.debug("" + |
| | | "\n接口地址:/base/img/querySysImg" + |
| | | "\n接口名称:获取系统图片" + |
| | | "\n请求参数:type:{}" + |
| | | "\n响应结果:{}" |
| | | , type, JSON.toJSONString(responseWarpper)); |
| | | return responseWarpper; |
| | | } |
| | | } |
| | |
| | | package com.supersavedriving.driver.modular.system.api; |
| | | |
| | | import com.supersavedriving.driver.core.common.annotion.ServiceLog; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.service.IDriverService; |
| | | import com.supersavedriving.driver.modular.system.service.IOrderService; |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.AddOrderWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.HallOrderList; |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.ResponseWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/rejectionOrder") |
| | | @ServiceLog(name = "司机拒绝接单", url = "/api/order/rejectionOrder") |
| | | @ApiOperation(value = "司机拒绝接单", tags = {"司机端-首页"}, notes = "") |
| | | @ApiOperation(value = "司机拒绝接单", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/receiveOrder") |
| | | @ServiceLog(name = "司机接单操作", url = "/api/order/receiveOrder") |
| | | @ApiOperation(value = "司机接单操作", tags = {"司机端-首页"}, notes = "") |
| | | @ApiOperation(value = "司机接单操作", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderInfo") |
| | | @ServiceLog(name = "获取订单详情", url = "/api/order/queryOrderInfo") |
| | | @ApiOperation(value = "获取订单详情", tags = {"司机端-首页"}, notes = "") |
| | | @ApiOperation(value = "获取订单详情", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | |
| | | |
| | | |
| | | public ResponseWarpper driverProcessOperations(Long orderId, Integer state, HttpServletRequest request){ |
| | | if(null == orderId){ |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/driverProcessOperations") |
| | | @ServiceLog(name = "司机走订单流程", url = "/api/order/driverProcessOperations") |
| | | @ApiOperation(value = "司机走订单流程", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper driverProcessOperations(ProcessOperationsWarpper processOperationsWarpper, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | ResultUtil resultUtil = orderService.driverProcessOperations(uid, processOperationsWarpper); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/transferOrder") |
| | | @ServiceLog(name = "司机转单操作", url = "/api/order/transferOrder") |
| | | @ApiOperation(value = "司机转单操作", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(value = "原因", name = "cause", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper transferOrder(Long orderId, String cause, HttpServletRequest request){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | if(null == state){ |
| | | if(ToolUtil.isEmpty(cause)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("cause")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | ResultUtil resultUtil = orderService.transferOrder(uid, orderId, cause); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/setOrderEndAddress") |
| | | @ServiceLog(name = "司机修改订单终点", url = "/api/order/setOrderEndAddress") |
| | | @ApiOperation(value = "司机修改订单终点", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper setOrderEndAddress(OrderEndAddressWarpper orderEndAddressWarpper, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | ResultUtil resultUtil = orderService.setOrderEndAddress(uid, orderEndAddressWarpper); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/cancelTransferOrder") |
| | | @ServiceLog(name = "司机取消转单操作", url = "/api/order/cancelTransferOrder") |
| | | @ApiOperation(value = "司机取消转单操作", tags = {"司机端-我的订单"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper cancelTransferOrder(Long orderId, HttpServletRequest request){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | ResultUtil resultUtil = orderService.cancelTransferOrder(uid, orderId); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/driverCancelOrder") |
| | | @ServiceLog(name = "司机取消订单操作", url = "/api/order/driverCancelOrder") |
| | | @ApiOperation(value = "司机取消订单操作", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(value = "原因", name = "cause", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper driverCancelOrder(Long orderId, String cause, HttpServletRequest request){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | if(ToolUtil.isEmpty(cause)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("cause")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | ResultUtil resultUtil = orderService.driverCancelOrder(uid, orderId, cause); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderPrice") |
| | | @ServiceLog(name = "获取订单费用明细", url = "/api/order/queryOrderPrice") |
| | | @ApiOperation(value = "获取订单费用明细", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<OrderPriceWarpper> queryOrderPrice(Long orderId, HttpServletRequest request){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | try { |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | OrderPriceWarpper orderPriceWarpper = orderService.queryOrderPrice(uid, orderId); |
| | | return ResponseWarpper.success(orderPriceWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/setOrderStatus") |
| | | @ServiceLog(name = "服务完成后修改订单状态", url = "/api/order/setOrderStatus") |
| | | @ApiOperation(value = "服务完成后修改订单状态", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(value = "107(线上支付),108(完成线下支付)", name = "state", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper setOrderStatus(Long orderId, Integer state, HttpServletRequest request){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | if(ToolUtil.isEmpty(state)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("state")); |
| | | } |
| | | try { |
| | | |
| | | Integer uid = driverService.getUserByRequset(request); |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | ResultUtil resultUtil = orderService.setOrderStatus(uid, orderId, state); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.supersavedriving.driver.core.common.annotion.ServiceLog; |
| | | import com.supersavedriving.driver.modular.system.model.SystemConfig; |
| | | import com.supersavedriving.driver.modular.system.service.ISystemConfigService; |
| | | import com.supersavedriving.driver.modular.system.warpper.ResponseWarpper; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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; |
| | | |
| | | /** |
| | | * 系统配置 |
| | | * @author pzb |
| | | * @Date 2023/2/25 11:53 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class SystemConfigController { |
| | | |
| | | @Autowired |
| | | private ISystemConfigService systemConfigService; |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/config/queryTransferOrderConfig") |
| | | @ServiceLog(name = "获取转单提醒时间配置", url = "/base/config/queryTransferOrderConfig") |
| | | @ApiOperation(value = "获取转单提醒时间配置", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<Integer> queryTransferOrderConfig(){ |
| | | try { |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 1)); |
| | | JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); |
| | | Integer num5 = jsonObject.getInteger("num5"); |
| | | return ResponseWarpper.success(num5); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.driver.modular.system.model.CancelOrder; |
| | | |
| | | public interface CancelOrderMapper extends BaseMapper<CancelOrder> { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.driver.modular.system.model.OrderTransfer; |
| | | |
| | | public interface OrderTransferMapper extends BaseMapper<OrderTransfer> { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.driver.modular.system.model.Revenue; |
| | | |
| | | public interface RevenueMapper extends BaseMapper<Revenue> { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.driver.modular.system.model.WeatherCity; |
| | | |
| | | public interface WeatherCityMapper extends BaseMapper<WeatherCity> { |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.supersavedriving.driver.modular.system.dao.CancelOrderMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.supersavedriving.driver.modular.system.model.CancelOrder"> |
| | | <id column="id" property="id"/> |
| | | <result column="orderId" property="orderId"/> |
| | | <result column="userType" property="userType"/> |
| | | <result column="userId" property="userId"/> |
| | | <result column="cause" property="cause"/> |
| | | <result column="status" property="status"/> |
| | | <result column="createTime" property="createTime"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | <result column="remark" property="remark"/> |
| | | <result column="isException" property="isException"/> |
| | | <result column="createTime" property="createTime"/> |
| | | <result column="provinceCode" property="provinceCode"/> |
| | | <result column="provinceName" property="provinceName"/> |
| | | <result column="cityCode" property="cityCode"/> |
| | | <result column="cityName" property="cityName"/> |
| | | <result column="areaCode" property="areaCode"/> |
| | | <result column="areaName" property="areaName"/> |
| | | <result column="commission" property="commission"/> |
| | | <result column="wxCollectionCode" property="wxCollectionCode"/> |
| | | <result column="zfbCollectionCode" property="zfbCollectionCode"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | <result column="source" property="source" /> |
| | | <result column="agentId" property="agentId" /> |
| | | <result column="branchOfficeId" property="branchOfficeId" /> |
| | | <result column="orderTakingTime" property="orderTakingTime"/> |
| | | <result column="goToAppointmentPointTime" property="goToAppointmentPointTime"/> |
| | | <result column="arrivalTimeAtTheAppointmentPoint" property="arrivalTimeAtTheAppointmentPoint"/> |
| | | <result column="startTime" property="startTime" /> |
| | | <result column="startAddress" property="startAddress" /> |
| | | <result column="startLat" property="startLat" /> |
| | |
| | | <result column="payMoney" property="payMoney" /> |
| | | <result column="discountedPrice" property="discountedPrice" /> |
| | | <result column="couponId" property="couponId" /> |
| | | <result column="discountAmount" property="discountAmount"/> |
| | | <result column="discount" property="discount"/> |
| | | <result column="payType" property="payType" /> |
| | | <result column="payTime" property="payTime" /> |
| | | <result column="hallOrder" property="hallOrder"/> |
| | | <result column="startWaitTime" property="startWaitTime"/> |
| | | <result column="state" property="state" /> |
| | | <result column="oldState" property="oldState"/> |
| | | <result column="status" property="status" /> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.supersavedriving.driver.modular.system.dao.OrderTransferMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.supersavedriving.driver.modular.system.model.OrderTransfer"> |
| | | <id column="id" property="id" /> |
| | | <result column="orderId" property="orderId" /> |
| | | <result column="oldDriverId" property="oldDriverId" /> |
| | | <result column="newDriverId" property="newDriverId" /> |
| | | <result column="cause" property="cause"/> |
| | | <result column="status" property="status" /> |
| | | <result column="successTime" property="successTime" /> |
| | | <result column="createTime" property="createTime" /> |
| | | </resultMap> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.supersavedriving.driver.modular.system.dao.RevenueMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.supersavedriving.driver.modular.system.model.Revenue"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="userType" property="userType" /> |
| | | <result column="userId" property="userId" /> |
| | | <result column="orderId" property="orderId" /> |
| | | <result column="amount" property="amount" /> |
| | | <result column="createTime" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.supersavedriving.driver.modular.system.dao.WeatherCityMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.supersavedriving.driver.modular.system.model.WeatherCity"> |
| | | <id column="id" property="id" /> |
| | | <result column="province" property="province" /> |
| | | <result column="city" property="city" /> |
| | | <result column="district" property="district" /> |
| | | </resultMap> |
| | | </mapper> |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 订单取消记录 |
| | | * @author pzb |
| | | * @Date 2023/2/25 14:37 |
| | | */ |
| | | @Data |
| | | @TableName("t_cancel_order") |
| | | public class CancelOrder { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 订单id |
| | | */ |
| | | @TableField("orderId") |
| | | private Long orderId; |
| | | /** |
| | | * 用户类型(1=用户,2=司机) |
| | | */ |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 取消原因 |
| | | */ |
| | | @TableField("cause") |
| | | private String cause; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | } |
| | |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | /** |
| | | * 加盟区域省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 加盟区域省名称 |
| | | */ |
| | | @TableField("provinceName") |
| | | private String provinceName; |
| | | /** |
| | | * 加盟区域市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 加盟区域市名称 |
| | | */ |
| | | @TableField("cityName") |
| | | private String cityName; |
| | | /** |
| | | * 加盟区域区编号 |
| | | */ |
| | | @TableField("areaCode") |
| | | private String areaCode; |
| | | /** |
| | | * 加盟区域区名称 |
| | | */ |
| | | @TableField("areaName") |
| | | private String areaName; |
| | | /** |
| | | * 佣金 |
| | | */ |
| | | @TableField("commission") |
| | | private Double commission; |
| | | /** |
| | | * 微信收款码 |
| | | */ |
| | | @TableField("wxCollectionCode") |
| | | private String wxCollectionCode; |
| | | /** |
| | | * 支付宝收款码 |
| | | */ |
| | | @TableField("zfbCollectionCode") |
| | | private String zfbCollectionCode; |
| | | } |
| | |
| | | @TableField("branchOfficeId") |
| | | private Integer branchOfficeId; |
| | | /** |
| | | * 接单时间 |
| | | */ |
| | | @TableField("orderTakingTime") |
| | | private Date orderTakingTime; |
| | | /** |
| | | * 前往预约点时间 |
| | | */ |
| | | @TableField("goToAppointmentPointTime") |
| | | private Date goToAppointmentPointTime; |
| | | /** |
| | | * 到达预约点时间 |
| | | */ |
| | | @TableField("arrivalTimeAtTheAppointmentPoint") |
| | | private Date arrivalTimeAtTheAppointmentPoint; |
| | | /** |
| | | * 开始服务时间 |
| | | */ |
| | | @TableField("startTime") |
| | |
| | | * 实际里程 |
| | | */ |
| | | @TableField("actualMileage") |
| | | private Double actualMileage; |
| | | private Integer actualMileage; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | |
| | | @TableField("couponId") |
| | | private Integer couponId; |
| | | /** |
| | | * 折扣优惠金额 |
| | | */ |
| | | @TableField("discountAmount") |
| | | private Double discountAmount; |
| | | /** |
| | | * 折扣0.01 |
| | | */ |
| | | @TableField("discount") |
| | | private Double discount; |
| | | /** |
| | | * 支付类型(1=微信支付,2=余额支付,3=线下支付) |
| | | */ |
| | | @TableField("payType") |
| | |
| | | @TableField("hallOrder") |
| | | private Integer hallOrder; |
| | | /** |
| | | * 订单状态(101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待评价,108=已完成,201=转单中,301=已取消) |
| | | * 订单开始进入等待状态时间 |
| | | */ |
| | | @TableField("startWaitTime") |
| | | private Date startWaitTime; |
| | | /** |
| | | * 订单状态(101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待支付,108=待评价,109=已完成,201=转单中,301=已取消,401=等待中) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 司机转单记录 |
| | | * @author pzb |
| | | * @Date 2023/2/25 13:40 |
| | | */ |
| | | @Data |
| | | @TableName("t_order_transfer") |
| | | public class OrderTransfer { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 订单id |
| | | */ |
| | | @TableField("orderId") |
| | | private Long orderId; |
| | | /** |
| | | * 原司机id |
| | | */ |
| | | @TableField("oldDriverId") |
| | | private Integer oldDriverId; |
| | | /** |
| | | * 新司机id |
| | | */ |
| | | @TableField("newDriverId") |
| | | private Integer newDriverId; |
| | | /** |
| | | * 转单原因 |
| | | */ |
| | | @TableField("cause") |
| | | private String cause; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 转单成功时间 |
| | | */ |
| | | @TableField("successTime") |
| | | private Date successTime; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 收入记录 |
| | | * @author pzb |
| | | * @Date 2023/2/25 16:06 |
| | | */ |
| | | @Data |
| | | @TableName("t_revenue") |
| | | public class Revenue { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 收入类型(1=订单收入,2=分佣收入) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 用户类型(1=用户,2=司机,3=代理商) |
| | | */ |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 订单id |
| | | */ |
| | | @TableField("orderId") |
| | | private Long orderId; |
| | | /** |
| | | * 收入金额 |
| | | */ |
| | | @TableField("amount") |
| | | private Double amount; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 天气相关城市 |
| | | * @author pzb |
| | | * @Date 2023/2/25 10:56 |
| | | */ |
| | | @Data |
| | | @TableName("t_weather_city") |
| | | public class WeatherCity { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.INPUT) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 区 |
| | | */ |
| | | @TableField("district") |
| | | private String district; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.supersavedriving.driver.modular.system.model.CancelOrder; |
| | | |
| | | public interface ICancelOrderService extends IService<CancelOrder> { |
| | | } |
| | |
| | | package com.supersavedriving.driver.modular.system.service; |
| | | |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.DriverPositionWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderPositionWarpper; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.supersavedriving.driver.modular.system.model.Order; |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.AddOrderWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.BaseWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.HallOrderList; |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | OrderInfoWarpper queryOrderInfo(Integer uid, Long orderId) throws Exception; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 司机走订单流程 |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil driverProcessOperations(Integer uid, ProcessOperationsWarpper processOperationsWarpper) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 司机转单操作 |
| | | * @param uid |
| | | * @param orderId |
| | | * @param cause |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil transferOrder(Integer uid, Long orderId, String cause) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 修改终点地址 |
| | | * @param uid |
| | | * @param orderEndAddressWarpper |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil setOrderEndAddress(Integer uid, OrderEndAddressWarpper orderEndAddressWarpper) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 取消转单操作 |
| | | * @param uid |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil cancelTransferOrder(Integer uid, Long orderId) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 司机取消订单 |
| | | * @param uid |
| | | * @param orderId |
| | | * @param cause |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil driverCancelOrder(Integer uid, Long orderId, String cause) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取订单费用明细 |
| | | * @param uid |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | OrderPriceWarpper queryOrderPrice(Integer uid, Long orderId) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 修改订单状态 |
| | | * @param uid |
| | | * @param orderId |
| | | * @param state |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil setOrderStatus(Integer uid, Long orderId, Integer state) throws Exception; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.supersavedriving.driver.modular.system.model.OrderTransfer; |
| | | |
| | | public interface IOrderTransferService extends IService<OrderTransfer> { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.supersavedriving.driver.modular.system.model.Revenue; |
| | | |
| | | public interface IRevenueService extends IService<Revenue> { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.supersavedriving.driver.modular.system.model.WeatherCity; |
| | | |
| | | public interface IWeatherCityService extends IService<WeatherCity> { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.modular.system.dao.CancelOrderMapper; |
| | | import com.supersavedriving.driver.modular.system.model.CancelOrder; |
| | | import com.supersavedriving.driver.modular.system.service.ICancelOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 取消订单记录 |
| | | * @author pzb |
| | | * @Date 2023/2/25 14:45 |
| | | */ |
| | | @Service |
| | | public class CancelOrderServiceImpl extends ServiceImpl<CancelOrderMapper, CancelOrder> implements ICancelOrderService { |
| | | } |
| | |
| | | } |
| | | driver.setBranchOfficeId(branchOffice.getId()); |
| | | driver.setAgentId(branchOffice.getAgentId()); |
| | | driver.setProvinceCode(branchOffice.getProvinceCode()); |
| | | driver.setProvinceName(branchOffice.getProvinceName()); |
| | | driver.setCityName(branchOffice.getCityName()); |
| | | driver.setCityCode(branchOffice.getCityCode()); |
| | | driver.setAreaCode(branchOffice.getDistrictCode()); |
| | | driver.setAreaName(branchOffice.getDistrictName()); |
| | | driver.setInviterType(driverRegisterWarpper.getInviterType()); |
| | | driver.setInviterId(driverRegisterWarpper.getInviterId()); |
| | | driver.setApprovalStatus(1); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取司机推广二维码 |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public PromotionWarpper queryPromotionQRCode(Integer uid) throws Exception { |
| | | PromotionWarpper promotionWarpper = new PromotionWarpper(); |
| | |
| | | package com.supersavedriving.driver.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.modular.system.dao.DriverWorkMapper; |
| | | import com.supersavedriving.driver.modular.system.model.Driver; |
| | | import com.supersavedriving.driver.modular.system.model.DriverWork; |
| | | import com.supersavedriving.driver.modular.system.model.OrderTransfer; |
| | | import com.supersavedriving.driver.modular.system.model.SystemConfig; |
| | | import com.supersavedriving.driver.modular.system.service.IDriverService; |
| | | import com.supersavedriving.driver.modular.system.service.IDriverWorkService; |
| | | import com.supersavedriving.driver.modular.system.service.IOrderService; |
| | | import com.supersavedriving.driver.modular.system.service.ISystemConfigService; |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | @Autowired |
| | | private IOrderTransferService orderTransferService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | return ResultUtil.error("账户余额不足,请先充值"); |
| | | } |
| | | systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 1)); |
| | | JSON.parseObject(systemConfig.getContent()).getDouble("num1"); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); |
| | | Integer num5 = jsonObject.getInteger("num5"); |
| | | OrderTransfer orderTransfer = orderTransferService.selectOne(new EntityWrapper<OrderTransfer>().eq("oldDriverId", driverId) |
| | | .eq("status", 1).isNotNull("successTime").orderBy("createTime desc limit 0, 1")); |
| | | if(null != orderTransfer){ |
| | | int i = Double.valueOf((System.currentTimeMillis() - orderTransfer.getSuccessTime().getTime()) / 60000).intValue(); |
| | | if(num5 > i){ |
| | | return ResultUtil.error("暂时还无法上班,请稍后重试"); |
| | | } |
| | | } |
| | | |
| | | DriverWork driverWork = this.selectOne(new EntityWrapper<DriverWork>().eq("driverId", 1).eq("status", 1)); |
| | | if(null != driverWork){ |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.model.DriverWork; |
| | | import com.supersavedriving.driver.modular.system.model.Order; |
| | | import com.supersavedriving.driver.modular.system.service.IDriverWorkService; |
| | | import com.supersavedriving.driver.modular.system.service.IOrderPositionService; |
| | | import com.supersavedriving.driver.modular.system.service.IOrderService; |
| | | import com.supersavedriving.driver.modular.system.util.GeodesyUtil; |
| | | import com.supersavedriving.driver.modular.system.util.RedisUtil; |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.DriverPositionWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderPositionWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.ProcessOperationsWarpper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 订单轨迹逻辑类 |
| | |
| | | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | private Map<String, Integer> map = new HashMap<>(); |
| | | |
| | | |
| | | |
| | |
| | | file.createNewFile(); |
| | | } |
| | | List<OrderPositionWarpper> orderPositionWarppers = queryPosition(orderId, orderType); |
| | | if(orderPositionWarppers.size() > 0){ |
| | | OrderPositionWarpper orderPositionWarpper = orderPositionWarppers.get(orderPositionWarppers.size() - 1); |
| | | saveOrderMileage(driverPositionWarpper, orderPositionWarpper); |
| | | } |
| | | OrderPositionWarpper orderPositionWarpper = new OrderPositionWarpper(); |
| | | BeanUtils.copyProperties(driverPositionWarpper, orderPositionWarpper); |
| | | orderPositionWarpper.setInsertTime(new Date()); |
| | |
| | | |
| | | |
| | | /** |
| | | * 保存行驶里程 |
| | | * @param driverPositionWarpper |
| | | * @param orderPositionWarpper |
| | | */ |
| | | public void saveOrderMileage(DriverPositionWarpper driverPositionWarpper, OrderPositionWarpper orderPositionWarpper){ |
| | | String fromLonLat = driverPositionWarpper.getLon() + "," + driverPositionWarpper.getLat(); |
| | | String toLonLat = orderPositionWarpper.getLon() + "," + orderPositionWarpper.getLat(); |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(fromLonLat, toLonLat); |
| | | Order order = orderService.selectById(driverPositionWarpper.getOrderId()); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | Integer num = map.get(order.getId().toString()); |
| | | if(50 < wgs84){ |
| | | order.setActualMileage(order.getActualMileage() + wgs84.intValue()); |
| | | map.put(order.getId().toString(), 0); |
| | | |
| | | if(order.getState() == 401){//定位变动,自动开始服务 |
| | | ProcessOperationsWarpper processOperationsWarpper = new ProcessOperationsWarpper(); |
| | | processOperationsWarpper.setOrderId(order.getId()); |
| | | processOperationsWarpper.setState(105); |
| | | try { |
| | | orderService.driverProcessOperations(order.getDriverId(), processOperationsWarpper); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | if(50 >= wgs84 && 12 <= (null == num ? 0 : num)){//1分钟(5秒上传一次数据) |
| | | Integer integer = map.get(order.getId().toString()); |
| | | map.put(order.getId().toString(), integer++); |
| | | order.setState(401);//进入等待状态 |
| | | order.setStartWaitTime(new Date()); |
| | | } |
| | | if(50 >= wgs84 && 12 > (null == num ? 0 : num)){ |
| | | Integer integer = map.get(order.getId().toString()); |
| | | map.put(order.getId().toString(), integer++); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取订单坐标数据 |
| | | * @param orderId |
| | | * @param orderType |
| | |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.util.*; |
| | | import com.supersavedriving.driver.modular.system.util.GaoDe.MapUtil; |
| | | import com.supersavedriving.driver.modular.system.util.GaoDe.model.District; |
| | | import com.supersavedriving.driver.modular.system.util.juhe.WeatherUtil; |
| | | import com.supersavedriving.driver.modular.system.util.mongodb.model.Location; |
| | | import com.supersavedriving.driver.modular.system.warpper.AddOrderWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.HallOrderList; |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.geo.Circle; |
| | | import org.springframework.data.geo.Distance; |
| | |
| | | @Autowired |
| | | private IYouTuiDriverService youTuiDriverService; |
| | | |
| | | @Autowired |
| | | private IWeatherCityService weatherCityService; |
| | | |
| | | @Autowired |
| | | private IOrderTransferService orderTransferService; |
| | | |
| | | @Autowired |
| | | private ICancelOrderService cancelOrderService; |
| | | |
| | | @Autowired |
| | | private IRevenueService revenueService; |
| | | |
| | | private Map<String, Timer> timerMap = new HashMap<>(); |
| | | |
| | | |
| | | |
| | | |
| | |
| | | if(driverWork != null && null == order1){ |
| | | order.setDriverId(uid); |
| | | driver.setServerStatus(2); |
| | | order.setOrderTakingTime(new Date()); |
| | | } |
| | | order.setCode(UUIDUtil.getTimeStr() + UUIDUtil.getNumberRandom(3)); |
| | | order.setSource(2); |
| | |
| | | d = Double.valueOf(distance.get("distance")) / 1000; |
| | | order.setEstimatedMileage(d); |
| | | } |
| | | order = getOrderPrice(1, d, 0, order, ""); |
| | | String city = ""; |
| | | District geocode = MapUtil.geocode(order.getStartLng(), order.getStartLat()); |
| | | if(null != geocode){ |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getProvince() + "' like district")); |
| | | city = null != weatherCity ? weatherCity.getId().toString() : ""; |
| | | } |
| | | order = getOrderPrice(1, d, 0, order, city); |
| | | order.setHallOrder(0); |
| | | order.setState(null == order.getDriverId() ? 101 : 102); |
| | | order.setStatus(1); |
| | |
| | | } |
| | | } |
| | | |
| | | //计算折扣 |
| | | if(null != order.getUserId()){ |
| | | |
| | | } |
| | | |
| | | //计算总金额 |
| | | BigDecimal bigDecimal = new BigDecimal(order.getStartPrice() + order.getOverDrivePrice() + order.getLongDistancePrice() + order.getOverLongDistancePrice() + |
| | | order.getWaitTimePrice() + order.getOutWaitTimePrice() + order.getBadWeatherPrice() + order.getOverBadWeatherPrice()).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | order.getWaitTimePrice() + order.getOutWaitTimePrice() + order.getBadWeatherPrice() + order.getOverBadWeatherPrice() - order.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | |
| | | if(type == 1){//预估价 |
| | | order.setEstimatedPrice(bigDecimal.doubleValue()); |
| | | } |
| | |
| | | order.setOverBadWeatherPrice(0D);//恶劣天气超出里程费 |
| | | order.setDiscountedPrice(0D);//优惠金额 |
| | | order.setCouponId(null);//优惠券 |
| | | order.setDiscountAmount(0D);//折扣优惠金额 |
| | | order.setDiscount(0D);//折扣 |
| | | return order; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void run() { |
| | | Order order1 = OrderServiceImpl.this.selectById(order.getId()); |
| | | if(order1.getState() == 101){ |
| | | if(order1.getState() == 101 || order1.getState() == 201){ |
| | | order1.setHallOrder(1); |
| | | OrderServiceImpl.this.updateById(order1); |
| | | } |
| | |
| | | } |
| | | } |
| | | Order order = this.selectById(orderId); |
| | | if(order.getState() != 301){ |
| | | Integer state = order.getState(); |
| | | Integer oldDriverId = order.getDriverId(); |
| | | if(state != 301){ |
| | | redisUtil.unlock(); |
| | | return ResultUtil.error("订单已被取消"); |
| | | } |
| | | if(order.getState() != 101){ |
| | | if(state != 101){ |
| | | redisUtil.unlock(); |
| | | return ResultUtil.error("手速慢了哦"); |
| | | } |
| | |
| | | order.setAgentId(driver.getAgentId()); |
| | | order.setBranchOfficeId(driver.getBranchOfficeId()); |
| | | order.setState(102); |
| | | order.setOrderTakingTime(new Date()); |
| | | this.updateById(order); |
| | | redisUtil.unlock(); |
| | | |
| | | driver.setServerStatus(2); |
| | | driverService.updateById(driver); |
| | | if(state == 201){//转单的订单 |
| | | //停止定时任务 |
| | | Timer timer = timerMap.get(order.getId().toString()); |
| | | if(null != timer){ |
| | | timer.cancel(); |
| | | timerMap.remove(order.getId().toString()); |
| | | } |
| | | //原司机下班 |
| | | Driver oldDriver = driverService.selectById(oldDriverId); |
| | | oldDriver.setServerStatus(1); |
| | | driverService.updateById(oldDriver); |
| | | |
| | | DriverWork driverWork1 = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", oldDriverId).eq("status", 1)); |
| | | driverWork1.setStatus(2); |
| | | driverWork1.setOffWorkTime(new Date()); |
| | | driverWorkService.updateById(driverWork1); |
| | | |
| | | //添加关系数据 |
| | | OrderTransfer orderTransfer = orderTransferService.selectOne(new EntityWrapper<OrderTransfer>().eq("orderId", order.getId()).eq("status", 1).isNull("successTime")); |
| | | if(null != orderTransfer){ |
| | | orderTransfer.setNewDriverId(uid); |
| | | orderTransfer.setSuccessTime(new Date()); |
| | | orderTransferService.updateById(orderTransfer); |
| | | }else{ |
| | | orderTransfer = new OrderTransfer(); |
| | | orderTransfer.setOrderId(order.getId()); |
| | | orderTransfer.setOldDriverId(oldDriverId); |
| | | orderTransfer.setCreateTime(new Date()); |
| | | orderTransfer.setStatus(1); |
| | | orderTransfer.setNewDriverId(uid); |
| | | orderTransfer.setSuccessTime(new Date()); |
| | | orderTransferService.insert(orderTransfer); |
| | | } |
| | | |
| | | pushUtil.pushTransferSuccessful(order.getUserId(), 1, order.getId()); |
| | | pushUtil.pushTransferSuccessful(oldDriverId, 2, order.getId()); |
| | | } |
| | | |
| | | //推动订单数据 |
| | | new Thread(new Runnable() { |
| | |
| | | orderInfoWarpper.setCurrentDistance(wgs84); |
| | | return orderInfoWarpper; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机走订单流程 |
| | | * @param uid |
| | | * @param processOperationsWarpper |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil driverProcessOperations(Integer uid, ProcessOperationsWarpper processOperationsWarpper) throws Exception { |
| | | //101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待支付,108=待评价,109=已完成,201=转单中,301=已取消,401=等待中 |
| | | Order order = this.selectById(processOperationsWarpper.getOrderId()); |
| | | if(order.getState() == processOperationsWarpper.getState()){ |
| | | return ResultUtil.error("不能重复操作"); |
| | | } |
| | | if(order.getState() == 201){ |
| | | return ResultUtil.error("订单正在转单中"); |
| | | } |
| | | order.setState(processOperationsWarpper.getState()); |
| | | switch (processOperationsWarpper.getState()){ |
| | | case 103: |
| | | order.setGoToAppointmentPointTime(new Date()); |
| | | pushOrderInfo(order.getId(), uid);//开始推送订单数据 |
| | | break; |
| | | case 104: |
| | | order.setStartWaitTime(new Date()); |
| | | order.setArrivalTimeAtTheAppointmentPoint(new Date()); |
| | | break; |
| | | case 105: |
| | | if(null == order.getStartTime()){ |
| | | redisUtil.addSetValue("serverOrder", order.getId().toString());//存入缓存用于计算实时距离 |
| | | order.setBoardingTime(new Date()); |
| | | order.setStartTime(new Date()); |
| | | } |
| | | order.setStartWaitTime(null); |
| | | //计算等待用户时长 |
| | | Integer w = Double.valueOf((System.currentTimeMillis() - order.getStartWaitTime().getTime()) / 60000).intValue(); |
| | | order.setWaitTime(order.getWaitTime() + w); |
| | | break; |
| | | case 106: |
| | | order.setGetoffTime(new Date()); |
| | | if(ToolUtil.isEmpty(order.getEndAddress())){ |
| | | order.setEndAddress(processOperationsWarpper.getEndAddress()); |
| | | order.setEndLng(processOperationsWarpper.getEndLng()); |
| | | order.setEndLat(processOperationsWarpper.getEndLat()); |
| | | } |
| | | //停止定时任务 |
| | | Timer timer = timerMap.get(order.getId().toString()); |
| | | if(null != timer){ |
| | | timer.cancel(); |
| | | timerMap.remove(order.getId().toString()); |
| | | } |
| | | //开始计算费用 |
| | | String city = ""; |
| | | District geocode = MapUtil.geocode(order.getEndLng(), order.getEndLat()); |
| | | if(null != geocode){ |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getProvince() + "' like district")); |
| | | city = null != weatherCity ? weatherCity.getId().toString() : ""; |
| | | } |
| | | order = getOrderPrice(2, Double.valueOf(order.getActualMileage() / 1000), order.getWaitTime(), order, city); |
| | | |
| | | //修改司机状态 |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | driver.setServerStatus(1); |
| | | driverService.updateById(driver); |
| | | break; |
| | | case 401: |
| | | order.setStartWaitTime(new Date()); |
| | | break; |
| | | } |
| | | this.updateAllColumnById(order); |
| | | |
| | | //推送订单状态 |
| | | pushUtil.pushOrderStatus(order.getDriverId(), 2, order.getId(), order.getState()); |
| | | if(null != order.getUserId()){ |
| | | pushUtil.pushOrderStatus(order.getUserId(), 1, order.getId(), order.getState()); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时任务推送订单数据 |
| | | * @param orderId |
| | | * @param uid |
| | | */ |
| | | public void pushOrderInfo(Long orderId, Integer uid){ |
| | | Timer timer = new Timer(); |
| | | timer.schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | String value = redisUtil.getValue("DRIVER" + uid); |
| | | Order order = OrderServiceImpl.this.selectById(orderId); |
| | | if(order.getState() == 106){ |
| | | Timer timer = timerMap.get(order.getId().toString()); |
| | | if(null != timer){ |
| | | timer.cancel(); |
| | | timerMap.remove(order.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | PushOrderInfoWarpper pushOrderInfoWarpper = new PushOrderInfoWarpper(); |
| | | pushOrderInfoWarpper.setId(orderId); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | String[] split = value.split(","); |
| | | pushOrderInfoWarpper.setDriverLat(split[1]); |
| | | pushOrderInfoWarpper.setDriverLng(split[0]); |
| | | } |
| | | pushOrderInfoWarpper.setWaitTime(order.getWaitTime()); |
| | | pushOrderInfoWarpper.setState(order.getState()); |
| | | pushOrderInfoWarpper.setActualMileage(Double.valueOf(order.getActualMileage() / 1000)); |
| | | int travelTime = Double.valueOf((System.currentTimeMillis() - order.getStartTime().getTime()) / 60000).intValue(); |
| | | pushOrderInfoWarpper.setTravelTime(travelTime); |
| | | pushUtil.pushOrderInfo(uid, 2, pushOrderInfoWarpper); |
| | | } |
| | | },0, 5000); |
| | | timerMap.put(orderId.toString(), timer); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机转单操作 |
| | | * @param uid |
| | | * @param orderId |
| | | * @param cause |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil transferOrder(Integer uid, Long orderId, String cause) throws Exception { |
| | | Order order = this.selectById(orderId); |
| | | if(order.getDriverId().compareTo(uid) != 0){ |
| | | return ResultUtil.error("无权操作"); |
| | | } |
| | | if(order.getState() > 104){ |
| | | return ResultUtil.error("订单不支持转单"); |
| | | } |
| | | order.setOldState(order.getState()); |
| | | order.setState(201); |
| | | this.updateById(order); |
| | | |
| | | OrderTransfer orderTransfer = new OrderTransfer(); |
| | | orderTransfer.setOrderId(orderId); |
| | | orderTransfer.setOldDriverId(order.getDriverId()); |
| | | orderTransfer.setCause(cause); |
| | | orderTransfer.setStatus(1); |
| | | orderTransfer.setCreateTime(new Date()); |
| | | orderTransferService.insert(orderTransfer); |
| | | |
| | | //开始派单 |
| | | pushOrder(order); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机修改订单终点 |
| | | * @param uid |
| | | * @param orderEndAddressWarpper |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil setOrderEndAddress(Integer uid, OrderEndAddressWarpper orderEndAddressWarpper) throws Exception { |
| | | Order order = this.selectById(orderEndAddressWarpper.getOrderId()); |
| | | order.setEndLat(orderEndAddressWarpper.getEndLat()); |
| | | order.setEndLng(orderEndAddressWarpper.getEndLng()); |
| | | order.setEndAddress(orderEndAddressWarpper.getEndAddress()); |
| | | Map<String, String> distance = MapUtil.getDistance(order.getStartLng() + "," + order.getStartLat(), order.getEndLng() + "," + order.getEndLat(), 1); |
| | | if(null == distance){ |
| | | return ResultUtil.error("获取预估距离出错"); |
| | | } |
| | | Double d = Double.valueOf(distance.get("distance")) / 1000; |
| | | order.setEstimatedMileage(d); |
| | | String city = ""; |
| | | District geocode = MapUtil.geocode(order.getStartLng(), order.getStartLat()); |
| | | if(null != geocode){ |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getProvince() + "' like district")); |
| | | city = null != weatherCity ? weatherCity.getId().toString() : ""; |
| | | } |
| | | order = getOrderPrice(1, d, 0, order, city); |
| | | this.updateById(order); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机取消转到操作 |
| | | * @param uid |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil cancelTransferOrder(Integer uid, Long orderId) throws Exception { |
| | | Order order = this.selectById(orderId); |
| | | if(order.getState() != 201){ |
| | | return ResultUtil.error("不能取消转单"); |
| | | } |
| | | order.setState(order.getOldState()); |
| | | order.setOldState(null); |
| | | this.updateAllColumnById(order); |
| | | |
| | | OrderTransfer orderTransfer = orderTransferService.selectOne(new EntityWrapper<OrderTransfer>().eq("orderId", orderId) |
| | | .eq("status", 1).isNull("successTime").orderBy("createTime desc limit 0, 1")); |
| | | if(null != orderTransfer){ |
| | | orderTransfer.setStatus(3); |
| | | orderTransferService.updateById(orderTransfer); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机取消订单 |
| | | * @param uid |
| | | * @param orderId |
| | | * @param cause |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil driverCancelOrder(Integer uid, Long orderId, String cause) throws Exception { |
| | | Order order = this.selectById(orderId); |
| | | if(uid.compareTo(order.getDriverId()) != 0){ |
| | | return ResultUtil.error("无法取消订单"); |
| | | } |
| | | if(order.getState() > 105){ |
| | | return ResultUtil.error("无法取消订单"); |
| | | } |
| | | |
| | | order.setState(301); |
| | | this.updateById(order); |
| | | |
| | | CancelOrder cancelOrder = new CancelOrder(); |
| | | cancelOrder.setOrderId(orderId); |
| | | cancelOrder.setUserType(2); |
| | | cancelOrder.setUserId(uid); |
| | | cancelOrder.setCause(cause); |
| | | cancelOrder.setStatus(1); |
| | | cancelOrder.setCreateTime(new Date()); |
| | | cancelOrderService.insert(cancelOrder); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取订单费用明细 |
| | | * @param uid |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public OrderPriceWarpper queryOrderPrice(Integer uid, Long orderId) throws Exception { |
| | | Driver driver = driverService.selectById(uid); |
| | | Order order = this.selectById(orderId); |
| | | OrderPriceWarpper orderPriceWarpper = new OrderPriceWarpper(); |
| | | BeanUtils.copyProperties(order, orderPriceWarpper); |
| | | orderPriceWarpper.setActualMileage(new BigDecimal(order.getActualMileage() / 1000).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPriceWarpper.setTravelTime(Double.valueOf((order.getGetoffTime().getTime() - order.getStartTime().getTime()) / 60000).intValue()); |
| | | orderPriceWarpper.setWxCollectionCode(driver.getWxCollectionCode()); |
| | | orderPriceWarpper.setZfbCollectionCode(driver.getZfbCollectionCode()); |
| | | return orderPriceWarpper; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改订单状态 |
| | | * @param uid |
| | | * @param orderId |
| | | * @param state |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil setOrderStatus(Integer uid, Long orderId, Integer state) throws Exception { |
| | | List<Integer> s = Arrays.asList(107, 108); |
| | | if(s.contains(state)){ |
| | | return ResultUtil.error("操作失败"); |
| | | } |
| | | Order order = this.selectById(orderId); |
| | | order.setState(state); |
| | | if(state == 108){ |
| | | order.setPayType(3); |
| | | order.setPayTime(new Date()); |
| | | order.setPayMoney(order.getOrderMoney() - order.getDiscountAmount()); |
| | | } |
| | | this.updateById(order); |
| | | |
| | | if(state == 108){//计算抽成 |
| | | saveRevenue(order); |
| | | } |
| | | |
| | | pushUtil.pushOrderStatus(order.getDriverId(), 2, orderId, order.getState()); |
| | | if(null != order.getUserId()){ |
| | | pushUtil.pushOrderStatus(order.getUserId(), 1, orderId, order.getState()); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 计算抽成和分佣 |
| | | * @param order |
| | | */ |
| | | public void saveRevenue(Order order){ |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.modular.system.dao.OrderTransferMapper; |
| | | import com.supersavedriving.driver.modular.system.model.OrderTransfer; |
| | | import com.supersavedriving.driver.modular.system.service.IOrderTransferService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class OrderTransferServiceImpl extends ServiceImpl<OrderTransferMapper, OrderTransfer> implements IOrderTransferService { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.modular.system.dao.RevenueMapper; |
| | | import com.supersavedriving.driver.modular.system.model.Revenue; |
| | | import com.supersavedriving.driver.modular.system.service.IRevenueService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 收入记录 |
| | | * @author pzb |
| | | * @Date 2023/2/25 16:12 |
| | | */ |
| | | @Service |
| | | public class RevenueServiceImpl extends ServiceImpl<RevenueMapper, Revenue> implements IRevenueService { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.modular.system.dao.WeatherCityMapper; |
| | | import com.supersavedriving.driver.modular.system.model.WeatherCity; |
| | | import com.supersavedriving.driver.modular.system.service.IWeatherCityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class WeatherCityServiceImpl extends ServiceImpl<WeatherCityMapper, WeatherCity> implements IWeatherCityService { |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.supersavedriving.driver.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | */ |
| | | @Component |
| | | public class ALiApiUtil { |
| | | |
| | | @Autowired |
| | | private HttpClientUtil httpClientUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | param.put("verifyKey", "IVO4js5kValcdt"); |
| | | param.put("userName", name); |
| | | param.put("identifyNum", code); |
| | | String get = httpClientUtil.pushHttpRequset("GET", url, param, header, "form"); |
| | | String get = null; |
| | | try { |
| | | get = HttpClientUtil.pushHttpRequset("GET", url, param, header, "form").getData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(get); |
| | | if(jsonObject.getIntValue("code") == 200){ |
| | | JSONObject value = jsonObject.getJSONObject("value"); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.supersavedriving.driver.core.util.MD5Util; |
| | | import com.supersavedriving.driver.modular.system.util.httpClinet.HttpClientUtil; |
| | | import com.supersavedriving.driver.modular.system.util.httpClinet.HttpResult; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | private String APIKey = "zj42494b1bdd416b9762229af6b5cbbd"; |
| | | |
| | | private String SecretKey = "30323561316534653735613230316339"; |
| | | |
| | | @Autowired |
| | | private HttpClientUtil httpClientUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | Map<String, String> header = new HashMap<String, String>(3); |
| | | header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes()))); |
| | | header.put("Content-Type", "application/json;charset=utf-8"); |
| | | String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/binding", request, header, "json"); |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/binding", request, header, "json"); |
| | | String post = httpResult.getData(); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | if(post.indexOf("0000") != -1){ |
| | | JSONObject jsonObject = JSONObject.parseObject(post); |
| | |
| | | Map<String, String> header = new HashMap<String, String>(3); |
| | | header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes()))); |
| | | header.put("Content-Type", "application/json;charset=utf-8"); |
| | | String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/unbinding", request, header, "json"); |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/unbinding", request, header, "json"); |
| | | String post = httpResult.getData(); |
| | | JSONObject jsonObject = JSONObject.parseObject(post); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | if(jsonObject.getString("code").equals("0000")){ |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.supersavedriving.driver.modular.system.util.GaoDe.model.District; |
| | | import com.supersavedriving.driver.modular.system.util.httpClinet.HttpClientUtil; |
| | | import com.supersavedriving.driver.modular.system.util.httpClinet.HttpResult; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.supersavedriving.driver.modular.system.util.GaoDe.MapConfig.key; |
| | | |
| | | /** |
| | | * 地图工具类 |
| | |
| | | */ |
| | | public static Map<String, String> getDistance(String origins, String destination, Integer type){ |
| | | try { |
| | | String url = "https://restapi.amap.com/v3/distance?key=" + MapConfig.key + "&origins=" + origins + "&destination=" + destination + |
| | | String url = "https://restapi.amap.com/v3/distance?key=" + key + "&origins=" + origins + "&destination=" + destination + |
| | | "&type=" + type; |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); |
| | | if(httpResult.getCode() != 200){ |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 地址转换经纬度 |
| | | * @param address |
| | | * @return |
| | | */ |
| | | public static List<String> geocoding(String address){ |
| | | try { |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON&address=" + address; |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | String status = jsonObject.getString("status"); |
| | | List<String> list = new ArrayList<>(); |
| | | if(status.equals("1")){ |
| | | JSONArray geocodes = jsonObject.getJSONArray("geocodes"); |
| | | for(int i = 0; i < geocodes.size(); i++){ |
| | | String location = geocodes.getJSONObject(i).getString("location"); |
| | | list.add(location); |
| | | } |
| | | } |
| | | return list; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * @param lon |
| | | * @param lan |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static District geocode(String lon, String lan) { |
| | | try { |
| | | String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan; |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if(jsonObject.getString("status").equals("1")){ |
| | | JSONObject regeocode = jsonObject.getJSONObject("regeocode"); |
| | | JSONObject addressComponent = regeocode.getJSONObject("addressComponent"); |
| | | String address = regeocode.getString("formatted_address"); |
| | | map.put("address", address); |
| | | String code = addressComponent.getString("adcode"); |
| | | String province = addressComponent.getString("province"); |
| | | String city = addressComponent.getString("city"); |
| | | String district = addressComponent.getString("district"); |
| | | District district1 = new District(); |
| | | district1.setProvince(province); |
| | | district1.setProvinceCode(code.substring(0, 2) + "0000"); |
| | | district1.setCity(city); |
| | | district1.setCityCode(code.substring(0, 4) + "00"); |
| | | district1.setDistrict(district); |
| | | district1.setDistrictCode(code); |
| | | return district1; |
| | | } |
| | | logger.debug(httpResult.getData()); |
| | | return null; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.GaoDe.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 行政区域 |
| | | * @author pzb |
| | | * @Date 2023/2/25 11:40 |
| | | */ |
| | | @Data |
| | | public class District { |
| | | /** |
| | | * 省名称 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市名称 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | private String district; |
| | | /** |
| | | * 区县编号 |
| | | */ |
| | | private String districtCode; |
| | | } |
| | |
| | | import com.alipay.api.response.AlipayTradePrecreateResponse; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.alipay.api.response.AlipayTradeRefundResponse; |
| | | import com.supersavedriving.driver.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.apache.commons.collections.map.HashedMap; |
| | | import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| | | import org.dom4j.Document; |
| | |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath;//支付回调网关地址 |
| | | |
| | | @Autowired |
| | | private HttpClientUtil httpClientUtil; |
| | | |
| | | private Map<String, JSONObject> order = new HashMap<>();//存储支付订单用于主动查询支付结果 |
| | | |
| | |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()); |
| | | String body1 = HttpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData(); |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()); |
| | | String body1 = null; |
| | | try { |
| | | body1 = HttpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()); |
| | | String body1 = null; |
| | | try { |
| | | body1 = HttpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()); |
| | | String body1 = HttpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData(); |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.supersavedriving.driver.modular.system.warpper.PushOrderInfoWarpper; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 推送订单数据 |
| | | * @param id |
| | | * @param type |
| | | * @param pushOrderInfoWarpper |
| | | */ |
| | | public void pushOrderInfo(Integer id, Integer type, PushOrderInfoWarpper pushOrderInfoWarpper){ |
| | | JSONObject msg = new JSONObject(); |
| | | msg.put("code", 200); |
| | | msg.put("msg", "SUCCESS"); |
| | | msg.put("method", "ORDER_INFO"); |
| | | msg.put("data", pushOrderInfoWarpper); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转单成功推送 |
| | | * @param id |
| | | * @param type |
| | | */ |
| | | public void pushTransferSuccessful(Integer id, Integer type, Long orderId){ |
| | | JSONObject msg = new JSONObject(); |
| | | msg.put("code", 200); |
| | | msg.put("msg", "SUCCESS"); |
| | | msg.put("method", "TRANSFER_SUCCESS"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | map.put("orderId", orderId); |
| | | msg.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | logger.debug(jsonObject1.getString("msg")); |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param header 自定义请求头 |
| | | * @return |
| | | */ |
| | | public HttpResult pushHttpRequsetXml(String url, String xml, Map<String, String> header) throws Exception{ |
| | | public static HttpResult pushHttpRequsetXml(String url, String xml, Map<String, String> header) throws Exception{ |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setConfig(getRequestConfig()); |
| | | for(String key : header.keySet()){ |
| | |
| | | int statusCode = httpResponse.getStatusLine().getStatusCode(); |
| | | String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); |
| | | HttpResult httpResult = HttpResult.getHttpResult(statusCode, content); |
| | | this.close(httpResponse); |
| | | close(httpResponse); |
| | | return httpResult; |
| | | } |
| | | |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.util.juhe; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 天气相关城市 |
| | | * @author pzb |
| | | * @Date 2023/2/25 10:56 |
| | | */ |
| | | @Data |
| | | @TableName("t_weather_city") |
| | | public class WeatherCityInfo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.INPUT) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 区 |
| | | */ |
| | | @TableField("district") |
| | | private String district; |
| | | } |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 天气工具类 |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取支持城市列表 |
| | | * @return |
| | | */ |
| | | public static List<WeatherCityInfo> queryCityList(){ |
| | | String url = "http://apis.juhe.cn/simpleWeather/cityList?key=" + key; |
| | | HttpResult httpResult = null; |
| | | try { |
| | | httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "json"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(httpResult.getCode() != 200){ |
| | | logger.debug("查询支持城市失败:" + httpResult.getData()); |
| | | return null; |
| | | } |
| | | String data = httpResult.getData(); |
| | | JSONObject jsonObject = JSON.parseObject(data); |
| | | Integer error_code = jsonObject.getInteger("error_code"); |
| | | if(0 != error_code){ |
| | | logger.debug("查询支持城失败:" + jsonObject.getString("reason")); |
| | | return null; |
| | | } |
| | | JSONArray result = jsonObject.getJSONArray("result"); |
| | | List<WeatherCityInfo> weatherCities = result.toJavaList(WeatherCityInfo.class); |
| | | return weatherCities; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class OrderEndAddressWarpper { |
| | | @ApiModelProperty(value = "订单id", dataType = "long", required = true) |
| | | private Long orderId; |
| | | @ApiModelProperty(value = "终点地址(106上传)", dataType = "string", required = true) |
| | | private String endAddress; |
| | | @ApiModelProperty(value = "终点纬度(106上传)", dataType = "string", required = true) |
| | | private String endLat; |
| | | @ApiModelProperty(value = "终点经度(106上传)", dataType = "string", required = true) |
| | | private String endLng; |
| | | } |
| | |
| | | private Double actualMileage; |
| | | @ApiModelProperty("行驶时间") |
| | | private Integer travelTime; |
| | | @ApiModelProperty("订单状态(101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待评价,108=已完成,201=转单中,301=已取消)") |
| | | @ApiModelProperty("订单状态(101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待支付,108=待评价,109=已完成,201=转单中,301=已取消,401=等待中)") |
| | | private Integer state; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 订单金额 |
| | | * @author pzb |
| | | * @Date 2023/2/25 15:11 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class OrderPriceWarpper { |
| | | @ApiModelProperty("订单金额") |
| | | private Double orderMoney; |
| | | @ApiModelProperty("总行驶里程") |
| | | private Double actualMileage; |
| | | @ApiModelProperty("总行驶时间") |
| | | private Integer travelTime; |
| | | @ApiModelProperty("起步里程") |
| | | private Double startDistance; |
| | | @ApiModelProperty("起步价") |
| | | private Double startPrice; |
| | | @ApiModelProperty("超过起步里程") |
| | | private Double overDriveDistance; |
| | | @ApiModelProperty("超过起步里程费") |
| | | private Double overDrivePrice; |
| | | @ApiModelProperty("长途里程") |
| | | private Double longDistance; |
| | | @ApiModelProperty("长途费") |
| | | private Double longDistancePrice; |
| | | @ApiModelProperty("超过长途里程") |
| | | private Double overLongDistance; |
| | | @ApiModelProperty("超过长途里程费") |
| | | private Double overLongDistancePrice; |
| | | @ApiModelProperty("等待时长") |
| | | private Integer waitTime; |
| | | @ApiModelProperty("等待费") |
| | | private Double waitTimePrice; |
| | | @ApiModelProperty("超出等待时长") |
| | | private Integer outWaitTime; |
| | | @ApiModelProperty("超出等待费") |
| | | private Double outWaitTimePrice; |
| | | @ApiModelProperty("恶劣天气里程") |
| | | private Double badWeatherDistance; |
| | | @ApiModelProperty("恶劣天气费") |
| | | private Double badWeatherPrice; |
| | | @ApiModelProperty("恶劣天气超出里程") |
| | | private Double overBadWeatherDistance; |
| | | @ApiModelProperty("恶劣天气超出里程费") |
| | | private Double overBadWeatherPrice; |
| | | @ApiModelProperty("折扣金额") |
| | | private Double discountAmount; |
| | | @ApiModelProperty("微信收款码") |
| | | private String wxCollectionCode; |
| | | @ApiModelProperty("支付宝收款码") |
| | | private String zfbCollectionCode; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProcessOperationsWarpper { |
| | | @ApiModelProperty(value = "订单id", dataType = "long", required = true) |
| | | private Long orderId; |
| | | @ApiModelProperty(value = "状态码(103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,401=等待中)", dataType = "int", required = true) |
| | | private Integer state; |
| | | @ApiModelProperty(value = "终点地址(106上传)", dataType = "string", required = false) |
| | | private String endAddress; |
| | | @ApiModelProperty(value = "终点纬度(106上传)", dataType = "string", required = false) |
| | | private String endLat; |
| | | @ApiModelProperty(value = "终点经度(106上传)", dataType = "string", required = false) |
| | | private String endLng; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class PushOrderInfoWarpper { |
| | | @ApiModelProperty("订单id") |
| | | private Long id; |
| | | @ApiModelProperty("司机纬度") |
| | | private String driverLat; |
| | | @ApiModelProperty("司机经度") |
| | | private String driverLng; |
| | | @ApiModelProperty("等待时长(分钟)") |
| | | private Integer waitTime; |
| | | @ApiModelProperty("行驶里程(公里)") |
| | | private Double actualMileage; |
| | | @ApiModelProperty("行驶时间(分钟)") |
| | | private Integer travelTime; |
| | | @ApiModelProperty("101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待支付,108=待评价,109=已完成,201=转单中,301=已取消,401=等待中") |
| | | private Integer state; |
| | | } |
| | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://admin:123456@127.0.0.1:27017/admin |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | |
| | | <!-- 4 最终的策略: |
| | | 基本策略(root级) + 根据profile在启动时, logger标签中定制化package日志级别(优先级高于上面的root级)--> |
| | | <springProfile name="dev"> |
| | | <root level="debug"> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE" /> |
| | | <appender-ref ref="DEBUG_FILE" /> |
| | | <appender-ref ref="INFO_FILE" /> |
New file |
| | |
| | | //package com.supersavedriving.driver; |
| | | // |
| | | //import com.supersavedriving.driver.modular.system.model.WeatherCity; |
| | | //import com.supersavedriving.driver.modular.system.service.IWeatherCityService; |
| | | //import com.supersavedriving.driver.modular.system.util.juhe.WeatherCityInfo; |
| | | //import com.supersavedriving.driver.modular.system.util.juhe.WeatherUtil; |
| | | //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; |
| | | // |
| | | //import java.util.ArrayList; |
| | | //import java.util.List; |
| | | // |
| | | //@RunWith(SpringRunner.class) |
| | | //@SpringBootTest |
| | | //public class GunsApplicationTest { |
| | | // |
| | | // @Autowired |
| | | // private IWeatherCityService weatherCityService; |
| | | // |
| | | // |
| | | // @Test |
| | | // public void test(){ |
| | | // List<WeatherCityInfo> weatherCities = WeatherUtil.queryCityList(); |
| | | // List<WeatherCity> list = new ArrayList<>(); |
| | | // for (WeatherCityInfo weatherCityInfo : weatherCities) { |
| | | // WeatherCity weatherCity1 = new WeatherCity(); |
| | | // BeanUtils.copyProperties(weatherCityInfo, weatherCity1); |
| | | // list.add(weatherCity1); |
| | | // } |
| | | // weatherCityService.insertBatch(list); |
| | | // } |
| | | //} |