| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.common.utils.TreeUtils; |
| | | import com.zy.asrs.common.wms.entity.LocDetl; |
| | | import com.zy.asrs.common.wms.entity.LocMast; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import com.zy.asrs.common.wms.entity.OrderDetl; |
| | | import com.zy.asrs.common.wms.service.LocDetlService; |
| | | import com.zy.asrs.common.wms.service.LocMastService; |
| | | import com.zy.asrs.common.wms.service.MatService; |
| | | import com.zy.asrs.framework.annotations.ManagerAuth; |
| | | import com.zy.asrs.framework.common.Cools; |
| | |
| | | private MatService matService; |
| | | @Autowired |
| | | private TreeUtils treeUtils; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @RequestMapping(value = "/mat/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok().add(matService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/pad/search") |
| | | @ManagerAuth |
| | | public R padSearch(@RequestParam("matnr") String matnr) { |
| | | List<Mat> list = matService.list(new LambdaQueryWrapper<Mat>() |
| | | .like(Mat::getMatnr, matnr) |
| | | .eq(Mat::getHostId, getHostId())); |
| | | if (list.isEmpty()){ |
| | | return R.error("未查询到相关物料"); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/pad/searchLoc") |
| | | @ManagerAuth |
| | | public R padSearchLoc(@RequestParam("matnr") String matnr) { |
| | | List<LocDetl> list = locDetlService.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getMatnr, matnr).eq(LocDetl::getHostId, getHostId())); |
| | | |
| | | ArrayList<LocDetl> locDetls = new ArrayList<>(); |
| | | for (LocDetl locDetl : list) { |
| | | LocMast one = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, locDetl.getLocNo()).eq(LocMast::getHostId, locDetl.getHostId())); |
| | | if (one == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (!one.getLocSts().equals("F")) { |
| | | continue; |
| | | } |
| | | |
| | | locDetls.add(locDetl); |
| | | } |
| | | return R.ok(locDetls); |
| | | } |
| | | |
| | | } |