| | |
| | | return R.ok(matService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/matCode/auth") |
| | | @ManagerAuth |
| | | public R find(@RequestParam("matnr") String matnr) { |
| | | return R.ok(matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | |
| | | @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)); |
| | | Object tagId = param.get("tag_id"); |
| | | if (Cools.isEmpty(tagId)) { |
| | | tagId = getOriginTag().getId(); |
| | | } |
| | | Page<Mat> page = matService.selectPage(new Page<>(curr, limit), wrapper); |
| | | return R.ok(matService.getPage(new Page<>(curr, limit) |
| | | , String.valueOf(tagId) |
| | | , param.get("matnr") |
| | | , param.get("maktx")) |
| | | ); |
| | | |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |