| | |
| | | return R.ok(locDetlPage); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/groupLocExport/auth") |
| | | @ManagerAuth(memo = "库位汇总导出") |
| | | public R groupLocExport(@RequestBody JSONObject param) { |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("locDetl")); |
| | | Map<String, Object> queryParam = new HashMap<>(); |
| | | putIfPresent(queryParam, "matnr", map.get("matnr")); |
| | | putIfPresent(queryParam, "maktx", map.get("maktx")); |
| | | putIfPresent(queryParam, "specs", map.get("specs")); |
| | | putIfPresent(queryParam, "warnStatus", map.get("warnStatus")); |
| | | int total = Optional.ofNullable(locDetlMapper.groupLocListCount(queryParam)).orElse(0); |
| | | if (total <= 0) { |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | queryParam.put("pageNumber", 1); |
| | | queryParam.put("pageSize", total); |
| | | List<AbnormalLocDetlParam> list = locDetlMapper.groupLocList(queryParam); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | private void putIfPresent(Map<String, Object> target, String key, Object value) { |
| | | String normalized = normalizeFilterText(value); |
| | | if (normalized != null) { |