| | |
| | | private SysDeptService sysDeptService; |
| | | |
| | | /** |
| | | * reportInoutDetailPR#getQuery 根据报表类型,获取默认查询信息,比如表头信息等 |
| | | * reportInDetailPR#getQuery 根据报表类型,获取默认查询信息,比如表头信息等 |
| | | * |
| | | * @param |
| | | * @return |
| | |
| | | result.setTitle(deptName + "入库明细汇总"); |
| | | result.setDeptId(deptId); |
| | | } |
| | | result.setUnit("千克(KG)"); |
| | | result.setEnd(new Date()); |
| | | Date start = DateUtil.getNewByDay(new Date(), -30); |
| | | result.setStart(start); |
| | | |
| | | result.setTimeDesc( |
| | | DateFormatUtils.format(start, "yyyy-MM-dd") + " 截至:" |
| | | DateFormatUtils.format(start, "yyyy-MM-dd") + " 至 " |
| | | + DateFormatUtils.format(new Date(), "yyyy-MM-dd")); |
| | | |
| | | result.setCreateUser(ContextUtil.getLoginUserName()); |
| | | result.setCreateTime(new Date()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 出入库汇总表 |
| | | * reportInoutDetailPR#listRecord 报表数据,只获取已经完成的,并且非异常数据和删除数据 |
| | | * reportInDetailPR#listRecord 报表数据,只获取已经完成的,并且非异常数据和删除数据 |
| | | * |
| | | * @param param |
| | | * @return |
| | |
| | | } |
| | | //查询入库数据 |
| | | param.setType(Constant.TYPE_IN); |
| | | param.setProgress(Constant.PROGRESS_RECORD); |
| | | param.setRecordStatus(Constant.RECORD_STATUS_NORMAL); |
| | | //多参数分页查询 |
| | | 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())){ |
| | | String substring = param.getDeptId().substring(0, (param.getDeptId().length() - 3)); |
| | | if (!substring.equals(param.getCompanyId())){ |
| | | return new ArrayList<InoutRecord>(); |
| | | } |
| | | } |
| | | if(StringUtils.isEmpty(param.getDeptId())){ |
| | | param.setDeptId(param.getCompanyId()); |
| | | } |
| | | |
| | | param.setCompanyId(null); |
| | | inoutReportService.listPageInout(corePage, param); |
| | | //获取查询到得list数据 |
| | | List<InoutRecord> result = corePage.getRecords(); |
| | |
| | | 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))); |
| | | } |
| | | list.add(record); |
| | | record.setRemarks(String.valueOf(index)); |
| | | emptyWeightSum += record.getEmptyWeight(); |