Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 5 months ago
parent
commit
87a9422768
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  2. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  4. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  5. 4
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java
  6. 28
      blade-service/logpm-report/src/main/java/com/logpm/report/config/ReportExceptionHandler.java
  7. 13
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java
  8. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java
  9. 35
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/DataInWarehouseListener.java
  10. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java
  11. 84
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  12. 409
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  13. 20
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java
  14. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  15. 228
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java

@ -39,7 +39,7 @@ public abstract class FanoutConstants {
String STATISTICSDATA_CREATEPACKAGEINFO = "fanout.trunkline.openWaybill.statisticsdata.createPackageinfo" + ModuleNameConstant.DEVAUTH;
// 开单检测数据 --商家端
String SEND_BUSINESS_DATA_BY_OPENWAYBILL_DATA = "fanout.trunkline.openWaybill.send_business_data.open" + ModuleNameConstant.DEVAUTH;
// 改单数据 --商家端
}
}

3
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java

@ -62,6 +62,9 @@ public interface IWarehouseTrayTypeClient {
@PostMapping(API_PREFIX+"/orderScanOrderPackageCodeReturnR")
R orderScanOrderPackageCodeReturnR(@RequestBody Map<String, Object> map);
@PostMapping(API_PREFIX+"/orderScanOrderPackageCodeSyncJd")
R orderScanOrderPackageCodeSyncJd(@RequestBody Map<String, Object> map);
@PostMapping(API_PREFIX+"/enterZeroOrderByTrayCode")
boolean enterZeroOrderByTrayCode(@RequestBody Map<String, Object> map);

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

@ -1730,6 +1730,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
loadscanEntity.setLoadedNub(parcelListEntity.getQuantity());
loadscanEntity.setWarehouseId(myCurrentWarehouse.getId());
loadscanEntity.setWarehouseName(myCurrentWarehouse.getName());
loadscanEntity.setScanTime(now);
if (StringUtils.isNotBlank(finalDistributionDeliverySelfEntity.getDriverPhone())) {
loadscanEntity.setDriverPhone(finalDistributionDeliverySelfEntity.getDriverPhone());

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

@ -1522,7 +1522,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
handleNum = handleNum + 1;
} else if ("60".equals(orderPackageStatus)) {
outNum = outNum + 1;
} else if ("70".equals(orderPackageStatus)) {
} else {
signNum = signNum + 1;
}
}

4
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java

@ -199,9 +199,9 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
advanceDetailEntity.setFirstPackName(orderPackageDTO.getType());
// 获取映射志邦映射品类信息
// 二级品类名称
advanceDetailEntity.setSecondPackName(orderPackageDTO.getMaterialCategory());
advanceDetailEntity.setSecondPackName(StrUtil.isNotEmpty(orderPackageDTO.getMaterialCategory()) ? orderPackageDTO.getMaterialCategory() : orderPackageDTO.getType());
// 三级品类名称
advanceDetailEntity.setThirdPackName(orderPackageDTO.getMaterialCategory());
advanceDetailEntity.setThirdPackName(StrUtil.isNotEmpty(orderPackageDTO.getMaterialCategory()) ? orderPackageDTO.getMaterialCategory() : orderPackageDTO.getType());
// advanceDetailEntity.setMaterialName(orderPackageDTO.getMaterialCategory());
advanceDetailEntity.setSiteName("");

28
blade-service/logpm-report/src/main/java/com/logpm/report/config/ReportExceptionHandler.java

