浏览代码

提交代码

xwh 4 年之前
父节点
当前提交
9ebc8e2084

+ 24 - 0
wms-core-service/src/main/java/com/lote/wms/inventory/inventory/service/impl/InventoryServiceImpl.java

@@ -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);
 	}
 

+ 1 - 0
wms-operate/src/main/resources/static/ui/js/inventory/inventory/inventory/list.js

@@ -23,6 +23,7 @@ $("#myGrid").iDatagrid({
     	 {field: 'barcode',width:'120px', title: '条码'},
     	 {field: 'productName',width:'120px', title: '名称'},
     	 {field: 'model',width:'60px', title: '规格'},
+		 {field: 'unit',width:'60px', title: '计量单位'},
     	 {field: 'zoneTypeCode', width:'60px',title: '库区类型'},
     	 {field: 'zoneCode',width:'60px', title: '库区号'},
     	 {field: 'locationCode',width:'140px', title: '库位号'},