Browse Source

feat(all): 增加业务系统作业回推工厂

dist.1.3.0
zhaoqiaobo 11 months ago
parent
commit
871b315188
  1. 114
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/OrderStatusDTO.java
  2. 29
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  3. 114
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderStatusDTO.java
  4. 113
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  5. 166
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

114
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/OrderStatusDTO.java

@ -0,0 +1,114 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.dto;
import lombok.Data;
import org.springblade.core.tool.utils.StringUtil;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
/**
* OrderStatus
*
* @author zhy
* @since 2023-06-12
*/
@Data
public class OrderStatusDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotEmpty(message = "派车单号不能为空")
private String dispatchNumber;//派车单号
@NotEmpty(message = "客户订单号不能为空")
private String orderNo;//客户订单号
@NotEmpty(message = "工厂ID不能为空")
private String plantId;//工厂ID
@NotEmpty(message = "物流单号不能为空")
private String logiBillNo;//物流单号
@NotEmpty(message = "包件码不能为空")
private String unitNo;//包件码
@NotEmpty(message = "操作时间不能为空")
private String operationTime;//操作时间
@NotEmpty(message = "当前仓库不能为空")
private String currentWarehouse;//当前仓库
@NotEmpty(message = "目的仓库不能为空")
private String destinationWarehouse;//目的仓库
@NotEmpty(message = "状态不能为空")
private String status;//状态
@NotEmpty(message = "送货任务ID不能为空")
private String distributionContactId;
@NotEmpty(message = "托盘id")
private Integer trayId;
@NotEmpty(message = "托盘编码")
private String trayNo;
@NotEmpty(message = "操作人名称")
private String username;
/**
* 验证参数是否都存在
* @return
*/
public boolean verifyData(){
if(StringUtil.isBlank(dispatchNumber)){
return false;
}
if(StringUtil.isBlank(orderNo)){
return false;
}
if(StringUtil.isBlank(plantId)){
return false;
}
if(StringUtil.isBlank(logiBillNo)){
return false;
}
if(StringUtil.isBlank(unitNo)){
return false;
}
if(StringUtil.isBlank(operationTime)){
return false;
}
if(StringUtil.isBlank(currentWarehouse)){
return false;
}
if(StringUtil.isBlank(destinationWarehouse)){
return false;
}
if(StringUtil.isBlank(status)){
return false;
}
if(StringUtil.isBlank(distributionContactId)){
return false;
}
return true;
}
}

29
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -17,6 +17,7 @@
package com.logpm.distribution.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
@ -35,6 +36,7 @@ import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.DistributionParcelListDTO;
import com.logpm.distribution.dto.DistributionStockListDTO;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.dto.OrderStatusDTO;
import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
@ -52,6 +54,7 @@ import lombok.extern.log4j.Log4j2;
import org.apache.logging.log4j.util.Strings;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.Inventory.InventoryStockUpStatusConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.billLading.BillLadingStatusConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
@ -76,6 +79,7 @@ import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@ -152,6 +156,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
private BladeRedis redis;
@Resource
private FactoryDataMessageSender factoryDataMessageSender;
@Resource
private RabbitTemplate rabbitTemplate;
@Override
@ -2959,6 +2965,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s),myCurrentWarehouse.getId());
}
parcelListIds.addAll(ladingScanEntities.stream().map(DistributionBillLadingScanEntity::getParcelListId).collect(Collectors.toSet()));
for (DistributionBillLadingScanEntity ladingScanEntity : ladingScanEntities) {
// 签收发送消息到工厂
pushFactoryOrderData(myCurrentWarehouse.getId(), ladingScanEntity.getParcelListId().toString(), ladingScanEntity.getOrderSelfNumbering());
}
}else {
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s),myCurrentWarehouse.getId());
}
@ -2993,7 +3003,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
//处理库存品签收数据
updateStock(s);
}
// 回传工厂数据
sendFactory(myCurrentWarehouse, parcelListIds);
@ -3036,6 +3045,24 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
}
private void pushFactoryOrderData(Long warehouseId, String orderPackageCode, String orderCode) {
try {
// 发送入库消息
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
// 通过包件id 查询包件
orderStatusDTO.setUnitNo(orderPackageCode);
orderStatusDTO.setOrderNo(orderCode);
orderStatusDTO.setStatus("3");
orderStatusDTO.setOperationTime(DateUtil.now());
orderStatusDTO.setCurrentWarehouse(warehouseId.toString());
Map<String, Object> map = new HashMap<>();
map.put("messageData", orderStatusDTO);
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
} catch (Exception e) {
log.error("入库推送失败:{}", e);
}
}
/**
* 处理提货库存品签收
*/

114
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderStatusDTO.java

