Merge branch '0.8.X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.8.X
This commit is contained in:
@@ -1341,7 +1341,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
if (bo.getActualWarehouseId() != null) {
|
||||
validateActualWarehouseForAssign(bo.getActualWarehouseId(), null);
|
||||
}
|
||||
validateCoilWeight(bo.getGrossWeight());
|
||||
validateCoilWeight(bo.getGrossWeight(), bo.getNetWeight());
|
||||
validEntityBeforeSave(add);
|
||||
// 在新增钢卷数据之前需要先看库区id是否被占用如果被占用则不能新增抛异常为实际库区已被占用 不能再当前库区修改或者新增
|
||||
int rows = baseMapper.insert(add);
|
||||
@@ -1545,7 +1545,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
throw new RuntimeException("已发货的钢卷不允许占用实际库区!");
|
||||
}
|
||||
}
|
||||
validateCoilWeight(bo.getGrossWeight());
|
||||
validateCoilWeight(bo.getGrossWeight(), bo.getNetWeight());
|
||||
// 直接更新钢卷属性
|
||||
WmsMaterialCoil updateCoil = BeanUtil.toBean(bo, WmsMaterialCoil.class);
|
||||
validEntityBeforeSave(updateCoil);
|
||||
@@ -1653,7 +1653,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
newCoil.setSupplierCoilNo(oldCoil.getSupplierCoilNo());
|
||||
}
|
||||
|
||||
validateCoilWeight(newCoil.getGrossWeight());
|
||||
validateCoilWeight(newCoil.getGrossWeight(), newCoil.getNetWeight());
|
||||
validEntityBeforeSave(newCoil);
|
||||
|
||||
// 把老记录的coilId赋值给新纪录的parentCoilId
|
||||
@@ -1912,7 +1912,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// 在子卷的 parent_coil_nos 字段中记录母卷号
|
||||
newCoil.setParentCoilNos(oldCoil.getCurrentCoilNo());
|
||||
|
||||
validateCoilWeight(newCoil.getGrossWeight());
|
||||
validateCoilWeight(newCoil.getGrossWeight(), newCoil.getNetWeight());
|
||||
// 为每个子钢卷生成独立二维码
|
||||
Long newQrcodeId = generateQrcodeForSplit(oldCoil, newCoilBo, allNewCoilNos);
|
||||
newCoil.setQrcodeRecordId(newQrcodeId);
|
||||
@@ -2043,7 +2043,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
}
|
||||
newCoil.setQrcodeRecordId(mergedQrcodeId);
|
||||
|
||||
validateCoilWeight(newCoil.getGrossWeight());
|
||||
validateCoilWeight(newCoil.getGrossWeight(), newCoil.getNetWeight());
|
||||
validEntityBeforeSave(newCoil);
|
||||
// 收集所有参与合卷的原始钢卷ID并用逗号分隔
|
||||
List<Long> parentCoilIds = new ArrayList<>();
|
||||
@@ -2521,9 +2521,12 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
|
||||
private static final BigDecimal MAX_WEIGHT_TONS = new BigDecimal("100");
|
||||
|
||||
private void validateCoilWeight(BigDecimal grossWeight) {
|
||||
private void validateCoilWeight(BigDecimal grossWeight, BigDecimal netWeight) {
|
||||
if (grossWeight != null && grossWeight.compareTo(MAX_WEIGHT_TONS) > 0) {
|
||||
throw new RuntimeException("钢卷重量不能超过100吨,当前重量:" + grossWeight + "吨");
|
||||
throw new RuntimeException("钢卷毛重不能超过100吨,当前毛重:" + grossWeight + "吨");
|
||||
}
|
||||
if (netWeight != null && netWeight.compareTo(MAX_WEIGHT_TONS) > 0) {
|
||||
throw new RuntimeException("钢卷净重不能超过100吨,当前净重:" + netWeight + "吨");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4882,7 +4885,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
childCoil.setQrcodeRecordId(childQrcodeId);
|
||||
|
||||
// 7. 校验并插入子钢卷
|
||||
validateCoilWeight(childCoil.getGrossWeight());
|
||||
validateCoilWeight(childCoil.getGrossWeight(), childCoil.getNetWeight());
|
||||
validEntityBeforeSave(childCoil);
|
||||
childCoil.setParentCoilId(String.valueOf(parentCoilId));
|
||||
baseMapper.insert(childCoil);
|
||||
@@ -5155,7 +5158,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
newCoil.setCreateBy(LoginHelper.getUsername());
|
||||
newCoil.setUpdateBy(LoginHelper.getUsername());
|
||||
|
||||
validateCoilWeight(newCoil.getGrossWeight());
|
||||
validateCoilWeight(newCoil.getGrossWeight(), newCoil.getNetWeight());
|
||||
validEntityBeforeSave(newCoil);
|
||||
boolean flag = baseMapper.insert(newCoil) > 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user