优化单据中仓库的校验逻辑
This commit is contained in:
@@ -1262,7 +1262,7 @@
|
||||
}
|
||||
var totalRowNum = "";
|
||||
for (var i = 0; i < row.length; i++) {
|
||||
if (row[i].DepotId == "" || row[i].barCode == "" || row[i].OperNumber == "" || row[i].UnitPrice === "" || row[i].AllPrice === "") {
|
||||
if (row[i].barCode == "" || row[i].OperNumber == "" || row[i].UnitPrice === "" || row[i].AllPrice === "") {
|
||||
totalRowNum += (i + 1) + "、";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,6 +294,12 @@ public class ExceptionConstants {
|
||||
//单据录入数量超出限制
|
||||
public static final int DEPOT_HEAD_OVER_LIMIT_FAILED_CODE = 8500003;
|
||||
public static final String DEPOT_HEAD_OVER_LIMIT_FAILED_MSG = "单据录入数量超出限制,请联系管理员";
|
||||
//单据录入-仓库不能为空
|
||||
public static final int DEPOT_HEAD_DEPOT_FAILED_CODE = 8500004;
|
||||
public static final String DEPOT_HEAD_DEPOT_FAILED_MSG = "仓库不能为空";
|
||||
//单据录入-调入仓库不能为空
|
||||
public static final int DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE = 8500005;
|
||||
public static final String DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG = "调入仓库不能为空";
|
||||
/**
|
||||
* 单据明细信息
|
||||
* type = 90
|
||||
|
||||
@@ -355,12 +355,19 @@ public class DepotItemService {
|
||||
if (StringUtil.isExist(rowObj.get("AllPrice"))) {
|
||||
depotItem.setAllPrice(rowObj.getBigDecimal("AllPrice"));
|
||||
}
|
||||
depotItem.setRemark(rowObj.getString("Remark"));
|
||||
if (rowObj.get("DepotId") != null && !StringUtil.isEmpty(rowObj.get("DepotId").toString())) {
|
||||
if (StringUtil.isExist(rowObj.get("DepotId"))) {
|
||||
depotItem.setDepotId(rowObj.getLong("DepotId"));
|
||||
} else {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_MSG));
|
||||
}
|
||||
if (rowObj.get("AnotherDepotId") != null && !StringUtil.isEmpty(rowObj.get("AnotherDepotId").toString())) {
|
||||
if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) {
|
||||
if (StringUtil.isExist(rowObj.get("AnotherDepotId"))) {
|
||||
depotItem.setAnotherDepotId(rowObj.getLong("AnotherDepotId"));
|
||||
} else {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG));
|
||||
}
|
||||
}
|
||||
if (StringUtil.isExist(rowObj.get("TaxRate"))) {
|
||||
depotItem.setTaxRate(rowObj.getBigDecimal("TaxRate"));
|
||||
@@ -371,10 +378,10 @@ public class DepotItemService {
|
||||
if (StringUtil.isExist(rowObj.get("TaxLastMoney"))) {
|
||||
depotItem.setTaxLastMoney(rowObj.getBigDecimal("TaxLastMoney"));
|
||||
}
|
||||
if (rowObj.get("MType") != null) {
|
||||
if (StringUtil.isExist(rowObj.get("MType"))) {
|
||||
depotItem.setMaterialType(rowObj.getString("MType"));
|
||||
}
|
||||
if (rowObj.get("Remark") != null) {
|
||||
if (StringUtil.isExist(rowObj.get("Remark"))) {
|
||||
depotItem.setRemark(rowObj.getString("Remark"));
|
||||
}
|
||||
//出库时判断库存是否充足
|
||||
|
||||
Reference in New Issue
Block a user