| | |
| | | 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 |
| | | */ |
| | |
| | | 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()); |
| | |
| | | result.put("createTime", new Date()); |
| | | result.put("title", title); |
| | | result.put("type", type); |
| | | |
| | | |
| | | return result; |
| | | } |
| | |
| | | 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); |
| | |
| | | result.put("createUser", ContextUtil.getLoginUserName()); |
| | | result.put("createTime", new Date()); |
| | | result.put("title", title); |
| | | |
| | | |
| | | return result; |
| | | } |
| | |
| | | //多参数分页查询 |
| | | 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()); |
| | | } |
| | | |
| | |
| | | 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)); |