| | |
| | | |
| | | |
| | | /** |
| | | * 获取正在进行中的订单 |
| | | * 获取正在sudo rm -rf的订单 |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | orderStatusWarpper.setOrderType(3); |
| | | orderStatusWarpper.setState(orderCrossCity.getState()); |
| | | // orderStatusWarpper.setTripId(orderPrivateCar.getTripId()); |
| | | data.add(orderStatusWarpper); |
| | | } |
| | | List<OrderLogistics> orderLogistics = orderLogisticsService.selectList(new EntityWrapper<OrderLogistics>().eq("userId", uid) |
| | | .in("state", Arrays.asList(1, 2, 3, 4, 5, 6, 7, 11, 12)).eq("isDelete", 1)); |
| | | for(OrderLogistics orderLogistics1 : orderLogistics){ |
| | | if(orderLogistics1.getState() == 11){ |
| | | orderLogistics1.setState(orderLogistics1.getOldState()); |
| | | } |
| | | OrderStatusWarpper orderStatusWarpper = new OrderStatusWarpper(); |
| | | orderStatusWarpper.setOrderId(orderLogistics1.getId()); |
| | | orderStatusWarpper.setOrderType(4); |
| | | orderStatusWarpper.setState(orderLogistics1.getState()); |
| | | orderStatusWarpper.setTripId(orderLogistics1.getTripId()); |
| | | data.add(orderStatusWarpper); |
| | | } |
| | | return ResultUtil.success(data); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/sendOrderState") |
| | | public ResultUtil cancelOrder(Integer id, Integer orderType){ |
| | | public ResultUtil cancelOrder(Integer id, Integer orderType, String from){ |
| | | try { |
| | | Integer driverId = null; |
| | | Integer userId = null; |
| | |
| | | userId = orderPrivateCar.getUserId(); |
| | | state = orderPrivateCar.getState(); |
| | | if(null != driverId){ |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, ""); |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from); |
| | | } |
| | | break; |
| | | case 2: |
| | |
| | | userId = orderTaxi.getUserId(); |
| | | state = orderTaxi.getState(); |
| | | if(null != driverId){ |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, ""); |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from); |
| | | } |
| | | break; |
| | | case 3: |
| | |
| | | if(orderCrossCity.getPayMoney() == null && state == 10){//支付的情况才推送取消 |
| | | break; |
| | | }else{ |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, ""); |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from); |
| | | } |
| | | break; |
| | | case 4: |
| | |
| | | if(orderLogistics.getPayMoney() == null && state == 10){//支付的情况才推送取消 |
| | | break; |
| | | }else{ |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, ""); |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from); |
| | | } |
| | | break; |
| | | case 5: |
| | |
| | | if(orderLogistics1.getPayMoney() == null && state == 10){//支付的情况才推送取消 |
| | | break; |
| | | }else{ |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, ""); |
| | | pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from); |
| | | } |
| | | break; |
| | | } |
| | | pushUtil.pushOrderState(1, userId, id, orderType, state, 0, ""); |
| | | pushUtil.pushOrderState(1, userId, id, orderType, state, 0, "", from); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Double payMoney = 0D; |
| | | Integer companyId = null; |
| | | switch (orderType){ |
| | | case 1: |
| | | map = orderPrivateCarService.queryBalance(orderId, uid); |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | companyId = orderPrivateCar.getCompanyId(); |
| | | payMoney = orderPrivateCar.getOrderMoney(); |
| | | UserActivityDiscount1 query = userActivityDiscount1Mapper.query(orderPrivateCar.getCompanyId()); |
| | | if(null != query){ |
| | |
| | | case 4: |
| | | map = orderLogisticsService.queryBalance(orderId, uid); |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | companyId = orderLogistics.getCompanyId(); |
| | | payMoney = orderLogistics.getOrderMoney(); |
| | | UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderLogistics.getCompanyId()); |
| | | if(null != query2){ |
| | |
| | | // map = orderLogisticsService.queryBalance(orderId, uid); |
| | | // break; |
| | | } |
| | | Double aDouble = userRedPacketRecordService.queryRemainingAmount(uid); |
| | | List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>() |
| | | .eq("companyId", companyId).eq("state", 1).eq("userId", uid)); |
| | | Double aDouble = 0D; |
| | | if(userRedPacketRecords.size() > 0){ |
| | | aDouble = userRedPacketRecords.stream().mapToDouble(UserRedPacketRecord::getRemainingAmount).sum(); |
| | | } |
| | | map.put("redTotal", aDouble); |
| | | RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings(); |
| | | if(null == redEnvelopePaymentSettings){ |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | System.err.println("支付接口请求参数:payType=" + payType + "&bankCardId=" + bankCardId + "&orderId=" + orderId + "&orderType=" + orderType + |
| | | "&couponId=" + couponId + "&redDeduction=" + redDeduction + "&type=" + type + "&language=" + language); |
| | | String format = String.format("uid=%s&payType=%s&orderId=%s&orderType=%s", uid, payType, orderId, orderType); |
| | | String key = MD5Util.encrypt(format); |
| | | String value = redisUtil.getValue(key); |
| | |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Double payMoney = 0D; |
| | | Integer companyId = 1; |
| | | switch (orderType){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | companyId = orderPrivateCar.getCompanyId(); |
| | | Double orderMoney = orderPrivateCar.getOrderMoney(); |
| | | if(null == orderMoney){ |
| | | orderMoney = 0D; |
| | |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | companyId = orderLogistics.getCompanyId(); |
| | | Double orderMoney1 = orderLogistics.getOrderMoney(); |
| | | if(null == orderMoney1){ |
| | | orderMoney1 = 0D; |
| | |
| | | } |
| | | break; |
| | | } |
| | | Double aDouble = userRedPacketRecordService.queryRemainingAmount(uid); |
| | | List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>().eq("userId", uid) |
| | | .eq("state", 1).eq("companyId", companyId).gt("remainingAmount", 0).orderBy("insertTime", false)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("redTotal", aDouble); |
| | | map.put("redTotal", userRedPacketRecords.stream().mapToDouble(UserRedPacketRecord::getRemainingAmount).sum()); |
| | | RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings(); |
| | | if(null == redEnvelopePaymentSettings){ |
| | | map.put("deductionAmount", 0D); |