|  |  |  | 
|---|
|  |  |  | return R.ok(matService.getById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/mat/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R find(@RequestParam("matnr") String matnr) { | 
|---|
|  |  |  | Mat one = matService.getOne(new LambdaQueryWrapper<Mat>() | 
|---|
|  |  |  | .eq(Mat::getMatnr, matnr) | 
|---|
|  |  |  | .eq(Mat::getHostId, getHostId())); | 
|---|
|  |  |  | if (Cools.isEmpty(one)){ | 
|---|
|  |  |  | return R.error("未查询到相关物料"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(one); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/mat/page/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R page(@RequestParam(defaultValue = "1") Integer curr, | 
|---|
|  |  |  | 
|---|
|  |  |  | LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<>(); | 
|---|
|  |  |  | wrapper.eq(Mat::getHostId, getHostId()); | 
|---|
|  |  |  | if (!Cools.isEmpty(condition)) { | 
|---|
|  |  |  | wrapper.like(Mat::getId, condition); | 
|---|
|  |  |  | wrapper.like(Mat::getMatnr, condition); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | matService.page(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(item.getMatnr(), item.getId()))); | 
|---|
|  |  |  | return R.ok().add(vos); | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.ok().add(orderDetl); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/mat/list/pda/page/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R pdaPageList(@RequestParam(required = true)Long tagId, | 
|---|
|  |  |  | @RequestParam(defaultValue = "1")Integer curr, | 
|---|
|  |  |  | @RequestParam(defaultValue = "10")Integer limit){ | 
|---|
|  |  |  | LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<>(); | 
|---|
|  |  |  | wrapper.eq(Mat::getHostId, getHostId()); | 
|---|
|  |  |  | wrapper.orderBy(true, false,Mat::getCreateTime); | 
|---|
|  |  |  | return R.ok().add(matService.page(new Page<>(curr, limit), wrapper)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|