From f9ac6553e1e96f07b58ea4e0b51f6af9875219ea Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期五, 28 二月 2025 10:32:42 +0800
Subject: [PATCH] 1、中空创建任务界面新增厚度查询,按流程卡升序排序
---
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java | 101 ++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 88 insertions(+), 13 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 ee80460..ae517cd 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,11 +6,12 @@
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.BigStorageDTO;
-import com.mes.bigstorage.entity.dto.SlotSequenceDTO;
-import com.mes.bigstorage.entity.dto.TemperingLayoutDTO;
+import com.mes.bigstorage.entity.dto.*;
+import com.mes.bigstorage.entity.vo.BigStorageQueryVO;
import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
@@ -296,7 +297,7 @@
}
bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
.eq(BigStorageCage::getEnableState, Const.SLOT_ON)
- .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)
// .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0")
.inSql(BigStorageCage::getDeviceId,
"select distinct device_id from big_storage_cage_details where engineer_id = '" + glassInfo.getEngineerId() + "' and tempering_layout_id = " + glassInfo.getTemperingLayoutId())
@@ -337,7 +338,7 @@
}
for (Integer item : deviceUsedList) {
bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
- .eq(BigStorageCage::getRemainWidth, slotWidth)
+ .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)
.eq(BigStorageCage::getEnableState, Const.SLOT_ON)
.eq(BigStorageCage::getDeviceId, item)
.last("limit 1"));
@@ -397,9 +398,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)
@@ -421,14 +422,38 @@
@Override
- public List<Map<String, Object>> selectTemperingGlass() {
- List<Map<String, Object>> temperingGlass = baseMapper.selectTemperingGlassCount();
- return temperingGlass;
+ public List<TemperingGlassCountDTO> selectTemperingGlass(int isTempering) {
+ return baseMapper.selectTemperingGlassCount(isTempering);
}
@Override
public void updateBySlot(List<UpdateBigStorageCageDTO> glassList, int state) {
baseMapper.updateBySlot(glassList, state);
+ }
+
+ @Override
+ public String dispatchSwitch(Boolean flag) {
+ redisUtil.setCacheObject("dispatchSwitch", flag);
+ return "success";
+ }
+
+ @Override
+ public List<GlassInfoLackDTO> queryLackGlassInfo(BigStorageQueryVO bigStorageQueryVO) {
+ return baseMapper.queryLackGlassInfo(bigStorageQueryVO);
+ }
+
+ @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
@@ -438,7 +463,57 @@
}
@Override
- public void appointEngineerId(String engineerId) {
- redisUtil.setCacheObject("temperingengineerId", engineerId);
+ public boolean appointTemperingEngineerId(String engineerId) {
+ LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
+ temperingGlassInfoLambdaQueryWrapper
+ .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW);
+ List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper);
+
+ if (temperingGlassInfoList.size() == 0) {
+ 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(GlassInfo::getEngineerId, engineerId)
+ .ne(GlassInfo::getTemperingLayoutId, 0)
+ .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ .orderByAsc(BigStorageCageDetails::getTemperingLayoutId)
+ .orderByAsc(BigStorageCageDetails::getTemperingFeedSequence)
+ );
+ if (CollectionUtils.isNotEmpty(temperingGlassInfos)) {
+ //閬垮厤澶ч噺鏁版嵁鎻掑叆瀵艰嚧sqlserver鏁版嵁搴撳紓甯革紝鍒嗘壒娆℃瘡璋冨瓨鍌ㄤ緷娆�
+ List<List<TemperingGlassInfo>> temperingGlassInfoLists = Lists.partition(temperingGlassInfos, 50);
+ for (List<TemperingGlassInfo> item : temperingGlassInfoLists) {
+ temperingGlassInfoService.saveBatch(item);
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public List<BigStorageRelationDTO> queryIsAllNeedDispatchVirtualSlot() {
+ return baseMapper.queryIsAllNeedDispatchVirtualSlot();
+ }
+
+ @Override
+ public List<BigStorageSequenceDTO> dispatchBigStorageGlassInfo(BigStorageRelationDTO bigStorageRelationDTO) {
+ return baseMapper.queryNeedDispatchSlot(bigStorageRelationDTO);
+ }
+
+ @Override
+ public String bigStorageGlassDamageByGlassId(String glassId) {
+ Damage damage = new Damage();
+ damage.setGlassId(glassId);
+ damage.setType(Const.GLASS_STATE_DAMAGE);
+ damageService.insertDamage(damage);
+ return "success";
+ }
+
+ @Override
+ public void updateDeviceIdBySlot(List<Integer> slotList) {
+ baseMapper.updateDeviceIdBySlot(slotList);
}
}
--
Gitblit v1.8.0