|
|
|
@ -34,6 +34,7 @@ import com.shkj.wms.service.IBaseGoodsDataService; |
|
|
|
import com.shkj.wms.service.IBusinDataTaskService; |
|
|
|
import com.shkj.wms.service.IBusinDataTaskService; |
|
|
|
import com.shkj.wms.service.IPutInOutStorageService; |
|
|
|
import com.shkj.wms.service.IPutInOutStorageService; |
|
|
|
import com.shkj.wms.utils.JsonUtil; |
|
|
|
import com.shkj.wms.utils.JsonUtil; |
|
|
|
|
|
|
|
import io.lettuce.core.dynamic.domain.Timeout; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -384,7 +385,11 @@ public class PlcEventTask { |
|
|
|
// containerCode=containerCode.substring(0,containerCode.length()-1);
|
|
|
|
// containerCode=containerCode.substring(0,containerCode.length()-1);
|
|
|
|
log.info("治具编号" + containerCode + "first:" + firstBarcode + "second:" + secondBarcode + "third:" + thirdBarcode); |
|
|
|
log.info("治具编号" + containerCode + "first:" + firstBarcode + "second:" + secondBarcode + "third:" + thirdBarcode); |
|
|
|
//连续读到相同治具编号时不生成新任务
|
|
|
|
//连续读到相同治具编号时不生成新任务
|
|
|
|
String redisContainerCode = redisTemplate.opsForValue().get("autoTask").toString(); |
|
|
|
Object autoTask = redisTemplate.opsForValue().get("autoTask"); |
|
|
|
|
|
|
|
String redisContainerCode=""; |
|
|
|
|
|
|
|
if (autoTask != null){ |
|
|
|
|
|
|
|
redisContainerCode = autoTask.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
if (redisContainerCode.equals(containerCode)) { |
|
|
|
if (redisContainerCode.equals(containerCode)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -426,7 +431,7 @@ public class PlcEventTask { |
|
|
|
log.info("生成新任务:" + taskId + "治具编号:" + containerCode); |
|
|
|
log.info("生成新任务:" + taskId + "治具编号:" + containerCode); |
|
|
|
scheduledTasks.inTask(taskId, one.getId()); |
|
|
|
scheduledTasks.inTask(taskId, one.getId()); |
|
|
|
if (ObjectUtils.isNotEmpty(taskId)) { |
|
|
|
if (ObjectUtils.isNotEmpty(taskId)) { |
|
|
|
redisTemplate.opsForValue().set("autoTask", containerCode); |
|
|
|
redisTemplate.opsForValue().set("autoTask", containerCode,5,TimeUnit.MINUTES); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|