| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocCount; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.digitaltwin.*; |
| | | import com.zy.asrs.entity.mes.StockDetl; |
| | | import com.zy.asrs.mapper.DigitalTwinMapper; |
| | | import com.zy.asrs.mapper.LocCountMapper; |
| | | import com.zy.asrs.service.DigitalTwinService; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | return dbDetainMats; |
| | | } |
| | | |
| | | @Resource |
| | | private LocDetlService locDetlService; |
| | | |
| | | @Resource |
| | | private LocMastService locMastService; |
| | | |
| | | /** |
| | | * 查询库存和库位详细信息 |
| | | * |
| | | * @param areaId |
| | | * @return |
| | | */ |
| | | public List<DtLocDetailVo> warehouseDetail(String areaId) { |
| | | List<DtLocDetailVo> locDetailVos = new ArrayList<>(); |
| | | public R warehouseDetail(String areaId) { |
| | | List<LocDetl> locDetls; |
| | | locDetls = locDetlService.selectList(new EntityWrapper<>()); |
| | | |
| | | List<LocMast> locMasts = new ArrayList<>(); |
| | | List<LocDetl> locDetls = new ArrayList<>(); |
| | | List<String> locNoList = locDetls.stream().map(LocDetl::getLocNo).distinct().collect(Collectors.toList()); |
| | | List<DtLocDetailVo> dtLocDetailVoList = new ArrayList<>(); |
| | | for (String locNo: locNoList) { |
| | | |
| | | for (LocMast locMast : locMasts) { |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | DtLocDetailVo dtLocDetailVo = new DtLocDetailVo(); |
| | | dtLocDetailVo.setLocMast(locMast); |
| | | dtLocDetailVo.setLocNo(locMast.getLocNo()); |
| | | dtLocDetailVo.setLocNo(locNo); |
| | | dtLocDetailVo.setLocSts(locMast.getLocSts()); |
| | | dtLocDetailVo.setRow1(locMast.getRow1()); |
| | | dtLocDetailVo.setBay1(locMast.getBay1()); |
| | | dtLocDetailVo.setLev1(locMast.getLev1()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | List<LocDetl> locDetl1 = locDetls.parallelStream().filter(a -> a.getLocNo().equals(locDetl.getLocNo())).collect(Collectors.toList()); |
| | | if (locDetl1 != null && locDetl1.size() == 1) { |
| | | dtLocDetailVo.setLocDetl(locDetl1.get(0)); |
| | | dtLocDetailVo.setAreaId(locDetl.getAreaId()); |
| | | dtLocDetailVo.setAreaName(locDetl.getAreaName()); |
| | | } |
| | | |
| | | List<LocDetl> locDetlList2 = locDetls.parallelStream().filter(o-> o.getLocNo().equals(locNo)).collect(Collectors.toList()); |
| | | List<StockDetl> stockDetls = new ArrayList<>(); |
| | | for(LocDetl locDetl:locDetlList2) { |
| | | StockDetl stockDetl = new StockDetl(); |
| | | stockDetl.setMatnr(locDetl.getMatnr()); |
| | | stockDetl.setMaktx(locDetl.getMaktx()); |
| | | stockDetl.setAnfme(locDetl.getAnfme()); |
| | | stockDetls.add(stockDetl); |
| | | } |
| | | locDetailVos.add(dtLocDetailVo); |
| | | dtLocDetailVo.setLocDetl(stockDetls); |
| | | dtLocDetailVoList.add(dtLocDetailVo); |
| | | } |
| | | |
| | | return locDetailVos; |
| | | return R.ok(dtLocDetailVoList); |
| | | } |
| | | |
| | | /** |