| | |
| | | @Resource |
| | | private LocCountMapper locCountMapper; |
| | | |
| | | @Override |
| | | public R getAllLocations() { |
| | | List<AllLocationsVo> allLocationsVos = new ArrayList<>(); |
| | | List<LocMast> locMastList = locMastService.selectList(new EntityWrapper<>()); |
| | | locMastList.forEach(locMast -> { |
| | | AllLocationsVo allLocationsVo = new AllLocationsVo(); |
| | | allLocationsVo.setLocNo(locMast.getLocNo()); |
| | | String locSts = locMast.getLocSts(); |
| | | allLocationsVo.setLocSts(locSts); |
| | | // 有库存 |
| | | if (locSts.equals("F") || locSts.equals("P") || locSts.equals("Q") || locSts.equals("R")) { |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | if (!locDetls.isEmpty()) { |
| | | List<AllLocationsVo.LocDetl> locDetlList = locDetls.stream().map(locDetl -> { |
| | | AllLocationsVo.LocDetl locDetl1 = new AllLocationsVo.LocDetl(); |
| | | BeanUtils.copyProperties(locDetl, locDetl1); |
| | | return locDetl1; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | allLocationsVo.setLocDetls(locDetlList); |
| | | } |
| | | } |
| | | allLocationsVos.add(allLocationsVo); |
| | | }); |
| | | return R.ok(allLocationsVos); |
| | | } |
| | | |
| | | /** |
| | | * 总览:总库位、已用库位、剩余库位、今日出库、今日入库、剩余库位 |
| | | * |