Browse Source

异常签收整改

single_db
汤建军 1 year ago
parent
commit
f03af21c9b
  1. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  2. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  3. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  4. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  5. 35
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -140,4 +140,12 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
* @param packageIds
*/
Integer updateLoadingAndSigningByIds(@Param("packageIds")List<Long> packageIds);
/**
* 根据二维码查询包件信息
* @param orderPackageCode
* @param warehouseId
* @return
*/
DistributionParcelListEntity selectByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode,@Param("warehouseId") Long warehouseId);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -868,6 +868,10 @@
where order_package_code = #{orderPackageCode}
and order_package_status in ('20','30')
</select>
<select id="selectByOrderPackageCode"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT * FROM logpm_distribution_parcel_list WHERE order_package_code = #{orderPackageCode} and warehouse_id = #{warehouseId}
</select>
<update id="updateOrderPackageCodeById">
update logpm_distribution_parcel_list

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java

@ -161,4 +161,12 @@ public interface IDistributionParcelListService extends BaseService<Distribution
DistributionParcelListEntity findByOrderPackageCodeAndStatus(String orderPackageCode);
void updateOrderPackageCodeById(Long packageId, String orderPackageStatus);
/**
* 根据二维码查询包件
* @param barcode
* @param id
* @return
*/
DistributionParcelListEntity selectByOrderPackageCode(String orderPackageCode, Long warehouseId);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -619,6 +619,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
baseMapper.updateOrderPackageCodeById(packageId,orderPackageStatus);
}
@Override
public DistributionParcelListEntity selectByOrderPackageCode(String orderPackageCode, Long warehouseId) {
return baseMapper.selectByOrderPackageCode(orderPackageCode,warehouseId);
}
/**
* @param distributionParcelList 包件信息
* @return

35
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -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())

Loading…
Cancel
Save