Browse Source

1.干线bug修复

fix-sign
zhenghaoyu 5 months ago
parent
commit
09475e583a
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  2. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/UpdownZeroOrderVO.java
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  4. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  5. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  7. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  8. 37
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java
  9. 16
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  10. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

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

@ -319,5 +319,8 @@ public interface IDistributionParcelListClient {
@PostMapping(API_PREFIX + "/findListByOrderPackageCodesAndCode")
List<DistributionParcelListEntity> findListByOrderPackageCodesAndCode(@RequestBody List<String> orderPackageCodeGroup);
@PostMapping(API_PREFIX + "/findSignOrderPackageCodes")
List<String> findSignOrderPackageCodes(@RequestBody List<String> orderPackageCodeList);
}

2
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/UpdownZeroOrderVO.java

@ -13,6 +13,8 @@ public class UpdownZeroOrderVO implements Serializable {
private String orderCode;//订单号
private Integer totalNumber;//合同数量
private Integer residueNumber;//剩余数量
private String consignee;//收货单位
private String consigneePerson;//收货人
private List<PositionVO> list = new ArrayList<>();
}

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

@ -674,4 +674,9 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
return distributionParcelListService.findListByOrderPackageCodesAndCode(orderPackageCodeGroup);
}
@Override
public List<String> findSignOrderPackageCodes(List<String> orderPackageCodeList) {
return distributionParcelListService.findSignOrderPackageCodes(orderPackageCodeList);
}
}

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

@ -346,4 +346,7 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
DistributionParcelListEntity findOneByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode);
List<DistributionParcelListEntity> findListByOrderPackageCodesAndCode(@Param("orderPackageCodes") List<String> orderPackageCodeGroup);
List<String> findSignOrderPackageCodes(@Param("orderPackageCodeList") List<String> orderPackageCodeList);
}

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

@ -2304,4 +2304,15 @@
and ldpl.is_deleted = 0
</select>
<select id="findSignOrderPackageCodes" resultType="String">
select order_package_code
from logpm_distribution_parcel_list
where order_package_code in
<foreach collection="orderPackageCodes" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and order_package_status = '70'
and is_deleted = 0
</select>
</mapper>

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

@ -320,4 +320,6 @@ public interface IDistributionParcelListService extends BaseService<Distribution
DistributionParcelListEntity findOneByOrderPackageCode(String orderPackageCode);
List<DistributionParcelListEntity> findListByOrderPackageCodesAndCode(List<String> orderPackageCodeGroup);
List<String> findSignOrderPackageCodes(List<String> orderPackageCodeList);
}

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

@ -1610,4 +1610,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
public List<DistributionParcelListEntity> findListByOrderPackageCodesAndCode(List<String> orderPackageCodeGroup) {
return baseMapper.findListByOrderPackageCodesAndCode(orderPackageCodeGroup);
}
@Override
public List<String> findSignOrderPackageCodes(List<String> orderPackageCodeList) {
return baseMapper.findSignOrderPackageCodes(orderPackageCodeList);
}
}

37
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java

