From c20baabe480137a7dabfbe804a4fb72d95b46724 Mon Sep 17 00:00:00 2001 From: zhoushihao <zsh19950802@163.com> Date: 星期四, 05 十二月 2024 16:36:43 +0800 Subject: [PATCH] 1、修改推送数据格式类型,便于前端展示 --- hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java | 62 ++---------------------------- 1 files changed, 5 insertions(+), 57 deletions(-) diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java index e7354e6..654ea16 100644 --- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java +++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mes.common.config.Const; +import com.mes.glassinfo.entity.GlassInfo; +import com.mes.glassinfo.service.GlassInfoService; import com.mes.hollow.entity.HollowBigStorageCageDetails; import com.mes.hollow.entity.HollowGlassOutRelationInfo; import com.mes.hollow.service.HollowBigStorageCageDetailsService; @@ -11,10 +13,12 @@ import com.mes.hollowqueue.entity.HollowGlassQueueInfo; import com.mes.hollowqueue.mapper.HollowGlassQueueInfoMapper; import com.mes.hollowqueue.service.HollowGlassQueueInfoService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -25,69 +29,13 @@ * @since 2024-11-30 10:19:56 */ @Service +@Slf4j public class HollowGlassQueueInfoServiceImpl extends ServiceImpl<HollowGlassQueueInfoMapper, HollowGlassQueueInfo> implements HollowGlassQueueInfoService { - @Resource - HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService; @Resource HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService; - @Override - public void forceOutGlass(String flowCardId, int cell) { - hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell); - hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() - .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId) - .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) - ); - List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() - .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) - .eq(HollowBigStorageCageDetails::getFlowCardId, flowCardId) - .orderByAsc(HollowBigStorageCageDetails::getVirtualSlot) - .orderBy(Boolean.TRUE, cell != 931, HollowBigStorageCageDetails::getSequence) - .orderByAsc(HollowBigStorageCageDetails::getHollowSequence) - ); - - List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> { - HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo(); - BeanUtils.copyProperties(queue, queueInfo); - queueInfo.setState(Const.TEMPERING_NEW); - queueInfo.setCell(cell); - return queueInfo; - }).collect(Collectors.toList()); - this.saveBatch(hollowQueues); - } - - @Override - public void changeForceOutGlass(String flowCardId, int cell) { - hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() - .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId) - .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) - ); - //鎯呭喌鍘嗗彶浠诲姟涓湭鍋氬畬鐨勭幓鐠冧俊鎭� - this.remove(new LambdaQueryWrapper<HollowGlassQueueInfo>() - .eq(HollowGlassQueueInfo::getFlowCardId, flowCardId) - .eq(HollowGlassQueueInfo::getCell, cell) - .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW) - ); - //鎸夌収绾胯矾閲嶆柊鍘荤悊鐗囩鏌ヨ鐜荤拑淇℃伅 - List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() - .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) - .eq(HollowBigStorageCageDetails::getFlowCardId, flowCardId) - .orderByAsc(HollowBigStorageCageDetails::getVirtualSlot) - .orderBy(Boolean.TRUE, cell != 931, HollowBigStorageCageDetails::getSequence) - .orderByAsc(HollowBigStorageCageDetails::getHollowSequence) - ); - - List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> { - HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo(); - BeanUtils.copyProperties(queue, queueInfo); - queueInfo.setState(Const.TEMPERING_NEW); - queueInfo.setCell(cell); - return queueInfo; - }).collect(Collectors.toList()); - this.saveBatch(hollowQueues); - } @Override public List<HollowGlassQueueInfo> queryHollowGlassQueueInfo(int cell) { -- Gitblit v1.8.0