Pu Zhibing
2025-02-08 f1c81c66b4ce666e61a3604e299ea41b874fa8b7
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SettlementRecordServiceImpl.java
@@ -93,10 +93,16 @@
            JSONObject jsonObject = JSON.parseObject(settlementAllocation.getContent());
            Integer type = jsonObject.getInteger("type");
            querySettlementAmount.setType(type);
            List<SettlementRecord> settlementRecords = this.selectList(new EntityWrapper<SettlementRecord>().eq("driverId", driverId).eq("paymentStatus", 1));
            //所有未支付的主表数据
            List<SettlementRecord> settlementRecords = this.selectList(new EntityWrapper<SettlementRecord>().eq("driverId", driverId)
                    .eq("paymentStatus", 1));
            double sum = settlementRecords.stream().mapToDouble(SettlementRecord::getPayMoney).sum();
            List<SettlementDetail> settlementDetailList = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", driverId).isNull("settlementRecordId"));
            //所有未生成主表数据的明细
            List<SettlementDetail> settlementDetailList = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", driverId)
                    .isNull("settlementRecordId"));
            double sum1 = settlementDetailList.stream().mapToDouble(SettlementDetail::getPrice).sum();
            //显示的金额
            querySettlementAmount.setAmount(new BigDecimal(sum).add(new BigDecimal(sum1)).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
    
            List<Integer> collect = settlementRecords.stream().map(SettlementRecord::getId).collect(Collectors.toList());
@@ -148,7 +154,9 @@
            JSONObject jsonObject = JSON.parseObject(settlementAllocation.getContent());
            Integer type = jsonObject.getInteger("type");
    
            List<SettlementDetail> settlementDetails = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", driverId).isNull("settlementRecordId"));
            //所以未生成主表的明细数据
            List<SettlementDetail> settlementDetails = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", driverId)
                    .isNull("settlementRecordId"));
            double sum = settlementDetails.stream().mapToDouble(SettlementDetail::getPrice).sum();
            if(sum > 0){
                SettlementRecord settlementRecord = new SettlementRecord();