Pu Zhibing
6 天以前 4c99ee7028c3fe58a2cd4b8273b22c75c45574fc
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -693,7 +693,7 @@
     */
    @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;
@@ -705,7 +705,7 @@
                    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:
@@ -714,7 +714,7 @@
                    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:
@@ -725,7 +725,7 @@
                    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:
@@ -736,7 +736,7 @@
                    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:
@@ -747,11 +747,11 @@
                    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();
@@ -1118,10 +1118,12 @@
            }
            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){
@@ -1147,6 +1149,7 @@
                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){
@@ -1166,7 +1169,12 @@
//                    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){