【需求】出库处理

dev
zengchenxi 5 months ago
parent 6a1ee68688
commit 3238271ac4

@ -105,4 +105,7 @@ public class MaterialPageReqVO extends PageParam {
@Schema(description = "存货属性") @Schema(description = "存货属性")
private Integer inventoryProperty; private Integer inventoryProperty;
@Schema(description = "仓库id")
private Long warehouseId;
} }

@ -25,7 +25,7 @@ public interface StorageMatMapper extends BaseMapperX<StorageMatDO> {
return selectPage(reqVO, new LambdaQueryWrapperX<StorageMatDO>() return selectPage(reqVO, new LambdaQueryWrapperX<StorageMatDO>()
.eqIfPresent(StorageMatDO::getStockId, reqVO.getStockId()) .eqIfPresent(StorageMatDO::getStockId, reqVO.getStockId())
.eqIfPresent(StorageMatDO::getMatId, reqVO.getMatId()) .eqIfPresent(StorageMatDO::getMatId, reqVO.getMatId())
.eqIfPresent(StorageMatDO::getWhId, reqVO.getWhId()) // .eqIfPresent(StorageMatDO::getWhId, reqVO.getWhId())
.eqIfPresent(StorageMatDO::getRgId, reqVO.getRgId()) .eqIfPresent(StorageMatDO::getRgId, reqVO.getRgId())
.eqIfPresent(StorageMatDO::getPnId, reqVO.getPnId()) .eqIfPresent(StorageMatDO::getPnId, reqVO.getPnId())
.eqIfPresent(StorageMatDO::getStorageOkQty, reqVO.getStorageOkQty()) .eqIfPresent(StorageMatDO::getStorageOkQty, reqVO.getStorageOkQty())

@ -881,11 +881,13 @@ public class ChanjetManager {
/** /**
* *
*
* @param materialDOList * @param materialDOList
* @param warehouseId
* @throws ChanjetApiException * @throws ChanjetApiException
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void queryStockAndInject(List<MaterialDO> materialDOList) throws ChanjetApiException { public void queryStockAndInject(List<MaterialDO> materialDOList, Long warehouseId) throws ChanjetApiException {
CommonResult<List<QueryCurrentStockResVO>> result = chanjetSpi.invokeRetList(QUERY_CURRENT_STOCK, CommonResult<List<QueryCurrentStockResVO>> result = chanjetSpi.invokeRetList(QUERY_CURRENT_STOCK,
new QueryCurrentStockReqVO(new QueryCurrentStockReqVO.QueryCurrentStockParamVO(materialDOList.stream().map(MaterialDO::getCode).collect(Collectors.toList()))), new QueryCurrentStockReqVO(new QueryCurrentStockReqVO.QueryCurrentStockParamVO(materialDOList.stream().map(MaterialDO::getCode).collect(Collectors.toList()))),
@ -901,18 +903,25 @@ public class ChanjetManager {
if(CollUtil.isEmpty(stockResVOList)){ if(CollUtil.isEmpty(stockResVOList)){
aDo.setStockQuantity(new BigDecimal(0)); aDo.setStockQuantity(new BigDecimal(0));
}else{ }else{
aDo.setStockQuantity(new BigDecimal(stockResVOList.get(0).getAvailableQuantity())); QueryCurrentStockResVO resVO = stockResVOList.get(0);
BigDecimal stockQuantity = new BigDecimal(resVO.getAvailableQuantity());;
if(warehouseId != null && resVO.getWarehouseID() != warehouseId){
stockQuantity = new BigDecimal(0);
}
aDo.setStockQuantity(stockQuantity);
} }
} }
} }
/** /**
* *
*
* @param doList * @param doList
* @param warehouseId
* @throws ChanjetApiException * @throws ChanjetApiException
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void queryStockAndInject2(List<StorageMatDO> doList) throws ChanjetApiException { public void queryStockAndInject2(List<StorageMatDO> doList, Long warehouseId) throws ChanjetApiException {
CommonResult<List<QueryCurrentStockResVO>> result = chanjetSpi.invokeRetList(QUERY_CURRENT_STOCK, CommonResult<List<QueryCurrentStockResVO>> result = chanjetSpi.invokeRetList(QUERY_CURRENT_STOCK,
new QueryCurrentStockReqVO(new QueryCurrentStockReqVO.QueryCurrentStockParamVO(doList.stream().map(StorageMatDO::getProjectSubCode).collect(Collectors.toList()))), new QueryCurrentStockReqVO(new QueryCurrentStockReqVO.QueryCurrentStockParamVO(doList.stream().map(StorageMatDO::getProjectSubCode).collect(Collectors.toList()))),
@ -928,7 +937,12 @@ public class ChanjetManager {
if(CollUtil.isEmpty(stockResVOList)){ if(CollUtil.isEmpty(stockResVOList)){
aDo.setStockQuantity(new BigDecimal(0)); aDo.setStockQuantity(new BigDecimal(0));
}else{ }else{
aDo.setStockQuantity(new BigDecimal(stockResVOList.get(0).getAvailableQuantity())); QueryCurrentStockResVO resVO = stockResVOList.get(0);
BigDecimal stockQuantity = new BigDecimal(resVO.getAvailableQuantity());;
if(warehouseId != null && resVO.getWarehouseID() != warehouseId){
stockQuantity = new BigDecimal(0);
}
aDo.setStockQuantity(stockQuantity);
} }
} }
} }

@ -157,7 +157,7 @@ public class MaterialServiceImpl implements MaterialService {
if(pageReqVO.isReturnStock() && CollUtil.isNotEmpty(result.getList())){ if(pageReqVO.isReturnStock() && CollUtil.isNotEmpty(result.getList())){
try { try {
chanjetManager.queryStockAndInject(result.getList()); chanjetManager.queryStockAndInject(result.getList(), pageReqVO.getWarehouseId());
}catch (Exception e) { }catch (Exception e) {
// do nothing // do nothing
} }

@ -76,7 +76,7 @@ public class StorageMatServiceImpl implements StorageMatService {
List<StorageMatDO> storageMatDOList = storageMatMapper.selectMatByStorckID(pageReqVO.getStockId()); List<StorageMatDO> storageMatDOList = storageMatMapper.selectMatByStorckID(pageReqVO.getStockId());
if(CollUtil.isNotEmpty(storageMatDOList)){ if(CollUtil.isNotEmpty(storageMatDOList)){
try { try {
chanjetManager.queryStockAndInject2(storageMatDOList); chanjetManager.queryStockAndInject2(storageMatDOList, pageReqVO.getWhId());
}catch (Exception e) { }catch (Exception e) {
// do nothing // do nothing
} }

@ -1210,7 +1210,8 @@ onMounted(async () => {
const queryParamsMat = reactive({ const queryParamsMat = reactive({
pageNo: 1, pageNo: 1,
pageSize: 99, pageSize: 99,
stockId: query.id stockId: query.id,
whId: formData.value.whId
}) })
const dataMats = await StorageMatApi.getStorageMatPage(queryParamsMat) const dataMats = await StorageMatApi.getStorageMatPage(queryParamsMat)
formData.value.matItemDOList = dataMats formData.value.matItemDOList = dataMats

Loading…
Cancel
Save