| | |
| | | allLike(LocNormal.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } else { |
| | | wrapper.orderBy("appe_time", false); |
| | | } |
| | | if (Cools.isEmpty(param.get("state"))) { |
| | | wrapper.in("state", "1,2"); |
| | |
| | | LocNormalExcelListener listener = new LocNormalExcelListener(getUserId()); |
| | | EasyExcel.read(file.getInputStream(), LocNormalExcel.class, listener).sheet().doRead(); |
| | | return R.ok("成功导入" + listener.getTotal() + "条物料信息"); |
| | | } |
| | | |
| | | /* 导出 */ |
| | | @RequestMapping(value = "/locNormal/export/auth") |
| | | @ManagerAuth(memo = "平仓管理导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<LocNormal> wrapper = new EntityWrapper<LocNormal>(); |
| | | wrapper.ne("state", "3"); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("exportData")); |
| | | convert(map, wrapper); |
| | | List<LocNormal> list = locNormalService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | /* 平仓入库 成品 */ |
| | |
| | | allLike(LocNormalLog.class, param.keySet(), wrapper, condition); |
| | | return R.ok(locNormalLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | //excel导出 |
| | | @RequestMapping("/locNomal/normalReportExport.action") |
| | | @ManagerAuth(memo = "日入库明细统计导出") |
| | | public R normalReportExport(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | @SuppressWarnings("unchecked") |
| | | List<LocNormalLog> list = JSONObject.parseArray(param.getJSONArray("exportData").toJSONString(), LocNormalLog.class); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | } |