|
@@ -62,6 +62,7 @@ import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseProductVo;
|
|
|
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseVo;
|
|
|
import com.fjhx.sale.mapper.arrival.ArrivalDetailMapper;
|
|
|
import com.fjhx.sale.mapper.purchase.EhsdPurchaseMapper;
|
|
|
+import com.fjhx.sale.mapper.purchase.EhsdPurchaseProductMapper;
|
|
|
import com.fjhx.sale.service.contract.ContractService;
|
|
|
import com.fjhx.sale.service.pack.PackDetailProductService;
|
|
|
import com.fjhx.sale.service.pack.PackDetailService;
|
|
@@ -76,6 +77,7 @@ 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.StockWaitDetailsService;
|
|
|
import com.fjhx.wms.service.stock.StockWaitService;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.core.domain.BaseSelectDto;
|
|
@@ -150,6 +152,10 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
private StockWaitService stockWaitService;
|
|
|
@Autowired
|
|
|
private ArrivalDetailMapper arrivalDetailMapper;
|
|
|
+ @Autowired
|
|
|
+ private EhsdPurchaseProductMapper ehsdPurchaseProductMapper;
|
|
|
+ @Autowired
|
|
|
+ private StockWaitDetailsService stockWaitDetailsService;
|
|
|
|
|
|
/**
|
|
|
* 分页
|
|
@@ -268,12 +274,11 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
result.setBuyCorporationName(corporation.getName());
|
|
|
}
|
|
|
//赋值采购明细
|
|
|
- List<EhsdPurchaseProduct> ehsdPurchaseProductList = ehsdPurchaseProductService.list(q ->
|
|
|
- q.eq(EhsdPurchaseProduct::getPurchaseId, ehsdPurchase.getId())
|
|
|
+ List<EhsdPurchaseProductVo> ehsdPurchaseProductVos = ehsdPurchaseProductMapper.getList(IWrapper.<EhsdPurchaseProduct>getWrapper()
|
|
|
+ .eq(EhsdPurchaseProduct::getPurchaseId, ehsdPurchase.getId())
|
|
|
);
|
|
|
- List<EhsdPurchaseProductVo> ehsdPurchaseProductVos = BeanUtil.copyToList(ehsdPurchaseProductList, EhsdPurchaseProductVo.class);
|
|
|
//赋值产品配件信息
|
|
|
- if (ObjectUtils.isNotEmpty(ehsdPurchaseProductList)) {
|
|
|
+ if (ObjectUtils.isNotEmpty(ehsdPurchaseProductVos)) {
|
|
|
List<Long> eppIds = ehsdPurchaseProductVos.stream().map(EhsdPurchaseProductVo::getId).collect(Collectors.toList());
|
|
|
Map<Long, List<EhsdPurchaseProductMountings>> eppMap = ehsdPurchaseProductMountingsService.mapKGroup(
|
|
|
EhsdPurchaseProductMountings::getPurchaseProductId, q -> q
|
|
@@ -726,11 +731,12 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
@Override
|
|
|
public void updateArrivalStatus(Long id) {
|
|
|
int status;//默认已到货
|
|
|
- long count = purchaseProductService.count(q -> q
|
|
|
- .eq(EhsdPurchaseProduct::getPurchaseId, id)
|
|
|
- .apply("arrival_quantity < quantity")
|
|
|
+
|
|
|
+ List<EhsdPurchaseProductVo> list = ehsdPurchaseProductMapper.getList(IWrapper.<EhsdPurchaseProduct>getWrapper()
|
|
|
+ .eq("epp", EhsdPurchaseProduct::getPurchaseId, id)
|
|
|
+ .apply("epp.arrivalQuantity < epp.quantity")
|
|
|
);
|
|
|
- if (count > 0) {
|
|
|
+ if (list.size() > 0) {
|
|
|
status = 1;//部分到货
|
|
|
} else {
|
|
|
status = 2;//已到货
|