Pu Zhibing
2024-11-09 f85ea638d98b302c590e65f00e6912d91601613c
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java
@@ -177,6 +177,7 @@
                    .eq("userType", 1)
                    .eq("objectId",1)
                    .ne("type", 1)
                    .between("insertTime", start, end)
                    .isNotNull("orderType"));
        }else{
            if (time == 5 && !StringUtils.hasLength(insertTime)){
@@ -184,6 +185,7 @@
                        .eq("userType", 1)
                        .eq("objectId",1)
                        .ne("type", 1)
                        .between("insertTime", start, end)
                        .isNotNull("orderType"));
            }else{
                incomes = tIncomeService.selectList(new EntityWrapper<Income>()
@@ -191,6 +193,7 @@
                        .eq("objectId",1)
                        .ne("type", 1)
                        .isNotNull("orderType")
                        .between("insertTime", start, end));
            }
@@ -218,7 +221,10 @@
                        continue;
                    }
                    // 查询订单信息
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(income.getIncomeId());
//                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(income.getIncomeId());
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>()
                            .eq("id", income.getIncomeId())
                            .between("insertTime", start, end));
                    if (tOrderPrivateCar==null){
                        continue;
                    }
@@ -236,22 +242,44 @@
                    String string = income.getMoney().toString();
                    BigDecimal bigDecimal1 = new BigDecimal(string);
                    platformVO.setMoney(bigDecimal1);
                    if (tOrderPrivateCar.getPayType() == null){
                    if (tOrderPrivateCar.getState()!=10 && tOrderPrivateCar.getPayType() == null){
                        continue;
                    }
                    switch (tOrderPrivateCar.getPayType()){
                        case 1:
                            platformVO.setPayType("手机支付");
                            break;
                        case 2:
                            platformVO.setPayType("银行卡支付");
                            break;
                        case 3:
                            platformVO.setPayType("余额支付");
                            break;
                        case 4:
                            platformVO.setPayType("现金支付");
                            break;
                    if (tOrderPrivateCar.getState() == 10){
                        // 查询取消订单 用户支付方式
                        OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>()
                                .eq("orderType", 4)
                                .eq("orderId", tOrderPrivateCar.getId()));
                        if (orderCancel!=null &&orderCancel.getPayType()!=null){
                            switch (orderCancel.getPayType()){
                                case 1:
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                    platformVO.setPayType("余额支付");
                                    break;
                            }
                        }
                    }else{
                        if (tOrderPrivateCar.getPayType()!=null){
                            switch (tOrderPrivateCar.getPayType()){
                                case 1:
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                    platformVO.setPayType("余额支付");
                                    break;
                                case 4:
                                    platformVO.setPayType("现金支付");
                                    break;
                            }
                        }
                    }
                    // 专车订单
@@ -264,7 +292,10 @@
                    }
                    // 小件物流
                    // 查询订单信息
                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(income.getIncomeId());
//                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(income.getIncomeId());
                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectOne(new EntityWrapper<TOrderLogistics>()
                            .eq("id", income.getIncomeId())
                            .between("insertTime", start, end));
                    if (tOrderLogistics==null){
                        continue;
                    }
