Commit 2ccc6f69 authored by 季圣华's avatar 季圣华
Browse files

优化商品选择界面的多单位展示形式

parent 76f3ac76
...@@ -208,11 +208,26 @@ public class MaterialController { ...@@ -208,11 +208,26 @@ public class MaterialController {
for (MaterialVo4Unit material : dataList) { for (MaterialVo4Unit material : dataList) {
JSONObject item = new JSONObject(); JSONObject item = new JSONObject();
item.put("id", material.getMeId()); //商品扩展表的id item.put("id", material.getMeId()); //商品扩展表的id
String ratioStr; //比例 String ratioStr = ""; //比例
if (material.getUnitId() == null || material.getUnitId().equals("")) { Unit unit = new Unit();
if (material.getUnitId() == null) {
ratioStr = ""; ratioStr = "";
} else { } else {
ratioStr = "[多单位]"; unit = unitService.getUnit(material.getUnitId());
//拼接副单位的比例
String commodityUnit = material.getCommodityUnit();
if(commodityUnit.equals(unit.getBasicUnit())) {
ratioStr = "[基本]";
}
if(commodityUnit.equals(unit.getOtherUnit())) {
ratioStr = "[" + unit.getRatio() + unit.getBasicUnit() + "]";
}
if(commodityUnit.equals(unit.getOtherUnitTwo())) {
ratioStr = "[" + unit.getRatioTwo() + unit.getBasicUnit() + "]";
}
if(commodityUnit.equals(unit.getOtherUnitThree())) {
ratioStr = "[" + unit.getRatioThree() + unit.getBasicUnit() + "]";
}
} }
item.put("mBarCode", material.getmBarCode()); item.put("mBarCode", material.getmBarCode());
item.put("name", material.getName()); item.put("name", material.getName());
...@@ -230,7 +245,6 @@ public class MaterialController { ...@@ -230,7 +245,6 @@ public class MaterialController {
} else { } else {
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());
String commodityUnit = material.getCommodityUnit(); String commodityUnit = material.getCommodityUnit();
stock = unitService.parseStockByUnit(stock, unit, commodityUnit); stock = unitService.parseStockByUnit(stock, unit, commodityUnit);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment