|
@@ -3,9 +3,12 @@ package com.lote.wms.inventory.inventory.service.impl;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import com.lote.wms.base.product.dao.ProductMapper;
|
|
|
+import com.lote.wms.base.product.entity.queryvo.ProductQueryVo;
|
|
|
import org.mybatis.plugin.model.Pager;
|
|
|
import org.mybatis.plugin.util.PagerUtil;
|
|
|
import org.slf4j.Logger;
|
|
@@ -53,6 +56,9 @@ public class InventoryServiceImpl implements InventoryService {
|
|
|
private InventoryMapper inventoryMapper;
|
|
|
|
|
|
@Resource
|
|
|
+ private ProductMapper productMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private InventoryHistoryService inventoryHistoryService;
|
|
|
|
|
|
@Resource
|
|
@@ -118,6 +124,15 @@ public class InventoryServiceImpl implements InventoryService {
|
|
|
BeanUtil.trimString(InventoryQueryVo.class, vo);
|
|
|
|
|
|
List<Inventory> list = inventoryMapper.selectByVoList(vo);
|
|
|
+ list.forEach( inventory -> {
|
|
|
+ ProductQueryVo productQueryVo = new ProductQueryVo();
|
|
|
+ productQueryVo.setCustomerId(inventory.getCustomerId());
|
|
|
+ productQueryVo.setSku(inventory.getSku());
|
|
|
+ Product product = productMapper.getByCustomerAndSku(productQueryVo);
|
|
|
+ if (Objects.nonNull(product)){
|
|
|
+ inventory.setUnit(product.getUnit());
|
|
|
+ }
|
|
|
+ });
|
|
|
return PagerUtil.getPager(list, vo);
|
|
|
}
|
|
|
|
|
@@ -128,6 +143,15 @@ public class InventoryServiceImpl implements InventoryService {
|
|
|
|
|
|
vo.setCountType("2");// 不要使用GenMysqlCountUtil的方式统计总数,会报错
|
|
|
List<Inventory> list = inventoryMapper.selectByVoGpBySkuList(vo);
|
|
|
+ list.forEach( inventory -> {
|
|
|
+ ProductQueryVo productQueryVo = new ProductQueryVo();
|
|
|
+ productQueryVo.setCustomerId(inventory.getCustomerId());
|
|
|
+ productQueryVo.setSku(inventory.getSku());
|
|
|
+ Product product = productMapper.getByCustomerAndSku(productQueryVo);
|
|
|
+ if (Objects.nonNull(product)){
|
|
|
+ inventory.setUnit(product.getUnit());
|
|
|
+ }
|
|
|
+ });
|
|
|
return PagerUtil.getPager(list, vo);
|
|
|
}
|
|
|
|