|
|
|
@ -654,11 +654,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
|
|
|
|
// ---------------------------------2023-09-09 包件签收调整---------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
//思路: 在于一个客户下不会出现重复的包条码
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
throw new CustomerException(403, "仓库信息不能为空"); |
|
|
|
|
} |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(),myCurrentWarehouse.getId()); |
|
|
|
|
if (Func.isEmpty(parcelListEntity)){ |
|
|
|
|
return Resp.scanFail("包件信息不存在","包件信息不存在"); |
|
|
|
|
} |
|
|
|
|
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
if (Func.isEmpty(distributionReservationEntity)){ |
|
|
|
|
log.error("########无效的预约单,reservationId:{}",distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
@ -794,6 +799,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//该货物是否属于该计划
|
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = parcelListEntities.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(distributionParcelListEntities) && distributionParcelListEntities.size() == 1) { |
|
|
|
|
//这里按道理也具备签收条件,需要标注该装车记录不正常
|
|
|
|
|
log.error("#####################distributionParcelListEntities窜货", distributionParcelListEntities); |
|
|
|
@ -802,7 +808,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//判断该货物是否属于该客户
|
|
|
|
|
// 异常签收
|
|
|
|
|
// return Resp.scanFail("异常签收包件","异常签收包件");
|
|
|
|
|
return R.fail(3006, "异常签收"); |
|
|
|
|
//判断客户
|
|
|
|
|
boolean flag = judgmentClient(distributionReservationEntity,parcelListEntity.getStockArticleId()); |
|
|
|
|
if (flag){ |
|
|
|
|
return R.fail(3006, "异常签收"); |
|
|
|
|
}else { |
|
|
|
|
return Resp.scanFail("异常签收包件","不满足签收条件"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//一个客户下出现重复包条码
|
|
|
|
@ -814,6 +826,27 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return Resp.scanSuccess("签收成功", str); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean judgmentClient(DistributionReservationEntity distributionReservationEntity, Long stockArticleId) { |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(stockArticleId); |
|
|
|
|
switch (distributionReservationEntity.getDeliveryType()){ |
|
|
|
|
case "1": |
|
|
|
|
//商配
|
|
|
|
|
if (stockArticleEntity.getConsigneeUnit().equals(distributionReservationEntity.getReceivingUnit()) && stockArticleEntity.getConsigneePerson().equals(distributionReservationEntity.getConsignee()) && stockArticleEntity.getMallName().equals(distributionReservationEntity.getMallName())){ |
|
|
|
|
return true; |
|
|
|
|
}else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
case "2": |
|
|
|
|
if (stockArticleEntity.getCustomerName().equals(distributionReservationEntity.getConsignee()) && stockArticleEntity.getCustomerAddress().equals(distributionReservationEntity.getDeliveryAddress()) && stockArticleEntity.getCustomerTelephone().equals(distributionReservationEntity.getDeliveryPhone())){ |
|
|
|
|
return true; |
|
|
|
|
}else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
//市配
|
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
|
|
|
|
|
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
|
|
|
|
|