|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.common.wms.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
|---|
|  |  |  | import com.zy.asrs.common.domain.dto.QueryStockPreDo; | 
|---|
|  |  |  | import com.zy.asrs.common.domain.dto.ReportStockDto; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.mapper.LocDetlMapper; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.entity.LocDetl; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.service.LocDetlService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service("locDetlService") | 
|---|
|  |  |  | public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public IPage<LocDetl> getStockStatis(Integer curr, Integer limit, Map<String, Object> param) { | 
|---|
|  |  |  | Page<LocDetl> page = new Page<>(curr, limit); | 
|---|
|  |  |  | return this.baseMapper.getStockStatis(page, param); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取库存总数 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Integer sum() { | 
|---|
|  |  |  | return this.baseMapper.sum(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<LocDetl> queryStock(String matnr, String batch, Long hostId) { | 
|---|
|  |  |  | List<LocDetl> result = this.baseMapper.queryStock(matnr, batch, hostId); | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public LocDetl selectItem(String locNo, String matnr, String batch, Long hostId) { | 
|---|
|  |  |  | return this.baseMapper.selectItem(locNo, matnr, batch, hostId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public boolean updateAnfme(Double anfme, String locNo, String matnr, String batch, Long hostId) { | 
|---|
|  |  |  | if (anfme <= 0) { | 
|---|
|  |  |  | return this.baseMapper.deleteItem(locNo, matnr, batch, hostId) > 0; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return baseMapper.updateAnfme(anfme, locNo, matnr, batch, hostId) > 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public boolean updateLocNo(String newLocNo, String oldLocNo, Long hostId) { | 
|---|
|  |  |  | return baseMapper.updateLocNo(newLocNo, oldLocNo, hostId) > 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public IPage<LocDetl> getStockOut(Integer curr, Integer limit, Map<String, Object> param) { | 
|---|
|  |  |  | Page<LocDetl> page = new Page<>(curr, limit); | 
|---|
|  |  |  | return this.baseMapper.getStockOutPage(page, param); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<ReportStockDto> getReportStockDto(Long hostId) { | 
|---|
|  |  |  | return this.baseMapper.getReportStockDto(hostId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<String> getSameDetl(String matnr, String batch, Long hostId) { | 
|---|
|  |  |  | return this.baseMapper.selectSameDetl(matnr, batch, hostId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<LocDetl> getStockStatisExcel() { | 
|---|
|  |  |  | return this.baseMapper.getStockStatisExcel(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|