| | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.common.S7object; |
| | |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgOutTask() { |
| | | //todo:是否有正在出片的钢化任务 |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlassInfo::getTemperingFeedSequence)); |
| | | //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | //打车剩余尺寸 |
| | | AtomicReference<Integer> remainWidth = new AtomicReference<>(Const.BIG_STORAGE_WIDTH); |
| | | temperingGlassInfoList.stream().forEach(e -> { |
| | | if (bigStorageCageOutTaskList.size() > 5 || e.getWidth() > remainWidth.get()) { |
| | | return; |
| | | } |
| | | remainWidth.set(remainWidth.get() - e.getWidth().intValue() - Const.BIG_STORAGE_GAP); |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getState(), Const.A09_OUT_TARGET_POSITION, |
| | | 0, 0, 1)); |
| | | }); |
| | | bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | return; |
| | | } |
| | | |
| | | //todo:获取状态字 钢化优先 or 人工下片优先 |
| | | if (true) { |
| | | //todo:钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | //todo: 到齐,将玻璃小片数据存入钢化小片表,逻辑生成出片任务 结束 |
| | | //todo: 未到齐 执行内部调度任务 结束 |
| | | } |
| | | //todo:笼内是否有人工下片玻璃 有直接出 无 结束 |
| | | List<TemperingLayoutDTO> list = bigStorageCageDetailsService.listAllTemperingCount(); |
| | | } |
| | | |
| | | |