| | |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | // EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | // excludeTrash(param); |
| | | // convert(param, wrapper); |
| | | // if (!Cools.isEmpty(orderByField)){ |
| | | // wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | // } |
| | | // Page<Mat> page = matService.selectPage(new Page<>(curr, limit), wrapper); |
| | | // |
| | | // return R.ok().add(page); |
| | | Object tagId = param.get("tag_id"); |
| | | if (Cools.isEmpty(tagId)) { |
| | | tagId = getOriginTag().getId(); |
| | | } |
| | | return R.ok(matService.getPage(new Page<>(curr, limit), String.valueOf(tagId))); |
| | | return R.ok(matService.getPage(new Page<>(curr, limit) |
| | | , String.valueOf(tagId) |
| | | , param.get("matnr") |
| | | , param.get("maktx")) |
| | | ); |
| | | |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | wrapper.like("matnr", condition).or().like("maktx", condition); |
| | | Page<Mat> page = matService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Mat mat : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", mat.getId()); |
| | | map.put("value", mat.getId()); |
| | | map.put("value", mat.getMatnr() + "(" + mat.getMaktx() + ")"); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |