给多单位再增加两个副单位
This commit is contained in:
@@ -382,12 +382,14 @@ public class DepotItemService {
|
||||
Unit unitInfo = materialService.findUnit(materialExtend.getMaterialId()); //查询计量单位信息
|
||||
if (StringUtil.isNotEmpty(unitInfo.getName())) {
|
||||
String basicUnit = unitInfo.getBasicUnit(); //基本单位
|
||||
String otherUnit = unitInfo.getOtherUnit(); //副单位
|
||||
Integer ratio = unitInfo.getRatio(); //比例
|
||||
if (unit.equals(basicUnit)) { //如果等于基础单位
|
||||
depotItem.setBasicNumber(oNumber); //数量一致
|
||||
} else if (unit.equals(otherUnit)) { //如果等于副单位
|
||||
depotItem.setBasicNumber(oNumber.multiply(new BigDecimal(ratio)) ); //数量乘以比例
|
||||
} else if (unit.equals(unitInfo.getOtherUnit())) { //如果等于副单位
|
||||
depotItem.setBasicNumber(oNumber.multiply(new BigDecimal(unitInfo.getRatio())) ); //数量乘以比例
|
||||
} else if (unit.equals(unitInfo.getOtherUnitTwo())) { //如果等于副单位2
|
||||
depotItem.setBasicNumber(oNumber.multiply(new BigDecimal(unitInfo.getRatioTwo())) ); //数量乘以比例
|
||||
} else if (unit.equals(unitInfo.getOtherUnitThree())) { //如果等于副单位3
|
||||
depotItem.setBasicNumber(oNumber.multiply(new BigDecimal(unitInfo.getRatioThree())) ); //数量乘以比例
|
||||
}
|
||||
} else {
|
||||
depotItem.setBasicNumber(oNumber); //其他情况
|
||||
|
||||
Reference in New Issue
Block a user