Browse Source

feat(service): 增加直发商家签收数据推送工厂

pull/35/head
zhaoqiaobo 12 months ago
parent
commit
ff2019219c
  1. 109
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

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

@ -29,11 +29,73 @@ import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
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.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.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.TrunklineCarsLoadLogEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.entity.TrunklineCostShareRecordEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignOrderEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignPhotoEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
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.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.ITrunklineWaybillOrderService;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.CarsLoadOrderInfoVO;
import com.logpm.trunkline.vo.CarsLoadWaybillInfoVO;
import com.logpm.trunkline.vo.HasNotFinalNodeIdDataVO;
import com.logpm.trunkline.vo.LoadScanFinalNodeIdVO;
import com.logpm.trunkline.vo.LoadScanOrderVO;
import com.logpm.trunkline.vo.LoadZeroListVO;
import com.logpm.trunkline.vo.LoadingListGoodsVO;
import com.logpm.trunkline.vo.LoadingListMainVO;
import com.logpm.trunkline.vo.NodeNumDataVO;
import com.logpm.trunkline.vo.OrderScanDetailVO;
import com.logpm.trunkline.vo.SignOrderDetailVO;
import com.logpm.trunkline.vo.SignPackageVO;
import com.logpm.trunkline.vo.SignScanOrderVO;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadLoadingListVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadScanVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import com.logpm.trunkline.vo.TrunklineLoadSignOrderVO;
import com.logpm.trunkline.vo.UnloadPackageVO;
import com.logpm.trunkline.vo.UnloadScanOrderVO;
import com.logpm.trunkline.vo.UnloadZeroVO;
import com.logpm.trunkline.vo.WaybillCarsLoadVO;
import com.logpm.trunkline.vo.ZeroSuppleVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
@ -43,7 +105,11 @@ import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils;
import org.springblade.common.constant.*;
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.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
@ -62,7 +128,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
@Slf4j
@Service
@ -3682,16 +3755,34 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//重新计算签收单的数量
updateSignOrderNumBySignOrderId(signOrderId);
try{
List<String> orderPackageCodes = new ArrayList<>();
try {
orderPackageCodes.add(orderPackageCode);
String content = "包件在 " + warehouseEntity.getName() + "直发商家签收";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_DIRECT_SHIPPER.getCode(), content);
} catch (Exception e) {
log.warn("###########存入日志信息失败");
}
// 推送签收数据给工厂
try {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
if (ObjectUtil.isNotEmpty(parcelListEntity)) {
List<Object> contents = new ArrayList<>();
JSONObject jsonObject = new JSONObject();
jsonObject.put("packageCode", orderPackageCode);
contents.add(jsonObject);
NodePushMsg msg = new NodePushMsg();
msg.setNode(WorkNodeEnums.CLERK_REVIEW);
msg.setBrand(BrandEnums.getByValue(parcelListEntity.getBrandName()));
msg.setOperator(AuthUtil.getNickName());
msg.setOperatorTime(new Date());
msg.setContent(contents);
log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg));
factoryDataMessageSender.sendNodeDataByBrand(msg);
}
} catch (Exception e) {
log.error("推送签收数据给工厂失败 {}", e);
}
return R.success("签收成功");
}

Loading…
Cancel
Save