【需求】出库处理

dev
zengchenxi 5 months ago
parent 6a1ee68688
commit 3238271ac4

@ -105,4 +105,7 @@ public class MaterialPageReqVO extends PageParam {
@Schema(description = "存货属性")
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>()
.eqIfPresent(StorageMatDO::getStockId, reqVO.getStockId())
.eqIfPresent(StorageMatDO::getMatId, reqVO.getMatId())
.eqIfPresent(StorageMatDO::getWhId, reqVO.getWhId())
// .eqIfPresent(StorageMatDO::getWhId, reqVO.getWhId())
.eqIfPresent(StorageMatDO::getRgId, reqVO.getRgId())
.eqIfPresent(StorageMatDO::getPnId, reqVO.getPnId())
.eqIfPresent(StorageMatDO::getStorageOkQty, reqVO.getStorageOkQty())

@ -881,11 +881,13 @@ public class ChanjetManager {
/**
*
*
* @param materialDOList
* @param warehouseId
* @throws ChanjetApiException
*/
@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,
new QueryCurrentStockReqVO(new QueryCurrentStockReqVO.QueryCurrentStockParamVO(materialDOList.stream().map(MaterialDO::getCode).collect(Collectors.toList()))),
@ -901,18 +903,25 @@ public class ChanjetManager {
if(CollUtil.isEmpty(stockResVOList)){
aDo.setStockQuantity(new BigDecimal(0));
}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 warehouseId
* @throws ChanjetApiException
*/
@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,
new QueryCurrentStockReqVO(new QueryCurrentStockReqVO.QueryCurrentStockParamVO(doList.stream().map(StorageMatDO::getProjectSubCode).collect(Collectors.toList()))),
@ -928,7 +937,12 @@ public class ChanjetManager {
if(CollUtil.isEmpty(stockResVOList)){
aDo.setStockQuantity(new BigDecimal(0));
}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())){
try {
chanjetManager.queryStockAndInject(result.getList());
chanjetManager.queryStockAndInject(result.getList(), pageReqVO.getWarehouseId());
}catch (Exception e) {
// do nothing
}

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

@ -186,7 +186,7 @@
:rules="subFormRules.projectSubCode"
class="mb-0px!"
>
<el-input
class="!w-265px"
placeholder="物料编码"
@ -320,7 +320,7 @@
:rules="subFormRules.projectSubCode"
class="mb-0px!"
>
<el-input
class="!w-265px"
placeholder="物料编码"
@ -1210,7 +1210,8 @@ onMounted(async () => {
const queryParamsMat = reactive({
pageNo: 1,
pageSize: 99,
stockId: query.id
stockId: query.id,
whId: formData.value.whId
})
const dataMats = await StorageMatApi.getStorageMatPage(queryParamsMat)
formData.value.matItemDOList = dataMats

Loading…
Cancel
Save