|
|
|
@ -43,6 +43,7 @@ import com.logpm.warehouse.feign.IWarehouseUpdownGoodsLogClient;
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.common.constant.CodeDesEnum; |
|
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; |
|
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; |
|
|
|
|
import org.springblade.common.constant.stocklist.StockLockingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.stocklist.StockSignfoStatusConstant; |
|
|
|
@ -574,10 +575,80 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//商 市
|
|
|
|
|
//1.根据预约单id 查询到对应的数据
|
|
|
|
|
List<DistributionStockupOrderListVO> list = distributionReservationService.selectStockupOrderList(reservationId); |
|
|
|
|
// list.forEach( p ->{
|
|
|
|
|
//
|
|
|
|
|
// });
|
|
|
|
|
return list; |
|
|
|
|
List<DistributionStockupOrderListVO> collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); //有货位
|
|
|
|
|
Set<DistributionStockupOrderListVO> listYou = new HashSet<>(); |
|
|
|
|
collect11.forEach( p ->{ |
|
|
|
|
if(listYou.size() > 0){ |
|
|
|
|
//
|
|
|
|
|
boolean b = listYou.stream().anyMatch(a -> a.getAllocationId().equals(p.getAllocationId())); |
|
|
|
|
if(b){ |
|
|
|
|
//有一样的
|
|
|
|
|
listYou.forEach( y -> { |
|
|
|
|
if(y.getAllocationId().equals(p.getAllocationId())){ |
|
|
|
|
//相同
|
|
|
|
|
y.setPlanNum(y.getPlanNum()+1); |
|
|
|
|
if(ObjectUtils.isNotNull(p.getStockId())){ |
|
|
|
|
y.setScanNum(y.getScanNum()+1); |
|
|
|
|
} |
|
|
|
|
//t托盘信息
|
|
|
|
|
if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(p.getTrayId())){ |
|
|
|
|
y.setPallet(y.getPallet()+","+p.getPallet()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} ); |
|
|
|
|
}else{ |
|
|
|
|
//没有
|
|
|
|
|
p.setPlanNum(1); |
|
|
|
|
if (ObjectUtils.isNull(p.getStockId())){ |
|
|
|
|
p.setScanNum(0); |
|
|
|
|
}else{ |
|
|
|
|
p.setScanNum(1); |
|
|
|
|
} |
|
|
|
|
listYou.add(p); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//
|
|
|
|
|
p.setPlanNum(1); |
|
|
|
|
if (ObjectUtils.isNull(p.getStockId())){ |
|
|
|
|
p.setScanNum(0); |
|
|
|
|
}else{ |
|
|
|
|
p.setScanNum(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
listYou.add(p); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
List<DistributionStockupOrderListVO> collect22 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList()); //无货位
|
|
|
|
|
collect22.forEach(i ->{ |
|
|
|
|
boolean b = listYou.stream().anyMatch(ko -> ObjectUtils.isNull(ko.getAllocationId())); |
|
|
|
|
if(b){ |
|
|
|
|
listYou.forEach( wu -> { |
|
|
|
|
if(ObjectUtils.isNull(wu.getAllocationId())){ |
|
|
|
|
//相同
|
|
|
|
|
wu.setPlanNum(wu.getPlanNum()+1); |
|
|
|
|
if(ObjectUtils.isNotNull(i.getStockId())){ |
|
|
|
|
wu.setScanNum(wu.getScanNum()+1); |
|
|
|
|
} |
|
|
|
|
//托盘信息
|
|
|
|
|
if(ObjectUtils.isNotNull(wu.getTrayId()) && wu.getTrayId().equals(i.getTrayId())){ |
|
|
|
|
wu.setPallet(wu.getPallet()+","+i.getPallet()); |
|
|
|
|
} |
|
|
|
|
if(wu.getPlanNum().equals(wu.getScanNum())){ |
|
|
|
|
wu.setCompleteStact(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
i.setPlanNum(1); |
|
|
|
|
if(ObjectUtils.isNotNull(i.getStockId())){ |
|
|
|
|
i.setScanNum(1); |
|
|
|
|
}else{ |
|
|
|
|
i.setScanNum(0); |
|
|
|
|
} |
|
|
|
|
listYou.add(i); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return new ArrayList<>(listYou); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -603,7 +674,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//查询客户信息
|
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId()); //预约信息
|
|
|
|
|
//通过订单id和预约id,托盘信息查询对应的包件列表
|
|
|
|
|
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId()); |
|
|
|
|
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoList(stockupDTO); |
|
|
|
|
// int size = list.size(); //数量
|
|
|
|
|
Integer size = 0; //数量
|
|
|
|
|
Integer scanNum = 0; |
|
|
|
@ -624,6 +695,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
List<DistributionStockEntity> list1 = distributionStockService.list(Wrappers.<DistributionStockEntity>query().lambda() |
|
|
|
|
.eq(DistributionStockEntity::getCoding, vo.getPackageBarCode()) |
|
|
|
|
.eq(DistributionStockEntity::getParcelListId, vo.getParceListId()) |
|
|
|
|
.eq(DistributionStockEntity::getReservationId, stockupDTO.getReservationId()) |
|
|
|
|
.eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId()) |
|
|
|
|
); |
|
|
|
|
allocationTitle = vo.getAllocationTitle(); |
|
|
|
|
trayCode = vo.getTrayCode(); |
|
|
|
@ -708,11 +781,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if(stockupDTO.getStatus().equals(1)){ |
|
|
|
|
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillOverPackWuSelf(stockupDTO); |
|
|
|
|
// DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getStockArticleId, stockupDTO.getStockArticleId()) |
|
|
|
|
); |
|
|
|
|
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("stock_article_id", stockupDTO.getStockArticleId()); |
|
|
|
|
if(!stockupDTO.getTypeService().equals("3")){ |
|
|
|
|
queryWrapper.eq("order_package_reservation_status", OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper); |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
List<PackageStockupVO> listPack = new ArrayList<>(); |
|
|
|
|
list.forEach( i ->{ |
|
|
|
@ -769,7 +843,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
iterator.remove(); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (ObjectUtils.isNotNull(next.getIsScan())) { |
|
|
|
|
if (ObjectUtils.isNotNull(next.getIsScan()) && !next.getIsScan().equals(0)) { |
|
|
|
|
next.setIsScanStr("已备货"); |
|
|
|
|
next.setIsScan(2); |
|
|
|
|
} else { |
|
|
|
@ -784,7 +858,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
iterator.remove(); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (ObjectUtils.isNotNull(next.getIsScan())) { |
|
|
|
|
if (ObjectUtils.isNotNull(next.getIsScan()) && !next.getIsScan().equals(0)) { |
|
|
|
|
next.setIsScanStr("已备货"); |
|
|
|
|
next.setIsScan(2); |
|
|
|
|
} else { |
|
|
|
|