| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService; |
| | | import com.stylefeng.guns.modular.account.controller.AppOrderController; |
| | | import com.stylefeng.guns.modular.call.server.IOrderCallService; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.shunfeng.model.Financial; |
| | | import com.stylefeng.guns.modular.shunfeng.model.OrderRide; |
| | | import com.stylefeng.guns.modular.shunfeng.service.IDriverRideService; |
| | | import com.stylefeng.guns.modular.shunfeng.service.IFinancialService; |
| | | import com.stylefeng.guns.modular.shunfeng.service.IOrderRideService; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | |
| | | |
| | | @Autowired |
| | | private IOrderRideService orderRideService; |
| | | @Autowired |
| | | private IFinancialService financialService; |
| | | @Autowired |
| | | private ISystemNoticeService systemNoticeService; |
| | | /*顺风车司机*/ |
| | | @Autowired |
| | | private IDriverRideService driverRideService; |
| | |
| | | private IOrderPrivateCarService iOrderPrivateCarService; |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | |
| | | @Autowired |
| | | private AppOrderController appOrderController; |
| | | |
| | | |
| | | /** |
| | |
| | | if (split.length < 2) { |
| | | return buildCbyzxCallbackResponse(1, "invalid outRequestNo"); |
| | | } |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | String recordCode = StringUtils.defaultIfBlank(cbyzxOrderPayHelper.extractRecordCode(payload), outRequestNo); |
| | | String orderId = paymentOrderId; |
| | | |
| | | switch (type) { |
| | | case 1: |
| | | orderPrivateCarService.payOrderPrivateCarCallback(id, orderId, 1, recordCode); |
| | | if (StringUtils.isNumeric(split[0])) { |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | switch (type) { |
| | | case 1: |
| | | orderPrivateCarService.payOrderPrivateCarCallback(id, orderId, 1, recordCode); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payOrderTaxiCallback(id, orderId, 1, 0, recordCode); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, orderId, 1, recordCode); |
| | | break; |
| | | case 4: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, orderId, 1); |
| | | break; |
| | | case 5: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, orderId, 1); |
| | | break; |
| | | case 8: |
| | | OrderRide orderRide = orderRideService.selectById(id); |
| | | if (orderRide == null) { |
| | | return buildCbyzxCallbackResponse(1, "order not found"); |
| | | } |
| | | if (orderRide.getState() == null || orderRide.getState() != 2) { |
| | | orderRide.setOutNum(orderId); |
| | | orderRide.setPayTime(new Date()); |
| | | orderRide.setPayType(2); |
| | | orderRide.setState(2); |
| | | Financial financial = new Financial(); |
| | | financial.setType(1); |
| | | financial.setPayType("2"); |
| | | financial.setMoney(orderRide.getMoney()); |
| | | financial.setOrderNum(orderRide.getOrderNum()); |
| | | financial.setLsType(orderId); |
| | | financial.setAddTime(new Date()); |
| | | financial.setTradeStatus("SUCCESS"); |
| | | financial.setPwType(8); |
| | | financial.setUserId(orderRide.getUserId()); |
| | | financial.setLx(1); |
| | | financial.setOrderType(4); |
| | | financialService.insert(financial); |
| | | orderRideService.updateById(orderRide); |
| | | systemNoticeService.addSystemNotice(1, "您成功支付从" + orderRide.getStartName() + "到" + orderRide.getEndName() + "的顺风车订单", orderRide.getUserId(), 1); |
| | | } |
| | | break; |
| | | default: |
| | | return buildCbyzxCallbackResponse(1, "unsupported orderType"); |
| | | } |
| | | return buildCbyzxCallbackResponse(0, "success"); |
| | | } |
| | | |
| | | switch (split[0]) { |
| | | case "CANCEL": |
| | | if (split.length < 3) { |
| | | return buildCbyzxCallbackResponse(1, "invalid cancel outRequestNo"); |
| | | } |
| | | Integer cancelId = Integer.valueOf(split[1]); |
| | | Integer cancelType = Integer.valueOf(split[2]); |
| | | switch (cancelType) { |
| | | case 1: |
| | | orderPrivateCarService.payCancelOrderPrivateCar(cancelId, orderId, 1); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payCancelOrderTaxi(cancelId, orderId, 1); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payCancelOrderCrossCity(cancelId, orderId, 1); |
| | | break; |
| | | default: |
| | | return buildCbyzxCallbackResponse(1, "unsupported cancel orderType"); |
| | | } |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payOrderTaxiCallback(id, orderId, 1, 0, recordCode); |
| | | case "THANK": |
| | | if (split.length < 3) { |
| | | return buildCbyzxCallbackResponse(1, "invalid thank outRequestNo"); |
| | | } |
| | | Integer thankId = Integer.valueOf(split[1]); |
| | | Integer thankType = Integer.valueOf(split[2]); |
| | | switch (thankType) { |
| | | case 1: |
| | | orderPrivateCarService.payThankYouFeeCallback(thankId, orderId, 1); |
| | | break; |
| | | case 2: |
| | | orderTaxiService.payThankYouFeeCallback(thankId, orderId, 1); |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payThankYouFeeCallback(thankId, orderId, 1); |
| | | break; |
| | | case 4: |
| | | orderLogisticsService.payThankYouFeeCallback(thankId, orderId, 1); |
| | | break; |
| | | case 5: |
| | | orderLogisticsService.payThankYouFeeCallback(thankId, orderId, 1); |
| | | break; |
| | | case 6: |
| | | orderCharteredCarService.payThankYouFeeCallback(thankId, orderId, 1); |
| | | break; |
| | | case 7: |
| | | orderCallService.payThankYouFeeCallback(thankId, orderId, 1); |
| | | break; |
| | | default: |
| | | return buildCbyzxCallbackResponse(1, "unsupported thank orderType"); |
| | | } |
| | | break; |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, orderId, 1, recordCode); |
| | | case "SPREAD": |
| | | if (split.length < 3) { |
| | | return buildCbyzxCallbackResponse(1, "invalid spread outRequestNo"); |
| | | } |
| | | orderLogisticsService.payOrderLogisticsSpreadCallback(Integer.valueOf(split[1]), orderId, 1); |
| | | break; |
| | | case 4: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, orderId, 1); |
| | | case "CARD": |
| | | taxiCardService.payTaxiCardPaymentSpread(Integer.valueOf(split[1]), orderId); |
| | | break; |
| | | case 5: |
| | | orderLogisticsService.payOrderLogisticsCallback(id, orderId, 1); |
| | | case "BALANCE": |
| | | if (split.length < 3) { |
| | | return buildCbyzxCallbackResponse(1, "invalid balance outRequestNo"); |
| | | } |
| | | Integer uid = Integer.valueOf(split[1]); |
| | | Integer paymentRecordId = Integer.valueOf(split[2]); |
| | | PaymentRecord paymentRecord = paymentRecordService.selectById(paymentRecordId); |
| | | if (paymentRecord == null) { |
| | | return buildCbyzxCallbackResponse(1, "paymentRecord not found"); |
| | | } |
| | | if (paymentRecord.getState() == 1) { |
| | | userInfoService.payCancelUserBalance(uid, orderId, paymentRecordId, 1); |
| | | appOrderController.createAllocationReqUser(1, uid, 1, paymentRecord.getAmount()); |
| | | } |
| | | break; |
| | | default: |
| | | return buildCbyzxCallbackResponse(1, "unsupported orderType"); |
| | | return buildCbyzxCallbackResponse(1, "unsupported scene"); |
| | | } |
| | | return buildCbyzxCallbackResponse(0, "success"); |
| | | } catch (Exception e) { |