Browse Source

1.干线运单bug修复

visual
zhenghaoyu 5 months ago
parent
commit
18307fa133
  1. 17
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/dto/UpdatePackageDTO.java
  2. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  3. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  4. 99
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

17
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/dto/UpdatePackageDTO.java

@ -0,0 +1,17 @@
package com.logpm.distribution.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class UpdatePackageDTO implements Serializable {
private List<String> orderPackageCodes;
private Long warehouseId;
private String packageStatus;
}

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java

@ -19,6 +19,7 @@ package com.logpm.distribution.feign;
import com.alibaba.fastjson.JSONObject;
import com.logpm.distribution.dto.FindParamterDTO;
import com.logpm.distribution.dto.OrderPackageDTO;
import com.logpm.distribution.dto.UpdatePackageDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.UpdateOrderDTO;
@ -193,7 +194,7 @@ public interface IDistributionParcelListClient {
List<DistributionParcelListEntity> findAllStockListByOrderPackageCode(String orderPackageCode);
@PostMapping(API_PREFIX + "/updatePackageStatus")
void updatePackageStatus(@RequestParam List<String> orderPackageCodes, @RequestParam Long warehouseId, @RequestParam String packageStatus);
void updatePackageStatus(@RequestBody UpdatePackageDTO updatePackageDTO);
@PostMapping(API_PREFIX + "/updateList")
void updateList(@RequestBody List<DistributionParcelListEntity> updateParcelList);

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java

@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.FindParamterDTO;
import com.logpm.distribution.dto.OrderPackageDTO;
import com.logpm.distribution.dto.UpdatePackageDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
@ -376,13 +377,14 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
}
@Override
public void updatePackageStatus(List<String> orderPackageCodes, Long warehouseId, String packageStatus) {
public void updatePackageStatus(UpdatePackageDTO updatePackageDTO) {
List<String> orderPackageCodes = updatePackageDTO.getOrderPackageCodes();
Long warehouseId = updatePackageDTO.getWarehouseId();
String packageStatus = updatePackageDTO.getPackageStatus();
distributionParcelListService.updatePackageStatus(orderPackageCodes, warehouseId, packageStatus);
//把orderPackageCodes每500条进行分组
List<List<String>> orderPackageCodeList = CollUtil.split(orderPackageCodes, 500);
orderPackageCodeList.forEach(orderPackageCodeList1 -> {
distributionParcelListService.updatePackageStatus(orderPackageCodeList1, warehouseId, packageStatus);
});
List<DistributionParcelListEntity> list = distributionParcelListService.findListByOrderPackageCode(orderPackageCodes, warehouseId);
//把list中的orderCode放入一个set

99
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -1,6 +1,7 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.util.IdUtil;
@ -9,6 +10,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -23,6 +25,7 @@ import com.logpm.basicdata.feign.IBasicdataDriverArteryClient;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.FindParamterDTO;
import com.logpm.distribution.dto.UpdatePackageDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
@ -37,61 +40,11 @@ import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.BatchUnloadDTO;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.LoadScanBrandDTO;
import com.logpm.trunkline.dto.LoadingPackageDTO;
import com.logpm.trunkline.dto.LoadingZeroDTO;
import com.logpm.trunkline.dto.OrderStatusDTO;
import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO;
import com.logpm.trunkline.dto.TrunklineCarsOrderDTO;
import com.logpm.trunkline.dto.UnloadPackageDTO;
import com.logpm.trunkline.dto.UnloadZeroDTO;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.dto.ZeroPackageDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadContractEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadFinanceEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLinePhotoEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLogEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity;
import com.logpm.trunkline.entity.TrunklineCostShareRecordEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignOrderEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignPhotoEntity;
import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.IPackageTrackLogAsyncService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineCarsLoadContractService;
import com.logpm.trunkline.service.ITrunklineCarsLoadFinanceService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLinePhotoService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLineService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLogService;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineCarsLoadingLogService;
import com.logpm.trunkline.service.ITrunklineCarsOrderService;
import com.logpm.trunkline.service.ITrunklineCarsSignLogService;
import com.logpm.trunkline.service.ITrunklineCarsUnloadLogService;
import com.logpm.trunkline.service.ITrunklineCostShareRecordService;
import com.logpm.trunkline.service.ITrunklineLoadSignOrderService;
import com.logpm.trunkline.service.ITrunklineLoadSignPhotoService;
import com.logpm.trunkline.service.ITrunklineScanZeroDetailService;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import com.logpm.trunkline.service.ITrunklineWaybillPackageService;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
@ -106,11 +59,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.*;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
@ -130,18 +79,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -7220,7 +7158,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
});
try{
distributionParcelListClient.updatePackageStatus(orderPackageCodes, warehouseId, "60");
List<List<String>> partition = Lists.partition(orderPackageCodes, 500);
partition.forEach(list -> {
UpdatePackageDTO updatePackageDTO = new UpdatePackageDTO();
updatePackageDTO.setOrderPackageCodes(list);
updatePackageDTO.setWarehouseId(warehouseId);
updatePackageDTO.setPackageStatus("70");
distributionParcelListClient.updatePackageStatus(updatePackageDTO);
});
}catch (Exception e){
log.error("更新状态失败",e);
throw new CustomerException("更新状态失败");
@ -7345,6 +7291,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public R signLoadScanByIds(List<Long> loadScanIds, Long warehouseId) {
@ -7405,7 +7352,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateById(carsLoadEntity);
//包件签收状态修改
distributionParcelListClient.updatePackageStatus(orderPackageCodes, warehouseId, "70");
//把orderPackageCodes每500条拆分
List<List<String>> partition = ListUtil.partition(orderPackageCodes, 500);
partition.forEach(list -> {
UpdatePackageDTO updatePackageDTO = new UpdatePackageDTO();
updatePackageDTO.setOrderPackageCodes(list);
updatePackageDTO.setWarehouseId(warehouseId);
updatePackageDTO.setPackageStatus("70");
distributionParcelListClient.updatePackageStatus(updatePackageDTO);
});
waybillPackageService.updatePackageStatus(orderPackageCodes, WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode(),warehouseId, null);

Loading…
Cancel
Save