| | |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | |
| | | // @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param) { |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | MatCode mat = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",locDetl.getMatNo())); |
| | | // MatCode mat = matCodeService.selectById(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | VersionUtils.setLocDetl(locDetl, mat); |
| | | } |
| | | } |
| | | // for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | // MatCode mat = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",locDetl.getMatNo())); |
| | | //// MatCode mat = matCodeService.selectById(locDetl.getMatnr()); |
| | | // if (mat != null) { |
| | | // VersionUtils.setLocDetl(locDetl, mat); |
| | | // } |
| | | // } |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | |
| | | //库位报表导出 |
| | | @RequestMapping(value = "/stock/statis/export") |
| | | public void stockStatisExport(HttpServletResponse response) throws IOException { |
| | | List<LocDetl> excel = locDetlService.getStockStatisExcel(); |
| | | public void stockStatisExport(@RequestParam(required = false) String matNo, |
| | | @RequestParam(required = false) String matName, |
| | | @RequestParam(required = false) String supplier, |
| | | @RequestParam(required = false) String str3, |
| | | @RequestParam(required = false) String str4, |
| | | @RequestParam(required = false) String memo, |
| | | HttpServletResponse response) throws IOException { |
| | | LocDetl param = new LocDetl(); |
| | | param.setMatNo(matNo!=null ? matNo : ""); |
| | | param.setMatName(matName!=null ? matName : ""); |
| | | param.setSupplier(supplier!=null ? supplier : ""); |
| | | param.setStr3(str3!=null ? str3 : ""); |
| | | param.setStr4(str4!=null ? str4 : ""); |
| | | param.setMemo(memo!=null ? memo : ""); |
| | | |
| | | List<LocDetl> excel = locDetlService.getStockStatisExcel(param); |
| | | for (LocDetl locDetl : excel) { |
| | | MatCode mat = matCodeService.selectById(locDetl.getMatNo()); |
| | | if (mat != null) { |