|
@@ -149,8 +149,8 @@ public class EhsdPurchaseFlow extends FlowDelegate {
|
|
|
p.getDataResource()== PurchaseDataResourceEnum.DATA_RESOURCE_1.getKey()){//如果采购的是外销合同
|
|
|
ContractProduct contractProduct = contractProductService.getById(p.getDataResourceId());
|
|
|
BigDecimal expendQuantity = contractProduct.getExpendQuantity().subtract(p.getQuantity());
|
|
|
- if(expendQuantity.compareTo(BigDecimal.ZERO)< 1){//小于0不让继续执行
|
|
|
- throw new ServiceException("采购数量不得大于合同剩余采购数量");
|
|
|
+ if(expendQuantity.compareTo(BigDecimal.ZERO)< 0){//小于0不让继续执行
|
|
|
+ throw new ServiceException("采购数量不得大于合同剩余采购数量,请驳回审批修改");
|
|
|
}
|
|
|
contractProduct.setExpendQuantity(expendQuantity);
|
|
|
upContractProduct.add(contractProduct);
|
|
@@ -159,8 +159,8 @@ public class EhsdPurchaseFlow extends FlowDelegate {
|
|
|
p.getDataResource()== PurchaseDataResourceEnum.DATA_RESOURCE_2.getKey()){//如果采购的是样品单
|
|
|
SampleProduct sampleProduct = sampleProductService.getById(p.getDataResourceId());
|
|
|
BigDecimal expendQuantity = sampleProduct.getExpendQuantity().subtract(p.getQuantity());
|
|
|
- if(expendQuantity.compareTo(BigDecimal.ZERO)< 1){//小于0不让继续执行
|
|
|
- throw new ServiceException("采购数量不得大于合同剩余采购数量");
|
|
|
+ if(expendQuantity.compareTo(BigDecimal.ZERO)< 0){//小于0不让继续执行
|
|
|
+ throw new ServiceException("采购数量不得大于合同剩余采购数量,请驳回审批修改");
|
|
|
}
|
|
|
sampleProduct.setExpendQuantity(expendQuantity);
|
|
|
upSampleProduct.add(sampleProduct);
|