From 5879527ed5b7349ce7fd7cd3fe92c81307646b21 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期五, 19 九月 2025 11:09:23 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java index 196d4f0..d24beac 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -35,12 +35,10 @@ import com.zy.core.properties.SlaveProperties; import com.zy.core.thread.BarcodeThread; import com.zy.core.thread.SiemensDevpThread; -import com.zy.system.service.ConfigService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.io.IOException; @@ -53,7 +51,6 @@ */ @Slf4j @Service("mainService") -@Transactional public class MainServiceImpl { public static final long COMMAND_TIMEOUT = 5 * 1000; @@ -166,8 +163,34 @@ continue; } + StaDesc staDesc2 = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("type_no", 1).eq("stn_no", staProtocol.getSiteId())); + List<TaskWrk> taskWrkOutList = taskWrkService.selectList(new EntityWrapper<TaskWrk>() + .eq("crn_no", staDesc2.getCrnNo()) + .eq("wrk_sts", 12) + ); + if (!taskWrkOutList.isEmpty()) { + News.watchInfo(String.valueOf(staProtocol.getSiteId()), "鐢宠鍏ュ簱浠诲姟鏃跺彂鐜版鍦ㄦ墽琛岀殑鍑哄簱浠诲姟,鍏ュ簱浠诲姟琚己鍒堕��鍥�"); + + staProtocol.setWorkNo(9997); + staProtocol.setStaNo(inSta.getBackSta().shortValue()); + MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); + continue; + } + TaskWrk taskWrk1 = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", barcode)); if (taskWrk1 != null) { + if (staProtocol.getWorkNo() == 9999) { + Object object = redisUtil.get(RedisKeyType.IN_TASK_LOCK.key + inSta.getStaNo()); + if(object != null) { + continue; + } + StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() + .eq("crn_no", taskWrk1.getCrnNo()).eq("type_no", 1).eq("stn_no", staProtocol.getSiteId())); + staProtocol.setWorkNo(taskWrk1.getWrkNo()); + staProtocol.setStaNo(staDesc.getCrnStn().shortValue()); + MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); + redisUtil.set(RedisKeyType.IN_TASK_LOCK.key, "lock", 10); + } News.watchInfo(String.valueOf(staProtocol.getSiteId()), "鎵樼洏鐮侊細" + barcode + "浠诲姟妗e瓨鍦�"); continue; } @@ -205,9 +228,9 @@ } else if (jsonObject.getInteger("code") == 500) { News.watchInfo(String.valueOf(staProtocol.getSiteId()), "鏉$爜锛�" + barcode + "鐢宠WMS澶辫触,绯荤粺鍥為��,response=" + JSON.toJSONString(jsonObject)); -// staProtocol.setWorkNo(9997); -// staProtocol.setStaNo(inSta.getBackSta().shortValue()); -// MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); + staProtocol.setWorkNo(9997); + staProtocol.setStaNo(inSta.getBackSta().shortValue()); + MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); continue; }else { News.watchInfo(String.valueOf(staProtocol.getSiteId()), "鏉$爜锛�" + barcode + "鐢宠WMS澶辫触,response=" + JSON.toJSONString(jsonObject)); -- Gitblit v1.9.1