From 3ddf0ec67fe6d9aac2d34fab289fc19d0231bddc Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期一, 14 四月 2025 21:09:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java | 67 +++++++++++++++++++++++++++++----
1 files changed, 58 insertions(+), 9 deletions(-)
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
index f23a0a7..eaee561 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -6,6 +6,8 @@
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.google.common.collect.Lists;
+import com.mes.base.entity.vo.BigStorageVO;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.bigstorage.entity.dto.*;
@@ -13,6 +15,8 @@
import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask;
+import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO;
@@ -77,6 +81,9 @@
private DamageService damageService;
@Resource
private RedisUtil redisUtil;
+
+ @Resource
+ BigStorageCageHistoryTaskService bigStorageCageHistoryTaskService;
@Value("${mes.minCount}")
private int minCount;
@@ -396,9 +403,9 @@
if (temperingGlassInfoList.size() == 0) {
List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
- .selectAll(GlassInfo.class)
- .select("-1 as state")
- .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot)
+ .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(GlassInfo::getTemperingLayoutId, temperingLayoutId)
.eq(GlassInfo::getEngineerId, engineerId)
@@ -441,6 +448,44 @@
}
@Override
+ public List<BigStorageCageDetails> queryRealGlassInfo(BigStorageQueryVO bigStorageQueryVO) {
+ return this.list(new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getEngineerId, bigStorageQueryVO.getEngineerId())
+ .eq(BigStorageCageDetails::getTemperingLayoutId, bigStorageQueryVO.getTemperingLayoutId())
+ .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL).orderByAsc(BigStorageCageDetails::getTemperingFeedSequence));
+ }
+
+ @Override
+ public Map<Integer, List<BigStorageVO>> querybigStorageCageDetail() {
+ List<BigStorageVO> bigStorageCages = baseMapper.querybigStorageCageDetail();
+ return bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId()));
+ }
+
+ @Override
+ public boolean cancelTemperingTask() {
+ //褰撳墠姝e湪鎵ц鐨勫嚭鐗囦换鍔�
+ List<BigStorageCageHistoryTask> historyTaskList = bigStorageCageHistoryTaskService.list(new LambdaQueryWrapper<BigStorageCageHistoryTask>()
+ .eq(BigStorageCageHistoryTask::getTaskState, Const.GLASS_STATE_NEW)
+ .eq(BigStorageCageHistoryTask::getTargetSlot, Const.TEMPERING_OUT_TARGET_POSITION));
+ //涓嶅瓨鍦ㄥ嚭鐗囦换鍔★紝鐩存帴鍒犻櫎閽㈠寲灏忕墖琛ㄦ湭鍑虹墖鐨勪换鍔�
+ if (CollectionUtils.isEmpty(historyTaskList)) {
+ temperingGlassInfoMapper.delete(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW));
+ return Boolean.TRUE;
+ }
+ //瀛樺湪鍑虹墖浠诲姟锛屽垹闄ら挗鍖栧皬鐗囪〃
+ List<String> glassIdList = historyTaskList.stream().map(BigStorageCageHistoryTask::getGlassId).collect(Collectors.toList());
+ GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList)
+ .orderByDesc(GlassInfo::getTemperingFeedSequence).last("limit 1"));
+ temperingGlassInfoMapper.delete(new LambdaQueryWrapper<TemperingGlassInfo>()
+ .eq(TemperingGlassInfo::getEngineerId, glassInfo.getEngineerId())
+ .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW)
+ .ge(TemperingGlassInfo::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
+ .gt(TemperingGlassInfo::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence())
+ );
+ return Boolean.TRUE;
+ }
+
+ @Override
public String temperingSwitch(Boolean flag) {
redisUtil.setCacheObject("temperingSwitch", flag);
return "success";
@@ -455,18 +500,22 @@
if (temperingGlassInfoList.size() == 0) {
List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
- .selectAll(GlassInfo.class)
- .select("-1 as state")
- .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot)
+ .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(GlassInfo::getEngineerId, engineerId)
.ne(GlassInfo::getTemperingLayoutId, 0)
.in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
- .orderByAsc(GlassInfo::getTemperingLayoutId)
- .orderByAsc(GlassInfo::getTemperingFeedSequence)
+ .orderByAsc(BigStorageCageDetails::getTemperingLayoutId)
+ .orderByAsc(BigStorageCageDetails::getTemperingFeedSequence)
);
if (CollectionUtils.isNotEmpty(temperingGlassInfos)) {
- temperingGlassInfoService.saveBatch(temperingGlassInfos);
+ //閬垮厤澶ч噺鏁版嵁鎻掑叆瀵艰嚧sqlserver鏁版嵁搴撳紓甯革紝鍒嗘壒娆℃瘡璋冨瓨鍌ㄤ緷娆�
+ List<List<TemperingGlassInfo>> temperingGlassInfoLists = Lists.partition(temperingGlassInfos, 50);
+ for (List<TemperingGlassInfo> item : temperingGlassInfoLists) {
+ temperingGlassInfoService.saveBatch(item);
+ }
return true;
}
}
--
Gitblit v1.8.0