| | |
| | | import com.stylefeng.guns.modular.shunfeng.task.base.QuartzManager; |
| | | import com.stylefeng.guns.modular.shunfeng.task.base.TimeJobType; |
| | | import com.stylefeng.guns.modular.shunfeng.task.jobs.CourseExamineRide; |
| | | import com.stylefeng.guns.modular.shunfeng.util.DateUtil; |
| | | import com.stylefeng.guns.modular.shunfeng.util.OrderUtil; |
| | | import com.stylefeng.guns.modular.shunfeng.util.OrdersUtil; |
| | | import com.stylefeng.guns.modular.shunfeng.util.SensitiveWordUtil; |
| | | import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper; |
| | | import com.stylefeng.guns.modular.system.model.SensitiveWords; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.*; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/authentication") |
| | | @PostMapping("/authentication") |
| | | @ApiOperation(value = "发布顺风车行程实名认证", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "int"), |
| | | @ApiImplicitParam(name = "name", value = "姓名", dataType = "string"), |
| | | @ApiImplicitParam(name = "identity", value = "身份证", dataType = "string"), |
| | | @ApiImplicitParam(name = "type", value = "1用户,2司机", dataType = "int"), |
| | | }) |
| | | public Object authentication(Integer userId,String name,String identity,Integer type) { |
| | | try { |
| | | if (userId == null || userId == 0) { |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/faceAuthentication") |
| | | @PostMapping("/faceAuthentication") |
| | | @ApiOperation(value = "人脸识别", httpMethod = "POST") |
| | | public Object authentication(Integer userId,String headImg) { |
| | | // try { |
| | | // if (userId == null || userId == 0) { |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/getBrandList") |
| | | @GetMapping("/getBrandList") |
| | | @ApiOperation(value = "获取车辆品牌列表", httpMethod = "GET") |
| | | public Object getBrandList(){ |
| | | try { |
| | | List<Brand> brands=brandService.selectList(null); |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/homeOrderCount") |
| | | @GetMapping("/homeOrderCount") |
| | | @ApiOperation(value = "顺风车首页(待处理订单数)", httpMethod = "GET") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "int"), |
| | | @ApiImplicitParam(name = "type", value = "1用户,2司机", dataType = "int"), |
| | | }) |
| | | public Object homeOrderCount(Integer userId,Integer type){ |
| | | try { |
| | | if(ToolUtil.isEmpty(userId)){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/homeOrderList") |
| | | @GetMapping("/homeOrderList") |
| | | @ApiOperation(value = "顺风车首页(待处理订单列表)", httpMethod = "GET") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "int"), |
| | | @ApiImplicitParam(name = "type", value = "1用户待处理订单:进行中的订单 2司机待处理订单:进行中的订单 3我的顺风车行程", dataType = "int"), |
| | | }) |
| | | public Object homeOrderList(Integer userId,Integer type,Integer current,Integer size){ |
| | | try { |
| | | if(ToolUtil.isEmpty(userId)){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/orderPrice") |
| | | @PostMapping("/orderPrice") |
| | | @ApiOperation(value = "根据输入的开始结束经纬度和人数获取订单价格", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "num", value = "人数", dataType = "int"), |
| | | @ApiImplicitParam(name = "startLat", value = "起点纬度", dataType = "double"), |
| | | @ApiImplicitParam(name = "startLon", value = "起点经度", dataType = "double"), |
| | | @ApiImplicitParam(name = "endLat", value = "终点纬度", dataType = "double"), |
| | | @ApiImplicitParam(name = "endLon", value = "终点经度", dataType = "double"), |
| | | }) |
| | | public Object orderPrice(Integer num,Double startLat,Double startLon,Double endLat,Double endLon){ |
| | | try { |
| | | String locationS=startLon+","+startLat; |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/userAddOrder") |
| | | @PostMapping("/userAddOrder") |
| | | @ApiOperation(value = "用户下单", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "int"), |
| | | @ApiImplicitParam(name = "startTime", value = "出行时间", dataType = "string"), |
| | | @ApiImplicitParam(name = "num", value = "出行人数", dataType = "int"), |
| | | @ApiImplicitParam(name = "startName", value = "起点名称", dataType = "string"), |
| | | @ApiImplicitParam(name = "startLat", value = "起点纬度", dataType = "double"), |
| | | @ApiImplicitParam(name = "startLon", value = "起点经度", dataType = "double"), |
| | | @ApiImplicitParam(name = "endName", value = "终点名称", dataType = "string"), |
| | | @ApiImplicitParam(name = "endLat", value = "终点纬度", dataType = "double"), |
| | | @ApiImplicitParam(name = "endLon", value = "终点经度", dataType = "double"), |
| | | @ApiImplicitParam(name = "money", value = "金额", dataType = "double"), |
| | | @ApiImplicitParam(name = "isDai 1=是 2=否", value = "是否代喊 1=是 2=否", dataType = "int"), |
| | | @ApiImplicitParam(name = "lxPhone", value = "联系电话", dataType = "string"), |
| | | }) |
| | | public Object addOrder(Integer userId,String startTime,Integer num,String startName,Double startLat,Double startLon,Double endLat,Double endLon, |
| | | String endName,Double money,Integer isDai,String lxPhone){ |
| | | try { |
| | |
| | | } |
| | | } |
| | | OrderRide orderRide=new OrderRide(); |
| | | orderRide.setOrderNum(OrderUtil.getOrderNoForPrefix("ride")); |
| | | orderRide.setOrderNum(OrdersUtil.getOrderNoForPrefix("ride")); |
| | | orderRide.setPlatformMoney(platformMoney); |
| | | orderRide.setAddTime(new Date()); |
| | | orderRide.setUserId(userId); |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/driverAddTravel") |
| | | @PostMapping("/driverAddTravel") |
| | | @ApiOperation(value = "司机创建行程", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "driverId", value = "司机id", dataType = "int"), |
| | | @ApiImplicitParam(name = "startTime", value = "出行时间", dataType = "string"), |
| | | @ApiImplicitParam(name = "num", value = "出行人数", dataType = "int"), |
| | | @ApiImplicitParam(name = "startName", value = "起点名称", dataType = "string"), |
| | | @ApiImplicitParam(name = "startLat", value = "起点纬度", dataType = "double"), |
| | | @ApiImplicitParam(name = "startLon", value = "起点经度", dataType = "double"), |
| | | @ApiImplicitParam(name = "endName", value = "终点名称", dataType = "string"), |
| | | @ApiImplicitParam(name = "endLat", value = "终点纬度", dataType = "double"), |
| | | @ApiImplicitParam(name = "endLon", value = "终点经度", dataType = "double"), |
| | | }) |
| | | public Object driverAddTravel(Integer driverId,String startTime,Integer num,String startName,String endName,Double startLat,Double startLon,Double endLat,Double endLon){ |
| | | try { |
| | | if(ToolUtil.isEmpty(driverId)){ |
| | |
| | | } |
| | | /*1一个司机可以创建多个行程*/ |
| | | OrderTravel orderTravel=new OrderTravel(); |
| | | orderTravel.setOrderNum(OrderUtil.getOrderNoForPrefix("travel")); |
| | | orderTravel.setOrderNum(OrdersUtil.getOrderNoForPrefix("travel")); |
| | | orderTravel.setAddTime(new Date()); |
| | | orderTravel.setDriverId(driverId); |
| | | orderTravel.setStartTime(DateUtil.getDate(startTime,"yyyy-MM-dd HH:mm")); |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/driverAudit") |
| | | @PostMapping("/driverAudit") |
| | | @ApiOperation(value = "用户申请顺风车司机/修改司机资料", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "int"), |
| | | @ApiImplicitParam(name = "brandId", value = "品牌id", dataType = "int"), |
| | | @ApiImplicitParam(name = "driverId", value = "司机id", dataType = "int"), |
| | | @ApiImplicitParam(name = "carType", value = "车辆品牌", dataType = "string"), |
| | | @ApiImplicitParam(name = "carNum", value = "车牌", dataType = "string"), |
| | | @ApiImplicitParam(name = "inviteCodeRide", value = "别人的邀请码", dataType = "string"), |
| | | @ApiImplicitParam(name = "license", value = "驾驶证号", dataType = "string"), |
| | | @ApiImplicitParam(name = "licenseImg", value = "驾驶证图片", dataType = "string"), |
| | | @ApiImplicitParam(name = "comInsuranceTime", value = "交强险到期时间", dataType = "string"), |
| | | @ApiImplicitParam(name = "comInsuranceImg", value = "交强险照片", dataType = "string"), |
| | | @ApiImplicitParam(name = "businessInsuranceTime", value = "商业险到期时间", dataType = "string"), |
| | | @ApiImplicitParam(name = "businessInsuranceImg", value = "商业险图片", dataType = "string"), |
| | | @ApiImplicitParam(name = "dutyInsuranceTime", value = "驾乘人员责任险到期时间", dataType = "string"), |
| | | @ApiImplicitParam(name = "dutyInsuranceImg", value = "驾乘人员责任险照片", dataType = "string"), |
| | | @ApiImplicitParam(name = "annualInspectionTime", value = "年检到期时间", dataType = "string"), |
| | | @ApiImplicitParam(name = "annualInspectionImg", value = "年检图片", dataType = "string"), |
| | | }) |
| | | public Object driverAudit(Integer userId,Integer brandId,Integer driverId,String carType,String carNum,String inviteCodeRide,String license,String licenseImg,String comInsuranceTime,String comInsuranceImg, |
| | | String businessInsuranceTime,String businessInsuranceImg,String dutyInsuranceTime,String dutyInsuranceImg,String annualInspectionTime,String annualInspectionImg){ |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/driverInfo") |
| | | @GetMapping("/driverInfo") |
| | | @ApiOperation(value = "获取司机资料", httpMethod = "GET") |
| | | public Object driverInfo(Integer driverId){ |
| | | try { |
| | | if(ToolUtil.isEmpty(driverId)){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/cancelServiceMoney") |
| | | @GetMapping("/cancelServiceMoney") |
| | | @ApiOperation(value = "司机用户获取取消的服务费(同时计算退款金额)", httpMethod = "GET") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "int"), |
| | | @ApiImplicitParam(name = "type", value = "1用户,2司机", dataType = "int") |
| | | }) |
| | | public Object cancelServiceMoney(Integer orderId,Integer type){ |
| | | try { |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/userCancel") |
| | | @PostMapping("/userCancel") |
| | | @ApiOperation(value = "用户订单取消 待出行之前才可以取消", httpMethod = "POST") |
| | | public Object userCancel(Integer orderId){ |
| | | try { |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | |
| | | } |
| | | if(orderRide.getTuiMoney()>0){ |
| | | Financial financial= financialService.selectOne(new EntityWrapper<Financial>().eq("orderNum",orderRide.getOrderNum())); |
| | | String finNum=OrderUtil.getOrderNoForPrefix("fin"); |
| | | String finNum=OrdersUtil.getOrderNoForPrefix("fin"); |
| | | //todo 退款金额大于0需要退款 |
| | | if(orderRide.getPayType()==1){//余额 |
| | | UserInfo userInfo=userInfoService.selectById(orderRide.getUserId()); |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/driverCancel") |
| | | @PostMapping("/driverCancel") |
| | | @ApiOperation(value = "司机行程取消", httpMethod = "POST") |
| | | public Object driverCancel(Integer orderId){ |
| | | try { |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | |
| | | f.setMoney(orderTravel.getServiceMoney()); |
| | | f.setPwType(9);//9=顺风车取消服务费 |
| | | f.setOrderNum(orderTravel.getOrderNum()); |
| | | String finNum=OrderUtil.getOrderNoForPrefix("fin"); |
| | | String finNum=OrdersUtil.getOrderNoForPrefix("fin"); |
| | | f.setLsType(finNum); |
| | | f.setUserId(driverRide.getUserId()); |
| | | f.setOrderType(4); |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/driverOperation") |
| | | @PostMapping("/driverOperation") |
| | | @ApiOperation(value = "司机确认同行,接到乘客,送达乘客", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userOrderId", value = "用户订单id", dataType = "int"), |
| | | @ApiImplicitParam(name = "type", value = "1确认同行 2接到乘客,3送达乘客", dataType = "int"), |
| | | @ApiImplicitParam(name = "driverOrderId", value = "司机订单id", dataType = "int") |
| | | }) |
| | | @Transactional |
| | | public Object driverOperation(Integer userOrderId,Integer type,Integer driverOrderId){ |
| | | try { |
| | |
| | | f.setPayType("1");//余额 |
| | | f.setMoney(orderRide.getMoney()-orderRide.getPlatformMoney());//司机提成 |
| | | f.setPwType(11);//顺风车司机提成 |
| | | f.setLsType(OrderUtil.getOrderNoForPrefix("finan")); |
| | | f.setLsType(OrdersUtil.getOrderNoForPrefix("finan")); |
| | | f.setUserId(userInfo.getId()); |
| | | f.setOrderType(4); |
| | | f.setLx(1); |
| | |
| | | f.setPayType("1");//余额 |
| | | f.setMoney(money);//邀请金额 |
| | | f.setPwType(10);//分享收益 |
| | | f.setLsType(OrderUtil.getOrderNoForPrefix("finan")); |
| | | f.setLsType(OrdersUtil.getOrderNoForPrefix("finan")); |
| | | f.setUserId(userInfo1.getId()); |
| | | f.setOrderType(4); |
| | | f.setLx(1); |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/evaluate") |
| | | @PostMapping("/evaluate") |
| | | @ApiOperation(value = "用户评价", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "int"), |
| | | @ApiImplicitParam(name = "driverId", value = "司机id", dataType = "int"), |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "int"), |
| | | @ApiImplicitParam(name = "score", value = "评分", dataType = "int"), |
| | | @ApiImplicitParam(name = "content", value = "评价内容", dataType = "string") |
| | | }) |
| | | public Object evaluate(Integer orderId,Integer driverId,Integer userId,Integer score,String content){ |
| | | try { |
| | | if(userId == null || userId == 0){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/complaints") |
| | | @PostMapping("/complaints") |
| | | @ApiOperation(value = "投诉", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "driverId", value = "司机id", dataType = "int"), |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "int"), |
| | | @ApiImplicitParam(name = "content", value = "投诉内容", dataType = "string"), |
| | | @ApiImplicitParam(name = "reMark", value = "备注", dataType = "string"), |
| | | @ApiImplicitParam(name = "type", value = "1=顺风车用户,2=顺风车司机", dataType = "int"), |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "int") |
| | | }) |
| | | public Object complaints(Integer driverId,Integer userId,String content,String reMark,Integer type,Integer orderId) { |
| | | try { |
| | | if (userId == null || userId == 0) { |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/userInvite") |
| | | @PostMapping("/userInvite") |
| | | @ApiOperation(value = "用户邀请司机接单(需要发送消息)", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "int"), |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "int") |
| | | }) |
| | | public Object myOrders(Integer orderId,Integer userId){ |
| | | try { |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/userMatchingOrderList") |
| | | @PostMapping("/userMatchingOrderList") |
| | | @ApiOperation(value = "用户订单匹配列表页面,用户订单去匹配司机的行程", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "int"), |
| | | @ApiImplicitParam(name = "type", value = "1默认排序(根据线路、时间,人数综合匹配排序721),2时间最早,3距离最近", dataType = "int"), |
| | | @ApiImplicitParam(name = "lon", value = "经度", dataType = "double"), |
| | | @ApiImplicitParam(name = "lat", value = "纬度", dataType = "double"), |
| | | }) |
| | | public Object userMatchingOrderList(Integer orderId,Integer current,Integer size,Integer type,Double lon,Double lat){ |
| | | try { |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/driverMatchingOrderList") |
| | | @PostMapping("/driverMatchingOrderList") |
| | | @ApiOperation(value = "司机订单匹配列表页面(司机的订单去匹配乘客订单)", httpMethod = "POST") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "int"), |
| | | @ApiImplicitParam(name = "type", value = "1默认排序(根据线路、时间,人数综合匹配排序721),2时间最早,3距离最近,4价格最低", dataType = "int"), |
| | | @ApiImplicitParam(name = "lon", value = "经度", dataType = "double"), |
| | | @ApiImplicitParam(name = "lat", value = "纬度", dataType = "double"), |
| | | }) |
| | | public Object driverMatchingOrderList(Integer orderId,Integer current,Integer size,Integer type,Double lon,Double lat){ |
| | | try { |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/orderInfo") |
| | | @GetMapping("/orderInfo") |
| | | @ApiOperation(value = "订单详情", httpMethod = "GET") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "int"), |
| | | @ApiImplicitParam(name = "type", value = "1=用户订单,2=司机订单", dataType = "int"), |
| | | @ApiImplicitParam(name = "lon", value = "经度", dataType = "double"), |
| | | @ApiImplicitParam(name = "lat", value = "纬度", dataType = "double"), |
| | | }) |
| | | public Object orderInfo(Integer orderId,Integer type,Double lon,Double lat) { |
| | | try { |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/checkInviteCode") |
| | | @PostMapping("/checkInviteCode") |
| | | @ApiOperation(value = "验证输入的邀请码是否正确", httpMethod = "POST") |
| | | public Object orderInfo(String inviteCode,Integer type) { |
| | | try { |
| | | if(ToolUtil.isEmpty(inviteCode)){ |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/checkInsuranceTime") |
| | | @PostMapping("/checkInsuranceTime") |
| | | @ApiOperation(value = "验证司机证件是否过期", httpMethod = "POST") |
| | | public Object orderInfo(Integer driverId) { |
| | | try { |
| | | if(ToolUtil.isEmpty(driverId)){ |