优化商品选择界面的多单位展示形式
This commit is contained in:
@@ -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 {
|
|||||||
} 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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user