优化选择商品的时候的库存展示
This commit is contained in:
@@ -199,11 +199,12 @@ public class MaterialController {
|
|||||||
item.put("model", material.getModel());
|
item.put("model", material.getModel());
|
||||||
item.put("unit", material.getCommodityUnit() + ratio);
|
item.put("unit", material.getCommodityUnit() + ratio);
|
||||||
item.put("sku", material.getSku());
|
item.put("sku", material.getSku());
|
||||||
|
BigDecimal stock;
|
||||||
BigDecimal skuStock = depotItemService.getSkuStockByParam(depotId,material.getMeId(),null,null);
|
BigDecimal skuStock = depotItemService.getSkuStockByParam(depotId,material.getMeId(),null,null);
|
||||||
if(StringUtil.isNotEmpty(material.getSku())){
|
if(skuStock.compareTo(BigDecimal.ZERO)!=0){
|
||||||
item.put("skuStock", skuStock);
|
stock = skuStock;
|
||||||
}
|
} else {
|
||||||
BigDecimal stock = depotItemService.getStockByParam(depotId,material.getId(),null,null);
|
stock = depotItemService.getStockByParam(depotId,material.getId(),null,null);
|
||||||
if (material.getUnitId()!=null){
|
if (material.getUnitId()!=null){
|
||||||
Unit unit = unitService.getUnit(material.getUnitId());
|
Unit unit = unitService.getUnit(material.getUnitId());
|
||||||
if(material.getCommodityUnit().equals(unit.getOtherUnit())) {
|
if(material.getCommodityUnit().equals(unit.getOtherUnit())) {
|
||||||
@@ -212,6 +213,7 @@ public class MaterialController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
item.put("stock", stock);
|
item.put("stock", stock);
|
||||||
String expand = ""; //扩展信息
|
String expand = ""; //扩展信息
|
||||||
for (int i = 0; i < mpArr.length; i++) {
|
for (int i = 0; i < mpArr.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user