Browse Source

1.干线bug修复

dev
zhenghaoyu 2 months ago
parent
commit
e2d1b20b22
  1. 54
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  2. 18
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/DataInWarehouseListener.java
  3. 309
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

54
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java

@ -1,6 +1,7 @@
package com.logpm.aftersales.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -26,10 +27,12 @@ import com.logpm.trunkline.dto.ZeroPackageDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity;
import com.logpm.trunkline.feign.*;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.PackageData;
@ -73,6 +76,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
private final ITrunklineScanZeroDetailClient scanZeroDetailClient;
private final IAftersalesAyscService aftersakesAyscService;
private final ITrunklinePackageTrackLogClient iTrunklinePackageTrackLogClient;
@Override
public R findPageList(AbnormalRecordDTO abnormalRecordDTO) {
@ -111,6 +115,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
abnormalRecordDTO.setWarehouseId(myCurrentWarehouse.getId());
abnormalRecordDTO.setWarehouseName(myCurrentWarehouse.getName());
}
// Long abnormalRecordId = abnormalRecordDTO.getAbnormalRecordId();
List<Long> abnormalRecordIds = abnormalRecordDTO.getAbnormalRecordIds();
@ -137,6 +142,18 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
//删除装车异常数据
trunklineCarsLoadScanClient.removeLoadScanById(carsLoadScanId);
WarehousePackageTrackLogEntity warehousePackageTrackLogEntity = new WarehousePackageTrackLogEntity();
warehousePackageTrackLogEntity.setOrderPackageCode(orderPackageCode);
warehousePackageTrackLogEntity.setWarehouseId(abnormalRecordDTO.getWarehouseId());
warehousePackageTrackLogEntity.setWarehouseName(abnormalRecordDTO.getWarehouseName());
warehousePackageTrackLogEntity.setWorkNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode());
warehousePackageTrackLogEntity.setContent("异常处理已确认为无效包条码");
warehousePackageTrackLogEntity.setOperator(AuthUtil.getNickName());
List<JSONObject> ls = new ArrayList<>();
ls.add(JSON.parseObject(JSON.toJSONString(warehousePackageTrackLogEntity)));
iTrunklinePackageTrackLogClient.addPackageTrackLog(ls);
}else if(dealType.equals(2)){
//暂存单入库
R r = trunklineCarsLoadScanClient.incomingPackage(carsLoadScanId);
@ -150,14 +167,37 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
orderPackageCodeList.add(orderPackageCode);
aftersakesAyscService.sendReportPackageUnloadData(AuthUtil.getNickName(),AuthUtil.getUserId(),myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),abnormalRecordEntity,orderPackageCodeList);
WarehousePackageTrackLogEntity warehousePackageTrackLogEntity = new WarehousePackageTrackLogEntity();
warehousePackageTrackLogEntity.setOrderPackageCode(orderPackageCode);
warehousePackageTrackLogEntity.setWarehouseId(abnormalRecordDTO.getWarehouseId());
warehousePackageTrackLogEntity.setWarehouseName(abnormalRecordDTO.getWarehouseName());
warehousePackageTrackLogEntity.setWorkNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode());
warehousePackageTrackLogEntity.setContent("异常处理系统数据同步入库");
warehousePackageTrackLogEntity.setOperator(AuthUtil.getNickName());
List<JSONObject> ls = new ArrayList<>();
ls.add(JSON.parseObject(JSON.toJSONString(warehousePackageTrackLogEntity)));
iTrunklinePackageTrackLogClient.addPackageTrackLog(ls);
}
}else if("4".equals(abnormalType)){
Integer dealType = abnormalRecordDTO.getDealType();
Long carsLoadScanId = abnormalRecordEntity.getAssociationId();
String orderPackageCode = abnormalRecordEntity.getOrderPackageCode();
String carsNo = abnormalRecordEntity.getCarsNo();
if(dealType.equals(3)){
//本车次少货
abnormalRecordEntity.setRemark("本车次少货("+upWarehouseName+" "+AuthUtil.getNickName()+")");
abnormalRecordEntity.setRemark(carsNo+"本车次少货("+upWarehouseName+" "+AuthUtil.getNickName()+")");
WarehousePackageTrackLogEntity warehousePackageTrackLogEntity = new WarehousePackageTrackLogEntity();
warehousePackageTrackLogEntity.setOrderPackageCode(orderPackageCode);
warehousePackageTrackLogEntity.setWarehouseId(abnormalRecordDTO.getWarehouseId());
warehousePackageTrackLogEntity.setWarehouseName(abnormalRecordDTO.getWarehouseName());
warehousePackageTrackLogEntity.setWorkNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode());
warehousePackageTrackLogEntity.setContent("异常处理"+carsNo+"本车次少货");
warehousePackageTrackLogEntity.setOperator(AuthUtil.getNickName());
List<JSONObject> ls = new ArrayList<>();
ls.add(JSON.parseObject(JSON.toJSONString(warehousePackageTrackLogEntity)));
iTrunklinePackageTrackLogClient.addPackageTrackLog(ls);
}else if(dealType.equals(4)){
Long warehouseId = abnormalRecordEntity.getWarehouseId();
@ -175,6 +215,18 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
orderPackageCodeList.add(orderPackageCode);
aftersakesAyscService.sendReportPackageUnloadData(AuthUtil.getNickName(),AuthUtil.getUserId(),myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),abnormalRecordEntity,orderPackageCodeList);
WarehousePackageTrackLogEntity warehousePackageTrackLogEntity = new WarehousePackageTrackLogEntity();
warehousePackageTrackLogEntity.setOrderPackageCode(orderPackageCode);
warehousePackageTrackLogEntity.setWarehouseId(abnormalRecordDTO.getWarehouseId());
warehousePackageTrackLogEntity.setWarehouseName(abnormalRecordDTO.getWarehouseName());
warehousePackageTrackLogEntity.setWorkNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode());
warehousePackageTrackLogEntity.setContent("异常处理包件已入库");
warehousePackageTrackLogEntity.setOperator(AuthUtil.getNickName());
List<JSONObject> ls = new ArrayList<>();
ls.add(JSON.parseObject(JSON.toJSONString(warehousePackageTrackLogEntity)));
iTrunklinePackageTrackLogClient.addPackageTrackLog(ls);
}
}else if("5".equals(abnormalType)){

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

@ -2,15 +2,7 @@ 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
@ -19,11 +11,11 @@ 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)
// @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);
}

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

