|
|
|
@ -577,6 +577,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class) |
|
|
|
|
// synchronized
|
|
|
|
|
public R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询该包件是否能够从库存品包件表中查到
|
|
|
|
|
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); |
|
|
|
|
|
|
|
|
@ -642,6 +644,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isEmpty(parcelList)) { |
|
|
|
|
return Resp.scanFail("系统无编码", "系统无编码"); |
|
|
|
|
} |
|
|
|
|
if (parcelList.getConditions().equals(2)) { |
|
|
|
|
return Resp.scanFail("此包件不是订制品", "此包件不是订制品"); |
|
|
|
|
} |
|
|
|
|
if (!Objects.isNull(parcelList)) { |
|
|
|
|
if (OrderPackageStatusConstant.yiqianshou.getValue().equals(parcelList.getOrderPackageStatus())) { |
|
|
|
|
return Resp.scanFail("包件已签收", "包件已签收"); |
|
|
|
@ -787,21 +792,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (shangpeiFlag) { |
|
|
|
|
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList()); |
|
|
|
|
//查看是否存在满足条件的预约单
|
|
|
|
|
reservationEntities = reservationEntities.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList()); |
|
|
|
|
boolean flag = reservationEntityList.stream().anyMatch(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())); |
|
|
|
|
|
|
|
|
|
//存在多个,操作人指定具体客户即可
|
|
|
|
|
if (!reservationEntities.isEmpty() && reservationEntities.size() == 1) { |
|
|
|
|
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())) { |
|
|
|
|
log.info("异常装车未指定客户"); |
|
|
|
|
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车"); |
|
|
|
|
} |
|
|
|
|
if ( reservationEntities.size() == 1 && flag) { |
|
|
|
|
return R.fail(5000, "异常装车"); |
|
|
|
|
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
|
|
|
|
|
} else { |
|
|
|
|
if (parcelListEntity.getConditions() == 2) { |
|
|
|
|
return Resp.scanFail("此包件不是订制品", "此包件不是订制品"); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
if (flag){ |
|
|
|
|
if (reservationEntities.isEmpty()){ |
|
|
|
|
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车"); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
return Resp.scanFail("窜货", "窜货"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -810,15 +811,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (shangpeiFlag) { |
|
|
|
|
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList()); |
|
|
|
|
//查询是否满足商配异常装车
|
|
|
|
|
boolean flag = reservationEntities.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())); |
|
|
|
|
if (flag){ |
|
|
|
|
boolean flag = reservationEntityList.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())); |
|
|
|
|
if (reservationEntities.size() == 1 && flag){ |
|
|
|
|
return R.fail(5000, "异常装车"); |
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){ |
|
|
|
|
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车"); |
|
|
|
|
if (flag){ |
|
|
|
|
if (reservationEntities.isEmpty()){ |
|
|
|
|
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车"); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
return Resp.scanFail("窜货", "窜货"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|