|
|
|
@ -10,8 +10,10 @@ import com.logpm.distribution.entity.DistributionParcelListEntity;
|
|
|
|
|
import com.logpm.distribution.entity.QualityDeliverEntity; |
|
|
|
|
import com.logpm.distribution.feign.IDistributionParcelListClient; |
|
|
|
|
import com.logpm.distribution.feign.IQualityDeliverClient; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineCarsLoadLineClient; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineCarsLoadScanClient; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
|
|
|
@ -41,6 +43,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
|
|
|
|
|
private final IBasicdataWarehouseClient basicdataWarehouseClient; |
|
|
|
|
private final ISysClient systemClient; |
|
|
|
|
private final ITrunklineWaybillOrderClient trunklineWaybillOrderClient; |
|
|
|
|
private final ITrunklineCarsLoadLineClient traceCarsLoadLineClient; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R data(String type, String order) { |
|
|
|
@ -140,18 +143,23 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
|
|
|
|
|
|
|
|
|
|
if (allListByWaybillNo != null && !allListByWaybillNo.isEmpty()) { |
|
|
|
|
// 按照 车次号进行分组
|
|
|
|
|
Map<String, List<TrunklineCarsLoadScanEntity>> groupedByLoadId = allListByWaybillNo.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadCode)); |
|
|
|
|
Set<String> strings = groupedByLoadId.keySet(); |
|
|
|
|
for (String key : strings) { |
|
|
|
|
Map<Long, List<TrunklineCarsLoadScanEntity>> groupedByLoadId = allListByWaybillNo.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadId)); |
|
|
|
|
Set<Long> strings = groupedByLoadId.keySet(); |
|
|
|
|
for (Long key : strings) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询改车次所有卸车作业数据集合
|
|
|
|
|
List<TrunklineCarsLoadLineEntity> listByLoadId = traceCarsLoadLineClient.findListByLoadId(key); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities = groupedByLoadId.get(key); |
|
|
|
|
//干线发车
|
|
|
|
|
nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, key); |
|
|
|
|
nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, listByLoadId ); |
|
|
|
|
if (nodeInfoVO != null) { |
|
|
|
|
nodeInfoVOList.add(nodeInfoVO); |
|
|
|
|
} |
|
|
|
|
// 干线到达
|
|
|
|
|
nodeInfoVO = buildTrunklineByUnLoadCar(trunklineCarsLoadScanEntities, key); |
|
|
|
|
nodeInfoVO = buildTrunklineByUnLoadCar(trunklineCarsLoadScanEntities, listByLoadId); |
|
|
|
|
if (nodeInfoVO != null) { |
|
|
|
|
nodeInfoVOList.add(nodeInfoVO); |
|
|
|
|
} |
|
|
|
@ -296,18 +304,20 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
|
|
|
|
|
log.info( ">> allListByWaybillNo ={}",allListByWaybillNo); |
|
|
|
|
if (allListByWaybillNo != null && !allListByWaybillNo.isEmpty()) { |
|
|
|
|
// 按照 车次号进行分组
|
|
|
|
|
Map<String, List<TrunklineCarsLoadScanEntity>> groupedByLoadId = allListByWaybillNo.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadCode)); |
|
|
|
|
Set<String> strings = groupedByLoadId.keySet(); |
|
|
|
|
for (String key : strings) { |
|
|
|
|
Map<Long, List<TrunklineCarsLoadScanEntity>> groupedByLoadId = allListByWaybillNo.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadId)); |
|
|
|
|
Set<Long> strings = groupedByLoadId.keySet(); |
|
|
|
|
for (Long key : strings) { |
|
|
|
|
//
|
|
|
|
|
List<TrunklineCarsLoadLineEntity> listByLoadId = traceCarsLoadLineClient.findListByLoadId(key); |
|
|
|
|
|
|
|
|
|
List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities = groupedByLoadId.get(key); |
|
|
|
|
//干线发车
|
|
|
|
|
nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, key); |
|
|
|
|
nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, listByLoadId); |
|
|
|
|
if (nodeInfoVO != null) { |
|
|
|
|
nodeInfoVOList.add(nodeInfoVO); |
|
|
|
|
} |
|
|
|
|
// 干线到达
|
|
|
|
|
nodeInfoVO = buildTrunklineByUnLoadCar(trunklineCarsLoadScanEntities, key); |
|
|
|
|
nodeInfoVO = buildTrunklineByUnLoadCar(trunklineCarsLoadScanEntities, listByLoadId); |
|
|
|
|
if (nodeInfoVO != null) { |
|
|
|
|
nodeInfoVOList.add(nodeInfoVO); |
|
|
|
|
} |
|
|
|
@ -368,7 +378,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private NodeInfoVO buildTrunklineByUnLoadCar(List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities, String key) { |
|
|
|
|
private NodeInfoVO buildTrunklineByUnLoadCar(List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities, List<TrunklineCarsLoadLineEntity> listByLoadId ) { |
|
|
|
|
|
|
|
|
|
// 获取卸车集合
|
|
|
|
|
List<TrunklineCarsLoadScanEntity> collect = trunklineCarsLoadScanEntities.stream().filter(t -> t.getScanStatus().equals("2")).collect(Collectors.toList()); |
|
|
|
@ -376,17 +386,29 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
|
|
|
|
|
if (collect.isEmpty()) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(listByLoadId.isEmpty()){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 判断该卸车作业节点
|
|
|
|
|
TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity = collect.get(0); |
|
|
|
|
TrunklineCarsLoadLineEntity trunklineCarsLoadLineEntity = listByLoadId.stream().filter(t -> t.getNodeName().equals(trunklineCarsLoadScanEntity.getUnloadNodeName())).findFirst().orElse(null); |
|
|
|
|
|
|
|
|
|
if(trunklineCarsLoadLineEntity == null){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
NodeInfoVO nodeInfoVO = new NodeInfoVO(); |
|
|
|
|
nodeInfoVO.setOperateName("干线到达"); |
|
|
|
|
nodeInfoVO.setOperateNumber(collect.size() + ""); |
|
|
|
|
nodeInfoVO.setOperateWarehouseName(trunklineCarsLoadScanEntity.getUnloadNodeName()); |
|
|
|
|
nodeInfoVO.setOperateTime(trunklineCarsLoadScanEntity.getCreateTime()); |
|
|
|
|
nodeInfoVO.setOperateTime(trunklineCarsLoadLineEntity.getArriveDate()); |
|
|
|
|
return nodeInfoVO; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private NodeInfoVO buildTrunklineByLoadCar(List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities, String key) { |
|
|
|
|
private NodeInfoVO buildTrunklineByLoadCar(List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities, List<TrunklineCarsLoadLineEntity> listByLoadId ) { |
|
|
|
|
|
|
|
|
|
// 判断trunklineCarsLoadScanEntities 中 warehouseId 不是null的集合
|
|
|
|
|
log.info(">>> trunklineCarsLoadScanEntities ={}",trunklineCarsLoadScanEntities); |
|
|
|
@ -396,11 +418,18 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity = collect.get(0); |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadLineEntity trunklineCarsLoadLineEntity = listByLoadId.stream().filter(t -> t.getNodeName().equals(trunklineCarsLoadScanEntity.getWarehouseName())).findFirst().orElse(null); |
|
|
|
|
|
|
|
|
|
if(trunklineCarsLoadLineEntity == null){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
NodeInfoVO nodeInfoVO = new NodeInfoVO(); |
|
|
|
|
nodeInfoVO.setOperateName("干线发车"); |
|
|
|
|
nodeInfoVO.setOperateNumber(collect.size() + ""); |
|
|
|
|
nodeInfoVO.setOperateWarehouseName(trunklineCarsLoadScanEntity.getWarehouseName()); |
|
|
|
|
nodeInfoVO.setOperateTime(trunklineCarsLoadScanEntity.getUnloadTime()); |
|
|
|
|
nodeInfoVO.setOperateTime(trunklineCarsLoadLineEntity.getStartDate()); |
|
|
|
|
return nodeInfoVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|