@ -0,0 +1,114 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.trunkline.dto;
import lombok.Data;
import org.springblade.core.tool.utils.StringUtil;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
/**
* OrderStatus
*
* @author zhy
* @since 2023-06-12
*/
@Data
public class OrderStatusDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotEmpty(message = "派车单号不能为空")
private String dispatchNumber;//派车单号
@NotEmpty(message = "客户订单号不能为空")
private String orderNo;//客户订单号
@NotEmpty(message = "工厂ID不能为空")
private String plantId;//工厂ID
@NotEmpty(message = "物流单号不能为空")
private String logiBillNo;//物流单号
@NotEmpty(message = "包件码不能为空")
private String unitNo;//包件码
@NotEmpty(message = "操作时间不能为空")
private String operationTime;//操作时间
@NotEmpty(message = "当前仓库不能为空")
private String currentWarehouse;//当前仓库
@NotEmpty(message = "目的仓库不能为空")
private String destinationWarehouse;//目的仓库
@NotEmpty(message = "状态不能为空")
private String status;//状态
@NotEmpty(message = "送货任务ID不能为空")
private String distributionContactId;
@NotEmpty(message = "托盘id")
private Integer trayId;
@NotEmpty(message = "托盘编码")
private String trayNo;
@NotEmpty(message = "操作人名称")
private String username;
/**
* 验证参数是否都存在
* @return
*/
public boolean verifyData(){
if(StringUtil.isBlank(dispatchNumber)){
return false;
}
if(StringUtil.isBlank(orderNo)){
return false;
}
if(StringUtil.isBlank(plantId)){
return false;
}
if(StringUtil.isBlank(logiBillNo)){
return false;
}
if(StringUtil.isBlank(unitNo)){
return false;
}
if(StringUtil.isBlank(operationTime)){
return false;
}
if(StringUtil.isBlank(currentWarehouse)){
return false;
}
if(StringUtil.isBlank(destinationWarehouse)){
return false;
}
if(StringUtil.isBlank(status)){
return false;
}
if(StringUtil.isBlank(distributionContactId)){
return false;
}
return true;
}
}

