|
@@ -215,10 +215,12 @@ public class WebsitMPurchaseLogic {
|
|
if (bean.getFlag().equals(MaterialFlagEnum.SAVE.getKey())) {
|
|
if (bean.getFlag().equals(MaterialFlagEnum.SAVE.getKey())) {
|
|
// 检查进价范围值
|
|
// 检查进价范围值
|
|
if (Objects.nonNull(relaGoods.getCostRangeMini())
|
|
if (Objects.nonNull(relaGoods.getCostRangeMini())
|
|
|
|
+ && relaGoods.getCostRangeMini().compareTo(BigDecimal.ZERO) > 0
|
|
&& itemBean.getApplyCost().compareTo(relaGoods.getCostRangeMini()) < 0) {
|
|
&& itemBean.getApplyCost().compareTo(relaGoods.getCostRangeMini()) < 0) {
|
|
throw new RemoteServiceException(preStr + "不能低于辅材资料最小进价范围值");
|
|
throw new RemoteServiceException(preStr + "不能低于辅材资料最小进价范围值");
|
|
}
|
|
}
|
|
if (Objects.nonNull(relaGoods.getCostRangeMax())
|
|
if (Objects.nonNull(relaGoods.getCostRangeMax())
|
|
|
|
+ && relaGoods.getCostRangeMax().compareTo(BigDecimal.ZERO) > 0
|
|
&& itemBean.getApplyCost().compareTo(relaGoods.getCostRangeMax()) > 0) {
|
|
&& itemBean.getApplyCost().compareTo(relaGoods.getCostRangeMax()) > 0) {
|
|
throw new RemoteServiceException(preStr + "不能高于辅材资料最大进价范围值");
|
|
throw new RemoteServiceException(preStr + "不能高于辅材资料最大进价范围值");
|
|
}
|
|
}
|
|
@@ -236,10 +238,12 @@ public class WebsitMPurchaseLogic {
|
|
} else if (bean.getFlag().equals(MaterialFlagEnum.SUBMIT.getKey())) {
|
|
} else if (bean.getFlag().equals(MaterialFlagEnum.SUBMIT.getKey())) {
|
|
// 检查进价范围值
|
|
// 检查进价范围值
|
|
if (Objects.nonNull(relaGoods.getCostRangeMini())
|
|
if (Objects.nonNull(relaGoods.getCostRangeMini())
|
|
|
|
+ && relaGoods.getCostRangeMini().compareTo(BigDecimal.ZERO) > 0
|
|
&& itemBean.getCost().compareTo(relaGoods.getCostRangeMini()) < 0) {
|
|
&& itemBean.getCost().compareTo(relaGoods.getCostRangeMini()) < 0) {
|
|
throw new RemoteServiceException(preStr + "不能低于辅材资料最小进价范围值");
|
|
throw new RemoteServiceException(preStr + "不能低于辅材资料最小进价范围值");
|
|
}
|
|
}
|
|
if (Objects.nonNull(relaGoods.getCostRangeMax())
|
|
if (Objects.nonNull(relaGoods.getCostRangeMax())
|
|
|
|
+ && relaGoods.getCostRangeMax().compareTo(BigDecimal.ZERO) > 0
|
|
&& itemBean.getCost().compareTo(relaGoods.getCostRangeMax()) > 0) {
|
|
&& itemBean.getCost().compareTo(relaGoods.getCostRangeMax()) > 0) {
|
|
throw new RemoteServiceException(preStr + "不能高于辅材资料最大进价范围值");
|
|
throw new RemoteServiceException(preStr + "不能高于辅材资料最大进价范围值");
|
|
}
|
|
}
|