|
|
@ -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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|