|
|
|
@ -116,18 +116,24 @@ public class CountingReportController extends AbstractController { |
|
|
|
|
|
|
|
// 根据盘点维度校验必填字段 |
|
|
|
String dimension = countingReport.getCheckDimension(); |
|
|
|
if ("按仓库".equals(dimension) || "按货位".equals(dimension)) { |
|
|
|
if ("按仓库".equals(dimension)) { |
|
|
|
// 按仓库:仓库必填,货位和物料非必填 |
|
|
|
if (countingReport.getWarehouseId() == null || countingReport.getWarehouseId().isEmpty()) { |
|
|
|
return R.error("盘点仓库不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("按货位".equals(dimension) || "按仓库".equals(dimension)) { |
|
|
|
} else if ("按货位".equals(dimension)) { |
|
|
|
// 按货位:仓库和货位必填,物料非必填 |
|
|
|
// if (countingReport.getWarehouseId() == null || countingReport.getWarehouseId().isEmpty()) { |
|
|
|
// return R.error("盘点仓库不能为空"); |
|
|
|
// } |
|
|
|
if (countingReport.getLocationId() == null || countingReport.getLocationId().isEmpty()) { |
|
|
|
return R.error("盘点货位不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (countingReport.getPartNo() == null || countingReport.getPartNo().isEmpty()) { |
|
|
|
return R.error("盘点物料不能为空"); |
|
|
|
} else if ("按物料".equals(dimension)) { |
|
|
|
// 按物料:物料必填,仓库和货位非必填 |
|
|
|
if (countingReport.getPartNo() == null || countingReport.getPartNo().isEmpty()) { |
|
|
|
return R.error("盘点物料不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 设置创建人和修改人 |
|
|
|
|