From e52227b01983146f2e3c81dc575141d8b9889497 Mon Sep 17 00:00:00 2001 From: yanghb <yanghb> Date: 星期五, 21 四月 2023 10:16:30 +0800 Subject: [PATCH] 代码调整 --- DriverTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java | 452 ++++++++++++++++++++++---------------------------------- 1 files changed, 178 insertions(+), 274 deletions(-) diff --git a/DriverTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java b/DriverTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java index 62d1727..770d8b3 100644 --- a/DriverTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java +++ b/DriverTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java @@ -1,34 +1,34 @@ package com.stylefeng.guns.modular.api; import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.mapper.EntityWrapper; -import com.stylefeng.guns.core.util.DateUtil; -import com.stylefeng.guns.core.util.ToolUtil; -import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityInfoWrapper; -import com.stylefeng.guns.modular.crossCity.warpper.OrderWarpper; -import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; +import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; +import com.stylefeng.guns.modular.system.model.Driver; import com.stylefeng.guns.modular.system.model.Reassign; -import com.stylefeng.guns.modular.system.model.SysTimeoutMoney; -import com.stylefeng.guns.modular.system.model.TimeOutAppeal; -import com.stylefeng.guns.modular.system.service.*; -import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; -import com.stylefeng.guns.modular.system.util.PushUtil; -import com.stylefeng.guns.modular.system.util.ResultUtil; -import com.stylefeng.guns.modular.system.util.SystemException; -import com.stylefeng.guns.modular.system.warpper.*; +import com.stylefeng.guns.modular.system.service.IDriverService; +import com.stylefeng.guns.modular.system.service.IOrderService; +import com.stylefeng.guns.modular.system.service.IReassignService; +import com.stylefeng.guns.modular.system.service.ITransactionDetailsService; +import com.stylefeng.guns.modular.system.util.*; +import com.stylefeng.guns.modular.system.warpper.BaseWarpper; +import com.stylefeng.guns.modular.system.warpper.MoneyInfoWarpper; +import com.stylefeng.guns.modular.system.warpper.OrderInfoWarpper; +import com.stylefeng.guns.modular.system.warpper.OrderListWarpper; 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.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -57,6 +57,18 @@ @Autowired private IOrderLogisticsService orderLogisticsService; + @Autowired + private PayMoneyUtil payMoneyUtil; + + @Autowired + private IOrderCrossCityService orderCrossCityService; + + @Autowired + private ITransactionDetailsService transactionDetailsService; + + @Value("${callbackPath}") + private String callbackPath; + @@ -75,7 +87,7 @@ @PostMapping("/api/order/queryOrderList") @ApiOperation(value = "获取首页订单列表", tags = {"司机端-首页"}, notes = "") @ApiImplicitParams({ - @ApiImplicitParam(value = "数据类型(1=服务中,2=待服务,3=助老模式接单)", name = "state", required = true, dataType = "int"), + @ApiImplicitParam(value = "数据类型(1=服务中,2=待服务)", name = "state", required = true, dataType = "int"), @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") @@ -207,7 +219,7 @@ @ApiOperation(value = "获取抢单界面的订单详情", tags = {"司机端-首页"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(value = "当前定位经度", name = "lon", required = true, dataType = "string"), @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "string"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") @@ -235,7 +247,7 @@ @ApiOperation(value = "司机抢单操作", tags = {"司机端-首页"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) public ResultUtil grabOrder(Integer orderId, Integer orderType, HttpServletRequest request){ @@ -251,10 +263,6 @@ } } - - @Autowired - private ISysTimeoutMoneyService sysTimeoutMoneyService; - /** * 获取服务中页面订单详情 * @param orderId @@ -266,91 +274,13 @@ @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) public ResultUtil<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType){ try { Map<String, Object> map = orderService.queryOrderInfo(orderId, orderType); - - if (orderType == 4 || orderType == 5){ - - SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null); - map.put("timeOutMoney",Double.parseDouble(map.get("timeOutMoney").toString())); - map.put("note","配送超过" + sysTimeoutMoney.getTimeOut() + "分钟扣订单的" + sysTimeoutMoney.getDeductMoney() + "%费用"); - - TimeOutAppeal timeOutAppeal = timeAppealService.selectOne(new EntityWrapper<TimeOutAppeal>().eq("orderId",orderId)); - if (ToolUtil.isNotEmpty(timeOutAppeal)){ - if (timeOutAppeal.getState() == 1){ - map.put("appealState",1); - map.put("returnMoney",0); - }else if (timeOutAppeal.getState() == 2){ - map.put("appealState",2); - map.put("returnMoney",timeOutAppeal.getReturnMoney()==null?0:timeOutAppeal.getReturnMoney()); - }else { - map.put("appealState",2); - map.put("returnMoney",0); - } - } - } return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); - //return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); - }catch (Exception e){ - e.printStackTrace(); - return ResultUtil.runErr(); - } - } - - @ResponseBody - @PostMapping("/api/order/queryOrderInfo1") - @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), - @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") - }) - public ResultUtil<OrderWarpper> queryOrderInfo1(Integer orderId, Integer orderType){ - try { - Map<String, Object> map = orderService.queryOrderInfo(orderId, 7); - - if (orderType == 4 || orderType == 5){ - - SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null); - map.put("timeOutMoney",Double.parseDouble(map.get("timeOutMoney").toString())); - map.put("note","配送超过" + sysTimeoutMoney.getTimeOut() + "分钟扣订单的" + sysTimeoutMoney.getDeductMoney() + "%费用"); - - TimeOutAppeal timeOutAppeal = timeAppealService.selectOne(new EntityWrapper<TimeOutAppeal>().eq("orderId",orderId)); - if (ToolUtil.isNotEmpty(timeOutAppeal)){ - if (timeOutAppeal.getState() == 1){ - map.put("appealState",1); - map.put("returnMoney",0); - }else if (timeOutAppeal.getState() == 2){ - map.put("appealState",2); - map.put("returnMoney",timeOutAppeal.getReturnMoney()==null?0:timeOutAppeal.getReturnMoney()); - }else { - map.put("appealState",2); - map.put("returnMoney",0); - } - } - } - OrderWarpper orderWarpper = OrderWarpper.getOrderWarpper(map); - List<OrderCrossCityInfoWrapper> orders = orderWarpper.getOrders(); - Integer peopleNumber=0; - Double totalMoney=0d; - Double serverMoney=0d; - for(OrderCrossCityInfoWrapper orderCrossCityInfoWrapper:orders){ - - Map<String, Object> map1 = orderService.queryMoneyInfo(orderCrossCityInfoWrapper.getOrderId(), 1); - MoneyInfo1Warpper moneyInfo1Warpper = MoneyInfo1Warpper.getMoneyInfoWarpper(map1); - orderCrossCityInfoWrapper.setMoneyInfo1Warpper(moneyInfo1Warpper); - peopleNumber=peopleNumber+orderCrossCityInfoWrapper.getPeopleNumber(); - totalMoney=totalMoney+moneyInfo1Warpper.getOrderMoney(); - } - orderWarpper.setPeopleNumber(peopleNumber); - orderWarpper.setTotalMoney(totalMoney); - orderWarpper.setOrders(orders); - return ResultUtil.success(orderWarpper); - //return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); }catch (Exception e){ e.printStackTrace(); return ResultUtil.runErr(); @@ -369,7 +299,7 @@ @ApiOperation(value = "获取改派支付金额", tags = {"司机端-服务中"}, notes = "返回金额为0不需要调用支付") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id(跨城多个订单使用逗号分隔)", name = "orderId", required = true, dataType = "string"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) public ResultUtil<BaseWarpper> queryReassignMoney(String orderId, Integer orderType){ @@ -400,7 +330,7 @@ @ApiOperation(value = "提交改派申请", tags = {"司机端-服务中"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(value = "改派支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = false, dataType = "int"), @ApiImplicitParam(value = "改派原因", name = "reason", required = true, dataType = "string"), @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"), @@ -437,20 +367,19 @@ @ApiOperation(value = "司机走流程操作", tags = {"司机端-服务中"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(value = "流程操作状态(3=开始出发预约点,4=到达预约点,5=开始服务,6=服务结束)", name = "state", required = true, dataType = "int"), @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "double"), @ApiImplicitParam(value = "当前纬度", name = "lat", required = true, dataType = "double"), - @ApiImplicitParam(value = "小件物流司机上传的图片,多个分号分隔", name = "driverImg", required = true, dataType = "string"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) - public ResultUtil process(Integer orderId, Integer orderType, Integer state, Double lon, Double lat, String driverImg, HttpServletRequest request){ + public ResultUtil process(Integer orderId, Integer orderType, Integer state, Double lon, Double lat, HttpServletRequest request){ try { Integer uid = driverService.getUserIdFormRedis(request); if(null == uid){ return ResultUtil.tokenErr(); } - return orderService.process(orderId, orderType, state, uid, lon, lat, driverImg); + return orderService.process(orderId, orderType, state, uid, lon, lat); }catch (Exception e){ e.printStackTrace(); return ResultUtil.runErr(); @@ -520,60 +449,6 @@ } } - @ResponseBody - @PostMapping("/api/order/cancleOrder") - @ApiOperation(value = "取消订单", tags = {"司机端-服务中"}, notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"), - @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") - }) - public ResultUtil cancleOrder(Integer orderId, Integer orderType){ - try{ - return orderService.cancleOrder(orderId, orderType); - }catch (Exception e){ - e.printStackTrace(); - return ResultUtil.runErr(); - } - } - @ResponseBody - @PostMapping("/api/order/updatePeopleNum") - @ApiOperation(value = "修改人数", tags = {"司机端-服务中"}, notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "人数", name = "peopleNum", required = true, dataType = "int"), - @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") - }) - public ResultUtil updatePeopleNum(Integer orderId, Integer peopleNum){ - try{ - - return orderService.updatePeopleNum(orderId, peopleNum); - }catch (Exception e){ - e.printStackTrace(); - return ResultUtil.runErr(); - } - } - - @ResponseBody - @PostMapping("/api/order/confirmFees1") - @ApiOperation(value = "1.0-司机确认费用", tags = {"司机端-服务中"}, notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"), - @ApiImplicitParam(value = "支付方式(1=OK平台收款,2=其他方式收款)", name = "type", required = true, dataType = "int"), - @ApiImplicitParam(value = "行程费用(出租车必传)", name = "travelFee", required = false, dataType = "double"), - @ApiImplicitParam(value = "附加费JSON数组[{\"id\":1,\"amount\":20.5}]", name = "additionalFee", required = false, dataType = "double"), - @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") - }) - public ResultUtil confirmFees1(Integer orderId, Integer orderType, Integer type, Double travelFee, String additionalFee){ - try{ - return orderService.confirmFees1(orderId, orderType, type, travelFee, additionalFee); - }catch (Exception e){ - e.printStackTrace(); - return ResultUtil.runErr(); - } - } - /** @@ -625,9 +500,6 @@ public ResultUtil<OrderInfoWarpper> queryToBePaidPage(Integer orderId, Integer orderType){ try { Map<String, Object> map = orderService.queryToBePaidPage(orderId, orderType); - if(null != map.get("telX")){ - map.put("phone", map.get("telX")); - } return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); }catch (Exception e){ e.printStackTrace(); @@ -663,6 +535,95 @@ } + /** + * 管理后台处理改派后的回退金额 + * @return + */ + @ResponseBody + @PostMapping("/base/order/reassignRollbackAmount") + public String reassignRollbackAmount(Integer reassignId){ + try { + Reassign reassign = reassignService.selectById(reassignId); + Driver driver = driverService.selectById(reassign.getOriginalDriverId()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + String out_trade_no = sdf.format(new Date()) + reassign.getOrderType() + reassign.getId(); + if(reassign.getPayType() == 1){//微信 + reassign.setRefundState(1); + reassignService.updateById(reassign); + Map<String, String> map = payMoneyUtil.wxRefund(reassign.getPayOrder(), out_trade_no, reassign.getMoney().toString(), reassign.getMoney().toString(), callbackPath + "/base/wxReassignRollback"); + String return_code = map.get("return_code"); + if(!"SUCCESS".equals(return_code)){ + return JSON.toJSONString(ResultUtil.error(map.get("return_msg"))); + } + } + if(reassign.getPayType() == 2){//支付宝 + reassign.setRefundState(1); + reassignService.updateById(reassign); + Map<String, String> map = payMoneyUtil.aliRefund(reassign.getPayOrder(), reassign.getMoney().toString()); + String code = map.get("code"); + if("10000".equals(code)){ + String trade_no = map.get("trade_no"); + reassign.setRefundCode(trade_no); + reassign.setRefundState(2); + reassignService.updateById(reassign); + }else{ + return JSON.toJSONString(ResultUtil.error(map.get("msg"))); + } + + } + if(reassign.getPayType() == 3){//余额 + reassign.setRefundState(2); + reassignService.updateById(reassign); + driver.setLaveBusinessMoney(driver.getLaveBusinessMoney() + reassign.getMoney()); + driver.setBalance(driver.getBalance() + reassign.getMoney()); + driverService.updateById(driver); + } + transactionDetailsService.saveData(driver.getId(), "司机改派回退", reassign.getMoney(), 1, 1, 2, reassign.getOrderType(), reassign.getOrderId()); + }catch (Exception e){ + e.printStackTrace(); + return JSON.toJSONString(ResultUtil.runErr()); + } + return JSON.toJSONString(ResultUtil.success()); + } + + + + + public void wxReassignRollback(HttpServletRequest request, HttpServletResponse response){ + try { + Map<String, String> map = payMoneyUtil.wxRefundCallback(request); + if(null != map){ + String refund_id = map.get("refund_id"); + String out_refund_no = map.get("out_refund_no"); + String result = map.get("result"); + String substring = out_refund_no.substring(17); + Integer type = Integer.valueOf(substring.substring(0, 1)); + Integer id = Integer.valueOf(substring.substring(1)); + Reassign reassign = reassignService.selectById(id); + if(reassign.getRefundState() == 2){ + return; + } + + reassign.setRefundState(2); + reassign.setRefundCode(refund_id); + reassignService.updateById(reassign); + transactionDetailsService.saveData(reassign.getOriginalDriverId(), "司机改派回退", reassign.getMoney(), 1, 1, 2, reassign.getOrderType(), reassign.getOrderId()); + switch (type){ + case 1: + break; + } + + PrintWriter out = response.getWriter(); + out.print(result); + out.flush(); + out.close(); + } + }catch (Exception e){ + e.printStackTrace(); + } + } + + @ResponseBody @@ -670,7 +631,7 @@ @ApiOperation(value = "提交改派申请", tags = {"司机端-服务中"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8公务出行)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(value = "改派支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = false, dataType = "int"), @ApiImplicitParam(value = "改派原因", name = "reason", required = true, dataType = "string"), @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"), @@ -692,7 +653,7 @@ @PostMapping("/base/order/test") public String test(String phoneA, String phoneB){ try { - Map<String, String> map = chinaMobileUtil.midAxbBindSend(phoneA, phoneB, (System.currentTimeMillis() + 86400000)); + Map<String, String> map = chinaMobileUtil.midAxbBindSend(phoneA, phoneB, 28); System.err.println(JSON.toJSONString(map)); }catch (Exception e){ e.printStackTrace(); @@ -705,7 +666,7 @@ @PostMapping("/base/order/test_") public String test(String bindId){ try { - Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(bindId, null, null); + Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(bindId); }catch (Exception e){ e.printStackTrace(); return ""; @@ -749,7 +710,7 @@ @ApiOperation(value = "接单后获取语音播报内容", tags = {"司机端-首页"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(value = "当前位置经度", name = "lon", required = true, dataType = "string"), @ApiImplicitParam(value = "当前位置纬度", name = "lat", required = true, dataType = "string"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") @@ -810,26 +771,6 @@ } } - - @ResponseBody - @PostMapping("/api/order/queryMoneyInfo1") - @ApiOperation(value = "1.0-获取订单费用明细", tags = {"司机端-服务中"}, notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车)", name = "orderType", required = true, dataType = "int"), - @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") - }) - public ResultUtil<MoneyInfo1Warpper> queryMoneyInfo1(Integer orderId, Integer orderType){ - try { - Map<String, Object> map = orderService.queryMoneyInfo(orderId, orderType); - return ResultUtil.success(MoneyInfo1Warpper.getMoneyInfoWarpper(map)); - }catch (Exception e){ - e.printStackTrace(); - return ResultUtil.runErr(); - } - } - - @ResponseBody @PostMapping("/api/order/fillInPickUpCode") @ApiOperation(value = "验证小件物流取件码", tags = {"司机端-服务中"}, notes = "") @@ -846,70 +787,6 @@ return ResultUtil.runErr(); } } - - - @ResponseBody - @PostMapping("/api/order/turnAppeal") - @ApiOperation(value = "跳转到申诉", tags = {"司机端-服务中"}, notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") - }) - public ResultUtil<AppealWrapper> turnAppeal(Integer orderId){ - try { - OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); - Map<String,Object> map = new HashMap<>(); - map.put("arriveTimeExpect",DateUtil.getTime(orderLogistics.getArriveTimeExpect())); -// map.put("deductMoney",orderLogistics.getTimeOutMoney()); -// map.put("endServiceTime",orderLogistics.getEndServiceTime()); - map.put("travelTime",DateUtil.getTime(orderLogistics.getTravelTime())); - map.put("endServiceTime",DateUtil.getTime(orderLogistics.getEndServiceTime())); - if (ToolUtil.isNotEmpty(orderLogistics.getArriveTimeExpect()) && ToolUtil.isNotEmpty(orderLogistics.getEndServiceTime())){ - map.put("timeOut", DateUtil.CalTime(DateUtil.getTime(orderLogistics.getEndServiceTime()),DateUtil.getTime(orderLogistics.getArriveTimeExpect()))); - }else { - map.put("timeOut",0); - } - return ResultUtil.success(AppealWrapper.getAppealWrapper(map)); - }catch (Exception e){ - e.printStackTrace(); - return ResultUtil.runErr(); - } - } - - @Autowired - private ITimeOutAppealService timeAppealService; - - @ResponseBody - @PostMapping("/api/order/submitAppeal") - @ApiOperation(value = "提交申诉", tags = {"司机端-服务中"}, notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "申诉内容", name = "content", required = true, dataType = "string"), - @ApiImplicitParam(value = "申诉图片(多张用分号;隔开)", name = "imgList", required = true, dataType = "string"), - @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") - }) - public ResultUtil submitAppeal(HttpServletRequest request, Integer orderId, String content, String imgList){ - try { - Integer uid = driverService.getUserIdFormRedis(request); - if(null == uid){ - return ResultUtil.tokenErr(); - } - TimeOutAppeal timeAppeal = new TimeOutAppeal(); - timeAppeal.setOrderId(orderId); - timeAppeal.setDriverId(uid); - timeAppeal.setCreateTime(new Date()); - timeAppeal.setContent(content); - timeAppeal.setImgList(imgList); - timeAppealService.insert(timeAppeal); - - return ResultUtil.success(); - }catch (Exception e){ - e.printStackTrace(); - return ResultUtil.runErr(); - } - } - - @ResponseBody @PostMapping("/api/order/makeUpTheDifference") @@ -945,43 +822,70 @@ } } + /** - * 管理后台发送收货码 - * @param orderId - * @return + * 完成订单微信支付回调 + * @param request */ @ResponseBody - @PostMapping("/base/order/sendVerificationCode1") - public ResultUtil sendVerificationCode1(Integer orderId){ + @PostMapping("/base/wxPayCrossCity") + public void wxPayCrossCity(HttpServletRequest request, HttpServletResponse response){ try { - orderLogisticsService.sendVerificationCode(orderId); - return ResultUtil.success(); + Map<String, String> map = payMoneyUtil.weixinpayCallback(request); + if(null != map){ + String out_trade_no = map.get("out_trade_no"); + String transaction_id = map.get("transaction_id"); + + String substring = out_trade_no.substring(17); + Integer type = Integer.valueOf(substring.substring(0, 1)); + Integer id = Integer.valueOf(substring.substring(1)); + switch (type){ + case 3: + orderCrossCityService.payOrderCrossCityCallback(id, transaction_id, 1); + break; + } + + String result = map.get("result"); + PrintWriter out = response.getWriter(); + out.print(result); + out.flush(); + out.close(); + } }catch (Exception e){ e.printStackTrace(); - return ResultUtil.runErr(); } } + /** + * 完成订单支付宝支付回调 + * @param request + */ @ResponseBody - @PostMapping("/api/order/queryAdditionalFee") - @ApiOperation(value = "1.0-获取确认费用页面的附加费", tags = {"司机端-服务中"}, notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") - }) - public ResultUtil queryAdditionalFee(Integer orderType, Integer orderId, HttpServletRequest request){ + @PostMapping("/base/aliPayCrossCity") + public void aliPayCrossCity(HttpServletRequest request, HttpServletResponse response){ try { - Integer uid = driverService.getUserIdFormRedis(request); - if(null == uid){ - return ResultUtil.tokenErr(); + Map<String, String> map = payMoneyUtil.alipayCallback(request); + if(null != map){ + String out_trade_no = map.get("out_trade_no"); + String trade_no = map.get("trade_no"); + + String substring = out_trade_no.substring(17); + Integer type = Integer.valueOf(substring.substring(0, 1)); + Integer id = Integer.valueOf(substring.substring(1)); + switch (type){ + case 1: + case 3: + orderCrossCityService.payOrderCrossCityCallback(id, trade_no, 2); + break; + } + PrintWriter out = response.getWriter(); + out.print("success"); + out.flush(); + out.close(); } - List<BaseWarpper> list = orderService.queryAdditionalFee(orderType, orderId, uid); - return ResultUtil.success(list); }catch (Exception e){ e.printStackTrace(); - return ResultUtil.success(); } } } -- Gitblit v1.7.1