Pu Zhibing
3 天以前 5dacdee9b54c78372b68140e2b068d03a620eab9
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/IncomeServiceImpl.java
@@ -1,18 +1,17 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.beetl.ShiroExtUtil;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.ExcelUtil;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.dao.IncomeMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.model.Income;
import com.stylefeng.guns.modular.system.service.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
@@ -44,6 +43,8 @@
    @Autowired
    private ITDriverService driverService;
    @Resource
    private ShiroExtUtil shiroExtUtil;
    /**
@@ -230,7 +231,7 @@
        Map<String, Object> maps = new HashMap<>();
    
        List<Map<String, Object>> datas = new ArrayList<>();
        List<Map<String, Object>> list2 = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, offset, limit);
        List<Map<String, Object>> list2 = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, offset, limit);
        for (Map<String, Object> income : list2) {
            Double orderMoney = Double.valueOf(null != income.get("orderMoney") ? income.get("orderMoney").toString() : "0");
            Double payMoney = Double.valueOf(income.get("payMoney").toString());
@@ -318,7 +319,7 @@
        }
        List<Map<String, Object>> datas1 = new ArrayList<>();
        list2 = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        list2 = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        for (Map<String, Object> income : list2) {
            Double orderMoney = Double.valueOf(null != income.get("orderMoney") ? income.get("orderMoney").toString() : "0");
            Double payMoney = Double.valueOf(income.get("payMoney").toString());
@@ -448,7 +449,7 @@
            endTime = split[1];
        }
    
        List<Map<String, Object>> list = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        List<Map<String, Object>> list = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        List<Map<String, Object>> datas = new ArrayList<>();
        Integer num = 0;
@@ -576,8 +577,8 @@
        }
        Map<String, Object> maps = new HashMap<>();
    
        List<Map<String, Object>> list1 = this.baseMapper.summaryOfSpendingDetailsList1(ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, offset, limit);
        List<Map<String, Object>> list2 = this.baseMapper.summaryOfSpendingDetailsList1(ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        List<Map<String, Object>> list1 = this.baseMapper.summaryOfSpendingDetailsList1(shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, offset, limit);
        List<Map<String, Object>> list2 = this.baseMapper.summaryOfSpendingDetailsList1(shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        BigDecimal orderRevenue = new BigDecimal("0");
        BigDecimal activityAward = new BigDecimal("0");
        BigDecimal other = new BigDecimal("0");
@@ -598,7 +599,7 @@
        maps.put("rows", list1);
        System.out.println("支出明细"+list1);
    
        list1 = this.baseMapper.summaryOfSpendingDetailsList1(ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        list1 = this.baseMapper.summaryOfSpendingDetailsList1(shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        maps.put("total", list1.size());
        return maps;
    }
@@ -613,7 +614,7 @@
            endTime = split[1];
        }
    
        List<Map<String, Object>> list1 = this.baseMapper.summaryOfSpendingDetailsList1(ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        List<Map<String, Object>> list1 = this.baseMapper.summaryOfSpendingDetailsList1(shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null);
        String[] title = new String[]{"时间", "订单类型", "收益类型", "司机名称", "司机手机号", "订单应支付金额", "平台奖励支出", "其他支出", "支出合计"};
        String[][] values = new String[list1.size()][9];
        int n = 0;