|
|
|
@ -13,6 +13,7 @@ import com.logpm.distribution.entity.DistributionStockListEntity;
|
|
|
|
|
import com.logpm.distribution.feign.IDistributionParcelListClient; |
|
|
|
|
import com.logpm.distribution.feign.IDistributionStockArticleClient; |
|
|
|
|
import com.logpm.distribution.feign.IDistributionStockListClient; |
|
|
|
|
import com.logpm.distribution.vo.DistributionStockListVO; |
|
|
|
|
import com.logpm.warehouse.bean.Resp; |
|
|
|
|
import com.logpm.warehouse.dto.TrayTypeDTO; |
|
|
|
|
import com.logpm.warehouse.dto.ZeroOrderVO; |
|
|
|
@ -499,16 +500,23 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<TrayTypeDataListVO> getZeroOrderByWaybillCode(String waybillCode) { |
|
|
|
|
// List<TrayTypeDataListVO> zeroOrderByWaybillCode = baseMapper.getZeroOrderByWaybillCode(waybillCode);
|
|
|
|
|
// for (TrayTypeDataListVO trayTypeDataListVO:zeroOrderByWaybillCode){
|
|
|
|
|
//
|
|
|
|
|
// String ordeCode = trayTypeDataListVO.getDataCode();
|
|
|
|
|
// Long orderId = trayTypeDataListVO.getDataId();
|
|
|
|
|
// //计算零担订单可用数量
|
|
|
|
|
// countZeroAvailableNum(orderId);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
return baseMapper.getZeroOrderByWaybillCode(waybillCode); |
|
|
|
|
List<TrayTypeDataListVO> zeroOrderByWaybillCode = baseMapper.getZeroOrderByWaybillCode(waybillCode); |
|
|
|
|
for (TrayTypeDataListVO trayTypeDataListVO:zeroOrderByWaybillCode){ |
|
|
|
|
Long orderId = trayTypeDataListVO.getDataId(); |
|
|
|
|
Integer orderTotalNum = trayTypeDataListVO.getOrderTotalNum(); |
|
|
|
|
//查询该零担的库位数据
|
|
|
|
|
List<PositionVO> updownGoodsEntities = warehouseUpdownGoodsService.getUpdownGoodsByZeroOrderId(orderId); |
|
|
|
|
List<PositionVO> trayGoodsEntities = warehouseTrayGoodsService.getTrayGoodsByZeroOrderIdNoAllocationId(orderId); |
|
|
|
|
updownGoodsEntities.addAll(trayGoodsEntities); |
|
|
|
|
for (PositionVO positionVO:updownGoodsEntities){ |
|
|
|
|
Integer num = positionVO.getNum(); |
|
|
|
|
orderTotalNum = orderTotalNum - num; |
|
|
|
|
} |
|
|
|
|
trayTypeDataListVO.setOrderTotalNum(orderTotalNum); |
|
|
|
|
trayTypeDataListVO.setPositionList(updownGoodsEntities); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return zeroOrderByWaybillCode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -1485,7 +1493,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R selectStockByMaterialCodeAndMarketId(Long marketId, String materialCode) { |
|
|
|
|
List<DistributionStockListEntity> ls = new ArrayList<>(); |
|
|
|
|
List<DistributionStockListVO> ls = new ArrayList<>(); |
|
|
|
|
//根据商场id和物料编码查询对应的库存品
|
|
|
|
|
List<DistributionStockListEntity> stockListEntityList = distributionStockListClient.getListByMarketIdAndMaterialCode(marketId, materialCode); |
|
|
|
|
if(Objects.isNull(stockListEntityList) || stockListEntityList.size() == 0){ |
|
|
|
@ -1493,19 +1501,20 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
return R.fail(403,"库存品不存在"); |
|
|
|
|
} |
|
|
|
|
for(DistributionStockListEntity stockListEntity:stockListEntityList){ |
|
|
|
|
DistributionStockListVO distributionStockListVO = new DistributionStockListVO(); |
|
|
|
|
BeanUtil.copy(stockListEntity,distributionStockListVO); |
|
|
|
|
Integer quantityStock = stockListEntity.getQuantityStock();//在数量
|
|
|
|
|
String incomingBatch = stockListEntity.getIncomingBatch(); |
|
|
|
|
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("market_id",marketId) |
|
|
|
|
.eq("association_value",materialCode) |
|
|
|
|
.eq("incoming_batch",incomingBatch); |
|
|
|
|
List<WarehouseTrayGoodsEntity> list = warehouseTrayGoodsService.list(queryWrapper); |
|
|
|
|
Integer useNum = 0; |
|
|
|
|
for (WarehouseTrayGoodsEntity trayGoodsEntity:list){ |
|
|
|
|
useNum = useNum +trayGoodsEntity.getNum(); |
|
|
|
|
List<PositionVO> updownGoodsByStock = warehouseUpdownGoodsService.getUpdownGoodsByStock(marketId,materialCode,incomingBatch); |
|
|
|
|
List<PositionVO> traynGoodsByStock = warehouseTrayGoodsService.getTrayGoodsByStockNoAllocationId(marketId,materialCode,incomingBatch); |
|
|
|
|
updownGoodsByStock.addAll(traynGoodsByStock); |
|
|
|
|
for (PositionVO positionVO:updownGoodsByStock){ |
|
|
|
|
Integer num = positionVO.getNum(); |
|
|
|
|
quantityStock = quantityStock - num; |
|
|
|
|
} |
|
|
|
|
stockListEntity.setQuantityStock(quantityStock-useNum); |
|
|
|
|
ls.add(stockListEntity); |
|
|
|
|
distributionStockListVO.setQuantityStock(quantityStock); |
|
|
|
|
distributionStockListVO.setPositionList(updownGoodsByStock); |
|
|
|
|
ls.add(distributionStockListVO); |
|
|
|
|
} |
|
|
|
|
return R.data(ls); |
|
|
|
|
} |
|
|
|
|