@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.statistics.entity.*;
import com.logpm.statistics.service.*;
import com.logpm.statistics.vo.StatisticsPackageFeeInfoVO;
@ -32,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@Slf4j
@ -50,6 +52,7 @@ public class WaybillCheckListener {
private final IStatisticsWarehousePackageService warehousePackageService;
private final IStatisticsDistributionPackageService distributionPackageService;
private final IStatisticsBalanceOrderInfoService balanceOrderInfoService;
private final IDistributionParcelListClient distributionParcelListClient;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.trunkline.CHECKWAYBILL.QUEUE.CHECKWAYBILL_INCOMINGDATA),
@ -526,10 +529,18 @@ public class WaybillCheckListener {
List<StatisticsTrunklinePackageEntity> trunklinePackageEntities = new ArrayList<>();
List<StatisticsWarehousePackageEntity> warehousePackageEntities = new ArrayList<>();
List<StatisticsDistributionPackageEntity> distributionPackageEntities = new ArrayList<>();
List<StatisticsOrderInfoEntity> updateSignList = new ArrayList<>();
orderInfoEntities.forEach(orderInfoEntity -> {
Long orderId = orderInfoEntity.getId();
String orderCode = orderInfoEntity.getOrderCode();
List<TrunklineAdvanceDetailEntity> advanceDetailList = advanceDetailGroupByOrderCode.get(orderCode);
//把advanceDetailList中所有orderPackageCode放入一个List
List<String> orderPackageCodeList = advanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getOrderPackageCode).collect(Collectors.toList());
//查询包件是否签收
List<String> signPackages = distributionParcelListClient.findSignOrderPackageCodes(orderPackageCodeList);
AtomicReference<Integer> signNum = new AtomicReference<>(0);
advanceDetailList.forEach(advanceDetailEntity -> {
Long incomeCategoryId = advanceDetailEntity.getIncomeCategoryId();
String orderPackageCode = advanceDetailEntity.getOrderPackageCode();
@ -712,6 +723,11 @@ public class WaybillCheckListener {
distributionPackageEntity.setDeliveryCrossingFee(BigDecimal.ZERO);
distributionPackageEntity.setSignNum(0);
distributionPackageEntity.setIsSign(0);
if(signPackages.contains(orderPackageCode)){
distributionPackageEntity.setSignNum(1);
distributionPackageEntity.setIsSign(1);
signNum.set(signNum.get() + 1);
}
distributionPackageEntity.setBrandId(brandId);
distributionPackageEntity.setConsigneeId(consigneeId);
distributionPackageEntity.setDeliveryLoadingFee(handlingPrice.multiply(BigDecimal.ONE));
@ -769,6 +785,23 @@ public class WaybillCheckListener {
distributionPackageEntities.add(distributionPackageEntity);
});
StatisticsOrderInfoEntity updateEntity = new StatisticsOrderInfoEntity();
updateEntity.setId(orderInfoEntity.getId());
int size = advanceDetailList.size();
Integer sn = signNum.get();
if(sn == 0){
updateEntity.setSignStatus(0);
}else{
if(sn != size){
updateEntity.setSignStatus(1);
}else{
updateEntity.setSignStatus(2);
}
}
updateSignList.add(updateEntity);
});
if (CollUtil.isNotEmpty(trunklinePackageEntities)) {
trunklinePackageService.saveBatch(trunklinePackageEntities);
@ -780,6 +813,10 @@ public class WaybillCheckListener {
distributionPackageService.saveBatch(distributionPackageEntities);
}
if(CollUtil.isNotEmpty(updateSignList)){
statisticsOrderInfoService.updateBatchById(updateSignList);
}
} else {
log.warn("#############dealwithPackageOrder: 保存订单数据失败 waybillNo={}", waybillNo);
}

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

@ -8184,6 +8184,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
}
loadingMainList.addAll(unloadMainList);
//把loadingMainList通过waybillNo进行排序
loadingMainList.sort(Comparator.comparing(LoadingListMainVO::getWaybillNo));
trunklineCarsLoadLoadingListVO.setMainList(loadingMainList);
trunklineCarsLoadLoadingListVO.setCarsNoBase64(QRCodeUtil.getEmpAutograph(QRCodeUtil.createCodeToFileType(carsNo)));
return R.data(trunklineCarsLoadLoadingListVO);
@ -8224,14 +8228,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "车辆已签收");
}
if(!"40".equals(loadStatus)||!"91".equals(loadStatus)){
log.warn("############signLoadScanByIds: 车辆还未到达 loadStatus={}", loadStatus);
return R.fail(405, "车辆还未到达");
if(!"91".equals(loadStatus)){
if(!"40".equals(loadStatus)){
log.warn("############signLoadScanByIds: 车辆还未到达 loadStatus={}", loadStatus);
return R.fail(405, "车辆还未到达");
}
}
Integer realLoadingNumber = carsLoadEntity.getRealLoadingNumber();
String deliveryType = carsLoadEntity.getDeliveryType();
@ -9110,7 +9115,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String orderPackageCode = loadingPackageDTO.getOrderPackageCode();
R r = loadingScan(loadId, warehouseId, orderPackageCode, trayCode, "托盘正常装车");
if(r.getCode() != 200){
throw new CustomerException(r.getCode(),r.getMsg());
String msg = r.getMsg();
throw new CustomerException(r.getCode(),orderPackageCode+msg);
}
pacakagNum = pacakagNum + 1;
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -3620,6 +3620,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
totalNumber = totalNumber - num;
}
updownZeroOrderVO.setResidueNumber(totalNumber);
updownZeroOrderVO.setConsignee(stockArticleEntity.getConsigneeUnit());
updownZeroOrderVO.setConsigneePerson(stockArticleEntity.getConsigneePerson());
updownZeroOrderVO.setList(updownGoodsEntities);
return updownZeroOrderVO;
}

Loading…
Cancel
Save