113
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -1,10 +1,12 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.dto.OrderStatusDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineBillladingPackageEntity;
import com.logpm.trunkline.service.*;
@ -13,11 +15,14 @@ import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import java.util.*;
@ -33,7 +38,8 @@ public class InComingServiceImpl implements IInComingService {
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
private final IBasicdataWarehouseClient warehouseClient;
private final IPackageTrackLogAsyncService packageTrackLogAsyncService;
// private final DynamicDataSourceProvider dynamicDataSourceProvider;
// private final DynamicDataSourceProvider dynamicDataSourceProvider;
private final RabbitTemplate rabbitTemplate;
@Override
@ -48,84 +54,99 @@ public class InComingServiceImpl implements IInComingService {
String[] packageCodes = orderPackageCode.split(",");
for (String packageCode : packageCodes) {
log.info("############incomingPackage: 包件入库开始 packageCode={} billladingId={} warehouseId={}",packageCode,billladingId,warehouseId);
log.info("############incomingPackage: 包件入库开始 packageCode={} billladingId={} warehouseId={}", packageCode, billladingId, warehouseId);
//包件入库开始
//查询包件是否有数据
QueryWrapper<TrunklineAdvanceDetailEntity> advanceDetailQueryWrapper = new QueryWrapper<>();
advanceDetailQueryWrapper.eq("order_package_code",packageCode);
advanceDetailQueryWrapper.eq("order_package_code", packageCode);
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.getOne(advanceDetailQueryWrapper);
if(Objects.isNull(advanceDetailEntity)){
log.warn("############incomingPackage: 包件不存在 packageCode={} warehouseId={}",packageCode,warehouseId);
return Resp.scanFail(405,"包件无数据","包件无数据");
if (Objects.isNull(advanceDetailEntity)) {
log.warn("############incomingPackage: 包件不存在 packageCode={} warehouseId={}", packageCode, warehouseId);
return Resp.scanFail(405, "包件无数据", "包件无数据");
}
Long advanceDetailId = advanceDetailEntity.getId();
String packageStatus = advanceDetailEntity.getPackageStatus();
Long advanceId = advanceDetailEntity.getAdvanceId();
if("1".equals(packageStatus)){
if(incomingType != 1){
log.warn("############incomingPackage: 包件已入库 packageCode={} warehouseId={}",packageCode,warehouseId);
return Resp.scanFail(405,"包件已入库","包件已入库");
}else{
if(!Objects.isNull(billladingId)){
if ("1".equals(packageStatus)) {
if (incomingType != 1) {
log.warn("############incomingPackage: 包件已入库 packageCode={} warehouseId={}", packageCode, warehouseId);
return Resp.scanFail(405, "包件已入库", "包件已入库");
} else {
if (!Objects.isNull(billladingId)) {
//先判断该包件是否已经有提货记录了
TrunklineBillladingPackageEntity billladingPackageEntity = billladingPackageServicie.findBillladingPackage(packageCode);
if(Objects.isNull(billladingPackageEntity)){
billladingPackageServicie.saveEntity(packageCode,billladingId,warehouseId,incomingType);
if (Objects.isNull(billladingPackageEntity)) {
billladingPackageServicie.saveEntity(packageCode, billladingId, warehouseId, incomingType);
}
}
//4.如果有托盘码
if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){
Map<String,Object> map = new HashMap<>();
map.put("trayType",trayType);
map.put("trayCode",trayCode);
map.put("warehouseId",warehouseId);
map.put("orderPackageCode",packageCode);
if (StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)) {
Map<String, Object> map = new HashMap<>();
map.put("trayType", trayType);
map.put("trayCode", trayCode);
map.put("warehouseId", warehouseId);
map.put("orderPackageCode", packageCode);
warehouseTrayTypeClient.orderScanOrderPackageCode(map);
}
}
}else{
if(StringUtil.isBlank(warehouseName)){
} else {
if (StringUtil.isBlank(warehouseName)) {
BasicdataWarehouseEntity warehouseEntity = warehouseClient.getEntityWarehouseId(warehouseId);
if(!Objects.isNull(warehouseEntity)){
if (!Objects.isNull(warehouseEntity)) {
warehouseName = warehouseEntity.getName();
}
}
//1.修改暂存单包件入库状态
advanceDetailService.updatePackageStatusById("1",advanceDetailId,warehouseId,warehouseName);
advanceDetailService.updatePackageStatusById("1", advanceDetailId, warehouseId, warehouseName);
List<String> incomingWarehouseNames = advanceDetailService.findIncomingWarehouseName(advanceId);
advanceService.updateIncomingWarehouseName(String.join(",",incomingWarehouseNames),advanceId);
advanceService.updateIncomingWarehouseName(String.join(",", incomingWarehouseNames), advanceId);
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
//存入日志
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY.getCode(),"包件"+ IncomingTypeEnum.getValue(incomingType));
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY.getCode(), "包件" + IncomingTypeEnum.getValue(incomingType));
//2.判断包件和订单是否已经存入在库订单
boolean b = advanceService.saveOrderAndPackage(advanceDetailEntity, warehouseId);
if(b){
if (b) {
//3.根据是否有提货单id绑定提货单
if(!Objects.isNull(billladingId)){
if (!Objects.isNull(billladingId)) {
//先判断该包件是否已经有提货记录了
TrunklineBillladingPackageEntity billladingPackageEntity = billladingPackageServicie.findBillladingPackage(packageCode);
if(Objects.isNull(billladingPackageEntity)){
billladingPackageServicie.saveEntity(packageCode,billladingId,warehouseId,incomingType);
if (Objects.isNull(billladingPackageEntity)) {
billladingPackageServicie.saveEntity(packageCode, billladingId, warehouseId, incomingType);
}
}
//4.如果有托盘码
if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){
Map<String,Object> map = new HashMap<>();
map.put("trayType",trayType);
map.put("trayCode",trayCode);
map.put("warehouseId",warehouseId);
map.put("orderPackageCode",packageCode);
if (StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)) {
Map<String, Object> map = new HashMap<>();
map.put("trayType", trayType);
map.put("trayCode", trayCode);
map.put("warehouseId", warehouseId);
map.put("orderPackageCode", packageCode);
warehouseTrayTypeClient.orderScanOrderPackageCode(map);
}
}
try {
// 发送入库消息
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
// 通过包件id 查询包件
orderStatusDTO.setUnitNo(packageCode);
orderStatusDTO.setOrderNo(advanceDetailEntity.getOrderCode());
orderStatusDTO.setStatus("4");
orderStatusDTO.setOperationTime(DateUtil.now());
orderStatusDTO.setCurrentWarehouse(warehouseId.toString());
Map<String, Object> map = new HashMap<>();
map.put("messageData", orderStatusDTO);
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
} catch (Exception e) {
log.error("入库推送失败:{}", e);
}
}
}
return R.success("入库成功");
@ -134,14 +155,14 @@ public class InComingServiceImpl implements IInComingService {
@Override
public R findIncomingOrderList(InComingDTO inComingDTO) {
Integer incomingType = inComingDTO.getIncomingType();
if(incomingType == 5){
if (incomingType == 5) {
String incomingCode = inComingDTO.getIncomingCode();
if(!StringUtil.isBlank(incomingCode)){
incomingCode = incomingCode.replaceAll(",",",");
if (!StringUtil.isBlank(incomingCode)) {
incomingCode = incomingCode.replaceAll(",", ",");
List<String> orderCodes = new ArrayList<>();
if(incomingCode.contains(",")){
if (incomingCode.contains(",")) {
orderCodes.addAll(Arrays.asList(incomingCode.split(",")));
}else{
} else {
orderCodes.add(incomingCode);
}
inComingDTO.setOrderCodes(orderCodes);
@ -177,20 +198,20 @@ public class InComingServiceImpl implements IInComingService {
for (Long advanceId : advanceIds) {
QueryWrapper<TrunklineAdvanceDetailEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("advance_id",advanceId)
.eq("package_status","0");
queryWrapper.eq("advance_id", advanceId)
.eq("package_status", "0");
//查询所有包件
List<TrunklineAdvanceDetailEntity> detailList = advanceDetailService.list(queryWrapper);
List<String> orderPackageCodes = advanceService.incomingPackageBatch(advanceId, warehouseId, detailList,userId,deptId,tenantId);
List<String> orderPackageCodes = advanceService.incomingPackageBatch(advanceId, warehouseId, detailList, userId, deptId, tenantId);
advanceDetailService.updateBatchById(detailList);
List<String> incomingWarehouseNames = advanceDetailService.findIncomingWarehouseName(advanceId);
advanceService.updateIncomingWarehouseName(String.join(",",incomingWarehouseNames),advanceId);
advanceService.updateIncomingWarehouseName(String.join(",", incomingWarehouseNames), advanceId);
//存入日志
packageTrackLogAsyncService.addPackageTrackLog(tenantId,userId, deptId,nickName,orderPackageCodes,warehouseId,warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY.getCode(),"包件"+ IncomingTypeEnum.getValue(incomingType));
packageTrackLogAsyncService.addPackageTrackLog(tenantId, userId, deptId, nickName, orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY.getCode(), "包件" + IncomingTypeEnum.getValue(incomingType));
}

166
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.date.DateUtil;
import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
@ -450,8 +451,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsOrderService.updateBatchById(ls);
}
carsLoadEntity.setCustomerNum(CollUtil.isEmpty(list)?0:list.size());
carsLoadEntity.setIsCustomer(CollUtil.isEmpty(list)?"2":"1");
carsLoadEntity.setCustomerNum(CollUtil.isEmpty(list) ? 0 : list.size());
carsLoadEntity.setIsCustomer(CollUtil.isEmpty(list) ? "2" : "1");
updateById(carsLoadEntity);
@ -742,7 +743,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//通过loadId更新carsOrder关联表中的所有订单startNum为0
trunklineCarsOrderService.updateStartNumByLoadIdAndWarehouseId(loadId, warehouseId);
if(CollUtil.isNotEmpty(carsLoadScanIdList)){
if (CollUtil.isNotEmpty(carsLoadScanIdList)) {
removeCarsLoadScan(StringUtil.join(carsLoadScanIdList, ","), warehouseId);
}
@ -1097,7 +1098,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//把lineCarsOrderList中的所有运单号合并成一个集合
List<String> waybillNos = lineCarsOrderList.stream().map(TrunklineCarsOrderDTO::getWaybillNo).collect(Collectors.toList());
List<WarehouseWaybillEntity> freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos);
if(!CollUtil.isEmpty(freezeOrAbolishWaybillList)){
if (!CollUtil.isEmpty(freezeOrAbolishWaybillList)) {
log.warn("##########saveNew: 运单有变动,请重新做计划");
throw new CustomerException(400, "运单有变动,请重新做计划");
}
@ -1431,7 +1432,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//把lineCarsOrderList中的所有运单号合并成一个集合
List<String> waybillNos = addList.stream().map(TrunklineCarsOrderDTO::getWaybillNo).collect(Collectors.toList());
List<WarehouseWaybillEntity> freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos);
if(!CollUtil.isEmpty(freezeOrAbolishWaybillList)){
if (!CollUtil.isEmpty(freezeOrAbolishWaybillList)) {
log.warn("##########saveNew: 运单有变动,请重新做计划");
throw new CustomerException(400, "运单有变动,请重新做计划");
}
@ -2004,7 +2005,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setLoadStatus("90");
updateById(carsLoadEntity);
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3",new Date());
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3", new Date());
try {
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId);
@ -2308,16 +2309,35 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
String content = "包件在 " + warehouseName + " "+(StringUtil.isBlank(trayName)?"扫码": "托盘("+trayName+")")+" 装车,配载计划目的仓 " + carsLoadScanEntity.getFinalNodeName() + ",数据来源仓库 " + fromWarehouseName;
String content = "包件在 " + warehouseName + " " + (StringUtil.isBlank(trayName) ? "扫码" : "托盘(" + trayName + ")") + " 装车,配载计划目的仓 " + carsLoadScanEntity.getFinalNodeName() + ",数据来源仓库 " + fromWarehouseName;
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_LOADING.getCode(), content);
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, orderPackageCode, 1,
1, isData, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
updateNumByLoadId(loadId);
// 推送包件装车数据到工厂
pushFactoryOrderData(warehouseId, orderPackageCode, orderCode);
return R.success("装车成功");
}
private void pushFactoryOrderData(Long warehouseId, String orderPackageCode, String orderCode) {
try {
// 发送入库消息
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
// 通过包件id 查询包件
orderStatusDTO.setUnitNo(orderPackageCode);
orderStatusDTO.setOrderNo(orderCode);
orderStatusDTO.setStatus("3");
orderStatusDTO.setOperationTime(DateUtil.now());
orderStatusDTO.setCurrentWarehouse(warehouseId.toString());
Map<String, Object> map = new HashMap<>();
map.put("messageData", orderStatusDTO);
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
} catch (Exception e) {
log.error("入库推送失败:{}", e);
}
}
@Override
public R loadingZero(Long loadId, Long warehouseId, String waybillNo, String orderCode, String trayCode, Integer enterNum, String remark) {
@ -3448,7 +3468,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "配载计划节点信息不存在");
}
String unloadStatus = loadLineEntity.getUnloadStatus();
if(!"0".equals(unloadStatus)){
if (!"0".equals(unloadStatus)) {
log.warn("############batchUnload: 当前网点已经卸车确认 loadId={} warehouseId={}", loadId, warehouseId);
return R.fail(405, "当前网点已经卸车确认");
}
@ -3482,29 +3502,29 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanIds.add(unloadPackageDTO.getCarsLoadScanId());
}
if(!carsLoadScanIds.isEmpty()){
if (!carsLoadScanIds.isEmpty()) {
Date date = new Date();
List<TrunklineCarsLoadScanEntity> loadScanEntityList = trunklineCarsLoadScanService.findListByIdsNoPackage(carsLoadScanIds,warehouseId);
List<TrunklineCarsLoadScanEntity> loadScanEntityList = trunklineCarsLoadScanService.findListByIdsNoPackage(carsLoadScanIds, warehouseId);
List<DistributionParcelListEntity> parcelListEntities = trunklineCarsLoadScanService.findParceListByCarsLoadScanIds(carsLoadScanIds);
//把parcelListEntities转成orderPackageCode为键值的map
Map<String,DistributionParcelListEntity> parcelListMap = parcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, e -> e));
Map<String, DistributionParcelListEntity> parcelListMap = parcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, e -> e));
List<DistributionStockArticleEntity> stockArticleEntities = trunklineCarsLoadScanService.findOrderListByCarsLoadScanIds(carsLoadScanIds);
//把stockArticleEntities转成orderCode为键值的map
Map<String,DistributionStockArticleEntity> stockArticleMap = stockArticleEntities.stream().collect(Collectors.toMap(DistributionStockArticleEntity::getOrderCode, e -> e));
Map<String, DistributionStockArticleEntity> stockArticleMap = stockArticleEntities.stream().collect(Collectors.toMap(DistributionStockArticleEntity::getOrderCode, e -> e));
// List<WarehouseWaybillEntity> waybillEntities = trunklineCarsLoadScanService.findWaybillListByCarsLoadScanIds(carsLoadScanIds);
// //把waybillEntities转成WaybillNo为键值的map
// Map<String,WarehouseWaybillEntity> waybillMap = waybillEntities.stream().collect(Collectors.toMap(WarehouseWaybillEntity::getWaybillNo, e -> e));
List<TrunklineCarsUnloadLogEntity> unloadLogList = new ArrayList<>();
List<String> orderCodeList = trunklineCarsLoadScanService.findIncomingOrdeCodesByCarsLoadScanIds(carsLoadScanIds,warehouseId);
Map<String,Long> orderCodes = new HashMap<>();
if(!Objects.isNull(orderCodeList)){
List<String> orderCodeList = trunklineCarsLoadScanService.findIncomingOrdeCodesByCarsLoadScanIds(carsLoadScanIds, warehouseId);
Map<String, Long> orderCodes = new HashMap<>();
if (!Objects.isNull(orderCodeList)) {
Map<String, Long> finalOrderCodes2 = orderCodes;
orderCodeList.forEach(e -> {
String[] split = e.split("----");
finalOrderCodes2.put(split[0],Long.valueOf(split[1]));
finalOrderCodes2.put(split[0], Long.valueOf(split[1]));
});
orderCodes = finalOrderCodes2;
}
@ -3520,7 +3540,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
e.setUnloadNodeName(warehouseName);
e.setUnloadTime(date);
Long finalNodeId = e.getFinalNodeId();
if(!finalNodeId.equals(warehouseId)){
if (!finalNodeId.equals(warehouseId)) {
isAbnormal = 1;
remark = "卸车仓库与目的仓不一致,异常卸车";
}
@ -3558,7 +3578,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//需要解托下架的包件嘛
Map<Long,List<String>> unbingTrayAndDelAllocationPackages = new HashMap<>();
Map<Long, List<String>> unbingTrayAndDelAllocationPackages = new HashMap<>();
//直接新增的包件
List<DistributionParcelListEntity> newParcelListEntities = new ArrayList<>();
//需要修改仓库信息的打托数据
@ -3575,15 +3595,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
loadScanEntityListHasDataNoTrayMap.keySet().forEach(e -> {
//判断是否有已经有order了
Long orderId = null;
if(!finalOrderCodes.isEmpty()){
if (!finalOrderCodes.isEmpty()) {
orderId = finalOrderCodes.get(e);
}
if(ObjectUtil.isNull(orderId)){
if (ObjectUtil.isNull(orderId)) {
//没有id
DistributionStockArticleEntity stockArticleEntity = stockArticleMap.get(e);
DistributionStockArticleEntity newStockArticleEntity = new DistributionStockArticleEntity();
BeanUtil.copy(stockArticleEntity,newStockArticleEntity);
BeanUtil.copy(stockArticleEntity, newStockArticleEntity);
newStockArticleEntity.setId(null);
newStockArticleEntity.setCreateUser(userId);
newStockArticleEntity.setUpdateUser(userId);
@ -3599,7 +3619,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setOrderReceiveStatus("10");
newStockArticleEntity.setFreezeStatus("10");
orderId = distributionStockArticleClient.addData(newStockArticleEntity);
finalOrderCodes.put(e,orderId);
finalOrderCodes.put(e, orderId);
}
@ -3610,7 +3630,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
DistributionParcelListEntity parcelListEntity = parcelListMap.get(p.getScanCode());
Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId();
DistributionParcelListEntity newNoOrderPackage = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity,newNoOrderPackage);
BeanUtil.copy(parcelListEntity, newNoOrderPackage);
newNoOrderPackage.setId(null);
newNoOrderPackage.setCreateUser(userId);
newNoOrderPackage.setUpdateUser(userId);
@ -3623,22 +3643,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newNoOrderPackage.setOrderPackageStockupStatus("10");
newNoOrderPackage.setOrderPackageReservationStatus("10");
newNoOrderPackage.setOrderPackageLoadingStatus("10");
if(acceptWarehouseId.equals(warehouseId)){
if (acceptWarehouseId.equals(warehouseId)) {
newNoOrderPackage.setIsTransfer(0);
}else{
} else {
newNoOrderPackage.setIsTransfer(1);
}
newParcelListEntities.add(newNoOrderPackage);
orderPackageCodes.add(p.getScanCode());
List<String> list = unbingTrayAndDelAllocationPackages.get(fromWarehouseId);
if(Objects.isNull(list)){
if (Objects.isNull(list)) {
list = new ArrayList<>();
list.add(p.getScanCode());
}else{
} else {
list.add(p.getScanCode());
}
unbingTrayAndDelAllocationPackages.put(fromWarehouseId,list);
unbingTrayAndDelAllocationPackages.put(fromWarehouseId, list);
Integer isAbnormal = 0;
String remark = "正常卸车";
@ -3646,7 +3666,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
p.setUnloadNodeId(warehouseId);
p.setUnloadNodeName(warehouseName);
Long finalNodeId = p.getFinalNodeId();
if(!finalNodeId.equals(warehouseId)){
if (!finalNodeId.equals(warehouseId)) {
isAbnormal = 1;
remark = "卸车仓库与目的仓不一致,异常卸车";
}
@ -3697,11 +3717,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntitiesMap.keySet().forEach(e -> {
//判断是否有已经有order了
Long orderId = finalOrderCodes1.get(e);
if(ObjectUtil.isNull(orderId)){
if (ObjectUtil.isNull(orderId)) {
//没有id
DistributionStockArticleEntity stockArticleEntity = stockArticleMap.get(e);
DistributionStockArticleEntity newStockArticleEntity = new DistributionStockArticleEntity();
BeanUtil.copy(stockArticleEntity,newStockArticleEntity);
BeanUtil.copy(stockArticleEntity, newStockArticleEntity);
newStockArticleEntity.setId(null);
newStockArticleEntity.setCreateUser(userId);
newStockArticleEntity.setUpdateUser(userId);
@ -3717,7 +3737,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticleEntity.setOrderReceiveStatus("10");
newStockArticleEntity.setFreezeStatus("10");
orderId = distributionStockArticleClient.addData(newStockArticleEntity);
finalOrderCodes1.put(e,orderId);
finalOrderCodes1.put(e, orderId);
}
List<TrunklineCarsLoadScanEntity> carsLoadScanList = carsLoadScanEntitiesMap.get(e);
@ -3726,7 +3746,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
DistributionParcelListEntity parcelListEntity = parcelListMap.get(p.getScanCode());
Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId();
DistributionParcelListEntity newNoOrderPackage = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity,newNoOrderPackage);
BeanUtil.copy(parcelListEntity, newNoOrderPackage);
newNoOrderPackage.setId(null);
newNoOrderPackage.setCreateUser(userId);
newNoOrderPackage.setUpdateUser(userId);
@ -3739,9 +3759,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newNoOrderPackage.setOrderPackageStockupStatus("10");
newNoOrderPackage.setOrderPackageReservationStatus("10");
newNoOrderPackage.setOrderPackageLoadingStatus("10");
if(acceptWarehouseId.equals(warehouseId)){
if (acceptWarehouseId.equals(warehouseId)) {
newNoOrderPackage.setIsTransfer(0);
}else{
} else {
newNoOrderPackage.setIsTransfer(1);
}
newParcelListEntities.add(newNoOrderPackage);
@ -3754,7 +3774,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
p.setUnloadNodeId(warehouseId);
p.setUnloadNodeName(warehouseName);
Long finalNodeId = p.getFinalNodeId();
if(!finalNodeId.equals(warehouseId)){
if (!finalNodeId.equals(warehouseId)) {
isAbnormal = 1;
remark = "卸车仓库与目的仓不一致,异常卸车";
}
@ -3805,16 +3825,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//需要解托下架的包件嘛
unbingTrayAndDelAllocationPackages.keySet().forEach(w -> {
List<String> list = unbingTrayAndDelAllocationPackages.get(w);
updownTypeClient.downPackageOrDelTray(StringUtil.join(list),w,"批量入库解托下架");
updownTypeClient.downPackageOrDelTray(StringUtil.join(list), w, "批量入库解托下架");
});
//需要修改仓库信息的打托数据
trayCodes.forEach(trayCode -> {
trayTypeClient.changeTrayWarehouseInfo(trayCode,warehouseId);
trayTypeClient.changeTrayWarehouseInfo(trayCode, warehouseId);
});
newParcelListEntities.forEach(e -> {
carsLoadAsyncService.dealwithAfterAbnormalPackage(e.getOrderPackageCode(),warehouseId,warehouseName,carsLoadEntity.getCarsNo(),userId, deptId, nickName);
carsLoadAsyncService.dealwithAfterAbnormalPackage(e.getOrderPackageCode(), warehouseId, warehouseName, carsLoadEntity.getCarsNo(), userId, deptId, nickName);
});
String content = "包件在 " + warehouseName + "卸车,卸车方式:" + IncomingTypeEnum.getValue(incomingType);
@ -4273,7 +4293,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Date date = new Date();
if(!list.isEmpty()){
if (!list.isEmpty()) {
//排除list中scanStatus = 1的数据
list = list.stream().filter(e -> !"1".equals(e.getScanStatus())).collect(Collectors.toList());
@ -4284,18 +4304,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Map<Long, List<TrunklineCarsLoadScanVO>> map = list.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanVO::getSignOrderId));
map.keySet().forEach(e -> {
List<TrunklineCarsLoadScanVO> trunklineCarsLoadScanVOS = map.get(e);//该签收单对应的包件
trunklineCarsLoadScanVOS.forEach(t ->{
trunklineCarsLoadScanVOS.forEach(t -> {
TrunklineCarsLoadScanEntity entity = new TrunklineCarsLoadScanEntity();
BeanUtil.copy(t,entity);
BeanUtil.copy(t, entity);
entity.setScanStatus("3");
entity.setUnloadNum(t.getNum());
entity.setSignTime(date);
entity.setUnloadTime(date);
if(entity.getType().equals(1)){
if (entity.getType().equals(1)) {
String scanCode = entity.getScanCode();
List<DistributionParcelListEntity> parcelList = parcelListMap.get(scanCode);
if(!Objects.isNull(parcelList)){
parcelList.forEach(p ->{
if (!Objects.isNull(parcelList)) {
parcelList.forEach(p -> {
p.setOrderPackageStatus("70");
updateParcelList.add(p);
});
@ -4431,12 +4451,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long finalNodeId = e.getFinalNodeId();
String finalNodeName = null;
BasicdataWarehouseEntity finalNodeWarehouse = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
if (Objects.nonNull(finalNodeWarehouse)){
if (Objects.nonNull(finalNodeWarehouse)) {
finalNodeName = finalNodeWarehouse.getName();
}
List<DistributionParcelListEntity> entityListByOrderCode = distributionParcelListClient.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, "20",waybillNo);
List<DistributionParcelListEntity> entityListByOrderCode = distributionParcelListClient.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, "20", waybillNo);
int size = entityListByOrderCode.size();
if(planNum.equals(size + realNum)){
if (planNum.equals(size + realNum)) {
for (DistributionParcelListEntity parcelListEntity : entityListByOrderCode) {
String orderPackageCode = parcelListEntity.getOrderPackageCode();
TrunklineCarsLoadScanEntity carsLoadScanEntity = new TrunklineCarsLoadScanEntity();
@ -4482,11 +4502,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
warehousePackageTrackLogEntity.setOperator(nickName);
addPackageTrackLogList.add(warehousePackageTrackLogEntity);
orderPackageCodes.add(orderPackageCode);
// 推送包件装车信息到工厂
pushFactoryOrderData(warehouseId, orderPackageCode, orderCode);
}
}
});
distributionParcelListClient.updatePackageStatus(orderPackageCodes,warehouseId,"60");
distributionParcelListClient.updatePackageStatus(orderPackageCodes, warehouseId, "60");
trunklineCarsLoadScanService.saveBatch(addCarsLoadScanList);
@ -4497,7 +4519,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
1, 1, 0, null, null, null, e.getFromWarehouseId(), e.getId(), remark);
});
packageTrackLogAsyncService.addBatchPackageTrackLog(addPackageTrackLogList,orderPackageCodes,WorkNodeEnums.INITIAL_WAREHOUSE_LOADING.getCode());
packageTrackLogAsyncService.addBatchPackageTrackLog(addPackageTrackLogList, orderPackageCodes, WorkNodeEnums.INITIAL_WAREHOUSE_LOADING.getCode());
return R.success("装车完成");
}
@ -4608,13 +4630,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long loadScanId = loadScanIds.get(0);
TrunklineCarsLoadScanEntity scanEntity = trunklineCarsLoadScanService.getById(loadScanId);
if(Objects.isNull(scanEntity)){
if (Objects.isNull(scanEntity)) {
log.warn("############signLoadScanByIds: 数据信息不存在 loadScanId={}", loadScanId);
return R.fail(405, "数据信息不存在");
}
Long loadId = scanEntity.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
if (Objects.isNull(carsLoadEntity)) {
log.warn("############signLoadScanByIds: 车辆配载信息不存在 loadId={}", loadId);
return R.fail(405, "车辆配载信息不存在");
}
@ -4627,17 +4649,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
Date date = new Date();
trunklineCarsLoadScanService.updateScanStatusAndTime(loadScanIds, "3",new Date());
trunklineCarsLoadScanService.updateScanStatusAndTime(loadScanIds, "3", new Date());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodesByIds(loadScanIds);
//通过loadId查询是否所有包件都签收了
Integer num = trunklineCarsLoadScanService.findSignNumByLoadId(loadId);
if(realLoadingNumber.equals(num)){
if (realLoadingNumber.equals(num)) {
carsLoadEntity.setSignTime(date);
carsLoadEntity.setLoadStatus("90");
}else{
if(num == 1){
} else {
if (num == 1) {
carsLoadEntity.setSignTime(date);
carsLoadEntity.setLoadStatus("91");
}
@ -4646,9 +4668,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateById(carsLoadEntity);
//包件签收状态修改
distributionParcelListClient.updatePackageStatus(orderPackageCodes,warehouseId,"70");
distributionParcelListClient.updatePackageStatus(orderPackageCodes, warehouseId, "70");
waybillPackageService.updatePackageStatus(orderPackageCodes,WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode());
waybillPackageService.updatePackageStatus(orderPackageCodes, WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode());
try {
String content = "包件在" + warehouseEntity.getName() + "被三方中转签收";
@ -5051,7 +5073,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
log.warn("##############findWarehouseUnloadReport: 找不到对应的配载信息");
return R.fail(405,"找不到对应的配载信息");
return R.fail(405, "找不到对应的配载信息");
}
String carsNo = carsLoadEntity.getCarsNo();
@ -5059,22 +5081,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//判空
if (Objects.isNull(carsLoadLineEntity)) {
log.warn("##############findWarehouseUnloadReport: 找不到对应的配载节点信息");
return R.fail(405,"找不到对应的配载节点信息");
return R.fail(405, "找不到对应的配载节点信息");
}
String nodeName = carsLoadLineEntity.getNodeName();
Integer unloadReportStatus = carsLoadLineEntity.getUnloadReportStatus();
if(unloadReportStatus.equals(0)){
log.warn("##############findWarehouseUnloadReport: {} 还未卸车确认",nodeName);
return R.fail(405,nodeName+"还未卸车确认");
if (unloadReportStatus.equals(0)) {
log.warn("##############findWarehouseUnloadReport: {} 还未卸车确认", nodeName);
return R.fail(405, nodeName + "还未卸车确认");
}
Map<String,String> map = new HashMap<>();
map.put("one",carsLoadLineEntity.getReportOne());
map.put("two",carsLoadLineEntity.getReportTwo());
Map<String, String> map = new HashMap<>();
map.put("one", carsLoadLineEntity.getReportOne());
map.put("two", carsLoadLineEntity.getReportTwo());
JSONObject abnormalRecord = abnormalRecordClient.findListByCarsNoAndUpWarehouseId(carsNo,warehouseId);
JSONObject abnormalRecord = abnormalRecordClient.findListByCarsNoAndUpWarehouseId(carsNo, warehouseId);
map.put("three","当前待处理异常 "+abnormalRecord.getInteger("dealwithNum")+" 条、已处理异常 "+abnormalRecord.getInteger("noDealwithNum")+" 条");
map.put("three", "当前待处理异常 " + abnormalRecord.getInteger("dealwithNum") + " 条、已处理异常 " + abnormalRecord.getInteger("noDealwithNum") + " 条");
return R.data(map);
}
@ -5406,7 +5428,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "配载计划节点信息不存在");
}
String unloadStatus = loadLineEntity.getUnloadStatus();
if(!"0".equals(unloadStatus)){
if (!"0".equals(unloadStatus)) {
log.warn("############unloadPackage: 当前网点已经卸车确认 loadId={} warehouseId={}", loadId, warehouseId);
return R.fail(405, "当前网点已经卸车确认");
}
@ -5794,7 +5816,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
carsLoadAsyncService.dealwithAfterAbnormalPackage(orderPackageCode,warehouseId,warehouseName,carsLoadEntity.getCarsNo(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName());
carsLoadAsyncService.dealwithAfterAbnormalPackage(orderPackageCode, warehouseId, warehouseName, carsLoadEntity.getCarsNo(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName());
List<String> orderPackageCodes = new ArrayList<>();
@ -5826,7 +5848,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "配载计划节点信息不存在");
}
String unloadStatus = loadLineEntity.getUnloadStatus();
if(!"0".equals(unloadStatus)){
if (!"0".equals(unloadStatus)) {
log.warn("############unloadZero: 当前网点已经卸车确认 loadId={} warehouseId={}", loadId, warehouseId);
return R.fail(405, "当前网点已经卸车确认");
}

Loading…
Cancel
Save