From 1bc6b15f62a2f8cfb5d2e523c8da021de325fdc5 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期日, 16 十一月 2025 16:23:14 +0800
Subject: [PATCH] 1、 钢化前大理片笼直通增加厚度过滤
---
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java | 496 ++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 363 insertions(+), 133 deletions(-)
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
index f8f60df..442fbb7 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -4,17 +4,17 @@
import cn.hutool.core.lang.Assert;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer;
import com.github.yulichang.toolkit.JoinWrappers;
import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
+import com.mes.alarm.entity.ProductAlarmInfo;
+import com.mes.alarm.service.ProductAlarmInfoService;
import com.mes.base.entity.BigStorageCageBaseInfo;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
-import com.mes.bigstorage.entity.dto.BigStorageDTO;
-import com.mes.bigstorage.entity.dto.BigStorageRelationDTO;
-import com.mes.bigstorage.entity.dto.BigStorageSequenceDTO;
-import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
+import com.mes.bigstorage.entity.dto.*;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.bigstorage.service.BigStorageGlassInfoService;
@@ -96,11 +96,30 @@
*/
private static final Integer THROUGH_SLOT = 920;
+
+ @Resource
+ private ProductAlarmInfoService productAlarmInfoService;
+
+ private static final String ALARM_MODULE = "閽㈠寲";
+ private static final String ALARM_TYPE = "閽㈠寲澶х悊鐗�";
+ private static final String ALARM_CODE_SIZE = "sizeSame";
+ private static final String ALARM_CODE_ID = "idSame";
+ private static final String ALARM_CODE_SLOT = "slotLess";
+ private static final String ALARM_CODE_OVER = "overSize";
+
@Resource
private RedisUtil redisUtil;
@Scheduled(fixedDelay = 1000)
- public void inBigStorageTask() throws Exception {
+ public void inBigStorageTask() {
+ List<ProductAlarmInfo> alarmInfos = productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>()
+ .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW)
+ .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE)
+ .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE));
+ if (CollectionUtil.isNotEmpty(alarmInfos)) {
+ log.info("鐣岄潰鎶ヨ锛岀瓑寰呬汉宸ュ共棰勫鐞�");
+ return;
+ }
S7DataDLPOne s7DataDLPOne = s7SerializerDLPOne.read(S7DataDLPOne.class);
log.info("杩涚墖浠诲姟寮�濮媨}", s7DataDLPOne);
Boolean inkageEntity = s7DataDLPOne.getMesControl();
@@ -123,16 +142,17 @@
String fromOpcUa = s7DataDLPOne.getFrom1().toString();
List<String> ids = s7DataDLPOne.getIds();
+ log.info("鑾峰彇鍒拌繘鐗囦换鍔� 鐜荤拑id锛歿}", ids);
List<String> glassIdList = new ArrayList<>();
for (int i = 0; i < 6; i++) {
String requestWord = ids.get(i);
- if (null != requestWord && !requestWord.isEmpty()) {
+ if (StringUtils.isNotBlank(requestWord)) {
+ log.info("鐜荤拑id{}鍔犲叆杩涚墖浠诲姟", requestWord);
BigStorageCageTask task = new BigStorageCageTask();
task.setGlassId(requestWord);
task.setStartSlot(Integer.parseInt(fromOpcUa));
inTaskList.add(task);
glassIdList.add(requestWord);
- continue;
}
}
if (CollectionUtil.isEmpty(inTaskList)) {
@@ -140,9 +160,9 @@
return;
}
log.info("鑾峰彇浠诲姟鐨勭幓鐠僫d锛歿}", glassIdList);
- String countEntity = s7DataDLPOne.getGlassCount().toString();
- if (null == countEntity || Integer.parseInt(countEntity) != glassIdList.size()) {
- log.info("褰撳墠澶ц溅杩涚墖鐜荤拑鏁伴噺{}涓巑es璇诲彇鍒扮殑鏁伴噺{}涓嶅尮閰嶏紝缁撴潫杩涚墖浠诲姟", countEntity, glassIdList.size());
+ Integer glassCount = s7DataDLPOne.getGlassCount();
+ if (glassCount != glassIdList.size()) {
+ log.info("褰撳墠澶ц溅杩涚墖鐜荤拑鏁伴噺{}涓巑es璇诲彇鍒扮殑鏁伴噺{}涓嶅尮閰嶏紝缁撴潫杩涚墖浠诲姟", glassCount, glassIdList.size());
//鍚憄lc鍙戦�佹姤璀�:褰撳墠澶ц溅杩涚墖鐜荤拑鏁伴噺涓巑es璇诲彇鍒扮殑鏁伴噺涓嶅尮閰�
s7DataDLPOne = new S7DataDLPOne();
s7DataDLPOne.setAlarmSignal(1);
@@ -154,6 +174,13 @@
if (entry.getValue() > 1) {
log.info("杩涚墖鐜荤拑{}瀛樺湪鐩稿悓锛岀粨鏉熸湰娆′换鍔�", entry.getKey());
//鍚憄lc鍙戦�佹姤璀�:鍚屼竴杞﹁繘鐗囩幓鐠冨瓨鍦ㄧ浉鍚�
+ ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+ alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+ alarmInfo.setAlarmModule(ALARM_MODULE);
+ alarmInfo.setAlarmType(ALARM_TYPE);
+ alarmInfo.setAlarmCode(ALARM_CODE_ID);
+ alarmInfo.setAlarmMessage(entry.getKey());
+ productAlarmInfoService.save(alarmInfo);
s7DataDLPOne = new S7DataDLPOne();
s7DataDLPOne.setAlarmSignal(2);
s7SerializerDLPOne.write(s7DataDLPOne);
@@ -165,6 +192,17 @@
if (CollectionUtil.isNotEmpty(detailsList)) {
log.info("鐞嗙墖绗煎瓨鍦ㄧ浉鍚岀殑杩涚墖鐜荤拑{}锛岀粨鏉熸湰娆′换鍔�", detailsList);
//鍚憄lc鍙戦�佹姤璀�:鐞嗙墖绗煎瓨鍦ㄧ浉鍚岀殑杩涚墖鐜荤拑
+ List<String> sameGlassIds = detailsList.stream()
+ .map(BigStorageCageDetails::getGlassId)
+ .collect(Collectors.toList());
+ ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+ alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+ alarmInfo.setAlarmModule(ALARM_MODULE);
+ alarmInfo.setAlarmType(ALARM_TYPE);
+ alarmInfo.setAlarmCode(ALARM_CODE_ID);
+ alarmInfo.setAlarmMessage(sameGlassIds.toString());
+ productAlarmInfoService.save(alarmInfo);
+
s7DataDLPOne = new S7DataDLPOne();
s7DataDLPOne.setAlarmSignal(4);
s7SerializerDLPOne.write(s7DataDLPOne);
@@ -181,19 +219,27 @@
return;
}
Integer glassGap = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_GLASS_GAP);
- Integer slotMaxthickness = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_MAX_THICKNESS);
+ Integer slotMaxThickness = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_MAX_THICKNESS);
Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_WIDTH);
Integer slotMaxHeight = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_MAX_HEIGHT);
//鎸夌収鐜荤拑鍘氬害鍒嗙粍锛屽垽鏂墿浣欐牸瀛愭槸鍚﹀彲浠ュ瓨鏀�
Map<Double, Long> thickCountMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getThickness, Collectors.counting()));
- if (glassInfoList.get(0).getThickness() < slotMaxthickness) {
+ if (glassInfoList.get(0).getThickness() < slotMaxThickness) {
for (Map.Entry<Double, Long> entry : thickCountMap.entrySet()) {
int count = bigStorageCageService.count(new LambdaQueryWrapper<BigStorageCage>()
.eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth)
+ .le(BigStorageCage::getDeviceId, 4)
.le(BigStorageCage::getMinThickness, entry.getKey())
.ge(BigStorageCage::getMaxThickness, entry.getKey()));
if (count < entry.getValue()) {
log.info("绗煎唴鏍煎瓙鍓╀綑鏁伴噺涓嶈冻锛岀粨鏉熸湰娆¤繘鐗�");
+ ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+ alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+ alarmInfo.setAlarmModule(ALARM_MODULE);
+ alarmInfo.setAlarmType(ALARM_TYPE);
+ alarmInfo.setAlarmCode(ALARM_CODE_SLOT);
+ alarmInfo.setAlarmMessage(count + "");
+ productAlarmInfoService.save(alarmInfo);
//鍚憄lc鍙戦�佹姤璀�:绗煎唴鏍煎瓙鍓╀綑鏁伴噺涓嶈冻
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 16));
s7DataDLPOne = new S7DataDLPOne();
@@ -204,12 +250,19 @@
}
}
//瓒呭ぇ灏哄
- if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() >= slotMaxthickness) {
+ if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() >= slotMaxThickness) {
int count = bigStorageCageDetailsService.count(new LambdaQueryWrapper<BigStorageCageDetails>()
.eq(BigStorageCageDetails::getSlot, THROUGH_SLOT)
.in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
if (count > 0) {
log.info("鐩撮�氱墖鍙板瓨鍦ㄧ幓鐠冿紝缁撴潫鏈杩涚墖");
+ ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
+ alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
+ alarmInfo.setAlarmModule(ALARM_MODULE);
+ alarmInfo.setAlarmType(ALARM_TYPE);
+ alarmInfo.setAlarmCode(ALARM_CODE_OVER);
+ alarmInfo.setAlarmMessage("");
+ productAlarmInfoService.save(alarmInfo);
//鍚憄lc鍙戦�佹姤璀�:鐩撮�氱墖鍙板瓨鍦ㄧ幓鐠冿紝鏃犳硶缁х画鐩撮��
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 64));
s7DataDLPOne = new S7DataDLPOne();
@@ -224,14 +277,15 @@
.set(EdgGlassTaskInfo::getState, Const.EDG_GLASS_SUCCESS).in(EdgGlassTaskInfo::getGlassId, glassIdList));
//鎶ュ伐
for (String glass : glassIdList) {
- damageService.autoSubmitReport(glass, inTaskList.get(0).getStartSlot(), "纾ㄨ竟", "杩涘ぇ鐞嗙墖绗�", 1);
+ damageService.autoSubmitReport(glass, inTaskList.get(0).getStartSlot(),
+ "纾ㄨ竟", "杩涘ぇ鐞嗙墖绗�", 1);
}
Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId));
//璁$畻鐩爣鏍煎瓙
List<BigStorageCageHistoryTask> historyTasks = new ArrayList<>();
//瓒呭ぇ灏哄涓庢甯稿昂瀵哥幓鐠冭绠楁柟寮忎笉涓�鏍�
- if (slotMaxHeight > Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) && glassInfoList.get(0).getThickness() < slotMaxthickness) {
+ if (slotMaxHeight > Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) && glassInfoList.get(0).getThickness() < slotMaxThickness) {
for (BigStorageCageTask task : inTaskList) {
GlassInfo info = glassListMap.get(task.getGlassId()).get(0);
BigStorageDTO bigStorageDTO = bigStorageGlassInfoService.queryBigStorageTargetSlot(info.getEngineerId(), info.getTemperingLayoutId(), info.getTemperingFeedSequence());
@@ -263,27 +317,29 @@
bigStorageCageDetailsService.save(cageDetails);
}
} else {
- BigStorageCageTask task = inTaskList.get(0);
- task.setTargetSlot(THROUGH_SLOT);
- //瀛樻斁鍘嗗彶浠诲姟
- BigStorageCageHistoryTask historyTask = new BigStorageCageHistoryTask();
- BeanUtils.copyProperties(task, historyTask);
- historyTask.setTaskType(Const.BIG_STORAGE_BEFORE_IN);
- historyTask.setGlassCount(glassInfoList.size());
- historyTask.setTaskState(Const.ENGINEERING_NEW);
- historyTasks.add(historyTask);
- GlassInfo info = glassInfoList.get(0);
- BigStorageCageDetails cageDetails = new BigStorageCageDetails();
- BeanUtils.copyProperties(info, cageDetails);
- cageDetails.setSlot(THROUGH_SLOT);
- cageDetails.setState(Const.GLASS_STATE_NEW);
- cageDetails.setDeviceId(0);
- cageDetails.setSequence(0);
- cageDetails.setGap(glassGap);
- cageDetails.setAngle((int) info.getAngle());
- cageDetails.setFilmsId(info.getFilmsid());
- cageDetails.setId(null);
- bigStorageCageDetailsService.save(cageDetails);
+ for (BigStorageCageTask task : inTaskList) {
+ task.setTargetSlot(THROUGH_SLOT);
+ //瀛樻斁鍘嗗彶浠诲姟
+ BigStorageCageHistoryTask historyTask = new BigStorageCageHistoryTask();
+ BeanUtils.copyProperties(task, historyTask);
+ historyTask.setTaskType(Const.BIG_STORAGE_BEFORE_IN);
+ historyTask.setGlassCount(glassInfoList.size());
+ historyTask.setTaskState(Const.ENGINEERING_NEW);
+ historyTasks.add(historyTask);
+ GlassInfo info = glassListMap.get(task.getGlassId()).get(0);
+ BigStorageCageDetails cageDetails = new BigStorageCageDetails();
+ BeanUtils.copyProperties(info, cageDetails);
+ cageDetails.setSlot(THROUGH_SLOT);
+ cageDetails.setState(Const.GLASS_STATE_NEW);
+ cageDetails.setDeviceId(0);
+ cageDetails.setSequence(0);
+ cageDetails.setGap(glassGap);
+ cageDetails.setAngle((int) info.getAngle());
+ cageDetails.setFilmsId(info.getFilmsid());
+ cageDetails.setId(null);
+ bigStorageCageDetailsService.save(cageDetails);
+ }
+
}
//鍘嗗彶鏁版嵁鍏ュ簱
bigStorageCageHistoryTaskService.saveBatch(historyTasks);
@@ -339,49 +395,132 @@
log.info("鏈夋鍦ㄦ墽琛岀殑鍑虹墖浠诲姟锛岀粨鏉熸湰娆″嚭鐗囦换鍔�");
return;
}
- //鏄惁鍏佽閽㈠寲
- //鏄惁鏈夋鍦ㄩ挗鍖栫殑鐜荤拑:閽㈠寲灏忕墖琛ㄥ叧鑱斿巻鍙蹭换鍔¤〃锛岀瓫閫夋湭鍑虹鐨勭幓鐠冧俊鎭�
-// 鑾峰彇褰撳墠閽㈠寲浠诲姟鏈畬鎴愬嚭鐗囩殑鐜荤拑淇℃伅
+ Integer glassGap = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_GLASS_GAP);
+ Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_WIDTH);
+ Integer slotMaxThickness = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_MAX_THICKNESS);
+ Integer slotMaxHeight = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_MAX_HEIGHT);
+ List<BigStorageCageDetails> detailsList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getSlot, THROUGH_SLOT)
+ .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL).orderByAsc(BigStorageCageDetails::getId));
+ if (CollectionUtil.isNotEmpty(detailsList)) {
+ List<BigStorageCageHistoryTask> historyTasks = new ArrayList<>();
+ List<BigStorageCageTask> taskList = new ArrayList<>();
+ for (BigStorageCageDetails info : detailsList) {
+ BigStorageCageTask task = new BigStorageCageTask();
+ task.setGlassId(info.getGlassId());
+ task.setStartSlot(THROUGH_SLOT);
+ task.setTaskState(Const.ENGINEERING_NEW);
+
+ LambdaQueryWrapper<BigStorageCage> queryWrapper = new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
+ .le(BigStorageCage::getMinThickness, info.getThickness())
+ .ge(BigStorageCage::getMaxThickness, info.getThickness())
+ .orderByAsc(BigStorageCage::getDeviceId).orderByAsc(BigStorageCage::getSlot)
+ .last("limit 1");
+
+ if (slotMaxHeight > Math.min(info.getWidth(), info.getHeight())) {
+ queryWrapper.in(BigStorageCage::getDeviceId, Arrays.asList(5, 6));
+ } else {
+ queryWrapper.eq(BigStorageCage::getDeviceId, 6);
+ }
+
+ BigStorageCage bigStorageCage = bigStorageCageService.getOne(queryWrapper);
+ //鑾峰彇鐩爣鏍煎瓙淇℃伅
+// 涓存椂鏇存柊鏍煎瓙鐨勫墿浣欏昂瀵革細闃叉鐩搁偦鐜荤拑杩涘悓涓�鏍煎瓙閫犳垚鍓╀綑灏哄涓嶈冻锛岀幓鐠冭秺鐣岀殑鎯呭喌锛屼换鍔″畬鎴愬悗鍐嶆鏇存柊澶х悊鐗囩琛ㄥ墿浣欏搴︼紙鎸夌収绗煎唴鐜荤拑鏁伴噺鏇存柊澶х悊鐗囩鍓╀綑灏哄锛�
+ bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>()
+ .set(BigStorageCage::getRemainWidth, bigStorageCage.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap)
+ .eq(BigStorageCage::getSlot, bigStorageCage.getSlot()));
+ task.setTargetSlot(bigStorageCage.getSlot());
+ taskList.add(task);
+ //瀛樻斁鍘嗗彶浠诲姟
+ BigStorageCageHistoryTask historyTask = new BigStorageCageHistoryTask();
+ BeanUtils.copyProperties(task, historyTask);
+ historyTask.setTaskType(Const.BIG_STORAGE_BEFORE_DISPATCH);
+ historyTask.setGlassCount(detailsList.size());
+ historyTask.setTaskState(Const.ENGINEERING_NEW);
+ historyTasks.add(historyTask);
+ BigStorageCageDetails cageDetails = new BigStorageCageDetails();
+ BeanUtils.copyProperties(info, cageDetails);
+ cageDetails.setSlot(bigStorageCage.getSlot());
+ cageDetails.setState(Const.GLASS_STATE_NEW);
+ cageDetails.setDeviceId(bigStorageCage.getDeviceId());
+ cageDetails.setSequence(0);
+ cageDetails.setAngle(info.getAngle());
+ cageDetails.setGap(glassGap);
+ cageDetails.setFilmsId(info.getFilmsId());
+ cageDetails.setId(null);
+ bigStorageCageDetailsService.save(cageDetails);
+ info.setState(Const.GLASS_STATE_OUT);
+ bigStorageCageDetailsService.updateById(info);
+ }
+ //鍘嗗彶鏁版嵁鍏ュ簱
+ bigStorageCageHistoryTaskService.saveBatch(historyTasks);
+ extracted(taskList);
+ S7DataDLPTwo s7DataDLPTwo = new S7DataDLPTwo();
+ s7DataDLPTwo.setMesReply(1);
+ s7SerializerDLPTwo.write(s7DataDLPTwo);
+ return;
+ }
Integer temperingOutTargetPosition = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_TEMPERING_OUT_TARGET_POSITION);
- List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>()
- .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW).orderByAsc(TemperingGlassInfo::getTemperingLayoutId).orderByAsc(TemperingGlassInfo::getTemperingFeedSequence));
- if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) {
- log.info("鏈夋鍦ㄥ嚭鐗囩殑閽㈠寲浠诲姟");
- computeOutGlassInfoByVirtualSlot(unFinishTemperingGlassInfoList, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
- Date endDate = new Date();
- log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
- return;
- }
-
- BigStorageCageDetails details = bigStorageCageDetailsService.getOne(new LambdaQueryWrapper<BigStorageCageDetails>()
- .eq(BigStorageCageDetails::getSlot, THROUGH_SLOT)
- .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL).last("limit 1"));
- if (details != null) {
- TemperingGlassInfo temperingGlassInfo = new TemperingGlassInfo();
- BeanUtils.copyProperties(details, temperingGlassInfo);
- temperingGlassInfo.setState(-1);
- temperingGlassInfoService.save(temperingGlassInfo);
- computeOutGlassInfoByVirtualSlot(Arrays.asList(temperingGlassInfo), "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
- return;
- }
-
if (redisUtil.getCacheObject("temperingSwitch")) {
- //閽㈠寲浼樺厛锛氳幏鍙栫悊鐗囩 鐜荤拑灏忕墖 鐮存崯琛� 鏁伴噺 鍒ゆ柇绗煎唴鐗堝浘鏄惁鍒伴綈
- List<TemperingLayoutDTO> temperingLayoutDTOList = bigStorageCageDetailsService.temperingIsAll();
- if (CollectionUtil.isNotEmpty(temperingLayoutDTOList)) {
- //鐜荤拑鍒伴綈鍖呮嫭宸插嚭鐗囩殑
- //鍒伴綈锛屽皢鐜荤拑灏忕墖鏁版嵁瀛樺叆閽㈠寲灏忕墖琛紝閫昏緫鐢熸垚鍑虹墖浠诲姟 缁撴潫
- for (TemperingLayoutDTO item : temperingLayoutDTOList) {
-// if (item.getEngineerId().equals(redisUtil.getCacheObject("temperingengineerId"))) {
+ //鏄惁鍏佽閽㈠寲
+ //鏄惁鏈夋鍦ㄩ挗鍖栫殑鐜荤拑:閽㈠寲灏忕墖琛ㄥ叧鑱斿巻鍙蹭换鍔¤〃锛岀瓫閫夋湭鍑虹鐨勭幓鐠冧俊鎭�
+// 鑾峰彇褰撳墠閽㈠寲浠诲姟鏈畬鎴愬嚭鐗囩殑鐜荤拑淇℃伅
+ List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>()
+ .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW).orderByAsc(TemperingGlassInfo::getTemperingLayoutId).orderByAsc(TemperingGlassInfo::getTemperingFeedSequence));
+ if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) {
+ log.info("鏈夋鍦ㄥ嚭鐗囩殑閽㈠寲浠诲姟");
+ computeOutGlassInfoByVirtualSlot(unFinishTemperingGlassInfoList, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
+
+ String temperingEngineerId = redisUtil.getCacheObject("temperingEngineerId");
+ if (StringUtils.isNotBlank(temperingEngineerId)) {
+ List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(
+ new LambdaQueryWrapper<TemperingGlassInfo>()
+ .eq(TemperingGlassInfo::getEngineerId, temperingEngineerId)
+ .orderByAsc(TemperingGlassInfo::getId)
+ );
+ int temperingLayoutId = 1;
+ if (CollectionUtils.isEmpty(temperingGlassInfoList)) {
+ temperingLayoutId = 1;
+ } else {
+ List<Integer> tempIds = temperingGlassInfoList.stream()
+ .map(TemperingGlassInfo::getTemperingLayoutId)
+ .distinct()
+ .sorted()
+ .collect(Collectors.toList());
+
+ int expected = 1;
+ for (int current : tempIds) {
+ if (current > expected) {
+ break; // 鎵惧埌绗竴涓己澶卞�硷紝璺冲嚭寰幆
+ } else if (current == expected) {
+ expected++; // 杩炵画鍒欓�掑鏈熸湜鐨勫��
+ }
+ }
+ temperingLayoutId = expected; // 缂哄け鍒欎负expected锛岃繛缁垯涓簃ax+1
+ }
+ List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getEngineerId, temperingEngineerId).eq(GlassInfo::getTemperingLayoutId, temperingLayoutId));
+ if (CollectionUtil.isEmpty(glassInfos)) {
+ //鎸囧畾閽㈠寲宸ョ▼鎵ц瀹屾垚锛岀Щ闄ゅ伐绋嬪彿
+ redisUtil.deleteObject("temperingEngineerId");
+ return;
+ }
+ List<TemperingLayoutDTO> temperingLayoutDTOS = bigStorageCageDetailsService.temperingIsAllByTemperingLayoutId(temperingEngineerId, temperingLayoutId);
+ if (CollectionUtil.isNotEmpty(temperingLayoutDTOS)) {
List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
.select("-1 as state,t.filmsid as films_id,t.glass_id,t.flow_card_id,t.glass_type,t.width,t.height" +
",t.thickness,t.ishorizontal,t.tempering_layout_id,t.tempering_feed_sequence,t.x_coordinate,t.y_coordinate," +
"t.angle,t1.slot,t.engineer_id")
.innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId)
.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
- .eq(GlassInfo::getTemperingLayoutId, item.getTemperingLayoutId())
- .eq(GlassInfo::getEngineerId, item.getEngineerId())
+ .eq(GlassInfo::getTemperingLayoutId, temperingLayoutId)
+ .eq(GlassInfo::getEngineerId, temperingEngineerId)
.orderByAsc(GlassInfo::getTemperingFeedSequence));
if (CollectionUtil.isNotEmpty(temperingGlassInfos)) {
temperingGlassInfoService.saveBatch(temperingGlassInfos);
@@ -390,16 +529,18 @@
log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
return;
}
-// }
}
}
+
}
+
//鏄惁鏈変汉宸ヤ笅鐗囦换鍔� 鏈夌洿鎺ュ嚭
Integer artificialOutTargetPosition = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_ARTIFICIAL_OUT_TARGET_POSITION);
Integer outCarMaxSize = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_OUT_CAR_SIZE);
List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL)
- .orderByAsc(BigStorageCageDetails::getSlot)
+ .orderByAsc(BigStorageCageDetails::getDeviceId)
+ .orderByAsc(BigStorageCageDetails::getId)
.orderByAsc(BigStorageCageDetails::getId).last("limit " + outCarMaxSize));
if (CollectionUtil.isNotEmpty(artificialList)) {
computeOutGlassInfoByVirtualSlot(artificialList, "big_storage_cage_out_one_task", artificialOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
@@ -409,42 +550,121 @@
}
//鏄惁瀛樺湪闇�瑕佸唴閮ㄨ皟搴︾殑鏍煎瓙:鎵ц鍐呴儴璋冨害浠诲姟
if (redisUtil.getCacheObject("dispatchSwitch")) {
- //todo:鑾峰彇绗煎唴鍗曟牸宸茬粡鍒伴綈鐨勭幓鐠冩牸瀛愪俊鎭�
- List<BigStorageRelationDTO> virtualList = bigStorageCageDetailsService.queryIsAllNeedDispatchVirtualSlot();
- if (CollectionUtil.isEmpty(virtualList)) {
- log.info("娌℃湁闇�瑕佽皟搴︾殑鏍煎瓙");
+ //鑾峰彇杩涚墖鍗忚鍐呭锛屽湪杩涚墖鏈夎姹�/杩涚墖浠诲姟鎵ц涓笉鎵ц璋冨害浠诲姟
+ S7DataDLPOne s7DataDLPOne = s7SerializerDLPOne.read(S7DataDLPOne.class);
+ String requestInEntity = s7DataDLPOne.getRequestMes().toString();
+ if ("1".equals(requestInEntity)) {
+ log.info("褰撳墠鏀跺埌杩涚墖璇锋眰锛岀粨鏉熻皟搴︿换鍔�");
return;
}
+ String mesReplyInEntity = s7DataDLPOne.getMesReply().toString();
+ if ("1".equals(mesReplyInEntity)) {
+ log.info("鏈夋鍦ㄦ墽琛岀殑杩涚墖浠诲姟锛岀粨鏉熻皟搴︿换鍔�");
+ return;
+ }
+//4鍙疯幏鍙栫鍐呭崟鏍煎凡缁忓埌榻愮殑鐜荤拑鏍煎瓙淇℃伅
List<BigStorageCageDetails> list = new ArrayList<>();
- loop:
+ List<BigStorageRelationDTO> virtualList = bigStorageCageDetailsService.queryIsAllNeedDispatchVirtualSlot(Arrays.asList(4));
for (BigStorageRelationDTO dto : virtualList) {
List<BigStorageSequenceDTO> sequenceDTOList = bigStorageCageDetailsService.dispatchBigStorageGlassInfo(dto);
if (CollectionUtil.isEmpty(sequenceDTOList) || sequenceDTOList.size() == 1) {
continue;
}
- int sequence = -1;
- int targetSlot = -1;
- for (BigStorageSequenceDTO item : sequenceDTOList) {
- if (item.getMaxSequence() == sequence - 1) {
- //鐢熸垚璋冨害浠诲姟
- int startSlot = item.getSlot();
- list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
- .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN).eq(BigStorageCageDetails::getSlot, startSlot));
+ BigStorageCage bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
+ .in(BigStorageCage::getDeviceId, Arrays.asList(5, 6))
+ .orderByAsc(BigStorageCage::getDeviceId).orderByAsc(BigStorageCage::getSlot)
+ .last("limit 1"));
+ List<Integer> slotList = sequenceDTOList.stream().map(BigStorageSequenceDTO::getSlot).collect(Collectors.toList());
+ list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ .in(BigStorageCageDetails::getSlot, slotList)
+ .orderByAsc(BigStorageCageDetails::getTemperingFeedSequence)
+ );
+ computeOutGlassInfoByVirtualSlot(list, "big_storage_cage_out_one_task",
+ bigStorageCage.getSlot(), Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
+ slotList.add(bigStorageCage.getSlot());
+ updateSlotRemainBySlots(slotList);
+ return;
+ }
+ //鏈夛細缁熶竴寰�5鍙风瀛愰��
+// 鏃� 4鍙风瀛愪娇鐢ㄦ暟閲忔槸鍚﹁秴杩囬槇鍊� 鏈� 鐢熸垚璋冨害浠诲姟鎸夌収缁勫彿缁勫簭鐢�1寮�濮嬩緷娆″線5鍙风瀛愰�佸皬鐗�
+ int count = bigStorageCageService.count(new LambdaQueryWrapper<BigStorageCage>().eq(BigStorageCage::getDeviceId, 4).eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getEnableState, Const.SLOT_ON));
+ //瀹氫箟10涓牸瀛愪负闃堝��
+ if (count <= 10) {
+ log.info("绗煎瓙瓒呰繃闃堝�硷紝鎵ц4鍙风瀛愯皟搴﹂�昏緫");
+ //鑾峰彇搴忓彿涓�1鐨勬牸瀛� 灏嗘牸瀛愬唴鐨勬墍鏈夌幓鐠冮�佸埌瀵瑰簲鐨勭瀛�
+ BigStorageCage bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
+ .in(BigStorageCage::getDeviceId, Arrays.asList(5, 6))
+ .orderByAsc(BigStorageCage::getDeviceId).orderByAsc(BigStorageCage::getSlot)
+ .last("limit 1"));
+ if (null != bigStorageCage) {
+ list = bigStorageCageDetailsService.queryNeedDispatch();
+ if (CollectionUtil.isNotEmpty(list)) {
computeOutGlassInfoByVirtualSlot(list, "big_storage_cage_out_one_task",
- targetSlot, Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
+ bigStorageCage.getSlot(), Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
List<Integer> slotList = new ArrayList<>();
- slotList.add(targetSlot);
+ slotList.add(bigStorageCage.getSlot());
+ slotList.add(list.get(0).getSlot());
updateSlotRemainBySlots(slotList);
- break loop;
+ return;
}
- sequence = item.getMinSequence();
- targetSlot = item.getSlot();
}
}
+ //鐢熸垚璋冨害浠诲姟鎸夌収缁勫彿缁勫簭鐢�1寮�濮嬩緷娆″線5鍙风瀛愰�佸皬鐗�
+ BigStorageSlotDTO slotDTO = bigStorageCageDetailsService.queryNeedDispatchSlotBySequence();
+ if (null != slotDTO) {
+ list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ .in(BigStorageCageDetails::getSlot, slotDTO.getStartSlot())
+ .orderByAsc(BigStorageCageDetails::getTemperingFeedSequence)
+ );
+ computeOutGlassInfoByVirtualSlot(list, "big_storage_cage_out_one_task",
+ slotDTO.getTargetSlot(), Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
+ List<Integer> slotList = new ArrayList<>();
+ slotList.add(slotDTO.getStartSlot());
+ slotList.add(slotDTO.getTargetSlot());
+ updateSlotRemainBySlots(slotList);
+ return;
+ }
+ //1-3鍙疯幏鍙栫鍐呭崟鏍煎凡缁忓埌榻愮殑鐜荤拑鏍煎瓙淇℃伅
+ virtualList = bigStorageCageDetailsService.queryIsAllNeedDispatchVirtualSlot(Arrays.asList(1, 2, 3));
+ if (CollectionUtil.isNotEmpty(virtualList)) {
+
+ loop:
+ for (BigStorageRelationDTO dto : virtualList) {
+ List<BigStorageSequenceDTO> sequenceDTOList = bigStorageCageDetailsService.dispatchBigStorageGlassInfo(dto);
+ if (CollectionUtil.isEmpty(sequenceDTOList) || sequenceDTOList.size() == 1) {
+ continue;
+ }
+ int sequence = -1;
+ int targetSlot = -1;
+ for (BigStorageSequenceDTO item : sequenceDTOList) {
+ if (item.getMaxSequence() == sequence - 1) {
+ //鐢熸垚璋冨害浠诲姟
+ int startSlot = item.getSlot();
+ list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN).eq(BigStorageCageDetails::getSlot, startSlot));
+ computeOutGlassInfoByVirtualSlot(list, "big_storage_cage_out_one_task",
+ targetSlot, Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
+ List<Integer> slotList = new ArrayList<>();
+ slotList.add(targetSlot);
+ updateSlotRemainBySlots(slotList);
+ break loop;
+ }
+ sequence = item.getMinSequence();
+ targetSlot = item.getSlot();
+ }
+ }
+ Date endDate = new Date();
+ log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
+ return;
+ }
}
- Date endDate = new Date();
- log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
- return;
}
@Scheduled(fixedDelay = 1000)
@@ -784,20 +1004,21 @@
* @param <T>
* @return
*/
- private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfoByVirtualSlot(List<T> list, String tableName, int targetSlot, int state, int taskType) {
+ private <T extends BigStorageCageBaseInfo> Boolean
+ computeOutGlassInfoByVirtualSlot(List<T> list, String tableName, int targetSlot, int state, int taskType) {
//浠诲姟鏁版嵁:鑾峰彇杞﹀瓙瀛樻斁鐜荤拑鏈�澶ф暟閲�,鐜荤拑闂撮殧
List<T> outGlassList = list;
- if (!THROUGH_SLOT.equals(list.get(0).getSlot())) {
- //todo:涓存椂瑙e喅鏂规:鍑虹墖鏃惰�冭檻鐜荤拑纰版挒锛屾敼涓轰竴鐗囦竴鍑�
- // 鐣岄潰鍏抽棴璋冨害寮�鍏� !Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType)
- if (list.get(0).getThickness() >= 8) {
- outGlassList = list.subList(0, 1);
- } else {
- List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId(
- list.get(0).getEngineerId(), list.get(0).getTemperingLayoutId(), list.get(0).getTemperingFeedSequence());
- outGlassList = list.stream().filter(e -> glassIdList.contains(e.getGlassId())).collect(Collectors.toList());
- }
+// if (!THROUGH_SLOT.equals(list.get(0).getSlot())) {
+// 涓存椂瑙e喅鏂规:鍑虹墖鏃惰�冭檻鐜荤拑纰版挒锛屾敼涓轰竴鐗囦竴鍑�
+ // 鐣岄潰鍏抽棴璋冨害寮�鍏� !Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType)
+ if (list.get(0).getSlot() >= 500 && list.get(0).getThickness() > 8) {
+ outGlassList = list.subList(0, 1);
+ } else {
+ List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId(
+ list.get(0).getEngineerId(), list.get(0).getTemperingLayoutId(), list.get(0).getTemperingFeedSequence());
+ outGlassList = list.stream().filter(e -> glassIdList.contains(e.getGlassId())).collect(Collectors.toList());
}
+// }
Assert.isFalse(CollectionUtil.isEmpty(outGlassList), "鏈幏鍙栧嚭鐗囨暟鎹紝缁撴潫鍑虹墖浠诲姟");
log.info("鑾峰彇鍑虹墖浠诲姟鏁版嵁{}鏉★紝鎵ц淇濆瓨", outGlassList.size());
List<BigStorageCageTask> bigStorageCageTaskList = outGlassList.stream()
@@ -805,12 +1026,43 @@
List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
int glassCount = bigStorageCageTaskList.size();
- //鐢熸垚鍑虹墖浠诲姟鏉℃暟涓嶈冻6琛ュ叏
-// while (bigStorageCageTaskList.size() < 6) {
-// bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
-// }
//娓呯┖浠诲姟琛ㄦ暟鎹�
- resetOutTask();
+ extracted(bigStorageCageTaskList);
+ S7DataDLPTwo s7DataDLPTwo;
+ List<BigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> {
+ BigStorageCageHistoryTask history = new BigStorageCageHistoryTask();
+ BeanUtils.copyProperties(e, history);
+ history.setGlassCount(glassCount);
+ history.setTaskType(taskType);
+ return history;
+ }).collect(Collectors.toList());
+ bigStorageCageHistoryTaskService.saveBatch(historyList);
+
+ log.info("灏嗗嚭鐗囩幓鐠儃}鐜荤拑鐘舵�佹敼涓哄嚭鐗囦腑", glassIds);
+ bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>()
+ .set(BigStorageCageDetails::getState, state)
+ .set(Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType), BigStorageCageBaseInfo::getSlot, targetSlot)
+ .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
+ .in(BigStorageCageDetails::getGlassId, glassIds));
+ try {
+// miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 1));
+ s7DataDLPTwo = new S7DataDLPTwo();
+ s7DataDLPTwo.setMesReply(1);
+ s7SerializerDLPTwo.write(s7DataDLPTwo);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return Boolean.TRUE;
+ }
+
+ /**
+ * 鎸夌収浠诲姟鐢熸垚鍑虹墖浠诲姟
+ *
+ * @param bigStorageCageTaskList
+ * @return
+ */
+ private Boolean extracted(List<BigStorageCageTask> bigStorageCageTaskList) {
+// resetOutTask();
S7DataDLPTwo s7DataDLPTwo = new S7DataDLPTwo();
for (int i = 0; i < bigStorageCageTaskList.size() && i < 6; i++) {
String glassId = bigStorageCageTaskList.get(i).getGlassId();
@@ -852,29 +1104,6 @@
}
}
s7SerializerDLPTwo.write(s7DataDLPTwo);
- List<BigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> {
- BigStorageCageHistoryTask history = new BigStorageCageHistoryTask();
- BeanUtils.copyProperties(e, history);
- history.setGlassCount(glassCount);
- history.setTaskType(taskType);
- return history;
- }).collect(Collectors.toList());
- bigStorageCageHistoryTaskService.saveBatch(historyList);
-
- log.info("灏嗗嚭鐗囩幓鐠儃}鐜荤拑鐘舵�佹敼涓哄嚭鐗囦腑", glassIds);
- bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>()
- .set(BigStorageCageDetails::getState, state)
- .set(Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType), BigStorageCageBaseInfo::getSlot, targetSlot)
- .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
- .in(BigStorageCageDetails::getGlassId, glassIds));
- try {
-// miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 1));
- s7DataDLPTwo = new S7DataDLPTwo();
- s7DataDLPTwo.setMesReply(1);
- s7SerializerDLPTwo.write(s7DataDLPTwo);
- } catch (Exception e) {
- e.printStackTrace();
- }
return Boolean.TRUE;
}
@@ -885,7 +1114,8 @@
// * @param <T>
// * @return
// */
- private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType) {
+ private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName,
+ int targetSlot, int state, int taskType) {
//浠诲姟鏁版嵁:鑾峰彇杞﹀瓙瀛樻斁鐜荤拑鏈�澶ф暟閲�,鐜荤拑闂撮殧
List<BigStorageCageTask> bigStorageCageTaskList = new ArrayList<>();
//鎵撹溅鍓╀綑灏哄
--
Gitblit v1.8.0