Browse Source

1.干线运单bug修复

2.补丁新增处理包件
visual
zhenghaoyu 6 months ago
parent
commit
7aea6680aa
  1. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  2. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  3. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  4. 27
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  5. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java
  6. 17
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml
  7. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java
  8. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java
  9. 16
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  10. 6
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java

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

@ -386,9 +386,11 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
distributionParcelListService.updatePackageStatus(orderPackageCodes, warehouseId, packageStatus);
List<DistributionParcelListEntity> list = distributionParcelListService.findListByOrderPackageCode(orderPackageCodes, warehouseId);
// List<DistributionParcelListEntity> list = distributionParcelListService.findListByOrderPackageCode(orderPackageCodes, warehouseId);
List<String> orderCodesByOrderPackageCodes = distributionParcelListService.findOrderCodesByOrderPackageCodes(orderPackageCodes, warehouseId);
//把list中的orderCode放入一个set
Set<String> orderCodeSet = list.stream().map(DistributionParcelListEntity::getOrderCode).collect(Collectors.toSet());
Set<String> orderCodeSet = new HashSet<>(orderCodesByOrderPackageCodes);
orderCodeSet.forEach(orderCode -> {
distributionStockArticleService.updateOrderInfo(orderCode, warehouseId);
});

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

@ -1701,9 +1701,7 @@
<update id="updatePackageStatus">
update logpm_distribution_parcel_list ldpl
set ldpl.order_package_status = #{packageStatus}
where exists(
select 1 from (
join (
<foreach collection="orderPackageCodes" index="ind" item="item">
<if test="ind == 0">
select #{item} pid
@ -1713,8 +1711,10 @@
select #{item} pid
</if>
</foreach>
) packageCodes where packageCodes.pid = ldpl.order_package_code)
and ldpl.warehouse_id = #{warehouseId}
) t on t.pid = ldpl.order_package_code
set ldpl.order_package_status = #{packageStatus}
where ldpl.warehouse_id = #{warehouseId}
</update>
<select id="findListByOrderPackageCode" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">

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

@ -1437,6 +1437,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return orderInfoByOrderPackageCode;
}
@Transactional()
@Override
public void updateEntityByOpenOrderByAdvanceIds(UpdateOrderDTO updateOrderDTO) {
Long waybillId = updateOrderDTO.getWaybillId();

27
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -39,6 +39,7 @@ import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.stream.Collectors;
/**
* 同步老系统订单信息到新系统
@ -957,4 +958,30 @@ public class SyncOrderInfoToPlatform {
}
@XxlJob("dealPackageStatus")
public ReturnT<String> dealPackageStatus(String param) {
log.info("############dealPackageStatus: 处理包件状态为出库 开始");
if(StringUtil.isBlank(param)){
log.warn("###########dealPackageStatus: 仓库id为空");
throw new CustomerException(405,"仓库id为空");
}
Long warehouseId = Long.parseLong(param);
List<JSONObject> ls = warehouseMappingDataService.findAllOrderPackage();
List<String> orderPackageCodes = ls.stream().map(l -> l.getStr("orderPackageCode")).collect(Collectors.toList());
syncOrderInfoService.updatePackageStatusList(orderPackageCodes,warehouseId,"60");
log.info("############dealPackageStatus: 处理包件状态为出库 完成");
return ReturnT.SUCCESS;
}
}

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java

@ -146,5 +146,7 @@ public interface WarehouseMappingDataMapper {
void updateParcelListWaybillInfo(@Param("orderCodes") List<String> orderCodes, @Param("waybillId") Long waybillId, @Param("waybillNo") String waybillNo, @Param("departureWarehouseId") Long departureWarehouseId, @Param("departureWarehouseName") String departureWarehouseName, @Param("destinationWarehouseId") Long destinationWarehouseId, @Param("destinationWarehouseName") String destinationWarehouseName);
void updateRepairParcelListWaybillById(@Param("id") Integer id, @Param("status") int status);
void updatePackageStatusList(@Param("orderPackageCodes") List<String> orderPackageCodes, @Param("warehouseId") Long warehouseId, @Param("packageStatus") String packageStatus);
}

17
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml

@ -487,4 +487,21 @@
</update>
<update id="updatePackageStatusList" >
update logpm_distribution_parcel_list ldpl
join (
<foreach collection="orderPackageCodes" index="ind" item="item">
<if test="ind == 0">
select #{item} pid
</if>
<if test="ind != 0">
union all
select #{item} pid
</if>
</foreach>
) t on t.pid = ldpl.order_package_code
set ldpl.order_package_status = #{packageStatus}
where ldpl.warehouse_id = #{warehouseId}
</update>
</mapper>

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java

@ -32,4 +32,6 @@ public interface ISyncOrderInfoService {
void clearOrderPackageDownAndDelTray(String orderPackageCode, Long warehouseId);
void syncWaybillInfo(String waybillNo);
void updatePackageStatusList(List<String> orderPackageCodes, Long warehouseId, String number);
}

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java

@ -127,4 +127,6 @@ public interface IWarehouseMappingDataService {
void updateParcelListWaybillInfo(List<String> orderCodes, Long waybillId, String waybillNo, Long departureWarehouseId, String departureWarehouseName, Long destinationWarehouseId, String destinationWarehouseName);
void updateRepairParcelListWaybillById(Integer id, int status);
void updatePackageStatusList(List<String> orderPackageCodes, Long warehouseId, String packageStatus);
}

16
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -1,11 +1,13 @@
package com.logpm.patch.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.feign.*;
import com.logpm.distribution.dto.UpdatePackageDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
@ -387,6 +389,20 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
}
@Override
public void updatePackageStatusList(List<String> orderPackageCodes, Long warehouseId, String number) {
//把orderPackageCodes 每1000条进行分组
List<List<String>> partition = Lists.partition(orderPackageCodes, 1000);
partition.forEach(list -> {
UpdatePackageDTO updatePackageDTO = new UpdatePackageDTO();
updatePackageDTO.setOrderPackageCodes(list);
updatePackageDTO.setWarehouseId(warehouseId);
updatePackageDTO.setPackageStatus(number);
distributionParcelListClient.updatePackageStatus(updatePackageDTO);
});
}
@Transactional(rollbackFor = Exception.class)
@Override

6
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java

@ -305,4 +305,10 @@ public class WarehouseMappingDataServiceImpl implements IWarehouseMappingDataSer
public void updateRepairParcelListWaybillById(Integer id, int status) {
warehouseMappingDataMapper.updateRepairParcelListWaybillById(id,status);
}
@Override
public void updatePackageStatusList(List<String> orderPackageCodes, Long warehouseId, String packageStatus) {
warehouseMappingDataMapper.updatePackageStatusList(orderPackageCodes,warehouseId,packageStatus);
}
}

Loading…
Cancel
Save