|
@@ -22,6 +22,7 @@ import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.fjhx.common.service.documentary.GetDocumentaryBusinessTemplate;
|
|
|
import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.flow.entity.flow.po.FlowExample;
|
|
|
+import com.fjhx.flow.enums.FlowStatusEnum;
|
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
|
import com.fjhx.item.enums.ProductAvailableRecordType;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
@@ -62,13 +63,18 @@ import com.fjhx.sale.mapper.purchase.EhsdPurchaseMapper;
|
|
|
import com.fjhx.sale.service.contract.ContractService;
|
|
|
import com.fjhx.sale.service.pack.PackDetailProductService;
|
|
|
import com.fjhx.sale.service.pack.PackDetailService;
|
|
|
-import com.fjhx.sale.service.purchase.*;
|
|
|
+import com.fjhx.sale.service.purchase.EhsdPurchaseProductMountingsService;
|
|
|
+import com.fjhx.sale.service.purchase.EhsdPurchaseProductService;
|
|
|
+import com.fjhx.sale.service.purchase.EhsdPurchaseProjectService;
|
|
|
+import com.fjhx.sale.service.purchase.EhsdPurchaseService;
|
|
|
import com.fjhx.supply.entity.supplier.po.SupplierInfo;
|
|
|
import com.fjhx.supply.entity.supplier.po.SupplierPrice;
|
|
|
import com.fjhx.supply.entity.supplier.vo.SupplierPriceVo;
|
|
|
import com.fjhx.supply.service.supplier.SupplierInfoService;
|
|
|
import com.fjhx.supply.service.supplier.SupplierPriceService;
|
|
|
import com.fjhx.tenant.utils.DeptUstil;
|
|
|
+import com.fjhx.wms.entity.stock.po.StockWait;
|
|
|
+import com.fjhx.wms.service.stock.StockWaitService;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.core.domain.BaseSelectDto;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
@@ -119,8 +125,6 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
@Autowired
|
|
|
private EhsdPurchaseProjectService ehsdPurchaseProjectService;
|
|
|
@Autowired
|
|
|
- private EhsdPurchaseArrivalService ehsdPurchaseArrivalService;
|
|
|
- @Autowired
|
|
|
private EhsdPurchaseService ehsdPurchaseService;
|
|
|
@Autowired
|
|
|
private ProductInfoService productInfoService;
|
|
@@ -142,6 +146,8 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
private EhsdPurchaseProductService purchaseProductService;
|
|
|
@Autowired
|
|
|
private SubscribeDetailMapper subscribeDetailMapper;
|
|
|
+ @Autowired
|
|
|
+ private StockWaitService stockWaitService;
|
|
|
|
|
|
|
|
|
* 分页
|
|
@@ -167,12 +173,6 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
wrapper.ne(EhsdPurchase::getStatus, FlowStatusEnum1.UPDATE.getKey());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
Long companyId = SecurityUtils.getCompanyId();
|
|
|
if (!Objects.equals(companyId, 100L)) {
|
|
@@ -299,42 +299,6 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
BigDecimal add = ObjectUtils.isEmpty(ehsdPurchaseProductList1) ? BigDecimal.ZERO : ehsdPurchaseProductList1.stream().map(EhsdPurchaseProduct::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
ehsdPurchaseProductVo.setExpendQuantity(count.subtract(add));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -513,6 +477,22 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
}
|
|
|
}
|
|
|
productInfoService.editAvailableQuantity(inOutBoList, InOutType.OUT, id, ProductAvailableRecordType.PURCHASE_CANCEL, purchase.getCompanyId());
|
|
|
+
|
|
|
+ stockWaitService.update(q -> q
|
|
|
+ .eq(StockWait::getPurchaseId, purchase.getId())
|
|
|
+ .set(StockWait::getStatus, 3)
|
|
|
+ .set(BasePo::getUpdateTime, new Date())
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
+ flowExampleService.update(q -> q
|
|
|
+ .eq(FlowExample::getId, purchase.getFlowId())
|
|
|
+ .in(FlowExample::getStatus, 0, 1)
|
|
|
+ .set(FlowExample::getStatus, FlowStatusEnum.CANCELLATION.getKey())
|
|
|
+ .set(BasePo::getUpdateTime, new Date())
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
|
|
|
|
|
|
updateSubscribeStatus(id);
|