@ -9839,6 +9839,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
InComingDTO inComingDTO = new InComingDTO();
inComingDTO.setOrderPackageCode(scanCode);
inComingDTO.setWarehouseId(unloadNodeId);
inComingDTO.setIncomingType(IncomingTypeEnum.SYNC_INCOMING.getCode());
R r = inComingService.incomingPackage(inComingDTO);
int code = r.getCode();
if (code != 200) {
@ -10357,169 +10358,169 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String waybillNo = trunklineCarsLoadScan.getWaybillNo();
String orderCode = trunklineCarsLoadScan.getOrderCode();
String loadCode = trunklineCarsLoadScan.getLoadCode();
//
// BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
// if(Objects.isNull(warehouseEntity)){
// log.warn("###############adnormalHasStock: 仓库信息不存在");
// return R.fail(405, "仓库信息不存在");
// }
// String warehouseName = warehouseEntity.getName();
//
// List<TrunklineCarsLoadScanEntity> carsLoadScanEntities = new ArrayList<>();
// carsLoadScanEntities.add(trunklineCarsLoadScan);
// //把carsLoadScanEntities中所有元素的scanCode放入一个Set集合
// Set<String> scanCodeSet = carsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toSet());
//
// log.info("###############adnormalHasStock: 当前同步的数据 {}",scanCodeSet);
//
// List<String> scanCodeList = new ArrayList<>(scanCodeSet);
//
// List<TrunklineAdvanceDetailEntity> allAdvanceDetailList = new ArrayList<>();
//
// int packageBatchSize = 500;
// List<List<String>> orderPackageCodeGroups = new ArrayList<>();
//
// for (int i = 0; i < scanCodeList.size(); i += packageBatchSize) {
// int endIndex = Math.min(i + packageBatchSize, scanCodeList.size());
// orderPackageCodeGroups.add(scanCodeList.subList(i, endIndex));
// }
//
// orderPackageCodeGroups.forEach(orderPackageCodeGroup -> {
// List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = trunklineAdvanceDetailService.findListByOrderPackageCodeList(orderPackageCodeGroup);
// allAdvanceDetailList.addAll(advanceDetailEntityList);
// });
//
// //把allAdvanceDetailList转化成orderPackageCode为key的Map
// Map<String, TrunklineAdvanceDetailEntity> advanceDetailMap = allAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity()));
//
// List<TrunklineCarsLoadScanEntity> updateScanList = new ArrayList<>();
// List<TrunklineAdvanceDetailEntity> incomingAdvanceDetailList = new ArrayList<>();
// List<TrunklineAdvanceDetailEntity> udateAdvanceDetailList = new ArrayList<>();
// Set<String> orderPackageCodeSet = new HashSet<>();
//
// carsLoadScanEntities.forEach(carsLoadScanEntity -> {
// String orderPackageCode = carsLoadScanEntity.getScanCode();
// TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailMap.get(orderPackageCode);
// if(!Objects.isNull(trunklineAdvanceDetailEntity)){
// orderPackageCodeSet.add(orderPackageCode);
// TrunklineCarsLoadScanEntity updateScanEntity = new TrunklineCarsLoadScanEntity();
// updateScanEntity.setId(carsLoadScanEntity.getId());
//
// String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus();
// if(packageStatus.equals("0")){
// updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getWarehouseId());
// incomingAdvanceDetailList.add(trunklineAdvanceDetailEntity);
// }else{
// updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId());
// udateAdvanceDetailList.add(trunklineAdvanceDetailEntity);
// }
// updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
// updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
// updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
// updateScanEntity.setIsData(1);
// updateScanList.add(updateScanEntity);
// }
// });
//
// if(CollUtil.isNotEmpty(incomingAdvanceDetailList)){
//
// for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : incomingAdvanceDetailList) {
// InComingDTO inComingDTO = new InComingDTO();
// inComingDTO.setOrderPackageCode(trunklineAdvanceDetailEntity.getOrderPackageCode());
// inComingDTO.setIncomingType(IncomingTypeEnum.SYNC_INCOMING.getCode());
// inComingDTO.setWarehouseId(warehouseId);
// R r = inComingService.incomingPackage(inComingDTO);
// if(r.getCode() != 200){
// throw new CustomerException(405,"入库失败");
// }
// }
// }
//
// if(CollUtil.isNotEmpty(udateAdvanceDetailList)){
// List<DistributionParcelListEntity> updateParceList = new ArrayList<>();
// udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
// String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode();
// List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatus(orderPackageCode,"20");
// //把list通过warehouseId进行分组
//
// if(CollUtil.isNotEmpty(list)){
// list.forEach(distributionParcelListEntity -> {
// DistributionParcelListEntity updateEntity = new DistributionParcelListEntity();
// updateEntity.setId(distributionParcelListEntity.getId());
// updateEntity.setOrderPackageStatus("60");
// updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode());
// updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId());
// updateParceList.add(updateEntity);
// });
// }
//
// });
// distributionParcelListClient.updateList(updateParceList);
//
// advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId);
//
// List<TrunklineAdvanceDetailEntity> updateNowWarehouseList = new ArrayList<>();
// udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
// TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity();
// updateEntity.setId(trunklineAdvanceDetailEntity.getId());
// updateEntity.setNowWarehouseId(warehouseId);
// updateEntity.setNowWarehouseName(warehouseName);
// updateNowWarehouseList.add(updateEntity);
// });
//
// trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList);
// }
//
// trunklineCarsLoadScanService.updateBatchById(updateScanList);
//
// int i= 0;
//
// //完结所有包件异常列表
// if(CollUtil.isNotEmpty(orderPackageCodeSet)){
// i = orderPackageCodeSet.size();
// DealWithAbnormalVO dealWithAbnormalVO = new DealWithAbnormalVO();
// dealWithAbnormalVO.setOrderPackageCodes(new ArrayList<>(orderPackageCodeSet));
// dealWithAbnormalVO.setCarsNo(loadCode);
// dealWithAbnormalVO.setWarehouseName(warehouseName);
// dealWithAbnormalVO.setNickName(AuthUtil.getNickName());
// dealWithAbnormalVO.setRemark("数据同步系统自动处理("+warehouseName+" "+loadCode+" "+AuthUtil.getNickName()+")");
// abnormalRecordClient.dealwithOrderPackageCodes(dealWithAbnormalVO);
// }
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("###############adnormalHasStock: 仓库信息不存在");
return R.fail(405, "仓库信息不存在");
}
String warehouseName = warehouseEntity.getName();
List<TrunklineCarsLoadScanEntity> carsLoadScanEntities = new ArrayList<>();
carsLoadScanEntities.add(trunklineCarsLoadScan);
//把carsLoadScanEntities中所有元素的scanCode放入一个Set集合
Set<String> scanCodeSet = carsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toSet());
log.info("###############adnormalHasStock: 当前同步的数据 {}",scanCodeSet);
List<String> scanCodeList = new ArrayList<>(scanCodeSet);
List<TrunklineAdvanceDetailEntity> allAdvanceDetailList = new ArrayList<>();
int packageBatchSize = 500;
List<List<String>> orderPackageCodeGroups = new ArrayList<>();
for (int i = 0; i < scanCodeList.size(); i += packageBatchSize) {
int endIndex = Math.min(i + packageBatchSize, scanCodeList.size());
orderPackageCodeGroups.add(scanCodeList.subList(i, endIndex));
}
orderPackageCodeGroups.forEach(orderPackageCodeGroup -> {
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = trunklineAdvanceDetailService.findListByOrderPackageCodeList(orderPackageCodeGroup);
allAdvanceDetailList.addAll(advanceDetailEntityList);
});
//把allAdvanceDetailList转化成orderPackageCode为key的Map
Map<String, TrunklineAdvanceDetailEntity> advanceDetailMap = allAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity()));
List<TrunklineCarsLoadScanEntity> updateScanList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> incomingAdvanceDetailList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> udateAdvanceDetailList = new ArrayList<>();
Set<String> orderPackageCodeSet = new HashSet<>();
carsLoadScanEntities.forEach(carsLoadScanEntity -> {
String orderPackageCode = carsLoadScanEntity.getScanCode();
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailMap.get(orderPackageCode);
if(!Objects.isNull(trunklineAdvanceDetailEntity)){
orderPackageCodeSet.add(orderPackageCode);
TrunklineCarsLoadScanEntity updateScanEntity = new TrunklineCarsLoadScanEntity();
updateScanEntity.setId(carsLoadScanEntity.getId());
String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus();
if(packageStatus.equals("0")){
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getWarehouseId());
incomingAdvanceDetailList.add(trunklineAdvanceDetailEntity);
if(type==1){
//包件
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, warehouseId);
if(Objects.isNull(parcelListEntity)){
log.info("#########adnormalHasStock: 包件信息不存在");
Integer unbingTray = 0;
if(StringUtil.isNotBlank(trayCode)){
unbingTray = 1;
}
unloadPackageNoXz(loadId,scanCode,warehouseId,unbingTray,IncomingTypeEnum.ABNORMAL_INCOMING.getValue(),IncomingTypeEnum.ABNORMAL_INCOMING.getCode(),null,null);
}else{
String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
if("20".equals(orderPackageStatus)){
log.warn("#########adnormalHasStock: 包件已入库 scanCode={} warehouseId={}",scanCode,warehouseId);
return R.success("包件已入库");
}else{
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId());
udateAdvanceDetailList.add(trunklineAdvanceDetailEntity);
Integer unbingTray = 0;
if(StringUtil.isNotBlank(trayCode)){
unbingTray = 1;
}
unloadPackageNoXz(loadId,scanCode,warehouseId,unbingTray,IncomingTypeEnum.ABNORMAL_INCOMING.getValue(),IncomingTypeEnum.ABNORMAL_INCOMING.getCode(),null,null);
}
updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
updateScanEntity.setIsData(1);
updateScanList.add(updateScanEntity);
}
});
if(CollUtil.isNotEmpty(incomingAdvanceDetailList)){
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : incomingAdvanceDetailList) {
InComingDTO inComingDTO = new InComingDTO();
inComingDTO.setOrderPackageCode(trunklineAdvanceDetailEntity.getOrderPackageCode());
inComingDTO.setIncomingType(IncomingTypeEnum.SYNC_INCOMING.getCode());
inComingDTO.setWarehouseId(warehouseId);
R r = inComingService.incomingPackage(inComingDTO);
if(r.getCode() != 200){
throw new CustomerException(405,"入库失败");
}
}else{
Integer unbingTray = 0;
if(StringUtil.isNotBlank(trayCode)){
unbingTray = 1;
}
}
if(CollUtil.isNotEmpty(udateAdvanceDetailList)){
List<DistributionParcelListEntity> updateParceList = new ArrayList<>();
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode();
List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatus(orderPackageCode,"20");
//把list通过warehouseId进行分组
if(CollUtil.isNotEmpty(list)){
list.forEach(distributionParcelListEntity -> {
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity();
updateEntity.setId(distributionParcelListEntity.getId());
updateEntity.setOrderPackageStatus("60");
updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode());
updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId());
updateParceList.add(updateEntity);
});
}
});
distributionParcelListClient.updateList(updateParceList);
//零担
unloadZeroNoXz(loadId,waybillNo,num,warehouseId,unbingTray,trayCode,orderCode,"异常列表入库");
advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId);
List<TrunklineAdvanceDetailEntity> updateNowWarehouseList = new ArrayList<>();
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity();
updateEntity.setId(trunklineAdvanceDetailEntity.getId());
updateEntity.setNowWarehouseId(warehouseId);
updateEntity.setNowWarehouseName(warehouseName);
updateNowWarehouseList.add(updateEntity);
});
trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList);
}
trunklineCarsLoadScanService.updateBatchById(updateScanList);
int i= 0;
//完结所有包件异常列表
if(CollUtil.isNotEmpty(orderPackageCodeSet)){
i = orderPackageCodeSet.size();
DealWithAbnormalVO dealWithAbnormalVO = new DealWithAbnormalVO();
dealWithAbnormalVO.setOrderPackageCodes(new ArrayList<>(orderPackageCodeSet));
dealWithAbnormalVO.setCarsNo(loadCode);
dealWithAbnormalVO.setWarehouseName(warehouseName);
dealWithAbnormalVO.setNickName(AuthUtil.getNickName());
dealWithAbnormalVO.setRemark("数据同步系统自动处理("+warehouseName+" "+loadCode+" "+AuthUtil.getNickName()+")");
abnormalRecordClient.dealwithOrderPackageCodes(dealWithAbnormalVO);
}
// if(type==1){
// //包件
// DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, warehouseId);
// if(Objects.isNull(parcelListEntity)){
// log.info("#########adnormalHasStock: 包件信息不存在");
// Integer unbingTray = 0;
// if(StringUtil.isNotBlank(trayCode)){
// unbingTray = 1;
// }
// unloadPackageNoXz(loadId,scanCode,warehouseId,unbingTray,IncomingTypeEnum.ABNORMAL_INCOMING.getValue(),IncomingTypeEnum.ABNORMAL_INCOMING.getCode(),null,null);
// }else{
// String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
// if("20".equals(orderPackageStatus)){
// log.warn("#########adnormalHasStock: 包件已入库 scanCode={} warehouseId={}",scanCode,warehouseId);
// return R.success("包件已入库");
// }else{
// Integer unbingTray = 0;
// if(StringUtil.isNotBlank(trayCode)){
// unbingTray = 1;
// }
// unloadPackageNoXz(loadId,scanCode,warehouseId,unbingTray,IncomingTypeEnum.ABNORMAL_INCOMING.getValue(),IncomingTypeEnum.ABNORMAL_INCOMING.getCode(),null,null);
// }
// }
// }else{
// Integer unbingTray = 0;
// if(StringUtil.isNotBlank(trayCode)){
// unbingTray = 1;
// }
// //零担
// unloadZeroNoXz(loadId,waybillNo,num,warehouseId,unbingTray,trayCode,orderCode,"异常列表入库");
//
// }
return R.success("入库成功");
}

Loading…
Cancel
Save