@ -0,0 +1,28 @@
package com.logpm.report.config;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tenant.exception.TenantDataSourceException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
/**
* @Author: zqb
* @Date: 2024/11/13
*/
@ControllerAdvice
@Slf4j
public class ReportExceptionHandler {
@ExceptionHandler(TenantDataSourceException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public ResponseEntity<Object> handleCustomException(TenantDataSourceException e) {
String errorMessage = e.getMessage();
return new ResponseEntity<>(R.fail(ResultCode.FAILURE.getCode(),errorMessage), HttpStatus.BAD_REQUEST);
}
}

13
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java

@ -40,7 +40,6 @@ import org.apache.poi.ss.formula.functions.T;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springframework.beans.factory.annotation.Autowired;
@ -483,16 +482,16 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
if (ObjectUtil.isNotEmpty(query.getStartTaskTime()) || ObjectUtil.isNotEmpty(query.getEndTaskTime())) {
boolean withinOneMonth = DateUtil.between(query.getStartTaskTime(), query.getEndTaskTime(), DateUnit.DAY) <= 30;
if (!withinOneMonth) {
throw new CustomerException(5000, "配送日期必选且时间不超过一个月");
throw new ServiceException("配送日期必选且时间不超过一个月");
}
} else {
if (ObjectUtil.isNotEmpty(query.getStartSjsigningTime()) || ObjectUtil.isNotEmpty(query.getEndSjsigningTime())) {
boolean withinOneMonth = DateUtil.between(query.getStartSjsigningTime(), query.getEndSjsigningTime(), DateUnit.DAY) <= 30;
if (!withinOneMonth) {
throw new CustomerException(5000, "签收日期必选且时间不超过一个月");
throw new ServiceException("签收日期必选且时间不超过一个月");
}
} else {
throw new CustomerException(5000, "导出时配送日期必填");
throw new ServiceException("导出时配送日期必填");
}
}
}
@ -503,16 +502,16 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
if (ObjectUtil.isNotEmpty(query.getStartTaskTime()) || ObjectUtil.isNotEmpty(query.getEndTaskTime())) {
boolean withinOneMonth = DateUtil.between(query.getStartTaskTime(), query.getEndTaskTime(), DateUnit.DAY) <= 7;
if (!withinOneMonth) {
throw new CustomerException(5000, "配送日期必选且时间不超过7天");
throw new ServiceException("配送日期必选且时间不超过7天");
}
} else {
if (ObjectUtil.isNotEmpty(query.getStartSjsigningTime()) || ObjectUtil.isNotEmpty(query.getEndSjsigningTime())) {
boolean withinOneMonth = DateUtil.between(query.getStartSjsigningTime(), query.getEndSjsigningTime(), DateUnit.DAY) <= 7;
if (!withinOneMonth) {
throw new CustomerException(5000, "签收日期必选且时间不超过7天 ");
throw new ServiceException("签收日期必选且时间不超过7天 ");
}
} else {
throw new CustomerException(5000, "导出时配送日期必填");
throw new ServiceException("导出时配送日期必填");
}
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java

@ -809,6 +809,7 @@ public class CarsLoadApiController {
return R.fail(405,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
loadCarsDTO.setWarehouseName(myCurrentWarehouse.getName());
if(Objects.isNull(loadId)){
log.warn(method+"配载计划id为空 loadId={}",loadId);
return R.fail(405,"配载计划id为空");

35
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/DataInWarehouseListener.java

@ -0,0 +1,35 @@
package com.logpm.trunkline.mq;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Slf4j
@Component
@AllArgsConstructor
public class DataInWarehouseListener {
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.trunkline.REPORTDATA.QUEUE.REPORT_BASICDATA),
exchange = @Exchange(name = FanoutConstants.trunkline.REPORTDATA.EXCHANGE, type = ExchangeTypes.FANOUT)
))
@Transactional(rollbackFor = Exception.class)
public void dataInWarehouseHandler(String message) {
log.info("dataInWarehouseHandler:{}", message);
}
}

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java

@ -37,4 +37,11 @@ public interface ICarsLoadAsyncService {
void sendReportCarsLoadSuppleFanout(Long userId, String nickName, Long warehouseId, TrunklineCarsLoadEntity carsLoadEntity, List<TrunklineCarsLoadScanEntity> scanEntityList);
void saveLoadingLog(Long warehouseId,String warehouseName,Long loadId,String loadCode,Long waybillId,String waybillNo,String orderCode,String scanCode,Integer num,Integer type,Integer isData,Integer isAbnormal,Long trayId,String trayCode,String trayName,Long fromWarehouseId,Long loadScanId,String remark);
void savaUnloadLog(Long warehouseId,String warehouseName,Long loadId,String loadCode,Long waybillId,String waybillNo,String orderCode,String scanCode,Integer num,Integer type,Integer isData,Integer isAbnormal,Long trayId,String trayCode,String trayName,Long fromWarehouseId,Long loadScanId,String remark);
void sendFactoryData(String orderCode, String orderPackageCode, Long warehouseId, String warehouseName);
void downPackageOrDelTray(String orderPackageCode, Long fromWarehouseId, String remark);
}

84
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -1,7 +1,10 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -12,14 +15,21 @@ import com.logpm.aftersales.feign.IAftersalesAbnormalRecordZeroDetailClient;
import com.logpm.aftersales.feign.IAftersalesWorkOrderClient;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
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.trunkline.dto.OrderStatusDTO;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.TrunklineScanZeroDetailVO;
import com.logpm.trunkline.vo.UnloadReportVO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.annotations.LogpmAsync;
@ -87,6 +97,12 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
private IAftersalesAbnormalRecordZeroDetailClient abnormalRecordZeroDetailClient;
@Autowired
private ISendFanoutService sendFanoutService;
@Autowired
private ITrunklineCarsLoadingLogService trunklineCarsLoadingLogService;
@Autowired
private FactoryDataMessageSender factoryDataMessageSender;
@Autowired
private IWarehouseUpdownTypeClient updownTypeClient;
@LogpmAsync("asyncExecutor")
@Override
@ -984,6 +1000,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
}
@LogpmAsync("asyncExecutor")
@Override
public void sendReportCarsLoadSuppleFanout(Long userId, String nickName, Long warehouseId, TrunklineCarsLoadEntity carsLoadEntity, List<TrunklineCarsLoadScanEntity> scanEntityList) {
@ -1019,4 +1036,71 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@LogpmAsync("asyncExecutor")
@Override
public void saveLoadingLog(Long warehouseId, String warehouseName, Long loadId, String loadCode, Long waybillId, String waybillNo, String orderCode, String scanCode, Integer num, Integer type, Integer isData, Integer isAbnormal, Long trayId, String trayCode, String trayName, Long fromWarehouseId, Long loadScanId, String remark) {
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, scanCode, num,
type, isData, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
}
@LogpmAsync("asyncExecutor")
@Override
public void savaUnloadLog(Long warehouseId, String warehouseName, Long loadId, String loadCode, Long waybillId, String waybillNo, String orderCode, String scanCode, Integer num, Integer type, Integer isData, Integer isAbnormal, Long trayId, String trayCode, String trayName, Long fromWarehouseId, Long loadScanId, String remark) {
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, scanCode, num,
type, isData, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
}
@LogpmAsync("asyncExecutor")
@Override
public void sendFactoryData(String orderCode, String orderPackageCode, Long warehouseId, String warehouseName) {
try {
if (StrUtil.isNotEmpty(orderCode)) {
// 发送入库消息
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
// 通过包件id 查询包件
orderStatusDTO.setUnitNo(orderPackageCode);
orderStatusDTO.setOrderNo(orderCode);
orderStatusDTO.setStatus("4");
orderStatusDTO.setOperationTime(DateUtil.now());
orderStatusDTO.setCurrentWarehouse(warehouseId.toString());
Map<String, Object> map = new HashMap<>();
map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO));
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
JSONObject main = new JSONObject();
main.put("trainNumber", parcelListEntity.getTrainNumber());
main.put("waybillNumber", parcelListEntity.getWaybillNumber());
NodePushMsg nodePushMsg = NodePushMsg.builder()
.operator(AuthUtil.getNickName())
.operatorTime(new Date())
.warehouse(warehouseName)
.startWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getSendWarehouseName():"")
.endWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"")
.address("在【" + warehouseName + "】入库")
.brand(BrandEnums.getByValue(parcelListEntity.getBrandName()))
.main(JSONUtil.toJsonStr(main))
.node(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE)
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.warehouseName(warehouseName)
.waybillNumber(parcelListEntity.getWaybillNumber())
.destinationWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"")
.waybillStartWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getSendWarehouseName():"")
.orderCode(orderCode)
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
}
} catch (Exception e) {
log.error("入库推送失败:{}", e);
}
}
@Override
public void downPackageOrDelTray(String orderPackageCode, Long fromWarehouseId, String remark) {
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, remark);
}
}

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

