diff --git a/erp_web/js/pages/bill/in_out.js b/erp_web/js/pages/bill/in_out.js index e939af6a..318d408c 100644 --- a/erp_web/js/pages/bill/in_out.js +++ b/erp_web/js/pages/bill/in_out.js @@ -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) + "、"; } } diff --git a/src/main/java/com/jsh/erp/constants/ExceptionConstants.java b/src/main/java/com/jsh/erp/constants/ExceptionConstants.java index c46811b1..3a41bb91 100644 --- a/src/main/java/com/jsh/erp/constants/ExceptionConstants.java +++ b/src/main/java/com/jsh/erp/constants/ExceptionConstants.java @@ -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 diff --git a/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java b/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java index cb604172..6824ff00 100644 --- a/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java +++ b/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java @@ -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())) { - depotItem.setAnotherDepotId(rowObj.getLong("AnotherDepotId")); + 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")); } //出库时判断库存是否充足