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