From e711c834aec2293c53b07efe53e81e3573c289b6 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期三, 01 四月 2026 11:42:44 +0800
Subject: [PATCH] lsh#
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
index 875e6d4..2c4bfe5 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -28,6 +28,7 @@
import com.vincent.rsf.server.manager.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vincent.rsf.server.manager.utils.LocManageUtil;
+import com.vincent.rsf.server.manager.utils.WarehouseLocationRetrievalUtil;
import com.vincent.rsf.server.system.constant.GlobalConfigCode;
import com.vincent.rsf.server.system.constant.SerialRuleCode;
import com.vincent.rsf.server.manager.enums.LocStsType;
@@ -131,7 +132,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
- public synchronized R generateAGVTasks(WaitPakin pakins, String locCode, String orgSta,String targSite, Long loginUserId) {
+ public synchronized R generateAGVTasks(WaitPakin pakins, String locCode, String orgSta, Long loginUserId,String areaId) {
if (Cools.isEmpty(pakins) || Cools.isEmpty(locCode)) {
throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
@@ -201,6 +202,10 @@
throw new CoolException("浠诲姟鏄庣粏淇濆瓨澶辫触锛侊紒");
}
waitPakinItems.forEach(item -> {
+ boolean b = new WarehouseLocationRetrievalUtil().retrieveMatnrIsItAvailable(areaId, item.getMatnrId());
+ if (!b){
+ throw new CoolException("鍏ュ簱澶辫触锛侊紒鐗╂枡Id:"+item.getMatnrId()+"涓嶆敮鎸佹鐩爣搴撳尯锛�"+areaId);
+ }
if (!waitPakinItemService.update(new LambdaUpdateWrapper<WaitPakinItem>()
.set(WaitPakinItem::getWorkQty, item.getAnfme())
.eq(WaitPakinItem::getId, item.getId()))) {
@@ -307,11 +312,11 @@
throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
- DeviceSite deviceSite = deviceSiteService.getById(waitPakin.getSiteId());
- if (Objects.isNull(deviceSite)) {
- throw new CoolException("绔欑偣涓嶅瓨鍦紒锛�");
- }
- DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(deviceSite.getSite()));
+// DeviceSite deviceSite = deviceSiteService.getById();
+// if (Objects.isNull(deviceSite)) {
+// throw new CoolException("绔欑偣涓嶅瓨鍦紒锛�");
+// }
+ DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(waitPakin.getSiteNo()));
if (Cools.isEmpty(deviceBind)) {
throw new CoolException("搴撲綅瑙勫垯鏈煡");
}
@@ -336,7 +341,7 @@
// }
//楠岃瘉鍩虹淇℃伅
- checkStaStatus(pakin.getBarcode(), deviceSite.getSite(),warehouseArea.getId().toString());
+ checkStaStatus(pakin.getBarcode(),waitPakin.getSiteNo(),warehouseArea.getId().toString());
/**鑾峰彇搴撲綅*/
String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), null);
if (Cools.isEmpty(targetLoc)) {
@@ -355,8 +360,8 @@
.setResource(TaskResouceType.TASK_RESOUCE_PAKIN_TYPE.val)
.setTargLoc(targetLoc)
.setBarcode(pakin.getBarcode())
- .setOrgSite(deviceSite.getSite())
- .setTargSite(deviceSite.getDeviceSite())
+ .setOrgSite(waitPakin.getSiteNo())
+ .setTargSite(waitPakin.getSiteNo())
.setCreateBy(loginUserId)
.setUpdateBy(loginUserId);
// if (!Objects.isNull(waitPakin.getSiteId()) && waitPakin.getSiteId() > 0) {
@@ -380,7 +385,7 @@
throw new CoolException("浠诲姟淇濆瓨澶辫触锛侊紒");
}
BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
- .eq(BasStation::getStationName, deviceSite.getSite()));
+ .eq(BasStation::getStationName, waitPakin.getSiteNo()));
if (Objects.isNull(station) || !station.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) {
throw new CoolException("绔欑偣涓嶅瓨鍦ㄦ垨绔欑偣涓嶅浜庣┖搴撶姸鎬侊紒锛�");
}
--
Gitblit v1.9.1