@ -6068,13 +6068,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String audio = null;
String orders = null;
if (0 == isZero) {
unloadPackage(loadId, orderPackageCode, warehouseId, 1, "卸分一体 卸车", incomingType, palletName, trayCode);
R r1 = unloadPackage(loadId, orderPackageCode, warehouseId, 1, "卸分一体 卸车", incomingType, palletName, trayCode);
int code1 = r1.getCode();
if(NumberUtil.equals(code1,4005)){
log.warn("##########unloadTrayAllOne: 系统无编码 trayCode={} orderPackageCode={} msg={}", trayCode, orderPackageCode, r1.getMsg());
return R.fail(code1, "系统无编码");
}
Map<String, Object> map = new HashMap<>();
map.put("trayId", basicdataTrayEntity.getId());
map.put("trayType", trayType);
map.put("trayCode", trayCode);
map.put("trayName", basicdataTrayEntity.getPalletName());
map.put("warehouseId", warehouseId);
map.put("orderPackageCode", orderPackageCode);
R r = trayTypeClient.orderScanOrderPackageCodeReturnR(map);
R r = trayTypeClient.orderScanOrderPackageCodeSyncJd(map);
int code = r.getCode();
if (code != 200) {
log.warn("##########unloadTrayAllOne: 打托失败 trayCode={} orderPackageCode={} msg={}", trayCode, orderPackageCode, r.getMsg());
@ -6129,6 +6136,317 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.data(map);
}
public R unloadTrayAllOneNew(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId();
String trayCode = loadCarsDTO.getTrayCode();
String trayType = loadCarsDTO.getTrayType();
String orderPackageCode = loadCarsDTO.getOrderPackageCode();
Long warehouseId = loadCarsDTO.getWarehouseId();
String warehouseName = loadCarsDTO.getWarehouseName();
Integer incomingType = loadCarsDTO.getIncomingType();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("############unloadTrayAllOneNew: 配载计划信息不存在 loadId={} ", loadId);
return R.fail(405, "配载计划信息不存在");
}
String carsNo = carsLoadEntity.getCarsNo();
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if (Objects.isNull(carsLoadLineEntity)) {
log.warn("############unloadTrayAllOneNew: 配载计划节点信息不存在 loadId={} warehouseId={}", loadId, warehouseId);
return R.fail(405, "配载计划节点信息不存在");
}
String unloadStatus = carsLoadLineEntity.getUnloadStatus();
if (!"0".equals(unloadStatus)) {
log.warn("############unloadTrayAllOneNew: 当前网点已经卸车确认 loadId={} warehouseId={}", loadId, warehouseId);
return R.fail(405, "当前网点已经卸车确认");
}
DistributionParcelListEntity signDistributionParcelListEntity = distributionParcelListClient.findOrderPackageCodeAndStatus(orderPackageCode,"70");
if (!Objects.isNull(signDistributionParcelListEntity)) {
log.warn("##############unloadTrayAllOneNew: 包件已签收 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return R.fail(405, "包件已签收");
}
Integer trayStatus = 0;
TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity = null;
TrunklineAdvanceDetailEntity advanceDetailEntity = trunklineAdvanceDetailService.findEntityByOrderPackageCode(orderPackageCode);
// if(Objects.isNull(advanceDetailEntity)){
// //系统无编码
// trunklineCarsLoadScanEntity = new TrunklineCarsLoadScanEntity();
// trunklineCarsLoadScanEntity.setLoadId(loadId);
// trunklineCarsLoadScanEntity.setLoadCode(carsNo);
// trunklineCarsLoadScanEntity.setScanCode(orderPackageCode);
// trunklineCarsLoadScanEntity.setReserve1("1");
// //把其他仓reserve1为1的更新为2
// trunklineCarsLoadScanService.updateReserve1ByOrderPackageCode(orderPackageCode,"2");
// trunklineCarsLoadScanEntity.setScanStatus("2");
// trunklineCarsLoadScanEntity.setNum(1);
// trunklineCarsLoadScanEntity.setType(1);
// trunklineCarsLoadScanEntity.setIsData(0);
// trunklineCarsLoadScanEntity.setLoadingAbnormal(1);
// trunklineCarsLoadScanEntity.setUnloadAbnormal(1);
// trunklineCarsLoadScanEntity.setUnloadNodeName(warehouseName);
// trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
// trunklineCarsLoadScanEntity.setUnloadNum(1);
// trunklineCarsLoadScanEntity.setIsSupple(0);
// trunklineCarsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
// trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
// trunklineCarsLoadScanEntity.setUnloadTime(new Date());
// trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
// log.warn("##############unloadTrayAllOneNew: 系统无编码 orderPackageCode={}", orderPackageCode);
// return R.fail(405, "系统无编码");
// }else{
// Long advanceId = advanceDetailEntity.getAdvanceId();
// TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId);
// String orderCode = advanceEntity.getOrderCode();
// Long waybillId = advanceDetailEntity.getWaybillId();
// WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
//
// //首先判断包件是否已经入库
// DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
// if(Objects.isNull(parcelListEntity)){
//
// QueryWrapper<TrunklineCarsLoadScanEntity> neloadScanQueryWrapper = new QueryWrapper<>();
// neloadScanQueryWrapper.eq("load_id", loadId)
// .eq("scan_code", orderPackageCode)
// .eq("unload_node_id", warehouseId)
// .ne("scan_status", "1");
// TrunklineCarsLoadScanEntity unloadScanEntity = trunklineCarsLoadScanService.getOne(neloadScanQueryWrapper);
// if(Objects.isNull(unloadScanEntity)){
// log.warn("############unloadTrayAllOneNew: 包件已经卸车 loadId={} unload_node_id={}", loadId, warehouseId);
// return R.fail(405, "包件已经卸车");
// }
//
// //没有入库,去做判定能否入库
// QueryWrapper<TrunklineCarsLoadScanEntity> scanQueryWrapper = new QueryWrapper<>();
// scanQueryWrapper.eq("load_id", loadId)
// .eq("scan_code", orderPackageCode)
// .eq("scan_status", "1");
// TrunklineCarsLoadScanEntity scanEntity = trunklineCarsLoadScanService.getOne(scanQueryWrapper);
// if(Objects.isNull(scanEntity)){
// //当前车上没有在车记录
// trunklineCarsLoadScanEntity = new TrunklineCarsLoadScanEntity();
// trunklineCarsLoadScanEntity.setOrderCode(advanceDetailEntity.getOrderCode());
// trunklineCarsLoadScanEntity.setWaybillId(advanceDetailEntity.getWaybillId());
// trunklineCarsLoadScanEntity.setWaybillNo(advanceDetailEntity.getWaybillNo());
// trunklineCarsLoadScanEntity.setLoadId(loadId);
// trunklineCarsLoadScanEntity.setLoadCode(carsNo);
// trunklineCarsLoadScanEntity.setScanCode(orderPackageCode);
// trunklineCarsLoadScanEntity.setScanStatus("2");
// trunklineCarsLoadScanEntity.setNum(1);
// trunklineCarsLoadScanEntity.setType(1);
// trunklineCarsLoadScanEntity.setIsData(1);
// trunklineCarsLoadScanEntity.setLoadingAbnormal(1);
// trunklineCarsLoadScanEntity.setUnloadAbnormal(1);
// trunklineCarsLoadScanEntity.setUnloadNodeName(warehouseName);
// trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
// trunklineCarsLoadScanEntity.setUnloadNum(1);
// trunklineCarsLoadScanEntity.setIsSupple(0);
// trunklineCarsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
// trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
// trunklineCarsLoadScanEntity.setUnloadTime(new Date());
// trunklineCarsLoadScanEntity.setFirsts(advanceDetailEntity.getFirstPackName());
// trunklineCarsLoadScanEntity.setSenconds(advanceDetailEntity.getSecondPackName());
// trunklineCarsLoadScanEntity.setThirds(advanceDetailEntity.getThirdPackName());
// trunklineCarsLoadScanEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
// trunklineCarsLoadScanEntity.setMaterialName(advanceDetailEntity.getMaterialName());
// trunklineCarsLoadScanEntity.setCustomerName(advanceEntity.getCustomerName());
// trunklineCarsLoadScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());
// trunklineCarsLoadScanEntity.setCustomerAddress(advanceEntity.getCustomerAddress());
//
// Long currentOrderId = null;
// //查询当前仓库订单信息有没有
// Integer totalNumber = trunklineAdvanceDetailService.findTotalNumByOrderCode(orderCode);
// DistributionStockArticleEntity currentStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
// if (Objects.isNull(currentStockArticleEntity)) {
// //查询包件前面仓的订单信息
// currentStockArticleEntity = new DistributionStockArticleEntity();
// currentStockArticleEntity.setId(null);
// currentStockArticleEntity.setServiceNumber(advanceEntity.getServiceNum());
// currentStockArticleEntity.setOrderCode(orderCode);
// currentStockArticleEntity.setMallCode(advanceEntity.getDealerCode());
// currentStockArticleEntity.setMallName(advanceEntity.getDealerName());
// if(!Objects.isNull(waybillEntity)){
// currentStockArticleEntity.setMallId(waybillEntity.getConsigneeId());
// currentStockArticleEntity.setConsignee(waybillEntity.getConsignee());
// currentStockArticleEntity.setConsigneeTelephone(waybillEntity.getConsigneePhone());
// }
// }
// currentStockArticleEntity.setWarehouseId(warehouseId);
// currentStockArticleEntity.setWarehouse(warehouseName);
// currentStockArticleEntity.setTotalNumber(totalNumber);
// currentStockArticleEntity.setHandQuantity(0);
// currentStockArticleEntity.setCompleteSet(1);
// currentStockArticleEntity.setStockupStatus("10");
// currentStockArticleEntity.setReservationStatus("10");
// currentStockArticleEntity.setOrderStatus("20");
// currentStockArticleEntity.setGroundingStatus("10");
// currentStockArticleEntity.setOrderReceiveStatus("10");
// currentStockArticleEntity.setFreezeStatus("10");
// currentStockArticleEntity.setSortingQuantity(0);
// currentStockArticleEntity.setDeliveryQuantity(0);
// currentStockArticleEntity.setTransferQuantity(0);
// currentStockArticleEntity.setSigninQuantity(0);
// currentStockArticleEntity.setIncomingNum(0);
// currentStockArticleEntity.setGenre(1);
// currentStockArticleEntity.setAllocation(null);
// currentStockArticleEntity.setTrays(null);
// currentOrderId = distributionStockArticleClient.addData(currentStockArticleEntity);
// currentStockArticleEntity.setId(currentOrderId);
// } else {
// currentOrderId = currentStockArticleEntity.getId();
// String reservationStatus = currentStockArticleEntity.getReservationStatus();
// if("30".equals(reservationStatus)){
// currentStockArticleEntity.setReservationStatus("20");
// }
// String orderStatus = currentStockArticleEntity.getOrderStatus();
// if("80".equals(orderStatus)){
// currentStockArticleEntity.setOrderStatus("70");
// }
// currentStockArticleEntity.setGenre(1);
// currentStockArticleEntity.setTotalNumber(totalNumber);
//
// distributionStockArticleClient.updateEntity(currentStockArticleEntity);
// }
//
// //判断包件当前仓是否是目的仓
// WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber);
//
// if (Objects.isNull(distributionParcelListEntity)) {
// distributionParcelListEntity = new DistributionParcelListEntity();
// BeanUtil.copy(parcelListEntity, distributionParcelListEntity);
// distributionParcelListEntity.setId(null);
// distributionParcelListEntity.setIsTransfer(1);
// isTransfer = 1;
// if (!Objects.isNull(warehouseWaybillEntity)) {
// Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
// if (destinationWarehouseId.equals(warehouseId)) {
// distributionParcelListEntity.setIsTransfer(0);
// isTransfer = 0;
// }
// }
// distributionParcelListEntity.setAdvanceId(parcelListEntity.getAdvanceId());
// distributionParcelListEntity.setOrderPackageStatus("20");
// distributionParcelListEntity.setWarehouseId(warehouseId);
// distributionParcelListEntity.setWarehouse(warehouseName);
// distributionParcelListEntity.setTrainNumber(loadCode);
// distributionParcelListEntity.setStockArticleId(currentOrderId);
// distributionParcelListEntity.setOrderPackageFreezeStatus("10");
// distributionParcelListEntity.setOrderPackageGroundingStatus("10");
// distributionParcelListEntity.setOrderPackageStockupStatus("10");
// distributionParcelListEntity.setOrderPackageReservationStatus("10");
// distributionParcelListEntity.setOrderPackageLoadingStatus("10");
// distributionParcelListEntity.setWarehouseEntryTimeEnd(new Date());
// boolean add = distributionParcelListClient.add(distributionParcelListEntity);
//
// }else{
// //当前车上有在车记录
// trunklineCarsLoadScanEntity = scanEntity;
// trunklineCarsLoadScanEntity.setUnloadAbnormal(1);
// trunklineCarsLoadScanEntity.setUnloadNodeName(warehouseName);
// trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
// trunklineCarsLoadScanEntity.setUnloadNum(1);
// trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
// trunklineCarsLoadScanEntity.setUnloadTime(new Date());
//
// parcelListEntity.setOrderPackageStatus("20");
//
// }
//
// }else{
// //已经入库就直接打托
// String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
// if("20".equals(orderPackageStatus)){
// //已经入库就去打托
// log.info("###############unloadTrayAllOneNew: ");
// }else{
// QueryWrapper<TrunklineCarsLoadScanEntity> neloadScanQueryWrapper = new QueryWrapper<>();
// neloadScanQueryWrapper.eq("load_id", loadId)
// .eq("scan_code", orderPackageCode)
// .eq("unload_node_id", warehouseId)
// .ne("scan_status", "1");
// TrunklineCarsLoadScanEntity unloadScanEntity = trunklineCarsLoadScanService.getOne(neloadScanQueryWrapper);
// if(Objects.isNull(unloadScanEntity)){
// log.warn("############unloadTrayAllOneNew: 包件已经卸车 loadId={} unload_node_id={}", loadId, warehouseId);
// return R.fail(405, "包件已经卸车");
// }
//
// QueryWrapper<TrunklineCarsLoadScanEntity> scanQueryWrapper = new QueryWrapper<>();
// scanQueryWrapper.eq("load_id", loadId)
// .eq("scan_code", orderPackageCode)
// .eq("scan_status", "1");
// TrunklineCarsLoadScanEntity scanEntity = trunklineCarsLoadScanService.getOne(scanQueryWrapper);
// if(Objects.isNull(scanEntity)){
// //当前车上没有在车记录
// trunklineCarsLoadScanEntity = new TrunklineCarsLoadScanEntity();
// trunklineCarsLoadScanEntity.setOrderCode(advanceDetailEntity.getOrderCode());
// trunklineCarsLoadScanEntity.setWaybillId(advanceDetailEntity.getWaybillId());
// trunklineCarsLoadScanEntity.setWaybillNo(advanceDetailEntity.getWaybillNo());
// trunklineCarsLoadScanEntity.setLoadId(loadId);
// trunklineCarsLoadScanEntity.setLoadCode(carsNo);
// trunklineCarsLoadScanEntity.setScanCode(orderPackageCode);
// trunklineCarsLoadScanEntity.setScanStatus("2");
// trunklineCarsLoadScanEntity.setNum(1);
// trunklineCarsLoadScanEntity.setType(1);
// trunklineCarsLoadScanEntity.setIsData(1);
// trunklineCarsLoadScanEntity.setLoadingAbnormal(1);
// trunklineCarsLoadScanEntity.setUnloadAbnormal(1);
// trunklineCarsLoadScanEntity.setUnloadNodeName(warehouseName);
// trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
// trunklineCarsLoadScanEntity.setUnloadNum(1);
// trunklineCarsLoadScanEntity.setIsSupple(0);
// trunklineCarsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
// trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
// trunklineCarsLoadScanEntity.setUnloadTime(new Date());
// trunklineCarsLoadScanEntity.setFirsts(advanceDetailEntity.getFirstPackName());
// trunklineCarsLoadScanEntity.setSenconds(advanceDetailEntity.getSecondPackName());
// trunklineCarsLoadScanEntity.setThirds(advanceDetailEntity.getThirdPackName());
// trunklineCarsLoadScanEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
// trunklineCarsLoadScanEntity.setMaterialName(advanceDetailEntity.getMaterialName());
// trunklineCarsLoadScanEntity.setCustomerName(advanceEntity.getCustomerName());
// trunklineCarsLoadScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());
// trunklineCarsLoadScanEntity.setCustomerAddress(advanceEntity.getCustomerAddress());
//
// parcelListEntity.setOrderPackageStatus("20");
//
// }else{
// //当前车上有在车记录
// trunklineCarsLoadScanEntity = scanEntity;
// trunklineCarsLoadScanEntity.setUnloadAbnormal(1);
// trunklineCarsLoadScanEntity.setUnloadNodeName(warehouseName);
// trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
// trunklineCarsLoadScanEntity.setUnloadNum(1);
// trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
// trunklineCarsLoadScanEntity.setUnloadTime(new Date());
//
// parcelListEntity.setOrderPackageStatus("20");
//
// }
//
// }
//
//
//
//
// }
// }
Map<String, Object> map = new HashMap<>();
map.put("orders", "11111");
return R.data(map);
}
@Override
public R determineHasNoFinalNode(Long loadId, Long warehouseId) {
@ -10303,7 +10621,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String orderPackageStatus = distributionParcelListEntity.getOrderPackageStatus();
if ("20".equals(orderPackageStatus) || "30".equals(orderPackageStatus)) {
log.warn("##############unloadPackage: 包件已入库 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return R.fail(405, "包件已入库");
return R.success( "包件已入库");
}
}
@ -10326,7 +10644,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer isData1 = scanEntity.getIsData();
if (isData1.equals(0)) {
log.warn("##############unloadPackage: 系统无编码 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return R.fail(405, "系统无编码");
return R.fail(4005, "系统无编码");
}
log.warn("##############unloadPackage: 包件已卸车 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return R.fail(405, "包件已卸车");
@ -10360,8 +10678,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//需要补装车扫记录
TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity = new TrunklineCarsLoadScanEntity();
// trunklineCarsLoadScanEntity.setWarehouseId(warehouseId);
// trunklineCarsLoadScanEntity.setWarehouseName(warehouseName);
trunklineCarsLoadScanEntity.setOrderCode(advanceDetailEntity.getOrderCode());
trunklineCarsLoadScanEntity.setWaybillId(advanceDetailEntity.getWaybillId());
trunklineCarsLoadScanEntity.setWaybillNo(advanceDetailEntity.getWaybillNo());
@ -10386,12 +10702,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
loadScanId = trunklineCarsLoadScanEntity.getId();
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
carsLoadAsyncService.saveLoadingLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
1, 1, 1, trayId, trayCode, trayName, null, loadScanId, "有数据,补装车计划,异常装车");
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
carsLoadAsyncService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
1, 1, 1, trayId, trayCode, trayName, null, loadScanId, "有数据,异常卸车");
}else{
//已入库
Long nowWarehouseId = advanceDetailEntity.getNowWarehouseId();
@ -10427,10 +10745,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
loadScanId = trunklineCarsLoadScanEntity.getId();
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
carsLoadAsyncService.saveLoadingLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
1, 1, 1, trayId, trayCode, trayName, null, loadScanId, "有数据,无计划,无装车,补装车计划,异常装车");
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
carsLoadAsyncService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
1, 1, 1, trayId, trayCode, trayName, null, loadScanId, "有数据,无计划,无装车,异常卸车");
//无装车记录异常日志记录
@ -10566,7 +10884,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionParcelListClient.update(distributionParcelListEntity);
}
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, nowWarehouseId, "干线卸车下架解托");
carsLoadAsyncService.downPackageOrDelTray(orderPackageCode, nowWarehouseId, "干线卸车下架解托");
}
}
}else{
@ -10595,17 +10913,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setUnloadTime(new Date());
if(isData==1){
trunklineCarsLoadScanEntity.setUnloadTrayCode(unloadTrayCode);
trunklineCarsLoadScanEntity.setUnloadTrayName(unloadTrayName);
}
// if(isData==1){
// trunklineCarsLoadScanEntity.setUnloadTrayCode(unloadTrayCode);
// trunklineCarsLoadScanEntity.setUnloadTrayName(unloadTrayName);
// }
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
loadScanId = trunklineCarsLoadScanEntity.getId();
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
carsLoadAsyncService.saveLoadingLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
1, 0, 1, trayId, trayCode, trayName, null, loadScanId, "无数据,补装车计划,异常装车");
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
carsLoadAsyncService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, null, null, null, orderPackageCode, 1,
1, 0, 1, trayId, trayCode, trayName, null, loadScanId, "无数据,异常卸车");
}
@ -10668,10 +10986,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
loadScanId = trunklineCarsLoadScanEntity.getId();
//
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNumber, orderCode, orderPackageCode, 1,
carsLoadAsyncService.saveLoadingLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNumber, orderCode, orderPackageCode, 1,
1, 1, 1, trayId, trayCode, trayName, wid, loadScanId, "有数据,补装车计划,异常装车");
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNumber, orderCode, orderPackageCode, 1,
carsLoadAsyncService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNumber, orderCode, orderPackageCode, 1,
1, 1, 1, trayId, trayCode, trayName, wid, loadScanId, "有数据,异常卸车");
distributionStockArticleClient.submitHandleNumByOrderId(1, articleId);
@ -10771,7 +11089,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionParcelListClient.update(distributionParcelListEntity);
}
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, wid, "干线卸车下架解托");
carsLoadAsyncService.downPackageOrDelTray(orderPackageCode, wid, "干线卸车下架解托");
}
}
@ -10822,11 +11140,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trayName = trayEntity.getPalletName();
}
if (unbindTray == 1) {
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线卸车下架解托");
carsLoadAsyncService.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线卸车下架解托");
}
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, orderPackageCode, 1,
carsLoadAsyncService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, orderPackageCode, 1,
1, 1, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
if (1 == isData) {
@ -11009,54 +11327,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
orderPackageCodes.add(orderPackageCode);
String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(incomingType)+ (StringUtil.isNotBlank(unloadTrayName)?"托盘:"+unloadTrayName:"");
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content);
try {
if (StrUtil.isNotEmpty(orderCode)) {
// 发送入库消息
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
// 通过包件id 查询包件
orderStatusDTO.setUnitNo(orderPackageCode);
orderStatusDTO.setOrderNo(orderCode);
orderStatusDTO.setStatus("4");
orderStatusDTO.setOperationTime(DateUtil.now());
orderStatusDTO.setCurrentWarehouse(warehouseId.toString());
Map<String, Object> map = new HashMap<>();
map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO));
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
JSONObject main = new JSONObject();
main.put("trainNumber", parcelListEntity.getTrainNumber());
main.put("waybillNumber", parcelListEntity.getWaybillNumber());
NodePushMsg nodePushMsg = NodePushMsg.builder()
.operator(AuthUtil.getNickName())
.operatorTime(new Date())
.warehouse(warehouseName)
.startWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getSendWarehouseName():"")
.endWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"")
.address("在【" + warehouseName + "】入库")
.brand(BrandEnums.getByValue(distributionParcelListEntity.getBrandName()))
.main(JSONUtil.toJsonStr(main))
.node(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE)
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.warehouseName(warehouseName)
.waybillNumber(parcelListEntity.getWaybillNumber())
.destinationWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"")
.waybillStartWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getSendWarehouseName():"")
.orderCode(orderCode)
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
}
} catch (Exception e) {
log.error("入库推送失败:{}", e);
}
carsLoadAsyncService.sendFactoryData(orderCode,orderPackageCode,warehouseId,warehouseName);
} catch (Exception e) {
log.warn("#########卸车存入日志失败");
}
JSONObject jsonObject = trunklineCarsLoadScanService.findUnloadNumAudio(loadId,warehouseId);
Integer totalUnloadNum = jsonObject.getInteger("totalUnloadNum");
Integer abnormalUnloadNum = jsonObject.getInteger("abnormalUnloadNum");
// Integer abnormalUnloadNum = jsonObject.getInteger("abnormalUnloadNum");
StringBuilder audio = new StringBuilder();
audio.append("卸车").append(totalUnloadNum).append("件");
// if(!Objects.isNull(abnormalUnloadNum) && !abnormalUnloadNum.equals(0)){
@ -11068,7 +11347,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadAsyncService.sendReportPackageUnloadData(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,carsLoadEntity,orderPackageCodeList);
if (isData == 0) {
return Resp.scanSuccess("卸车成功", "系统无编码");
return Resp.fail(4005,"系统无编码");
}
return Resp.scanSuccess("卸车成功", audio.toString());
}

