| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OrderCancel; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.*; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | | import com.stylefeng.guns.modular.taxi.model.TransactionDetails; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | private IOrderCharteredCarService orderCharteredCarService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | private IPaymentRecordService paymentRecordService; |
| | | |
| | | @Autowired |
| | | private IOrderCancelService orderCancelService; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | @Value("${filePath}") |
| | |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<OrderWarpper>> queryMyOrderList(Integer type, Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil<List<OrderWarpper>> queryMyOrderList(Integer type, Integer pageNum, Integer size, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | |
| | | list = orderCrossCityService.queryMyOrderList(uid, pageNum, size); |
| | | break; |
| | | case 4: |
| | | list = orderLogisticsService.queryMyOrderList(uid, pageNum, size); |
| | | list = orderLogisticsService.queryMyOrderList(uid, pageNum, size, language); |
| | | break; |
| | | case 5: |
| | | list = orderCharteredCarService.queryMyOrderList(uid, pageNum, size); |
| | |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<TravelRecordWarpper>> queryMyTravelRecord(Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil<List<TravelRecordWarpper>> queryMyTravelRecord(Integer pageNum, Integer size, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | String name = language == 1 ? "打车" : language == 2 ? "Ride" : "Course"; |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> maps = orderCancelService.queryCancel(uid, 2); |
| | | for (Map<String, Object> map : maps) { |
| | | Integer orderType = Integer.valueOf(map.get("orderType").toString()); |
| | | if(1 == orderType){ |
| | | map.put("name", language == 1 ? "打车订单取消" : language == 2 ? "Ride order cancelled" : "Commande de trajet annulée"); |
| | | } |
| | | if(4 == orderType){ |
| | | map.put("name", language == 1 ? "包裹订单取消" : language == 2 ? "Parcel order cancellation" : "Annulation de commande de colis"); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = orderPrivateCarService.queryMyTravelRecord(uid);//专车 |
| | | List<Map<String, Object>> list1 = orderTaxiService.queryMyTravelRecord(uid);//出租车 |
| | | List<Map<String, Object>> list2 = orderCrossCityService.queryMyTravelRecord(uid);//跨城车 |
| | | for (Map<String, Object> map : list) { |
| | | map.put("name", name); |
| | | } |
| | | name = language == 1 ? "包裹" : language == 2 ? "Package" : "Livraison"; |
| | | List<Map<String, Object>> list3 = orderLogisticsService.queryMyTravelRecord(uid);//小件物流 |
| | | for (Map<String, Object> map : list3) { |
| | | map.put("name", name); |
| | | } |
| | | List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>().eq("state", 1) |
| | | .eq("type", 1).eq("userType", 1).eq("userId", uid).eq("orderType", 3).like("remark", "%跨城订单取消退款%")); |
| | | List<Map<String, Object>> list4 = new ArrayList<>(); |
| | |
| | | list4.add(map); |
| | | } |
| | | list.addAll(maps); |
| | | list.addAll(list1); |
| | | list.addAll(list2); |
| | | // list.addAll(list1); |
| | | // list.addAll(list2); |
| | | list.addAll(list3); |
| | | list.addAll(list4); |
| | | // list.addAll(list4); |
| | | |
| | | List<TravelRecordWarpper> orderWarpper = TravelRecordWarpper.getTravelRecordWarpper(list); |
| | | |
| | |
| | | case 1://专车 |
| | | list = orderPrivateCarService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | break; |
| | | case 2://出租车 |
| | | list = orderTaxiService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | break; |
| | | case 3://跨城 |
| | | list = orderCrossCityService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | break; |
| | | // case 2://出租车 |
| | | // list = orderTaxiService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | // break; |
| | | // case 3://跨城 |
| | | // list = orderCrossCityService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | // break; |
| | | case 4://同城小件物流 |
| | | list = orderLogisticsService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid, orderType); |
| | | break; |
| | | case 5://跨城小件物流 |
| | | list = orderLogisticsService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid, orderType); |
| | | break; |
| | | // case 5://跨城小件物流 |
| | | // list = orderLogisticsService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid, orderType); |
| | | // break; |
| | | } |
| | | }else{ |
| | | //专车 |
| | | List<Map<String, Object>> maps = orderPrivateCarService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | list.addAll(maps); |
| | | //出租车 |
| | | List<Map<String, Object>> list1 = orderTaxiService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | list.addAll(list1); |
| | | //跨城 |
| | | List<Map<String, Object>> list2 = orderCrossCityService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | list.addAll(list2); |
| | | // //出租车 |
| | | // List<Map<String, Object>> list1 = orderTaxiService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | // list.addAll(list1); |
| | | // //跨城 |
| | | // List<Map<String, Object>> list2 = orderCrossCityService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | // list.addAll(list2); |
| | | //同城小件物流 |
| | | List<Map<String, Object>> list3 = orderLogisticsService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid, orderType); |
| | | list.addAll(list3); |
| | | //跨城小件物流 |
| | | List<Map<String, Object>> list4 = orderLogisticsService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid, orderType); |
| | | list.addAll(list4); |
| | | // //跨城小件物流 |
| | | // List<Map<String, Object>> list4 = orderLogisticsService.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid, orderType); |
| | | // list.addAll(list4); |
| | | } |
| | | |
| | | //分页 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil pushOrderTaxi(Integer id, Integer orderType){ |
| | | public ResultUtil pushOrderTaxi(Integer id, Integer orderType, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | switch (orderType){ |
| | | case 1: |
| | | return orderPrivateCarService.pushOrderPrivateCar(id); |
| | | return orderPrivateCarService.pushOrderPrivateCar(uid, id, language); |
| | | case 2: |
| | | return orderTaxiService.pushOrderTaxi(id); |
| | | } |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderInfo") |
| | | @ApiOperation(value = "获取服务中的详情数据", tags = {"用户端-服务中"}, notes = "") |
| | | @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=专车,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<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType){ |
| | | public ResultUtil<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType, Integer language){ |
| | | try { |
| | | Map<String, Object> map = null; |
| | | switch (orderType){ |
| | |
| | | case 3://跨城 |
| | | map = orderCrossCityService.queryOrderInfo(orderId); |
| | | break; |
| | | case 4://同城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | case 5://跨城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | } |
| | | if(map.get("telX") != null){ |
| | | map.put("driverPhone", map.get("telX")); |
| | | } |
| | | OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map); |
| | | String driverName = orderInfoWarpper.getDriverName(); |
| | | if(language == 2){ |
| | | driverName = "Master " + driverName.replace("师傅", ""); |
| | | } |
| | | if(language == 3){ |
| | | driverName = "Maître " + driverName.replace("师傅", ""); |
| | | } |
| | | orderInfoWarpper.setDriverName(driverName); |
| | | |
| | | File file = new File(filePath + orderId + "_1.txt"); |
| | | if(file.exists()){ |
| | | //读取文件(字符流) |
| | |
| | | orderInfoWarpper.setOrderPositionList(list); |
| | | } |
| | | return ResultUtil.success(orderInfoWarpper); |
| | | //return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/queryOrderInfo_") |
| | | @ApiOperation(value = "获取服务中的详情数据", tags = {"分享专用"}, notes = "") |
| | | @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=专车,2=出租车,3=城际,4=同城小件,5=跨城小件)", name = "orderType", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<OrderInfoWarpper> queryOrderInfo_(Integer orderId, Integer orderType){ |
| | | public ResultUtil<OrderInfoWarpper> queryOrderInfo_(Integer orderId, Integer orderType, Integer language){ |
| | | try { |
| | | Map<String, Object> map = null; |
| | | switch (orderType){ |
| | |
| | | case 3://跨城 |
| | | map = orderCrossCityService.queryOrderInfo(orderId); |
| | | break; |
| | | case 4://同城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | case 5://跨城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | } |
| | | if(null != map.get("telX")){ |
| | | map.put("driverPhone", map.get("telX")); |
| | | } |
| | | |
| | | return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map); |
| | | String driverName = orderInfoWarpper.getDriverName(); |
| | | if(language == 2){ |
| | | driverName = "Master " + driverName.replace("师傅", ""); |
| | | } |
| | | if(language == 3){ |
| | | driverName = "Maître " + driverName.replace("师傅", ""); |
| | | } |
| | | orderInfoWarpper.setDriverName(driverName); |
| | | return ResultUtil.success(orderInfoWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | * 获取订单取消支付页面详情 |
| | | * @param orderId |
| | | * @param orderType |
| | | * @return |
| | | * @。,; |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryCancelPage") |
| | |
| | | @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<OrderInfoWarpper> queryCancelPage(Integer orderId, Integer orderType){ |
| | | public ResultUtil<OrderInfoWarpper> queryCancelPage(Integer orderId, Integer orderType, Integer language){ |
| | | try { |
| | | Map<String, Object> map = null; |
| | | switch (orderType) { |
| | |
| | | map.put("cancelPayMoney", r.getData().getAmount()); |
| | | break; |
| | | } |
| | | return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map); |
| | | String driverName = orderInfoWarpper.getDriverName(); |
| | | if(language == 2){ |
| | | driverName = "Master " + driverName.replace("师傅", ""); |
| | | } |
| | | if(language == 3){ |
| | | driverName = "Maître " + driverName.replace("师傅", ""); |
| | | } |
| | | orderInfoWarpper.setDriverName(driverName); |
| | | return ResultUtil.success(orderInfoWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "用户id", name = "uid", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "附加参数{\"key\":\"value\"}", name = "content", required = true, dataType = "string") |
| | | }) |
| | | public ResultUtil weChatPay(Integer orderId, Integer orderType, Integer type, Integer userType, Integer uid, String content){ |
| | | public ResultUtil weChatPay(Integer orderId, Integer orderType, Integer type, Integer userType, Integer uid, String content, Integer language){ |
| | | try { |
| | | return orderService.weChatPay(orderId, orderType, type, userType, uid, content); |
| | | return orderService.weChatPay(orderId, orderType, type, userType, uid, content, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "取消原因", name = "reason", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil addCancle(Integer id, Integer orderType, String reason, String remark, HttpServletRequest request){ |
| | | public ResultUtil addCancle(Integer id, Integer orderType, String reason, String remark, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | |
| | | } |
| | | switch (orderType){ |
| | | case 1: |
| | | return orderPrivateCarService.addCancle(id, reason, remark, uid); |
| | | case 2: |
| | | return orderTaxiService.addCancle(id, reason, remark, uid); |
| | | case 3: |
| | | return orderCrossCityService.addCancle(id, reason, remark, uid); |
| | | return orderPrivateCarService.addCancle(id, reason, remark, uid, language); |
| | | // case 2: |
| | | // return orderTaxiService.addCancle(id, reason, remark, uid); |
| | | // case 3: |
| | | // return orderCrossCityService.addCancle(id, reason, remark, uid); |
| | | case 4: |
| | | return orderLogisticsService.addCancle(id, reason, remark, uid); |
| | | case 5: |
| | | return orderLogisticsService.addCancle(id, reason, remark, uid); |
| | | case 6: |
| | | return orderCharteredCarService.addCancle(id, reason, remark, uid); |
| | | return orderLogisticsService.addCancle(id, reason, remark, uid, language); |
| | | // case 5: |
| | | // return orderLogisticsService.addCancle(id, reason, remark, uid); |
| | | // case 6: |
| | | // return orderCharteredCarService.addCancle(id, reason, remark, uid); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消订单退款回调 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/orderCancelRefundCallback") |
| | | public PayoutCallbackResponse orderCancelRefundCallback(@RequestBody PayoutCallbackRequest request){ |
| | | try { |
| | | System.err.println("转账回调>>>>" + JSON.toJSONString(request)); |
| | | PayoutCallbackResponse payoutCallbackResponse = new PayoutCallbackResponse(); |
| | | AuthStatus authStatus = new AuthStatus(); |
| | | authStatus.setAuthStatusCode(131); |
| | | authStatus.setAuthStatusDescription("Authentication was successful"); |
| | | payoutCallbackResponse.setAuthStatus(authStatus); |
| | | Results results = new Results(); |
| | | PayoutPacket packet = request.getPayload().getPacket(); |
| | | String statusCode = packet.getStatusCode(); |
| | | String beepTransactionID = packet.getBeepTransactionID(); |
| | | String payerTransactionID = packet.getPayerTransactionID(); |
| | | |
| | | String id = payerTransactionID.substring(17); |
| | | OrderCancel orderCancel = orderCancelService.selectById(id); |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderCancel.getOrderId()); |
| | | PaymentRecord query = paymentRecordService.query(1, orderLogistics.getUserId(), 1, orderLogistics.getId(), orderLogistics.getType(), 1, 2); |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "包裹取消退款", query.getAmount(), 1, 1, 1, 4, orderLogistics.getId()); |
| | | |
| | | results.setBeepTransactionID(beepTransactionID); |
| | | results.setPayerTransactionID(payerTransactionID); |
| | | results.setStatusCode("188"); |
| | | results.setStatusDescription("Response was received"); |
| | | payoutCallbackResponse.setResults(results); |
| | | return payoutCallbackResponse; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/taxi/cancleOrderTaxi") |
| | | @ApiOperation(value = "取消操作支付", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") |
| | | @ApiOperation(value = "取消操作支付【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "取消单id(取消操作返回)", name = "cancleId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil cancleOrderTaxi(Integer id, Integer orderType, Integer payType, Integer cancleId, Integer type, HttpServletRequest request){ |
| | | public ResultUtil cancleOrderTaxi(Integer id, Integer orderType, Integer payType, Integer bankCardId, Integer cancleId, Integer type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | |
| | | } |
| | | switch (orderType){ |
| | | case 1: |
| | | return orderPrivateCarService.cancleOrderPrivateCar(id, payType, cancleId, type); |
| | | case 2: |
| | | return orderTaxiService.cancleOrderTaxi(id, payType, cancleId, type); |
| | | case 3: |
| | | return orderCrossCityService.cancleOrderCrossCity(id, payType, cancleId, type); |
| | | return orderPrivateCarService.cancleOrderPrivateCar(id, payType, bankCardId, cancleId, type, language); |
| | | // case 2: |
| | | // return orderTaxiService.cancleOrderTaxi(id, payType, cancleId, type); |
| | | // case 3: |
| | | // return orderCrossCityService.cancleOrderCrossCity(id, payType, cancleId, type); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | |
| | | @ApiImplicitParam(value = "司机id", name = "driverId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "投诉原因", name = "reason", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "投诉描述", name = "description", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil complaintService(Integer driverId, String reason, String description, HttpServletRequest request){ |
| | | public ResultUtil complaintService(Integer driverId, String reason, String description, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | complaintService.saveData(driverId, reason, description, uid); |
| | | complaintService.saveData(driverId, reason, description, uid, language); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiOperation(value = "支付页面获取可用优惠券数量和余额", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "balance=余额,coupon=优惠券") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", 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 queryBalance(Integer orderId, Integer orderType, HttpServletRequest request){ |
| | |
| | | case 1: |
| | | map = orderPrivateCarService.queryBalance(orderId, uid); |
| | | break; |
| | | case 2: |
| | | map = orderTaxiService.queryBalance(orderId, uid); |
| | | break; |
| | | case 3: |
| | | map = orderCrossCityService.queryBalance(orderId, uid); |
| | | break; |
| | | // case 2: |
| | | // map = orderTaxiService.queryBalance(orderId, uid); |
| | | // break; |
| | | // case 3: |
| | | // map = orderCrossCityService.queryBalance(orderId, uid); |
| | | // break; |
| | | case 4: |
| | | map = orderLogisticsService.queryBalance(orderId, uid); |
| | | break; |
| | | case 5: |
| | | map = orderLogisticsService.queryBalance(orderId, uid); |
| | | break; |
| | | // case 5: |
| | | // map = orderLogisticsService.queryBalance(orderId, uid); |
| | | // break; |
| | | } |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | |
| | | case 1: |
| | | list = orderPrivateCarService.queryCoupon(orderId, uid, pageNum, size); |
| | | break; |
| | | case 2: |
| | | list = orderTaxiService.queryCoupon(orderId, uid, pageNum, size); |
| | | break; |
| | | case 3: |
| | | list = orderCrossCityService.queryCoupon(orderId, uid, pageNum, size); |
| | | break; |
| | | // case 2: |
| | | // list = orderTaxiService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | | // case 3: |
| | | // list = orderCrossCityService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | | // case 4: |
| | | // list = orderLogisticsService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | | // case 5: |
| | | // list = orderLogisticsService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | | } |
| | | return ResultUtil.success(CouponWarpper.getCouponWarppers(list)); |
| | | }catch (Exception e){ |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/taxi/payTaxiOrder") |
| | | @ApiOperation(value = "订单完成支付订单操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") |
| | | @ApiOperation(value = "订单完成支付订单操作【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额,4=线下支付)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "优惠券id", name = "couponId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil payTaxiOrder(Integer payType, Integer orderId, Integer orderType, Integer couponId, Integer type, HttpServletRequest request){ |
| | | public ResultUtil payTaxiOrder(Integer payType, Integer bankCardId, Integer orderId, Integer orderType, Integer couponId, Integer type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | |
| | | } |
| | | switch (orderType){ |
| | | case 1: |
| | | return orderPrivateCarService.payPrivateCarOrder(payType, orderId, couponId, type); |
| | | case 2: |
| | | return orderTaxiService.payTaxiOrder(payType, orderId, couponId, type); |
| | | case 3: |
| | | return orderCrossCityService.payCrossCityOrder(payType, orderId, couponId, type); |
| | | return orderPrivateCarService.payPrivateCarOrder(payType, bankCardId, orderId, couponId, type, language); |
| | | // case 2: |
| | | // return orderTaxiService.payTaxiOrder(payType, orderId, couponId, type); |
| | | // case 3: |
| | | // return orderCrossCityService.payCrossCityOrder(payType, orderId, couponId, type); |
| | | case 4: |
| | | return orderLogisticsService.payLogisticsOrder(payType, orderId, type); |
| | | case 5: |
| | | return orderLogisticsService.payLogisticsOrder(payType, orderId, type); |
| | | return orderLogisticsService.payLogisticsOrder(payType, bankCardId, orderId, type, language); |
| | | // case 5: |
| | | // return orderLogisticsService.payLogisticsOrder(payType, orderId, type, language); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | |
| | | @ApiImplicitParam(value = "评价内容", name = "content", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil orderEvaluate(Integer orderId, Integer orderType, Integer fraction, String content){ |
| | | public ResultUtil orderEvaluate(Integer orderId, Integer orderType, Integer fraction, String content, Integer language){ |
| | | try { |
| | | ResultUtil resultUtil = orderEvaluateService.saveData(orderId, orderType, fraction, content); |
| | | ResultUtil resultUtil = orderEvaluateService.saveData(orderId, orderType, fraction, content, language); |
| | | if(resultUtil.getCode() == 200){ |
| | | switch (orderType){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | orderPrivateCar.setState(9); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.ratedPassenger(Integer.valueOf(resultUtil.getData().toString())); |
| | | pushMinistryOfTransportUtil.ratedDriver(orderPrivateCar.getDriverId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | |
| | | @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil shareRedEnvelope(Integer orderId, Integer orderType){ |
| | | public ResultUtil shareRedEnvelope(Integer orderId, Integer orderType, Integer language){ |
| | | try { |
| | | switch (orderType){ |
| | | case 1: |
| | | return orderPrivateCarService.shareRedEnvelope(orderId); |
| | | return orderPrivateCarService.shareRedEnvelope(orderId, language); |
| | | case 2: |
| | | return orderTaxiService.shareRedEnvelope(orderId); |
| | | case 3: |
| | |
| | | |
| | | /** |
| | | * 取消订单微信回调 |
| | | * @param request |
| | | * @param callbackRequest |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/wxCancelOrderTaxi") |
| | | public void wxCancelOrderTaxi(HttpServletRequest request, HttpServletResponse response){ |
| | | public CallbackResponse wxCancelOrderTaxi(@RequestBody CallbackRequest callbackRequest){ |
| | | CallbackResponse callbackResponse = new CallbackResponse(); |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request);//icbcPayUtil.payCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("transaction_id"); |
| | | |
| | | /** |
| | | * 指示服务是否成功或付费的总体请求代码。。 |
| | | * 177-部分付费请求 |
| | | * 178-表明请求已全额支付 |
| | | * 179-表示请求已部分支付但已过期。 |
| | | * 129-请求已过期,未付款。 |
| | | * 180.商户拒绝请求 |
| | | * 183-商户接受请求,我们可以结算资金 |
| | | * 188-商户收到请求。 |
| | | */ |
| | | String request_status_code = callbackRequest.getRequest_status_code(); |
| | | String out_trade_no = callbackRequest.getMerchant_transaction_id(); |
| | | if("177".equals(request_status_code) || "178".equals(request_status_code)){ |
| | | Payments payments = callbackRequest.getPayments().get(0); |
| | | String order_id = payments.getPayer_transaction_id(); |
| | | if(ToolUtil.isNotEmpty(out_trade_no)){ |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | Integer type = Integer.valueOf(out_trade_no.substring(17, 18)); |
| | | Integer language = Integer.valueOf(out_trade_no.substring(18, 19)); |
| | | Integer id = Integer.valueOf(out_trade_no.substring(19)); |
| | | switch (type){ |
| | | case 1: |
| | | orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 1); |
| | | orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, language); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payCancelOrderTaxi(id, order_id, 1); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payCancelOrderCrossCity(id, order_id, 1); |
| | | break; |
| | | // case 2: |
| | | // orderTaxiService.payCancelOrderTaxi(id, order_id, 1); |
| | | // break; |
| | | // case 3: |
| | | // orderCrossCityService.payCancelOrderCrossCity(id, order_id, 1); |
| | | // break; |
| | | } |
| | | callbackResponse.setCheckout_request_id(order_id); |
| | | callbackResponse.setMerchant_transaction_id(out_trade_no); |
| | | callbackResponse.setStatus_code("183"); |
| | | callbackResponse.setStatus_description("Payment processed successfully"); |
| | | callbackResponse.setReceipt_number(UUIDUtil.getRandomCode(16)); |
| | | } |
| | | response.getOutputStream().print("success"); |
| | | }else{ |
| | | callbackResponse.setCheckout_request_id(UUIDUtil.getRandomCode(16)); |
| | | callbackResponse.setMerchant_transaction_id(out_trade_no); |
| | | callbackResponse.setStatus_code("180"); |
| | | callbackResponse.setStatus_description("means payment rejected."); |
| | | callbackResponse.setReceipt_number(UUIDUtil.getRandomCode(16)); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return callbackResponse; |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping("/base/aliCancelOrderTaxi") |
| | | public void aliCancelOrderTaxi(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request);//icbcPayUtil.payCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("trade_no"); |
| | | if(ToolUtil.isNotEmpty(out_trade_no)){ |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | switch (type){ |
| | | case 1: |
| | | orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 2); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payCancelOrderTaxi(id, order_id, 2); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payCancelOrderCrossCity(id, order_id, 2); |
| | | break; |
| | | } |
| | | } |
| | | response.setContentType("text/html;charset=UTF-8"); |
| | | PrintWriter out; |
| | | out = response.getWriter(); |
| | | out.println("success"); // 请不要修改或删除 |
| | | } |
| | | // Map<String, String> map = payMoneyUtil.alipayCallback(request);//icbcPayUtil.payCallback(request); |
| | | // if(null != map){ |
| | | // String out_trade_no = map.get("out_trade_no"); |
| | | // String order_id = map.get("trade_no"); |
| | | // if(ToolUtil.isNotEmpty(out_trade_no)){ |
| | | // String[] split = out_trade_no.split("_"); |
| | | // Integer id = Integer.valueOf(split[0]); |
| | | // Integer type = Integer.valueOf(split[1]); |
| | | // switch (type){ |
| | | // case 1: |
| | | // orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 2); |
| | | // break; |
| | | // case 2: |
| | | // orderTaxiService.payCancelOrderTaxi(id, order_id, 2); |
| | | // break; |
| | | // case 3: |
| | | // orderCrossCityService.payCancelOrderCrossCity(id, order_id, 2); |
| | | // break; |
| | | // } |
| | | // } |
| | | // response.setContentType("text/html;charset=UTF-8"); |
| | | // PrintWriter out; |
| | | // out = response.getWriter(); |
| | | // out.println("success"); // 请不要修改或删除 |
| | | // } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 完成订单微信支付回调 |
| | | * @param request |
| | | * @param |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/wxPayOrderTaxi") |
| | | public void wxPayOrderTaxi(HttpServletRequest request, HttpServletResponse response){ |
| | | public CallbackResponse wxPayOrderTaxi(@RequestBody CallbackRequest callbackRequest){ |
| | | CallbackResponse callbackResponse = new CallbackResponse(); |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request);//icbcPayUtil.payCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("transaction_id"); |
| | | /** |
| | | * 指示服务是否成功或付费的总体请求代码。。 |
| | | * 177-部分付费请求 |
| | | * 178-表明请求已全额支付 |
| | | * 179-表示请求已部分支付但已过期。 |
| | | * 129-请求已过期,未付款。 |
| | | * 180.商户拒绝请求 |
| | | * 183-商户接受请求,我们可以结算资金 |
| | | * 188-商户收到请求。 |
| | | */ |
| | | String request_status_code = callbackRequest.getRequest_status_code(); |
| | | String out_trade_no = callbackRequest.getMerchant_transaction_id(); |
| | | if("177".equals(request_status_code) || "178".equals(request_status_code)){ |
| | | Payments payments = callbackRequest.getPayments().get(0); |
| | | String order_id = payments.getPayer_transaction_id(); |
| | | if(ToolUtil.isNotEmpty(out_trade_no)){ |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | switch (type){ |
| | | Integer orderType = Integer.valueOf(out_trade_no.substring(17, 18)); |
| | | Integer language = Integer.valueOf(out_trade_no.substring(18, 19)); |
| | | Integer id = Integer.valueOf(out_trade_no.substring(19)); |
| | | switch (orderType){ |
| | | case 1: |
| | | orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 1); |
| | | orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, language); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payOrderTaxiCallback(id, order_id, 1); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1); |
| | | break; |
| | | // case 2: |
| | | // orderTaxiService.payOrderTaxiCallback(id, order_id, 1); |
| | | // break; |
| | | // case 3: |
| | | // orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1); |
| | | // break; |
| | | case 4: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1); |
| | | orderLogisticsService.payOrderLogisticsCallback(id, order_id, language); |
| | | break; |
| | | case 5: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1); |
| | | break; |
| | | // case 5: |
| | | // orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1, language); |
| | | // break; |
| | | } |
| | | response.getOutputStream().print("success"); |
| | | callbackResponse.setCheckout_request_id(order_id); |
| | | callbackResponse.setMerchant_transaction_id(out_trade_no); |
| | | callbackResponse.setStatus_code("183"); |
| | | callbackResponse.setStatus_description("Payment processed successfully"); |
| | | callbackResponse.setReceipt_number(UUIDUtil.getRandomCode(16)); |
| | | } |
| | | }else{ |
| | | callbackResponse.setCheckout_request_id(UUIDUtil.getRandomCode(16)); |
| | | callbackResponse.setMerchant_transaction_id(out_trade_no); |
| | | callbackResponse.setStatus_code("180"); |
| | | callbackResponse.setStatus_description("means payment rejected."); |
| | | callbackResponse.setReceipt_number(UUIDUtil.getRandomCode(16)); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return callbackResponse; |
| | | } |
| | | |
| | | |
| | |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | Integer language = Integer.valueOf(split[2]); |
| | | switch (type){ |
| | | case 1: |
| | | orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 2); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payOrderTaxiCallback(id, order_id, 2); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, order_id, 2); |
| | | break; |
| | | case 4: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, order_id, 2); |
| | | break; |
| | | case 5: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, order_id, 2); |
| | | break; |
| | | // case 1: |
| | | // orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 2, language); |
| | | // break; |
| | | // case 2: |
| | | // orderTaxiService.payOrderTaxiCallback(id, order_id, 2); |
| | | // break; |
| | | // case 3: |
| | | // orderCrossCityService.payOrderCrossCityCallback(id, order_id, 2); |
| | | // break; |
| | | // case 4: |
| | | // orderLogisticsService.payOrderLogisticsCallback(id, order_id, 2, language); |
| | | // break; |
| | | // case 5: |
| | | // orderLogisticsService.payOrderLogisticsCallback(id, order_id, 2, language); |
| | | // break; |
| | | } |
| | | response.setContentType("text/html;charset=UTF-8"); |
| | | PrintWriter out; |
| | |
| | | |
| | | /** |
| | | * 小件物流差价微信支付回调 |
| | | * @param request |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/wxPayOrderLogisticsSpread") |
| | | public void wxPayOrderLogisticsSpread(HttpServletRequest request, HttpServletResponse response){ |
| | | public CallbackResponse wxPayOrderLogisticsSpread(@RequestBody CallbackRequest callbackRequest){ |
| | | CallbackResponse callbackResponse = new CallbackResponse(); |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request);//icbcPayUtil.payCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("transaction_id"); |
| | | String s = null;//icbcPayUtil.queryTransaction("", order_id); |
| | | if(!s.equals("") && !s.equals("2")){ |
| | | //icbcPayUtil.answer(response);//回调应答 |
| | | /** |
| | | * 指示服务是否成功或付费的总体请求代码。。 |
| | | * 177-部分付费请求 |
| | | * 178-表明请求已全额支付 |
| | | * 179-表示请求已部分支付但已过期。 |
| | | * 129-请求已过期,未付款。 |
| | | * 180.商户拒绝请求 |
| | | * 183-商户接受请求,我们可以结算资金 |
| | | * 188-商户收到请求。 |
| | | */ |
| | | String request_status_code = callbackRequest.getRequest_status_code(); |
| | | String out_trade_no = callbackRequest.getMerchant_transaction_id(); |
| | | if("177".equals(request_status_code) || "178".equals(request_status_code)){ |
| | | Payments payments = callbackRequest.getPayments().get(0); |
| | | String order_id = payments.getPayer_transaction_id(); |
| | | if(ToolUtil.isNotEmpty(out_trade_no)){ |
| | | Integer orderType = Integer.valueOf(out_trade_no.substring(17, 18)); |
| | | Integer language = Integer.valueOf(out_trade_no.substring(18, 19)); |
| | | Integer id = Integer.valueOf(out_trade_no.substring(19)); |
| | | orderLogisticsService.payOrderLogisticsSpreadCallback(id, order_id, language); |
| | | callbackResponse.setCheckout_request_id(order_id); |
| | | callbackResponse.setMerchant_transaction_id(out_trade_no); |
| | | callbackResponse.setStatus_code("183"); |
| | | callbackResponse.setStatus_description("Payment processed successfully"); |
| | | callbackResponse.setReceipt_number(UUIDUtil.getRandomCode(16)); |
| | | } |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){ |
| | | String[] split = out_trade_no.split(","); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | orderLogisticsService.payOrderLogisticsSpreadCallback(id, order_id, 1); |
| | | } |
| | | }else{ |
| | | callbackResponse.setCheckout_request_id(UUIDUtil.getRandomCode(16)); |
| | | callbackResponse.setMerchant_transaction_id(out_trade_no); |
| | | callbackResponse.setStatus_code("180"); |
| | | callbackResponse.setStatus_description("means payment rejected."); |
| | | callbackResponse.setReceipt_number(UUIDUtil.getRandomCode(16)); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return callbackResponse; |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping("/base/aliPayOrderLogisticsSpread") |
| | | public void aliPayOrderLogisticsSpread(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request);//icbcPayUtil.payCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("trade_no"); |
| | | String s = null;//icbcPayUtil.queryTransaction("", order_id); |
| | | if(!s.equals("") && !s.equals("2")){ |
| | | //icbcPayUtil.answer(response);//回调应答 |
| | | } |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){ |
| | | String[] split = out_trade_no.split(","); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | orderLogisticsService.payOrderLogisticsSpreadCallback(id, order_id, 2); |
| | | } |
| | | |
| | | } |
| | | // Map<String, String> map = payMoneyUtil.alipayCallback(request);//icbcPayUtil.payCallback(request); |
| | | // if(null != map){ |
| | | // String out_trade_no = map.get("out_trade_no"); |
| | | // String order_id = map.get("trade_no"); |
| | | // String s = null;//icbcPayUtil.queryTransaction("", order_id); |
| | | // if(!s.equals("") && !s.equals("2")){ |
| | | // //icbcPayUtil.answer(response);//回调应答 |
| | | // } |
| | | // if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){ |
| | | // String[] split = out_trade_no.split(","); |
| | | // Integer id = Integer.valueOf(split[0]); |
| | | // Integer type = Integer.valueOf(split[1]); |
| | | // orderLogisticsService.payOrderLogisticsSpreadCallback(id, order_id, 2); |
| | | // } |
| | | // |
| | | // } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/IGO/tinggPayoutCallback") |
| | | public PayoutCallbackResponse tinggPayoutCallback(@RequestBody PayoutCallbackRequest request){ |
| | | System.err.println("转账回调>>>>" + JSON.toJSONString(request)); |
| | | PayoutCallbackResponse payoutCallbackResponse = new PayoutCallbackResponse(); |
| | | AuthStatus authStatus = new AuthStatus(); |
| | | authStatus.setAuthStatusCode(131); |
| | | authStatus.setAuthStatusDescription("Authentication was successful"); |
| | | payoutCallbackResponse.setAuthStatus(authStatus); |
| | | Results results = new Results(); |
| | | PayoutPacket packet = request.getPayload().getPacket(); |
| | | String beepTransactionID = packet.getBeepTransactionID(); |
| | | String payerTransactionID = packet.getPayerTransactionID(); |
| | | results.setBeepTransactionID(beepTransactionID); |
| | | results.setPayerTransactionID(payerTransactionID); |
| | | results.setStatusCode("188"); |
| | | results.setStatusDescription("Response was received"); |
| | | payoutCallbackResponse.setResults(results); |
| | | return payoutCallbackResponse; |
| | | } |
| | | } |