sgj
2026-03-02 747a4a421dc8c1faf1c768aaac0fc7abc258e2c0
fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInoutPR.java
@@ -15,11 +15,13 @@
import com.ruoyi.common.utils.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.util.*;
/**
 * @Description  出入库相关报表
 * @Description 出入库相关报表
 * @Author CZT
 * @Date 2025/12/29 10:32
 */
@@ -51,20 +53,20 @@
        result.put("deptId", deptId);
        //获取分库编码对应的分库名称
        String deptName = "";
        SysDept subDept = sysDeptService.getCacheDept(null, ContextUtil.subDeptId(null));
        if (null != subDept) {
            deptName = subDept.getDeptName();
        }
//        String deptName = "";
//        SysDept subDept = sysDeptService.getCacheDept(null, ContextUtil.subDeptId(null));
//        if (null != subDept) {
//            deptName = subDept.getDeptName();
//        }
        String title = "汇总表";
        if ("IN".equals(type)) {
            title= deptName + "入库明细汇总";
            title =  "入库明细汇总";
        }
        if ("OUT".equals(type)) {
            title= deptName + "出库明细汇总";
            title =  "出库明细汇总";
        }
        if ("STORE".equals(type)) {
            title= deptName + "库存汇总表";
            title =  "库存汇总表";
        }
        result.put("end", new Date());
@@ -77,7 +79,7 @@
        result.put("createUser", ContextUtil.getLoginUserName());
        result.put("createTime", new Date());
        result.put("title", title);
        result.put("type", type);
        return result;
    }
@@ -97,12 +99,12 @@
        result.put("deptId", deptId);
        //获取分库编码对应的分库名称
        String deptName = "";
        SysDept subDept = sysDeptService.getCacheDept(null, ContextUtil.subDeptId(null));
        if (null != subDept) {
            deptName = subDept.getDeptName();
        }
        String title = deptName + "库存汇总表";
//        String deptName = "";
//        SysDept subDept = sysDeptService.getCacheDept(null, ContextUtil.subDeptId(null));
//        if (null != subDept) {
//            deptName = subDept.getDeptName();
//        }
        String title = "库存汇总表";
        result.put("end", new Date());
        Date start = DateUtil.getNewByDay(new Date(), -30);
@@ -114,7 +116,6 @@
        result.put("createUser", ContextUtil.getLoginUserName());
        result.put("createTime", new Date());
        result.put("title", title);
        return result;
    }
@@ -138,13 +139,13 @@
        //多参数分页查询
        com.baomidou.mybatisplus.extension.plugins.pagination.Page<InoutRecord> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(0, 10000);
        //收储公司查询处理
        if(StringUtils.isNotEmpty(param.getDeptId()) && StringUtils.isNotEmpty(param.getCompanyId())){
        if (StringUtils.isNotEmpty(param.getDeptId()) && StringUtils.isNotEmpty(param.getCompanyId())) {
            String substring = param.getDeptId().substring(0, (param.getDeptId().length() - 3));
            if (!substring.equals(param.getCompanyId())){
            if (!substring.equals(param.getCompanyId())) {
                return new ArrayList<InoutRecord>();
            }
        }
        if(StringUtils.isEmpty(param.getDeptId())){
        if (StringUtils.isEmpty(param.getDeptId())) {
            param.setDeptId(param.getCompanyId());
        }
@@ -161,8 +162,8 @@
        int index = 1;
        List<InoutRecord> list = new ArrayList<>();
        for (InoutRecord record : result) {
            if(StringUtils.isNotBlank(record.getDeptId())){
                record.setCompanyId(record.getDeptId().substring(0,(record.getDeptId().length()-3)));
            if (StringUtils.isNotBlank(record.getDeptId())) {
                record.setCompanyId(record.getDeptId().substring(0, (record.getDeptId().length() - 3)));
            }
            list.add(record);
            record.setRemarks(String.valueOf(index));