| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("locDetlService") |
| | | public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService { |
| | |
| | | private MatService matService; |
| | | |
| | | @Override |
| | | public Page<LocDetl> getPage(Page page, String nodeId, Object locNo, Object matnr, Object maktx) { |
| | | return page.setRecords(baseMapper.listByPage(page, nodeId, locNo, matnr, maktx)); |
| | | public Page<LocDetl> getPage(Page<LocDetl> page) { |
| | | page.setRecords(baseMapper.listByPage(page.getCondition())); |
| | | page.setTotal(baseMapper.listByPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (!Cools.isEmpty(locDetls)) { |
| | | result.addAll(locDetls); |
| | | } |
| | | List<Long> nodeIds = locDetls.stream().map(LocDetl::getNodeId).distinct().collect(Collectors.toList()); |
| | | List<LocDetl> locDetls1 = this.selectList(new EntityWrapper<LocDetl>().eq("matnr", matnr).eq("status", 1).orderBy("create_time")); |
| | | if (!Cools.isEmpty(locDetls1)) { |
| | | result.addAll(locDetls1); |
| | | for (LocDetl locDetl : locDetls1) { |
| | | if (!nodeIds.contains(locDetl.getNodeId())) { |
| | | result.add(locDetl); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | |
| | | return this.baseMapper.reduceStock(nodeId, matnr, anfme)>0; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean incrementStock(Long nodeId, String matnr, Double anfme) { |
| | | return this.baseMapper.incrementStock(nodeId, matnr, anfme)>0; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean removeStock(Long nodeId, String matnr) { |
| | | return this.baseMapper.removeStock(nodeId, matnr)>0; |
| | | } |
| | | |
| | | |
| | | |
| | | } |