|
@@ -18,7 +18,6 @@ import com.fjhx.item.enums.ProductAvailableRecordType;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseDataResourceEnum;
|
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
|
|
|
-import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
|
|
|
import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
|
|
|
import com.fjhx.sale.entity.contract.po.Contract;
|
|
|
import com.fjhx.sale.entity.purchase.dto.EhsdPurchaseDto;
|
|
@@ -44,7 +43,6 @@ import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -226,29 +224,29 @@ public class EhsdPurchaseFlow extends FlowDelegate {
|
|
|
inOutBoList.add(inOutBo);
|
|
|
}
|
|
|
|
|
|
- //数据来源是合同
|
|
|
- if (Objects.equals(purchaseProduct.getDataResource(), PurchaseDataResourceEnum.DATA_RESOURCE_1.getKey())) {
|
|
|
- //获取采购,待采购信息
|
|
|
- Long subscribeDetailId = purchaseProduct.getSubscribeDetailId();
|
|
|
- BigDecimal purchaseSumCount = purchaseProductMapper.getPurchaseQuantitySumBySubscribeDetailId(subscribeDetailId);
|
|
|
- SubscribeDetail subscribeDetail = subscribeDetailService.getById(subscribeDetailId);
|
|
|
- Assert.notEmpty(subscribeDetail, "查询不到待采购信息!");
|
|
|
-
|
|
|
- //已采购数量>待采购 本次超采量=已采购数量-待采购量-((已采购-本次采购)-待采购量)
|
|
|
- if (purchaseSumCount.compareTo(subscribeDetail.getCount()) > 0) {
|
|
|
- //计算超采量
|
|
|
- BigDecimal oldPurchaseCount = purchaseSumCount.subtract(purchaseProduct.getQuantity());//(已采购-本次采购)
|
|
|
- BigDecimal subtract = oldPurchaseCount.subtract(subscribeDetail.getCount());//((已采购-本次采购)-待采购量)
|
|
|
- BigDecimal exceedQuantity = purchaseSumCount.subtract(subscribeDetail.getCount()).subtract(subtract);
|
|
|
-
|
|
|
- purchaseProduct.setExceedQuantity(exceedQuantity);
|
|
|
-
|
|
|
- AvailableStockBo inOutBo = new AvailableStockBo();
|
|
|
- inOutBo.setProductId(purchaseProduct.getProductId());
|
|
|
- inOutBo.setQuantity(exceedQuantity);
|
|
|
- inOutBoList.add(inOutBo);
|
|
|
- }
|
|
|
- }
|
|
|
+// //数据来源是合同
|
|
|
+// if (Objects.equals(purchaseProduct.getDataResource(), PurchaseDataResourceEnum.DATA_RESOURCE_1.getKey())) {
|
|
|
+// //获取采购,待采购信息
|
|
|
+// Long subscribeDetailId = purchaseProduct.getSubscribeDetailId();
|
|
|
+// BigDecimal purchaseSumCount = purchaseProductMapper.getPurchaseQuantitySumBySubscribeDetailId(subscribeDetailId);
|
|
|
+// SubscribeDetail subscribeDetail = subscribeDetailService.getById(subscribeDetailId);
|
|
|
+// Assert.notEmpty(subscribeDetail, "查询不到待采购信息!");
|
|
|
+//
|
|
|
+// //已采购数量>待采购 本次超采量=已采购数量-待采购量-((已采购-本次采购)-待采购量)
|
|
|
+// if (purchaseSumCount.compareTo(subscribeDetail.getCount()) > 0) {
|
|
|
+// //计算超采量
|
|
|
+// BigDecimal oldPurchaseCount = purchaseSumCount.subtract(purchaseProduct.getQuantity());//(已采购-本次采购)
|
|
|
+// BigDecimal subtract = oldPurchaseCount.subtract(subscribeDetail.getCount());//((已采购-本次采购)-待采购量)
|
|
|
+// BigDecimal exceedQuantity = purchaseSumCount.subtract(subscribeDetail.getCount()).subtract(subtract);
|
|
|
+//
|
|
|
+// purchaseProduct.setExceedQuantity(exceedQuantity);
|
|
|
+//
|
|
|
+// AvailableStockBo inOutBo = new AvailableStockBo();
|
|
|
+// inOutBo.setProductId(purchaseProduct.getProductId());
|
|
|
+// inOutBo.setQuantity(exceedQuantity);
|
|
|
+// inOutBoList.add(inOutBo);
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
productInfoService.editAvailableQuantity(inOutBoList, businessId, ProductAvailableRecordType.PURCHASE_PASS, purchase.getCompanyId());
|
|
|
|