From 9f43ee66e8fa2e0d02945f4bdd40d9c3a53a4bd7 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期六, 24 一月 2026 13:41:13 +0800
Subject: [PATCH] lsh#
---
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java | 49 +++++++++++++++++++++++++++++++------------------
1 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java
index a691ff0..a40715c 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java
@@ -10,7 +10,10 @@
import com.vincent.rsf.server.manager.entity.*;
import com.vincent.rsf.server.manager.enums.LocStsType;
import com.vincent.rsf.server.manager.enums.PakinIOStatus;
+import com.vincent.rsf.server.manager.enums.StationTypeEnum;
+import com.vincent.rsf.server.manager.enums.TaskType;
import com.vincent.rsf.server.manager.service.*;
+import com.vincent.rsf.server.manager.service.impl.DeviceSiteServiceImpl;
import com.vincent.rsf.server.manager.utils.LocManageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -35,6 +38,8 @@
private TaskService taskService;
@Autowired
private BasContainerService basContainerService;
+ @Autowired
+ private DeviceSiteServiceImpl deviceSiteService;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -55,6 +60,14 @@
return R.error("鏉$爜鏈壘鍒板搴旇鍒�");
}
return R.ok();
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public boolean AGVBindAndInTaskStart(String barcode, String sta) {
+ //楠岃瘉鏉$爜
+ checkStaStatus(barcode,sta);
+ return true;
}
@Override
@@ -97,17 +110,26 @@
String sta = waitPakinPda.getStaNo();
String area = waitPakinPda.getArea();
if (Cools.isEmpty(sta)) {
- throw new CoolException("鎺ラ┏浣嶆潯鐮佷笉鑳戒负绌�");
+ throw new CoolException("璧风偣涓嶈兘涓虹┖");
}
if (Cools.isEmpty(area)) {
throw new CoolException("鐩爣搴撳尯涓嶈兘涓虹┖");
}
+
+ DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
+ .eq(DeviceSite::getSite, sta)
+ .eq(DeviceSite::getAreaIdEnd, Long.parseLong(area))
+ .eq(DeviceSite::getType, TaskType.TASK_TYPE_IN.type).last("limit 1"));
+ if (Cools.isEmpty(deviceSite)) {
+ throw new CoolException("鏃犲彲鐢ㄨ矾寰勶紒锛�");
+ }
+
BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
.eq(BasStation::getStationName, sta)
.eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_F.type)
);
if (Cools.isEmpty(basStation)) {
- throw new CoolException("鏈壘鍒版帴椹崇珯鐐逛俊鎭紝璇锋鏌ョ珯鐐圭姸鎬�");
+ throw new CoolException("鏈壘鍒拌捣鐐圭珯鐐逛俊鎭紝璇锋鏌ョ珯鐐圭姸鎬�");
}
if (Cools.isEmpty(basStation.getBarcode())) {
throw new CoolException("鏁版嵁閿欒锛屾帴椹崇珯鏃犳潯鐮佷俊鎭�");
@@ -121,7 +143,7 @@
}
String targetLoc = LocManageUtil.getTargetLoc(Long.parseLong(area));
- taskService.generateAGVTasks(waitPakin, targetLoc, sta, loginUserId);
+ taskService.generateAGVTasks(waitPakin, targetLoc, sta, deviceSite.getTarget(),loginUserId);
basStation.setUseStatus(LocStsType.LOC_STS_TYPE_R.type);
if (!basStationService.updateById(basStation)) {
@@ -235,15 +257,9 @@
throw new CoolException("瀹瑰櫒鐮佷笉鑳戒负绌�");
}
if (Cools.isEmpty(sta)) {
- throw new CoolException("鎺ラ┏浣嶆潯鐮佷笉鑳戒负绌�");
+ throw new CoolException("绔欑偣淇℃伅涓嶈兘涓虹┖");
}
- WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>()
- .eq(WaitPakin::getBarcode, barcode)
- .eq(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_DONE.val)
- );
- if (Cools.isEmpty(waitPakin)) {
- throw new CoolException("瀹瑰櫒鐮佹湭鎵惧埌缁勬墭淇℃伅,璇锋鏌ョ粍鎵樼姸鎬�");
- }
+
BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
.eq(BasStation::getBarcode, barcode)
, false
@@ -256,9 +272,6 @@
);
if (Cools.isEmpty(basStation)) {
throw new CoolException("鏈壘鍒扮珯鐐逛俊鎭�");
- }
- if (!basStation.getUseStatus().equals("O")) {
- throw new CoolException("绔欑偣鐘舵�佷笉涓虹┖闂�");
}
if (!Cools.isEmpty(basStation.getContainerType())) {
List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class);
@@ -274,9 +287,6 @@
break; // 鎵惧埌鍖归厤鐨勫氨閫�鍑哄惊鐜�
}
}
-// boolean matches = containers.stream()
-// .map(BasContainer::getCodeType)
-// .anyMatch(codeType -> barcode.matches(codeType));
if (!matches) {
throw new CoolException("鏉$爜涓庣珯鐐逛笉鍖归厤");
}
@@ -315,6 +325,9 @@
}
if (!basStation.getUseStatus().equals("O")) {
throw new CoolException("绔欑偣鐘舵�佷笉涓虹┖闂�");
+ }
+ if (basStation.getType().equals(StationTypeEnum.STATION_TYPE_MUTI.type)) {
+ throw new CoolException("绔欑偣涓哄厜鐢电珯鐐癸紝绂佹鍛煎彨AGV");
}
List<String> areaList = JSONObject.parseArray(basStation.getCrossZoneArea(), String.class);
@@ -389,7 +402,7 @@
// .map(BasContainer::getCodeType)
// .anyMatch(codeType -> barcode.matches(codeType));
if (!matches) {
- throw new CoolException("瀹瑰櫒涓庣珯鐐逛笉鍖归厤");
+ return false;
}
return true;
--
Gitblit v1.9.1