20
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java

@ -99,6 +99,26 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
}
@Override
public R orderScanOrderPackageCodeSyncJd(Map<String, Object> map) {
Long trayId = (Long) map.get("trayId");
String trayType = (String) map.get("trayType");
String trayCode = (String) map.get("trayCode");
String trayName = (String) map.get("trayName");
Long warehouseId = (Long) map.get("warehouseId");
String orderPackageCode = (String) map.get("orderPackageCode");
try{
return warehouseTrayTypeService.orderScanOrderPackageCodeSyncJd(trayId,trayType, trayCode,trayName, orderPackageCode, warehouseId);
}catch (Exception e){
log.warn("############orderScanOrderPackageCodeReturnR: orderPackageCode={} 打托异常",orderPackageCode);
return R.fail(405,"打托异常 orderPackageCode="+orderPackageCode);
}
}
@Override
public boolean enterZeroOrderByTrayCode(Map<String, Object> map) {
String trayType = (String) map.get("trayType");

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -26,6 +26,7 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R orderScanOrderPackageCode(String trayType, String trayCode, String orderPackageCode,Long warehouseId,String remark);
R orderScanOrderPackageCodeSync(String trayType, String trayCode, String orderPackageCode, Long warehouseId);
R orderScanOrderPackageCodeSyncJd(Long trayId,String trayType, String trayCode,String trayName, String orderPackageCode, Long warehouseId);
R deleteScanOrderPackageCode(String trayCode, List<String> orderPackageCodes,Long warehouseId);

228
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -1040,6 +1040,234 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
return R.success("解绑成功");
}
@Override
public R orderScanOrderPackageCodeSyncJd(Long trayId,String trayType, String trayCode,String trayName, String orderPackageCode, Long warehouseId) {
QueryWrapper<WarehouseTrayGoodsEntity> qw = new QueryWrapper<>();
qw.eq("association_value", orderPackageCode);
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(qw);
if (!Objects.isNull(trayGoodsEntity)) {
String oldTrayCode = trayGoodsEntity.getTrayCode();
if (oldTrayCode.equals(trayCode)) {
log.warn("##############orderScanOrderPackageCode: 该包条已打托 trayCode={}", trayCode);
return R.fail(4001, "该包条已打托");
}
log.warn("#########orderScanOrderPackageCode: 包件已打托 orderPackageCode={}", orderPackageCode);
// 需要告知这个托盘名称
BasicdataTrayEntity trayByTray = basicdataTrayClient.getTrayByTrayCode(oldTrayCode);
if(!Objects.isNull(trayByTray)){
return R.fail(4002, "包件已在"+trayByTray.getPalletName()+"进行打托");
}else{
return R.fail(4002, "包件已在"+trayGoodsEntity.getTrayCode()+"进行打托");
}
}
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
if (Objects.isNull(parcelListEntity)) {
log.warn("##############orderScanOrderPackageCodeSyncJd: 包件不存在 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return R.fail(2001, "包件不在当前仓");
}
String orderCode = parcelListEntity.getOrderCode();//订单自编码
Integer conditions = parcelListEntity.getConditions();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (Objects.isNull(stockArticleEntity)) {
log.warn("#########orderScanOrderPackageCodeSyncJd: 未找到订单信息 orderCode={} warehouseId={}", orderCode, warehouseId);
return R.fail(2001, "未找到订单信息");
}
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_code", trayCode)
.eq("is_deleted", 0);
WarehouseTrayTypeEntity trayTypeEntity = baseMapper.selectOne(queryWrapper);
if (Objects.isNull(trayTypeEntity)) {
//如果为空则该托盘为空
//第一次存入数据
trayTypeEntity = saveTrayTypeByOrderPackageCode(trayType, trayCode, trayId, parcelListEntity, stockArticleEntity, warehouseId);
}
String filterValue = trayTypeEntity.getFilterValue();
String tt = trayTypeEntity.getTrayType();
if(!tt.equals(trayType)){
log.warn("#########orderScanOrderPackageCodeSyncJd: 打托方式不正确 orderCode={} warehouseId={}", orderCode, warehouseId);
return R.fail(2001, "打托方式不正确");
}
if (StringUtil.isBlank(filterValue)) {
if ("10".equals(trayType)) {//服务号
trayTypeEntity.setFilterValue(stockArticleEntity.getServiceNumber());
} else if ("20".equals(trayType)) {//订单自编号
trayTypeEntity.setFilterId(stockArticleEntity.getId());
trayTypeEntity.setFilterValue(stockArticleEntity.getOrderCode());
} else if ("30".equals(trayType)) {//商场
Long mallId = stockArticleEntity.getMallId();
if (!Objects.isNull(mallId)) {
trayTypeEntity.setFilterId(stockArticleEntity.getMallId());
trayTypeEntity.setFilterValue(stockArticleEntity.getMallName());
} else {
String dealerName = stockArticleEntity.getDealerName();
String brand = stockArticleEntity.getBrand();
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
if (!Objects.isNull(clientId)) {
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if (Objects.isNull(basicdataClientEntity)) {
log.error("#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}", clientId);
throw new CustomerException(405, "未找到三方商场对应的汇通商场");
}
trayTypeEntity.setFilterId(basicdataClientEntity.getId());
trayTypeEntity.setFilterValue(basicdataClientEntity.getClientName());
} else {
trayTypeEntity.setFilterValue(dealerName);
}
}
} else if ("40".equals(trayType)) {//门店
trayTypeEntity.setFilterId(stockArticleEntity.getStoreId());
trayTypeEntity.setFilterValue(stockArticleEntity.getStoreName());
} else if ("50".equals(trayType)) {//客户
trayTypeEntity.setFilterValue(stockArticleEntity.getCustomerName() + stockArticleEntity.getCustomerTelephone());
}
updateById(trayTypeEntity);
}
boolean chuanFlag = false;
String msg = "";
if ("10".equals(tt)) {//服务号
String serviceNumber = stockArticleEntity.getServiceNumber();
if (!filterValue.equals(serviceNumber)) {
chuanFlag = true;
msg = "服务号" + filterValue;
}
} else if ("20".equals(tt)) {//订单自编号
String oc = stockArticleEntity.getOrderCode();
if (!filterValue.equals(oc)) {
chuanFlag = true;
msg = "订单自编号" + filterValue;
}
} else if ("30".equals(tt)) {//商场
Long mallId = stockArticleEntity.getMallId();
String mallName = null;
if (!Objects.isNull(mallId)) {
mallName = stockArticleEntity.getMallName();
} else {
String dealerName = stockArticleEntity.getDealerName();
String brand = stockArticleEntity.getBrand();
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
if (!Objects.isNull(clientId)) {
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if (Objects.isNull(basicdataClientEntity)) {
log.error("#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}", clientId);
throw new CustomerException(405, "未找到三方商场对应的汇通商场");
}
mallName = basicdataClientEntity.getClientName();
} else {
mallName = dealerName;
}
}
if (!filterValue.equals(mallName)) {
chuanFlag = true;
msg = "商场" + filterValue;
}
} else if ("40".equals(tt)) {//门店
Long storeId = stockArticleEntity.getStoreId();
String storeName = stockArticleEntity.getStoreName();
if (!filterValue.equals(storeName)) {
chuanFlag = true;
msg = "门店" + filterValue;
}
} else if ("50".equals(tt)) {//客户
String customerName = stockArticleEntity.getCustomerName();
String customerTelephone = stockArticleEntity.getCustomerTelephone();
if (!filterValue.equals(customerName + customerTelephone)) {
chuanFlag = true;
msg = "客户" + filterValue;
}
} else if ("60".equals(tt)) {//仓库
String warehouse = null;
String waybillNumber = parcelListEntity.getWaybillNumber();
if (StringUtil.isBlank(waybillNumber)) {
//如果运单为空则去找有没有对应的dealName是否有对应的维护的商场信息
String brand = stockArticleEntity.getBrand();
String dealerName = parcelListEntity.getDealerName();
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
if (!Objects.isNull(clientId)) {
BasicdataStorageServicesEntity storageServicesEntity = basicdataStorageServicesClient.findEntityBySendWarehouseIdAndClientId(warehouseId, clientId);
if (!Objects.isNull(storageServicesEntity)) {
warehouse = storageServicesEntity.getServeWarehouseName();
} else {
warehouse = "";
}
} else {
warehouse = "";
}
} else {
WarehouseWaybillEntity waybillEntity = warehouseWaybillService.findByWaybillNo(waybillNumber);
if (!Objects.isNull(waybillEntity)) {
warehouse = waybillEntity.getDestinationWarehouseName();
} else {
warehouse = "";
}
}
if (!filterValue.equals(warehouse)) {
chuanFlag = true;
msg = "仓库" + filterValue;
}
}
//修改打托方式上的值
// changeTotalNumByTrayTypeId(parcelListEntity,trayTypeEntity.getId(),1);//addSub 1加 2减
if (chuanFlag) {
//存入包件与托盘绑定关系表
warehouseTrayGoodsService.saveEntityPackage(parcelListEntity, trayTypeEntity, "1", "1", "分拣打托:扫码分拣", "1");
} else {
//存入包件与托盘绑定关系表
warehouseTrayGoodsService.saveEntityPackage(parcelListEntity, trayTypeEntity, "0", "1", "分拣打托:扫码分拣", "1");
}
//添加上拖日志表
// warehouseTrayGoodsLogService.saveLogPackage(parcelListEntity,trayTypeEntity,"1","分拣打托:扫码分拣","1");
//更新打托方式上的值
updateNumByTrayTypeId(trayTypeEntity);
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType", 1);
jsonObject.put("operation", 1);
jsonObject.put("conditions", conditions);
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
jsonObject.put("orderPackageCodes", orderPackageCodes);
jsonObject.put("warehouseId", warehouseId);
jsonObject.put("trayName", trayName);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.TRAYTYPE.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
if (CollUtil.isNotEmpty(orderPackageCodes)) {
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
String warehouseName = warehouseEntity.getName();
String content = "包件在 " + warehouseName + " 打托,托盘 " + trayName;
warehousePackageTrackLogService.addBatchLog(new ArrayList<>(orderPackageCodes), content, warehouseId, warehouseName, AuthUtil.getNickName(), WorkNodeEnums.SORTING_TRAYS.getCode());
}
} catch (Exception e) {
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
redis.del(RedisKeyConstant.BUSINESS_IN_CARNUMBER + trayCode);
redis.del(RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + trayCode);
if (chuanFlag) {
log.warn("#########orderScanOrderPackageCode: 不属于同一个" + msg + " 串货 filterValue={} orderPackageCode={}", filterValue, orderPackageCode);
JSONObject jsonObject = new JSONObject();
jsonObject.put("audio", "串货");
return R.data(jsonObject.toJSONString());
} else {
return R.success("打托成功");
}
}
@Override
public R orderScanOrderPackageCodeSync(String trayType, String trayCode, String orderPackageCode, Long warehouseId) {

Loading…
Cancel
Save