| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.QueryStockPreDo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | |
| | | @Service("locDetlService") |
| | | public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService { |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @Override |
| | | public Page<LocDetl> getStockOut(Page<LocDetl> page) { |
| | |
| | | |
| | | @Override |
| | | public List<LocDetl> findSingleAreaByMatnr(String matnr) { |
| | | return this.baseMapper.findAreaByMatnr(matnr, 1); |
| | | ArrayList<LocDetl> list = new ArrayList<>(); |
| | | List<LocDetl> locDetls = this.baseMapper.findAreaByMatnr(matnr, 1); |
| | | |
| | | //将查出来的数据进行排序。1-3,8-11,15-18row需要颠倒顺序 |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (list.contains(locDetl)) { |
| | | continue; |
| | | } |
| | | |
| | | String locNo = locDetl.getLocNo(); |
| | | List<String> outerSingleLoc = Utils.getGroupLoc(locNo); |
| | | List<LocMast> locMasts = locMastService.selectByLocNos(outerSingleLoc); |
| | | int locRow = Utils.getRow(locNo); |
| | | if (locRow >= 1 && locRow <= 3 |
| | | || locRow >= 8 && locRow <= 11 |
| | | || locRow >= 15 && locRow <= 18) { |
| | | Collections.reverse(locMasts); |
| | | } |
| | | |
| | | for (LocMast locMast : locMasts) { |
| | | if (!locMast.getLocSts().equals("F")) { |
| | | continue; |
| | | } |
| | | |
| | | if (locMast.getLocType2() != 1) { |
| | | continue; |
| | | } |
| | | |
| | | for (LocDetl detl : this.baseMapper.selectByLocNo(locMast.getLocNo())) { |
| | | if (detl.getMatnr().equals(locDetl.getMatnr())) { |
| | | if (!list.contains(detl)) { |
| | | list.add(detl); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |