From ee536f9aedaf642d64ba2681778fd4e74731d00c Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期五, 16 一月 2026 16:47:28 +0800
Subject: [PATCH] lsh#空板流程
---
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java | 60 +++++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 45 insertions(+), 15 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java
index 69e3f30..8427aa3 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java
@@ -1,6 +1,8 @@
package com.vincent.rsf.server.api.service.impl;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.generator.config.IFileCreate;
import com.vincent.rsf.framework.common.Cools;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.framework.exception.CoolException;
@@ -8,11 +10,12 @@
import com.vincent.rsf.server.api.entity.params.CallForEmptyContainersParam;
import com.vincent.rsf.server.api.entity.params.ContainerWaveParam;
import com.vincent.rsf.server.api.service.PdaOutStockService;
+import com.vincent.rsf.server.common.constant.Constants;
+import com.vincent.rsf.server.manager.controller.params.LocToTaskParams;
import com.vincent.rsf.server.manager.entity.*;
-import com.vincent.rsf.server.manager.enums.AsnExceStatus;
-import com.vincent.rsf.server.manager.enums.StationTypeEnum;
-import com.vincent.rsf.server.manager.enums.TaskStsType;
+import com.vincent.rsf.server.manager.enums.*;
import com.vincent.rsf.server.manager.service.*;
+import com.vincent.rsf.server.manager.service.impl.BasContainerServiceImpl;
import lombok.Synchronized;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -41,6 +44,12 @@
private WaveOrderRelaService waveOrderRelaService;
@Autowired
private BasStationService basStationService;
+ @Autowired
+ private LocService locService;
+ @Autowired
+ private BasContainerServiceImpl basContainerService;
+ @Autowired
+ private LocItemService locItemService;
@Override
public R getOutStockTaskItem(String barcode) {
@@ -239,21 +248,42 @@
if (!basStation.getUseStatus().equals("O")) {
throw new CoolException("绔欑偣鐘舵�佷笉涓虹┖闂�");
}
- //瀹瑰櫒绫诲瀷鏌ヨ 璧风偣
- if (basStation.getType().equals(StationTypeEnum.STATION_TYPE_MUTI.type)) {
- //鍏夌數绔欑偣锛�
- Long area = basStation.getArea();
- //鏄惁闇�瑕佽浆闈炲厜鐢电珯鐐�
- //绔嬪簱鍑哄簱==銆嬬粨鏉�
- //AGV==銆嬬珛搴�==銆嬬粨鏉�
- } else {
- //闈炲厜鐢电珯鐐�
- //鏄惁闇�瑕佽浆鍏夌數绔欑偣
- //AGV==銆嬬粨鏉�
- //绔嬪簱鍑哄簱==銆婣GV==銆嬬粨鏉�
+ List<Long> areaList = JSONObject.parseArray(basStation.getCrossZoneArea(), Long.class);
+ if (Cools.isEmpty(areaList)){
+ throw new CoolException("褰撳墠绔欑偣搴撳尯鏈厤缃�");
}
+ BasContainer basContainer = basContainerService.getOne(new LambdaQueryWrapper<BasContainer>()
+ .in(BasContainer::getContainerType, containerWaveParam.getType(), false));
+ if (Cools.isEmpty(basContainer)){
+ throw new CoolException("鏈煡璇㈠埌鐩稿叧瀹瑰櫒瑙勫垯");
+ }
+ String barcodeType = "barcode REGEXP '"+basContainer.getCodeType()+"'";
+ //瀹瑰櫒绫诲瀷鏌ヨ 璧风偣
+ Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>()
+ .apply(barcodeType)
+ .eq(Loc::getDeleted, 0)
+ .eq(Loc::getStatus, 1)
+ .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_D.type)
+ .in(Loc::getAreaId, areaList)
+ .orderByDesc(Loc::getId)
+ .last("LIMIT 1"),
+ false);
+
+ if (Cools.isEmpty(loc)){
+ throw new CoolException("鏈煡璇㈠埌绗﹀悎鏉′欢鐨勬墭鐩�");
+ }
+ //鐢熸垚鐩樼偣浠诲姟鍙傛暟
+ LocToTaskParams locToTaskParams = new LocToTaskParams();
+ locToTaskParams.setType(Constants.TASK_TYPE_OUT_STOCK_EMPTY)
+ .setSiteNo(basStation.getStationName())
+ .setOrgLoc(loc.getId().toString());
+ try{
+ locItemService.generateTaskEmpty(TaskResouceType.TASK_RESOUCE_STOCK_TYPE.val,locToTaskParams,loginUserId);
+ } catch (Exception e){
+ throw new CoolException(e.getMessage());
+ }
return R.ok();
}
--
Gitblit v1.9.1