This commit is contained in:
linfso 2024-12-31 13:26:12 +08:00
parent 7c7e97b52b
commit f801c043ae
2 changed files with 17 additions and 0 deletions

View File

@ -106,6 +106,9 @@ public class EmisWarehouseInBatchController extends EmisBaseController
public AjaxResult registerWarehouseInInfo(@RequestBody EmisWarehouseInBatch emisWarehouseInBatch) public AjaxResult registerWarehouseInInfo(@RequestBody EmisWarehouseInBatch emisWarehouseInBatch)
{ {
try { try {
// 校验数据
return toAjax(emisWarehouseInBatchService.insertEmisWarehouseInBatch(emisWarehouseInBatch)); return toAjax(emisWarehouseInBatchService.insertEmisWarehouseInBatch(emisWarehouseInBatch));
} catch (EmisBizError emisBizError) { } catch (EmisBizError emisBizError) {
emisBizError.printStackTrace(); emisBizError.printStackTrace();

View File

@ -10,6 +10,7 @@
package com.xdadan.erp.emis.service.impl; package com.xdadan.erp.emis.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -95,6 +96,19 @@ public class EmisWarehouseInBatchServiceImpl extends EmisBaseService implements
throw new EmisBizError(EmisBizErrorType.FAIL,"进仓货物列表不能为空"); throw new EmisBizError(EmisBizErrorType.FAIL,"进仓货物列表不能为空");
} }
// 重量必填
if(emisWarehouseInBatch.getBillWeight()==null || ( emisWarehouseInBatch.getBillWeight()!=null && emisWarehouseInBatch.getBillWeight().compareTo(BigDecimal.ZERO)==0 ) ){
throw new EmisBizError(EmisBizErrorType.FAIL,"包裹重量必填");
}
if(emisWarehouseInBatch.getTotalVolume()==null || (emisWarehouseInBatch.getTotalVolume()!=null && emisWarehouseInBatch.getTotalVolume().compareTo(BigDecimal.ZERO)==0 ) ){
throw new EmisBizError(EmisBizErrorType.FAIL,"总体积必填");
}
if(emisWarehouseInBatch.getParcelQty()==null || (emisWarehouseInBatch.getParcelQty()!=null && emisWarehouseInBatch.getParcelQty() <= 0 ) ){
throw new EmisBizError(EmisBizErrorType.FAIL,"总件数必填");
}
// 进仓序列号,插入进仓批次 // 进仓序列号,插入进仓批次
String serialNo= WaybillHelper.genWsInSerialNo(); String serialNo= WaybillHelper.genWsInSerialNo();
emisWarehouseInBatch.setSerialNo(serialNo); emisWarehouseInBatch.setSerialNo(serialNo);