| | |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | 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<String> getSameDetl(String matnr, Integer start, Integer end) { |
| | | return this.baseMapper.selectSameDetl(matnr, start, end); |
| | | public List<String> getSameDetl(String matnr) { |
| | | return this.baseMapper.selectSameDetl(matnr); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public Page<LocDetl> getStockStatis2(Page<LocDetl> page) { |
| | | page.setRecords(baseMapper.getStockStatis2(page.getCondition())); |
| | | page.setTotal(baseMapper.getStockStatisCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public Page<LocDetl> getStockStatisOut(Page<LocDetl> page) { |
| | | page.setRecords(baseMapper.getStockStatisOut(page.getCondition())); |
| | | page.setTotal(baseMapper.getStockStatisOutCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | |
| | | return this.baseMapper.selectByLocNo(locNo); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> selectByLocNosAndMatnr(List<String> locNos, String matnr) { |
| | | return this.baseMapper.selectByLocNosAndMatnr(locNos, matnr); |
| | | } |
| | | |
| | | @Override |
| | | public LocDetl selectItem(String locNo, String matnr, String batch) { |
| | | return this.baseMapper.selectItem(locNo, matnr, batch); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> searchByLike(String orderNo, String matnr, String maktx, String specs, String locNo) { |
| | | if (Cools.isEmpty(orderNo) && Cools.isEmpty(matnr) && Cools.isEmpty(maktx) && Cools.isEmpty(specs) && Cools.isEmpty(locNo)) { |
| | | return new ArrayList<LocDetl>(); |
| | | } |
| | | return this.baseMapper.searchByLike(orderNo, matnr, maktx, specs, locNo); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> findHighAreaByMatnr(String matnr) { |
| | | return this.baseMapper.findAreaByMatnr(matnr, 2); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> findSingleAreaByMatnr(String matnr) { |
| | | 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 |
| | | public List<LocDetl> findLowAreaByMatnr(String matnr) { |
| | | return this.baseMapper.findAreaByMatnr(matnr, 3); |
| | | } |
| | | } |