@@ -281,22 +312,44 @@
                        platformVO.setEndTime(format.format(income.getInsertTime()));
                    }
                    platformVO.setInsertTime(format.format(tOrderLogistics.getInsertTime()));
                    if (tOrderLogistics.getPayType() == null){
                    if (tOrderLogistics.getState()!=10 && tOrderLogistics.getPayType() == null){
                        continue;
                    }
                    switch (tOrderLogistics.getPayType()){
                        case 1:
                            platformVO.setPayType("手机支付");
                            break;
                        case 2:
                            platformVO.setPayType("银行卡支付");
                            break;
                        case 3:
                            platformVO.setPayType("余额支付");
                            break;
                        case 4:
                            platformVO.setPayType("现金支付");
                            break;
                    if (tOrderLogistics.getState() == 10){
                        // 查询取消订单 用户支付方式
                        OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>()
                                .eq("orderType", 4)
                                .eq("orderId", tOrderLogistics.getId()));
                        if (orderCancel!=null &&orderCancel.getPayType()!=null){
                            switch (orderCancel.getPayType()){
                                case 1:
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                    platformVO.setPayType("余额支付");
                                    break;
                            }
                        }
                    }else{
                        if (tOrderLogistics.getPayType()!=null){
                            switch (tOrderLogistics.getPayType()){
                                case 1:
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                    platformVO.setPayType("余额支付");
                                    break;
                                case 4:
                                    platformVO.setPayType("现金支付");
                                    break;
                            }
                        }
                    }
                    // 专车订单
@@ -307,11 +360,11 @@
        }
        EntityWrapper<SettlementDetail> settlementDetailEntityWrapper = new EntityWrapper<>();
        if (time == 5 && !StringUtils.hasLength(insertTime)){
        }else{
            settlementDetailEntityWrapper.between("createTime", start, end);
        if (state!=null && state == 2){
            settlementDetailEntityWrapper.eq("paymentStatus", 2);
        }
        settlementDetailEntityWrapper.between("createTime", start, end);
        settlementDetails = settlementDetailService.selectList(settlementDetailEntityWrapper);
        // 查询所有现金支付的订单 再根据结算主表判断是否已结算
        for (SettlementDetail settlementDetail : settlementDetails) {
@@ -320,7 +373,10 @@
                case 1:
                    // 专车订单
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(settlementDetail.getOrderId());
//                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(settlementDetail.getOrderId());
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>()
                            .eq("id", settlementDetail.getOrderId())
                            .between("insertTime", start, end));
                    if (tOrderPrivateCar==null){
                        continue;
                    }
@@ -368,7 +424,10 @@
                case 4:
                    // 小件物流
                    // 查询订单信息
                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(settlementDetail.getOrderId());
//                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(settlementDetail.getOrderId());
                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectOne(new EntityWrapper<TOrderLogistics>()
                            .eq("id", settlementDetail.getOrderId())
                            .between("insertTime", start, end));
                    if (tOrderLogistics==null){
                        continue;
                    }
@@ -435,7 +494,7 @@
     */
    @RequestMapping(value = "/water/getCount")
    @ResponseBody
    public Object getCount1(Integer time,String insertTime,Integer payType,Integer type) {
    public Object getCount1(Integer time,String insertTime,Integer payType,Integer type,String code) {
        if (payType!=null){
            switch (payType){
                case 1:
@@ -507,10 +566,12 @@
        // 用户小件物流订单记录
        List<TOrderPrivateCar> tOrderPrivateCars = new ArrayList<>();
        List<TOrderLogistics> tOrderLogistics = new ArrayList<>();
        // 用户取消订单记录
        List<OrderCancel> orderCancels = new ArrayList<>();
        // 用户充值
        List<TPubTransactionDetails> tPubTransactionDetails = new ArrayList<>();
        // 司机结算总额
       List<SettlementDetail> settlementDetails1 = new ArrayList<>();
        List<SettlementDetail> settlementDetails1 = new ArrayList<>();
        // 司机提现
        List<TPubWithdrawal> driver = new ArrayList<>();
        // 用户提现
@@ -525,12 +586,10 @@
        EntityWrapper<TOrderPrivateCar> tOrderPrivateCarEntityWrapper = new EntityWrapper<>();
        // 用户小件物流订单wrapper
        EntityWrapper<TOrderLogistics> tOrderLogisticsEntityWrapper = new EntityWrapper<>();
        // 司机手动结算金额
        Wrapper<SettlementDetail> orderType1 = new EntityWrapper<SettlementDetail>();
        // 用户取消订单wrapper
        Wrapper<OrderCancel> orderCancelEntityWrapper = new EntityWrapper<>();
        // 用户取消订单记录
        List<OrderCancel> orderCancels = new ArrayList<>();
        // 司机手动结算金额
        Wrapper<SettlementDetail> orderType1 = new EntityWrapper<SettlementDetail>();
        List<Integer> integers = new ArrayList<>();
        integers.add(1);
        integers.add(2);
@@ -539,12 +598,12 @@
            orderType = new EntityWrapper<TPubTransactionDetails>()
                    .eq("userType",1)
                    .eq("orderType", 5)
                    ;
            ;
            // 用户提现wrapper
            userWrapper = new EntityWrapper<TPubWithdrawal>()
                    .eq("state", 2)
                    .eq("userType", 1)
                  ;
            ;
            // 司机提现wrapper
            between = new EntityWrapper<TPubWithdrawal>()
                    .eq("state", 2)
@@ -559,11 +618,12 @@
                    .in("payType",Arrays.asList(1, 2));
            // 司机手动结算金额
            orderType1 = new EntityWrapper<SettlementDetail>()
                    .isNotNull("settlementRecordId")
                    .in("orderType", Arrays.asList(1, 4));
            // 用户取消订单费用
            orderCancelEntityWrapper.eq("state", 2)
                    .eq("userType", 1).in("payType",integers)
                    ;
                    .in("payType",integers)
                    .eq("userType", 1);
        }else{
            orderType = new EntityWrapper<TPubTransactionDetails>()
                    .eq("orderType", 5)
@@ -580,7 +640,8 @@
                    .eq("userType", 2)
                    .between("handleTime", start, end);
            // 司机手动结算金额
           orderType1 = new EntityWrapper<SettlementDetail>()
            orderType1 = new EntityWrapper<SettlementDetail>()
                    .isNotNull("settlementRecordId")
                    .in("orderType", Arrays.asList(1, 4))
                    .between("createTime", start, end);
            // 用户专车订单wrapper
@@ -599,15 +660,15 @@
                    .in("payType",integers)
                    .between("insertTime", start, end);
        }
        if (type != null){
            switch (type){
                case 1:
                    // 只查询用户订单
                    tOrderPrivateCars = orderPrivateCarService.selectList(tOrderPrivateCarEntityWrapper);
                    tOrderLogistics = orderLogisticsService.selectList(tOrderLogisticsEntityWrapper);
                    // 用户取消订单费用
                    orderCancelEntityWrapper.eq("state", 2)
                            .eq("userType", 1);
                    orderCancels = orderCancelService.selectList(orderCancelEntityWrapper);
                    break;
                case 2:
                    // 只查询用户充值
@@ -627,16 +688,23 @@
                    break;
            }
        }else{
            if(ToolUtil.isNotEmpty(code)){
                tOrderPrivateCarEntityWrapper.like("orderNum", code);
                tOrderLogisticsEntityWrapper.like("orderNum", code);
                orderType.like("", code);
            }
            // 只查询用户订单
            tOrderPrivateCars = orderPrivateCarService.selectList(tOrderPrivateCarEntityWrapper);
            tOrderLogistics = orderLogisticsService.selectList(tOrderLogisticsEntityWrapper);
            orderCancels = orderCancelService.selectList(orderCancelEntityWrapper);
            tPubTransactionDetails = pubTransactionDetailsService.selectList(orderType);
            // 只查询司机手动结算的
            settlementDetails1 = settlementDetailService.selectList(orderType1);
            driver = pubWithdrawalService.selectList(between);
            user = pubWithdrawalService.selectList(userWrapper);
            orderCancels = orderCancelService.selectList(orderCancelEntityWrapper);
        }
        List<WaterVO> res = new ArrayList<>();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -650,6 +718,7 @@
        BigDecimal driverWithdrawal = new BigDecimal("0");
        // 用户提现金额
        BigDecimal userWithdrawal = new BigDecimal("0");
        // 用户订单消费
        // 用户订单消费
        for (TOrderPrivateCar tOrderPrivateCar : tOrderPrivateCars) {
@@ -718,7 +787,6 @@
            }
            res.add(waterVO);
            userConsume = userConsume.add(new BigDecimal(waterVO.getMoney()));
            break;
        }
        for (OrderCancel orderCancel : orderCancels) {
            WaterVO waterVO = new WaterVO();
@@ -802,6 +870,10 @@
            if(payType!=null && payType == 2){
                break;
            }
            String code1 = tPubWithdrawal.getCode();
            if(ToolUtil.isNotEmpty(code) && !code1.contains(code)){
                continue;
            }
            WaterVO waterVO = new WaterVO();
            waterVO.setInsertTime(format.format(tPubWithdrawal.getHandleTime()));
            waterVO.setCode(tPubWithdrawal.getCode());
@@ -823,10 +895,12 @@
            if(payType!=null && payType == 2){
                break;
            }
            WaterVO waterVO = new WaterVO();
            if (tPubWithdrawal.getHandleTime()!=null){
                waterVO.setInsertTime(format.format(tPubWithdrawal.getHandleTime()));
            String code1 = tPubWithdrawal.getCode();
            if(ToolUtil.isNotEmpty(code) && !code1.contains(code)){
                continue;
            }
            WaterVO waterVO = new WaterVO();
            waterVO.setInsertTime(format.format(tPubWithdrawal.getHandleTime()));
            waterVO.setCode(tPubWithdrawal.getCode());
            TUser user2 = appUserService.selectById(tPubWithdrawal.getUserId());
            if (user2!=null){
@@ -850,6 +924,10 @@
                    // 临时数据
                    continue;
                }
                String code1 = paymentRecord.getCode();
                if(ToolUtil.isNotEmpty(code) && !code1.contains(code)){
                    continue;
                }
                waterVO.setInsertTime(format.format(paymentRecord.getInsertTime()));
                waterVO.setCode(paymentRecord.getCode());
                if (paymentRecord.getPayType()!=null){
@@ -868,8 +946,12 @@
                                    continue;
                                }
                            }
                            waterVO.setPayType("银行卡支付");
                            break;
                        case 3:
                        case 4:
                            continue;
                    }
                }
@@ -897,9 +979,78 @@
            switch (income.getOrderType()){
                case 1:
                    SettlementRecord settlementRecord = settlementRecordService.selectById(income.getSettlementRecordId());
                    if (settlementRecord!=null){
                        if (settlementRecord.getPaymentStatus()!=null && settlementRecord.getPaymentStatus() == 2){
                    if (settlementRecord!=null && settlementRecord.getPaymentStatus()!=null && settlementRecord.getPaymentStatus() == 2){
                        if (settlementRecord.getPayType()!=null){
                            switch (settlementRecord.getPayType()){
                                case 1:
                                    if (payType!=null){
                                        if (payType != 1){
                                            continue;
                                        }
                                    }
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    if (payType!=null){
                                        if (payType != 2){
                                            continue;
                                        }
                                    }
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                case 4:
                                    continue;
                            }
                        }
                    }else{
                        continue;
                    }
                    // 查询订单信息
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(income.getOrderId());
                    if (tOrderPrivateCar==null){
                        continue;
                    }
                    String code1 = tOrderPrivateCar.getOrderNum();
                    if(ToolUtil.isNotEmpty(code) && !code1.contains(code)){
                        continue;
                    }
                    platformVO.setCode(tOrderPrivateCar.getOrderNum());
                    TDriver tDriver = driverService.selectById(tOrderPrivateCar.getDriverId());
                    if (tDriver != null){
                        platformVO.setName(tDriver.getFirstName()+tDriver.getLastName());
                        platformVO.setPhone(tDriver.getPhone());
                    }
                    platformVO.setRemark(tOrderPrivateCar.getRemark());
                    if (income.getCreateTime()!=null){
                        platformVO.setInsertTime(format.format(income.getCreateTime()));
                    }
                    platformVO.setInsertTime(format.format(tOrderPrivateCar.getInsertTime()));
                    if (income.getPrice() != null){
                        String string = income.getPrice().toString();
                        BigDecimal bigDecimal1 = new BigDecimal(string);
                        platformVO.setMoney(bigDecimal1+"");
                    }else{
                        continue;
                    }
                    if (tOrderPrivateCar.getPayType() == null){
                        continue;
                    }
                    // 专车订单
                    String string4 = tOrderPrivateCar.getOrderMoney().toString();
                    balance = balance.add(new BigDecimal(string4));
                    res.add(platformVO);
                    break;
                case 4:
                    // 小件物流
                    // 查询订单信息
                    SettlementRecord settlementRecord1 = settlementRecordService.selectById(income.getSettlementRecordId());
                    if (settlementRecord1!=null){
                        if (settlementRecord1.getPaymentStatus()!=null && settlementRecord1.getPaymentStatus() == 2){
                            switch (settlementRecord1.getPayType()){
                                case 1:
                                    if (payType!=null){
                                        if (payType != 1){
@@ -927,74 +1078,34 @@
                    }else{
                        continue;
                    }
                    // 查询订单信息
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(income.getOrderId());
                    if (tOrderPrivateCar==null){
                        continue;
                    }
                    platformVO.setCode(tOrderPrivateCar.getOrderNum());
                    TDriver tDriver = driverService.selectById(tOrderPrivateCar.getDriverId());
                    if (tDriver != null){
                        platformVO.setName(tDriver.getFirstName()+tDriver.getLastName());
                        platformVO.setPhone(tDriver.getPhone());
                    }
                    platformVO.setRemark(tOrderPrivateCar.getRemark());
                    if (income.getCreateTime()!=null){
                        platformVO.setInsertTime(format.format(income.getCreateTime()));
                    }
                    platformVO.setInsertTime(format.format(tOrderPrivateCar.getInsertTime()));
                    if (income.getOrderMoney() != null){
                        String string = income.getPrice().toString();
                        BigDecimal bigDecimal1 = new BigDecimal(string);
                        platformVO.setMoney(bigDecimal1+"");
                    }else{
                        continue;
                    }
                    if (tOrderPrivateCar.getPayType() == null){
                        continue;
                    }
                    // 专车订单
                    String string4 = income.getPrice().toString();
                    balance = balance.add(new BigDecimal(string4));
                    res.add(platformVO);
                    break;
                case 4:
                    SettlementRecord settlementRecord1 = settlementRecordService.selectById(income.getSettlementRecordId());
                    if (settlementRecord1!=null&& settlementRecord1.getPaymentStatus()!=null && settlementRecord1.getPaymentStatus() == 2){
                        if (settlementRecord1.getPayType()!=null){
                            switch (settlementRecord1.getPayType()){
                                case 1:
                                    if (payType!=null){
                                        if (payType != 1){
                                            continue;
                                        }
                                    }
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    if (payType!=null){
                                        if (payType != 2){
                                            continue;
                                        }
                                    }
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                case 4:
                                    continue;
                            }
                        }
                    }else {
                        continue;
                    }
                    // 小件物流
                    // 查询订单信息
                    TOrderLogistics tOrderLogistics1 = orderLogisticsService.selectById(income.getOrderId());
                    if (tOrderLogistics1==null){
                        continue;
                    }
                    switch (tOrderLogistics1.getPayType()){
                        case 1:
                            if (payType!=null){
                                if (payType != 1){
                                    continue;
                                }
                            }
                            platformVO.setPayType("手机支付");
                            break;
                        case 2:
                            if (payType!=null){
                                if (payType != 2){
                                    continue;
                                }
                            }
                            platformVO.setPayType("银行卡支付");
                            break;
                        case 3:
                        case 4:
                            continue;
                    }
                    String code2 = tOrderLogistics1.getOrderNum();
                    if(ToolUtil.isNotEmpty(code) && !code2.contains(code)){
                        continue;
                    }
                    platformVO.setCode(tOrderLogistics1.getOrderNum());
@@ -1003,8 +1114,9 @@
                        platformVO.setName(tDriver1.getFirstName()+tDriver1.getLastName());
                        platformVO.setPhone(tDriver1.getPhone());
                    }
                    platformVO.setRemark(tOrderLogistics1.getRemark());
                    platformVO.setMoney(new BigDecimal(income.getPrice())+"");
                    platformVO.setMoney(BigDecimal.valueOf(income.getPrice())+"");
                    if (income.getCreateTime()!=null){
                        platformVO.setInsertTime(format.format(income.getCreateTime()));
                    }
@@ -1013,7 +1125,7 @@
                        continue;
                    }
                    String string1 = income.getPrice().toString();
                    String string1 = tOrderLogistics1.getOrderMoney().toString();
                    // 小件物流订单
                    balance = balance.add(new BigDecimal(string1));
                    res.add(platformVO);
@@ -1153,32 +1265,37 @@
            orderType = new EntityWrapper<TPubTransactionDetails>()
                    .eq("userType",1)
                    .eq("orderType", 5)
                    .between("insertTime",start,end)
            ;
            // 用户提现wrapper
            userWrapper = new EntityWrapper<TPubWithdrawal>()
                    .eq("state", 2)
                    .eq("userType", 1)
                    .between("insertTime",start,end)
            ;
            // 司机提现wrapper
            between = new EntityWrapper<TPubWithdrawal>()
                    .eq("state", 2)
                    .eq("userType", 2);
                    .eq("userType", 2).between("insertTime",start,end);
            // 用户专车订单wrapper
            tOrderPrivateCarEntityWrapper
                    .isNotNull("payMoney")
                    .in("payType",Arrays.asList(1, 2));
                    .in("payType",Arrays.asList(1, 2)).between("insertTime",start,end);
            // 用户小件物流订单wrapper
            tOrderLogisticsEntityWrapper
                    .isNotNull("payMoney")
                    .in("payType",Arrays.asList(1, 2));
                    .in("payType",Arrays.asList(1, 2)).between("insertTime",start,end);
            // 司机手动结算金额
            orderType1 = new EntityWrapper<SettlementDetail>()
                    .isNotNull("settlementRecordId")
                    .in("orderType", Arrays.asList(1, 4));
                    .in("orderType", Arrays.asList(1, 4)).between("insertTime",start,end);
            // 用户取消订单费用
             orderCancelEntityWrapper.eq("state", 2)
                     .in("payType",integers)
                    .eq("userType", 1);
                    .eq("userType", 1)
                     .between("insertTime",start,end);
        }else{
            orderType = new EntityWrapper<TPubTransactionDetails>()
                    .eq("orderType", 5)
@@ -1253,12 +1370,13 @@
            // 只查询用户订单
            tOrderPrivateCars = orderPrivateCarService.selectList(tOrderPrivateCarEntityWrapper);
            tOrderLogistics = orderLogisticsService.selectList(tOrderLogisticsEntityWrapper);
            orderCancels = orderCancelService.selectList(orderCancelEntityWrapper);
            tPubTransactionDetails = pubTransactionDetailsService.selectList(orderType);
            // 只查询司机手动结算的
            settlementDetails1 = settlementDetailService.selectList(orderType1);
            driver = pubWithdrawalService.selectList(between);
            user = pubWithdrawalService.selectList(userWrapper);
            orderCancels = orderCancelService.selectList(orderCancelEntityWrapper);
        }
        List<WaterVO> res = new ArrayList<>();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -1341,7 +1459,6 @@
            }
            res.add(waterVO);
            userConsume = userConsume.add(new BigDecimal(waterVO.getMoney()));
            break;
        }
        for (OrderCancel orderCancel : orderCancels) {
            WaterVO waterVO = new WaterVO();
@@ -1766,6 +1883,8 @@
                    .eq("userType", 1)
                    .eq("objectId",1)
                    .ne("type", 1)
                    .between("insertTime", start, end)
                    .isNotNull("orderType"));
        }else{
@@ -1774,6 +1893,8 @@
                        .eq("userType", 1)
                        .eq("objectId",1)
                        .ne("type", 1)
                        .between("insertTime", start, end)
                        .isNotNull("orderType"));
            }else{
                incomes = tIncomeService.selectList(new EntityWrapper<Income>()
@@ -1785,6 +1906,10 @@
            }
        }
        EntityWrapper<SettlementDetail> settlementDetailEntityWrapper = new EntityWrapper<>();
        settlementDetailEntityWrapper.between("createTime", start, end);
        if (state!=null && state == 2){
            settlementDetailEntityWrapper.eq("paymentStatus", 2);
        }
        if (time == 5 && !StringUtils.hasLength(insertTime)){
        }else{
@@ -1808,7 +1933,11 @@
                        continue;
                    }
                    // 查询订单信息
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(income.getIncomeId());
//                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(income.getIncomeId());
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>()
                            .eq("id", income.getIncomeId())
                            .between("insertTime", start, end));
                    if (tOrderPrivateCar==null){
                        continue;
                    }
@@ -1824,23 +1953,47 @@
                    }
                    platformVO.setMoney(new BigDecimal(income.getMoney()));
                    platformVO.setInsertTime(format.format(income.getInsertTime()));
                    if (tOrderPrivateCar.getPayType() == null){
                    if (tOrderPrivateCar.getState()!=10 && tOrderPrivateCar.getPayType() == null){
                        continue;
                    }
                    switch (tOrderPrivateCar.getPayType()){
                        case 1:
                            platformVO.setPayType("手机支付");
                            break;
                        case 2:
                            platformVO.setPayType("银行卡支付");
                            break;
                        case 3:
                            platformVO.setPayType("余额支付");
                            break;
                        case 4:
                            platformVO.setPayType("现金支付");
                            break;
                    if (tOrderPrivateCar.getState() == 10){
                        // 查询取消订单 用户支付方式
                        OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>()
                                .eq("orderType", 1)
                                .eq("orderId", tOrderPrivateCar.getId()));
                        if (orderCancel!=null &&orderCancel.getPayType()!=null){
                            switch (orderCancel.getPayType()){
                                case 1:
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                    platformVO.setPayType("余额支付");
                                    break;
                            }
                        }
                    }else{
                        if (tOrderPrivateCar.getPayType()!=null){
                            switch (tOrderPrivateCar.getPayType()){
                                case 1:
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                    platformVO.setPayType("余额支付");
                                    break;
                                case 4:
                                    platformVO.setPayType("现金支付");
                                    break;
                            }
                        }
                    }
                    // 专车订单
                    balance = balance.add(new BigDecimal(income.getMoney()));
@@ -1852,7 +2005,10 @@
                    }
                    // 小件物流
                    // 查询订单信息
                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(income.getIncomeId());
//                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(income.getIncomeId());
                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectOne(new EntityWrapper<TOrderLogistics>()
                            .eq("id", income.getIncomeId())
                            .between("insertTime", start, end));
                    if (tOrderLogistics==null){
                        continue;
                    }
@@ -1868,22 +2024,44 @@
                        platformVO.setEndTime(format.format(income.getInsertTime()));
                    }
                    platformVO.setInsertTime(format.format(tOrderLogistics.getInsertTime()));
                    if (tOrderLogistics.getPayType() == null){
                    if (tOrderLogistics.getState()!=10 && tOrderLogistics.getPayType() == null){
                        continue;
                    }
                    switch (tOrderLogistics.getPayType()){
                        case 1:
                            platformVO.setPayType("手机支付");
                            break;
                        case 2:
                            platformVO.setPayType("银行卡支付");
                            break;
                        case 3:
                            platformVO.setPayType("余额支付");
                            break;
                        case 4:
                            platformVO.setPayType("现金支付");
                            break;
                    if (tOrderLogistics.getState() == 10){
                        // 查询取消订单 用户支付方式
                        OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>()
                                .eq("orderType", 4)
                                .eq("orderId", tOrderLogistics.getId()));
                        if (orderCancel!=null &&orderCancel.getPayType()!=null){
                            switch (orderCancel.getPayType()){
                                case 1:
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                    platformVO.setPayType("余额支付");
                                    break;
                            }
                        }
                    }else{
                        if (tOrderLogistics.getPayType()!=null){
                            switch (tOrderLogistics.getPayType()){
                                case 1:
                                    platformVO.setPayType("手机支付");
                                    break;
                                case 2:
                                    platformVO.setPayType("银行卡支付");
                                    break;
                                case 3:
                                    platformVO.setPayType("余额支付");
                                    break;
                                case 4:
                                    platformVO.setPayType("现金支付");
                                    break;
                            }
                        }
                    }
                    // 专车订单
@@ -1898,7 +2076,10 @@
            switch (settlementDetail.getOrderType()){
                case 1:
                    // 专车订单
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(settlementDetail.getOrderId());
//                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(settlementDetail.getOrderId());
                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>()
                            .eq("id", settlementDetail.getOrderId())
                            .between("insertTime", start, end));
                    if (tOrderPrivateCar==null){
                        continue;
                    }
@@ -1944,7 +2125,10 @@
                case 4:
                    // 小件物流
                    // 查询订单信息
                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(settlementDetail.getOrderId());
//                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(settlementDetail.getOrderId());
                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectOne(new EntityWrapper<TOrderLogistics>()
                            .eq("id", settlementDetail.getOrderId())
                            .between("insertTime", start, end));
                    if (tOrderLogistics==null){
                        continue;
                    }