Browse Source

fix:优化下代码获取没有在盘点任务的代码

dist.1.3.0
pref_mail@163.com 9 months ago
parent
commit
641cf98f2b
  1. 68
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

68
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -2084,33 +2084,41 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
case "3": //3包件码
//查询订单ID
//查询订单信息
questDetail.setQuestTarget(1);//
questDetail.setOrderPackageCode(i.getAssociationValue());//包条码
questDetail.setOrderPackageId(i.getAssociationId());//包件ID
DistributionParcelListEntity parcelList = new DistributionParcelListEntity();
parcelList.setId(i.getAssociationId());
parcelList.setOrderPackageCode(i.getAssociationValue());
List<DistributionParcelListEntity> parcelList1 = distributionParcelListClient.getParcelList(parcelList);
if (!parcelList1.isEmpty()) {
questDetail.setOrderId(parcelList1.get(0).getStockArticleId());
} else {
continue;
}
DistributionStockArticleEntity distributionStockArticleEntity = getStockArticleInfo(parcelList1.get(0).getStockArticleId());
// if (!list.stream().anyMatch(d -> d.getRefName().equals(distributionStockArticleEntity.getMallName()))) {
// questDetail.setQuestTarget(1);//
// questDetail.setOrderPackageCode(i.getAssociationValue());//包条码
// questDetail.setOrderPackageId(i.getAssociationId());//包件ID
// DistributionParcelListEntity parcelList = new DistributionParcelListEntity();
// parcelList.setId(i.getAssociationId());
// parcelList.setOrderPackageCode(i.getAssociationValue());
// List<DistributionParcelListEntity> parcelList1 = distributionParcelListClient.getParcelList(parcelList);
// if (!parcelList1.isEmpty()) {
// questDetail.setOrderId(parcelList1.get(0).getStockArticleId());
// } else {
// continue;
// }
questDetail.setOrderCode(distributionStockArticleEntity.getOrderCode());//
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = getUpdownGoodsPack(i.getAssociationId(), "3", i.getAssociationValue(), warehouseId);
if (Optional.ofNullable(warehouseUpdownGoodsEntity).isPresent()) {
questDetail.setPositionCode(warehouseUpdownGoodsEntity.getPositionCode());//完整货位
questDetail.setAllocationId(String.valueOf(warehouseUpdownGoodsEntity.getAllocationId()));
}
questDetail.setIsNew(0);//是否新增
// DistributionStockArticleEntity distributionStockArticleEntity = getStockArticleInfo(parcelList1.get(0).getStockArticleId());
//// if (!list.stream().anyMatch(d -> d.getRefName().equals(distributionStockArticleEntity.getMallName()))) {
//// continue;
//// }
// questDetail.setOrderCode(distributionStockArticleEntity.getOrderCode());//
// WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = getUpdownGoodsPack(i.getAssociationId(), "3", i.getAssociationValue(), warehouseId);
//
// if (Optional.ofNullable(warehouseUpdownGoodsEntity).isPresent()) {
// questDetail.setPositionCode(warehouseUpdownGoodsEntity.getPositionCode());//完整货位
// questDetail.setAllocationId(String.valueOf(warehouseUpdownGoodsEntity.getAllocationId()));
// }
// questDetail.setIsNew(0);//是否新增
DistributionParcelListEntity byPacketBarCodeAndWarehouseId = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(i.getAssociationValue(), warehouseId);
questDetail =buildQuestDetailEntity(taskSearchDTO.getQuestId(),byPacketBarCodeAndWarehouseId,user,null);
break;
case "4": //4库存品
questDetail.setCreateUser(user.getUserId());
questDetail.setCreateDept(Long.parseLong(user.getDeptId().split(",")[0]));
questDetail.setStatus(1);
questDetail.setIsDeleted(0);
Date date = new Date();
questDetail.setCreateTime(date);
questDetail.setUpdateTime(date);
questDetail.setQuestTarget(3);//
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setIncomingBatch(i.getIncomingBatch());
@ -2138,14 +2146,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
break;
}
questDetail.setCreateUser(user.getUserId());
Date date = new Date();
questDetail.setHasData(1);
questDetail.setCreateTime(date);
questDetail.setUpdateTime(date);
questDetail.setCreateDept(Long.parseLong(user.getDeptId().split(",")[0]));
questDetail.setStatus(1);
questDetail.setIsDeleted(0);
questDetail.setQuestType(4);//托盘
questDetail.setQuestStatus(0); //包件盘点状态
questDetail.setStockNum(i.getNum()); //数量
@ -2154,6 +2156,10 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetail.setTrayId(String.valueOf(trayByTrayCode.getId()));
questDetail.setAllocationId(String.valueOf(trayByTrayCode.getId()));
questDetail.setIsNew(0);//是否新增
// 增加商场信息
questDetailList.add(questDetail);
}
//添加

Loading…
Cancel
Save