Browse Source

异常判定修复、日志排序修复

dist.1.3.0
汤建军 7 months ago
parent
commit
a850d8ba8f
  1. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  2. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  4. 72
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -169,7 +169,7 @@
DESC
</select>
<select id="getFinallyClientCode" resultType="java.lang.String">
SELECT client_code FROM `logpm_basicdata_client` WHERE is_deleted = 0 AND client_code LIKE 'HT%' AND LENGTH(client_code) = 9 ORDER BY client_code DESC
SELECT client_code FROM `logpm_basicdata_client` WHERE is_deleted = 0 AND client_code LIKE 'HT00%' AND LENGTH(client_code) = 9 ORDER BY client_code DESC
</select>
</mapper>

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -196,10 +196,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
if (ObjectUtils.isNotNull(basicdataClient1)) {
throw new ServiceException("客户编码或客户名称已存在");
}
//添加
this.save(basicdataClient);
// //绑定客户账号和客户关系
boolean save = this.save(basicdataClient);
if (save){
//进行redis的设置
redis.set(RedisKeyConstant.FINAL_CLIENT_CODE + AuthUtil.getTenantId(), basicdataClient.getClientCode());
}
//添加联系人
BasicdataStoreContactEntity basicdataStoreContactEntity = new BasicdataStoreContactEntity();

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

@ -1584,7 +1584,7 @@
ldpl.quantity AS quantity,
ldpl.train_number AS tranNumber,
ldpl.waybill_number AS waybillNumber,
ldbl.create_time AS nodeTime,
ldbp.create_time AS nodeTime,
ldbl.create_user AS nodeControlsUserId,
'自提配送' AS nodeName,
lwt.pallet_name,
@ -1637,7 +1637,7 @@
ldpl.quantity AS quantity,
ldpl.train_number AS tranNumber,
ldpl.waybill_number AS waybillNumber,
ldbl.update_time AS nodeTime,
ldbp.update_time AS nodeTime,
ldbl.update_user AS nodeControlsUserId,
'自提取消' AS nodeName,
lwt.pallet_name,

72
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -778,51 +778,55 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查找出该包件信息
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()).eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()));
List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
boolean shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue()));
if (Func.isEmpty(parcelListEntity)) {
return Resp.scanFail("无包件信息", "无包件信息");
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
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());
//查看是否存在满足条件的预约单
//存在多个,操作人指定具体客户即可
if (!reservationEntities.isEmpty()) {
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())) {
log.info("异常装车未指定客户");
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}
return R.fail(5000, "异常装车");
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
} else {
if (parcelListEntity.getConditions() == 2) {
return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
} else {
return Resp.scanFail("窜货", "窜货");
}
if (!reservationEntityList.isEmpty()){
boolean shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue()));
if (Func.isEmpty(parcelListEntity)) {
return Resp.scanFail("无包件信息", "无包件信息");
}
} else {
shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
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());
//查询是否满足商配异常装车
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());
//查看是否存在满足条件的预约单
boolean flag = reservationEntities.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
if (flag){
return R.fail(5000, "异常装车");
}else {
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){
//存在多个,操作人指定具体客户即可
if (!reservationEntities.isEmpty() && flag) {
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())) {
log.info("异常装车未指定客户");
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}else {
}
return R.fail(5000, "异常装车");
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
} else {
if (parcelListEntity.getConditions() == 2) {
return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
} else {
return Resp.scanFail("窜货", "窜货");
}
}
} else {
log.error("配送计划预约类型错误:{}", reservationEntityList);
shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
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){
return R.fail(5000, "异常装车");
}else {
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}else {
return Resp.scanFail("窜货", "窜货");
}
}
} else {
log.error("配送计划预约类型错误:{}", reservationEntityList);
}
}
}
log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId());
}
} else if (distrilbutionloadingscanDTO.getType() == 2) {

Loading…
Cancel
Save