Browse Source

feat(all): 林氏工厂

1 增加改单后是始发仓=末端仓的情况时,林氏回传逻辑
fix-sign
zhaoqiaobo 5 months ago
parent
commit
cf74bc620c
  1. 3
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/enums/NodeMappingEnums.java
  2. 1
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/enums/NodeNeedEnums.java
  3. 2
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/mq/NodeDataPushListener.java
  4. 140
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

3
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/enums/NodeMappingEnums.java

@ -21,7 +21,8 @@ public enum NodeMappingEnums {
* 收货完成
*/
END_WAREHOUSE_UNLOADING(FactoryNodeEnums.END_WAREHOUSE_UNLOADING, WorkNodeEnums.END_WAREHOUSE_UNLOADING, 1),
OPEN_ORDER(FactoryNodeEnums.END_WAREHOUSE_UNLOADING, WorkNodeEnums.OPEN_ORDER, 1);
OPEN_ORDER(FactoryNodeEnums.END_WAREHOUSE_UNLOADING, WorkNodeEnums.OPEN_ORDER, 1),
CHANGE_ORDER(FactoryNodeEnums.END_WAREHOUSE_UNLOADING, WorkNodeEnums.CHANGE_ORDER, 1);
/**
* 系统作业节点

1
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/enums/NodeNeedEnums.java

@ -18,6 +18,7 @@ public enum NodeNeedEnums implements Serializable {
*/
INITIAL_WAREHOUSE_ENTRY(101020, "始发仓入库"),
OPEN_ORDER(102010, "开单"),
CHANGE_ORDER(102020, "改单"),
/**
* 末端仓卸车确认
*/

2
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/mq/NodeDataPushListener.java

@ -111,7 +111,7 @@ public class NodeDataPushListener {
.in(FactoryNodePushEntity::getBillCode, groupByOrder.keySet())
);
// 开单 始发仓=目的仓 如果没有推送记录 则不处理
if (NumberUtil.equals(workNodeEnums.getCode(), WorkNodeEnums.OPEN_ORDER.getCode())) {
if (NumberUtil.equals(workNodeEnums.getCode(), WorkNodeEnums.OPEN_ORDER.getCode()) || NumberUtil.equals(workNodeEnums.getCode(), WorkNodeEnums.CHANGE_ORDER.getCode())) {
log.info("开单节点--------");
String main = entries.getStr("main");
if (StrUtil.isNotEmpty(main)) {

140
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -3,6 +3,7 @@ package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@ -12,8 +13,24 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.basicdata.entity.BasicdataBrandEntity;
import com.logpm.basicdata.entity.BasicdataCategoryEntity;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataFreightDetailEntity;
import com.logpm.basicdata.entity.BasicdataStorageServicesEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataBrandClient;
import com.logpm.basicdata.feign.IBasicdataCategoryClient;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataCodeClient;
import com.logpm.basicdata.feign.IBasicdataForwardingUnitClient;
import com.logpm.basicdata.feign.IBasicdataFreightClient;
import com.logpm.basicdata.feign.IBasicdataOpenIncomingClient;
import com.logpm.basicdata.feign.IBasicdataStorageServicesClient;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient;
import com.logpm.basicdata.feign.IBasicdataTripartiteMallClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.vo.BasicdataClientVO;
import com.logpm.basicdata.vo.BasicdataFreightApiVO;
import com.logpm.distribution.dto.FindParamterDTO;
@ -25,11 +42,56 @@ import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionParcelNumberClient;
import com.logpm.distribution.feign.IDistributionReservationStockarticleClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.statistics.feign.IOrderInfoClient;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.CheckWaybillListDTO;
import com.logpm.trunkline.dto.ImportCustomizedOuPaiDTO;
import com.logpm.trunkline.dto.ImportOrderNoPackageExcelDTO;
import com.logpm.trunkline.dto.ImportStandardOuPaiDTO;
import com.logpm.trunkline.dto.OpenLabelDTO;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.PacakgeDetailExcelDTO;
import com.logpm.trunkline.dto.WaybillDetailDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceMergeEntity;
import com.logpm.trunkline.entity.TrunklineBillladingEntity;
import com.logpm.trunkline.entity.TrunklineBillladingWaybillEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.entity.TrunklineWaybillReturnEntity;
import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import com.logpm.trunkline.service.IAsyncService;
import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.IOpenOrderService;
import com.logpm.trunkline.service.ISendFanoutService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceMergeService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.service.ITrunklineBillladingService;
import com.logpm.trunkline.service.ITrunklineBillladingWaybillService;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import com.logpm.trunkline.service.ITrunklineWaybillPackageService;
import com.logpm.trunkline.service.ITrunklineWaybillReturnService;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import com.logpm.trunkline.vo.AdvanceDetailGoodsVO;
import com.logpm.trunkline.vo.AdvanceDetailStockNumVO;
import com.logpm.trunkline.vo.AdvanceDetailVO;
import com.logpm.trunkline.vo.AdvancenceTotalNumberVO;
import com.logpm.trunkline.vo.BillladingPackageVO;
import com.logpm.trunkline.vo.CustomerInfoVO;
import com.logpm.trunkline.vo.EditOrderMsgVO;
import com.logpm.trunkline.vo.OpenOrderVO;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.trunkline.vo.TrunklineAdvanceVO;
import com.logpm.trunkline.vo.TrunklineWaybillTrackVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
@ -44,7 +106,12 @@ import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.order.*;
import org.springblade.common.constant.order.OrderFreezeStatusConstant;
import org.springblade.common.constant.order.OrderGroundingStatusConstant;
import org.springblade.common.constant.order.OrderReceiveStatusConstant;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
@ -67,7 +134,16 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList;
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.Set;
import java.util.TreeSet;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
@ -115,6 +191,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
private final IOrderInfoClient orderInfoClient;
private final BladeRedis bladeRedis;
private final ITrunklineAdvanceMergeService advanceMergeService;
private final FactoryDataMessageSender factoryDataMessageSender;
@Override
@ -2808,6 +2885,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<Long> advanceIds = trunklineWaybillOrderService.findAdvanceIdsByWaybillIds(waybillIds);
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(consigneeId);
List<DistributionParcelListEntity> sendParcelList = new ArrayList<>();
if (waybillType == 1) {
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findAllParcelListByAdvanceIds(advanceIds);
@ -2833,6 +2911,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<String> arriveWarehousePackageCode = new ArrayList<>();
List<String> noArriveWarehousePackageCode = new ArrayList<>();
parcelListEntityList.forEach(parcelListEntity -> {
sendParcelList.add(parcelListEntity);
Long nowWarehouseId = parcelListEntity.getWarehouseId();
String orderPackageCode = parcelListEntity.getOrderPackageCode();
String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
@ -2948,6 +3027,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findByWaybillNumber(waybillNo);
parcelListEntityList.forEach(parcelListEntity -> {
sendParcelList.add(parcelListEntity);
Long nowWarehouseId = parcelListEntity.getWarehouseId();
Long advanceId = parcelListEntity.getAdvanceId();
Long id = parcelListEntity.getId();
@ -3066,6 +3146,50 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
sendUpdateWaybillFanout(AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName, waybillEntity);
try{
// 按订单号分组
Map<String, List<DistributionParcelListEntity>> collect = sendParcelList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getOrderCode));
for (Map.Entry<String, List<DistributionParcelListEntity>> entry : collect.entrySet()) {
String orderCode = entry.getKey();
List<DistributionParcelListEntity> value = entry.getValue();
// 获取订单信息
// String mwhOrderCode = waybillEntity.getMwhOrderCode();
Integer SendtotalCount = value.size();
JSONObject jsonObject = new JSONObject();
jsonObject.put("mwhOrderCode",orderCode);
jsonObject.put("totalCount",SendtotalCount);
jsonObject.put("totalPrice", "0");
jsonObject.put("waybillNo", waybillNo);
jsonObject.put("departureWarehouseName", departureWarehouseName);
jsonObject.put("destinationWarehouseName", destinationWarehouseName);
String finalNowWarehouseName = warehouseName;
NodePushMsg msg = NodePushMsg.builder()
.operator(AuthUtil.getNickName())
.operatorTime(new Date())
.brand(BrandEnums.getByValue(waybillEntity.getBrand()))
.node(WorkNodeEnums.CHANGE_ORDER)
.startWarehouse(departureWarehouseName)
.endWarehouse(destinationWarehouseName)
.warehouse(finalNowWarehouseName)
.main(jsonObject)
.content(value.stream().map(data->{
return PushData.builder()
.packageCode(data.getOrderPackageCode())
.waybillStartWarehouse(departureWarehouseName)
.destinationWarehouse(destinationWarehouseName)
.warehouseName(finalNowWarehouseName)
.orderCode(data.getOrderCode())
.waybillNumber(waybillNo)
.build();
}).collect(Collectors.toList()))
.build();
log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg));
factoryDataMessageSender.sendNodeDataByBrand(msg);
}
}catch (Exception e){
log.error("推送工厂数据失败", e);
}
// openOrderAsyncService.sendUpdateWaybillFanout(waybillEntity,wayBillDetailList,advanceIds,oldConsignee);
return R.success("改单成功");
}

Loading…
Cancel
Save