1、卧式理片一拖二功能测试通过, 小片台新增最大尺寸配置:8mm,超过的玻璃小片只能走大线
| | |
| | | */ |
| | | public interface EdgStorageCageDetailsMapper extends MPJBaseMapper<EdgStorageCageDetails> { |
| | | |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height); |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(@Param("deviceId") int deviceId, @Param("currentSlot") int currentSlot, @Param("width") double width, |
| | | @Param("height") double height, @Param("cell") int cell, @Param("maxThickness") int maxThickness); |
| | | |
| | | EdgStorageCageDetails queryEdgStorageDetailsByLimitSize(@Param("deviceId") int deviceId, @Param("currentCell") Integer currentCell, |
| | | @Param("width") double width, @Param("height") double height, @Param("cell") int cell, |
| | | @Param("minOneFirstLength") int minOneFirstLength, @Param("minOneSecondLength") int minOneSecondLength, |
| | | @Param("maxTwoFirstLength") int maxTwoFirstLength, @Param("maxTwoSecondLength") int maxTwoSecondLength); |
| | | @Param("maxTwoFirstLength") int maxTwoFirstLength, @Param("maxTwoSecondLength") int maxTwoSecondLength, |
| | | @Param("maxThickness") int maxThickness); |
| | | |
| | | List<CutDrawingVO> queryCutDrawingByEngineerId(@Param("engineerId") String engineerId, @Param("patternSequence") int patternSequence, @Param("isAll") int isAll); |
| | | |
| | |
| | | * @param deviceId |
| | | * @param width |
| | | * @param height |
| | | * @param cell |
| | | * @param maxThickness |
| | | * @return |
| | | */ |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height); |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height, int cell, int maxThickness); |
| | | |
| | | /** |
| | | * 按照尺寸,线路、线路最大最小尺寸获取符合要求的玻璃小片数据 |
| | |
| | | * @param deviceId |
| | | * @param width |
| | | * @param height |
| | | * @param maxThickness |
| | | * @return |
| | | */ |
| | | EdgStorageCageDetails queryEdgStorageDetailsByLimitSize(int deviceId, Integer currentCell, double width, double height, int cell, int minOneFirstLength, int minOneSecondLength, int maxTwoFirstLength, int maxTwoSecondLength); |
| | | EdgStorageCageDetails queryEdgStorageDetailsByLimitSize(int deviceId, Integer currentCell, double width, double height, int cell, int minOneFirstLength, int minOneSecondLength, int maxTwoFirstLength, int maxTwoSecondLength, int maxThickness); |
| | | |
| | | String edgDetailsOperate(DamageRequest request); |
| | | |
| | |
| | | import com.mes.edgstoragecage.entity.vo.EdgStorageCageVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | EdgStorageCage selectNearestEmpty(int currentSlot, boolean flag); |
| | | EdgStorageCage selectNearestEmpty(Integer currentCell, int deviceId, boolean flag); |
| | | |
| | | /** |
| | | * 按照设备号返回对应的笼内详情数据 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height) { |
| | | return baseMapper.queryEdgStorageDetailsBySize(deviceId, currentSlot, width, height); |
| | | public EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height, int cell, int maxThickness) { |
| | | return baseMapper.queryEdgStorageDetailsBySize(deviceId, currentSlot, width, height, cell, maxThickness); |
| | | } |
| | | |
| | | @Override |
| | | public EdgStorageCageDetails queryEdgStorageDetailsByLimitSize(int deviceId, Integer currentCell, double width, double height, int cell, int minOneFirstLength, int minOneSecondLength, int maxTwoFirstLength, int maxTwoSecondLength) { |
| | | return baseMapper.queryEdgStorageDetailsByLimitSize(deviceId, currentCell, width, height, cell, minOneFirstLength, minOneSecondLength, maxTwoFirstLength, maxTwoSecondLength); |
| | | public EdgStorageCageDetails queryEdgStorageDetailsByLimitSize(int deviceId, Integer currentCell, double width, double height, int cell, int minOneFirstLength, int minOneSecondLength, int maxTwoFirstLength, int maxTwoSecondLength, int maxThickness) { |
| | | return baseMapper.queryEdgStorageDetailsByLimitSize(deviceId, currentCell, width, height, cell, minOneFirstLength, minOneSecondLength, maxTwoFirstLength, maxTwoSecondLength, maxThickness); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<PieChartVO> queryPieChart(){ |
| | | public List<PieChartVO> queryPieChart() { |
| | | return this.baseMapper.queryPieChart(); |
| | | } |
| | | } |
| | |
| | | package com.mes.edgstoragecage.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | |
| | | import com.mes.edgstoragecage.entity.vo.EdgStorageCageVO; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | DamageService damageService; |
| | | |
| | | @Override |
| | | public EdgStorageCage selectNearestEmpty(int currentSlot, boolean flag) { |
| | | public EdgStorageCage selectNearestEmpty(Integer currentSlot, int deviceId, boolean flag) { |
| | | List<EdgStorageCage> emptyList = this.selectJoinList(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>() |
| | | .selectAll(EdgStorageCage.class) |
| | | .leftJoin(EdgStorageCageDetails.class, on -> on |
| | |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(EdgStorageCage::getDeviceId, deviceId) |
| | | .last("order by abs(t.slot - " + currentSlot + ") asc limit 2") |
| | | ); |
| | | if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Value("${mes.max.secondLength}") |
| | | private int maxTwoSecondLength; |
| | | |
| | | @Value("${mes.maxThickness}") |
| | | private int maxThickness; |
| | | |
| | | private String glassInIdOne = ""; |
| | | private String glassInIdTwo = ""; |
| | | private String glassIdOne = ""; |
| | | private String glassIdTwo = ""; |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void startOneOpcTask() throws Exception { |
| | | //获取第二条线路的卧式理片笼状态 |
| | | ReadWriteEntity twoInkageEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isInkage"); |
| | | ReadWriteEntity twoInkageEntity = miloService.readFromOpcUa("WL2.WL2.deviceState"); |
| | | //默认只跑一台卧式理片,两条线路都可以走 |
| | | int cellFlag = 2; |
| | | //如果两条线都启动则只能跑一条线 |
| | | if (twoInkageEntity != null && "1".equals(twoInkageEntity.getValue() + "")) { |
| | | if (twoInkageEntity != null && Boolean.parseBoolean(twoInkageEntity.getValue() + "")) { |
| | | cellFlag = 1; |
| | | } |
| | | startOneOpcTaskChild(EDG_STORAGE_DEVICE_ONE_TASK, 1, cellFlag); |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void startTwoOpcTask() throws Exception { |
| | | ReadWriteEntity oneInkageEntity = miloService.readFromOpcUa("ZKQ1.ZKQ1.isInkage"); |
| | | ReadWriteEntity oneInkageEntity = miloService.readFromOpcUa("WL1.WL1.deviceState"); |
| | | int cellFlag = 2; |
| | | if (oneInkageEntity != null && "1".equals(oneInkageEntity.getValue() + "")) { |
| | | if (oneInkageEntity != null && Boolean.parseBoolean(oneInkageEntity.getValue() + "")) { |
| | | cellFlag = 1; |
| | | } |
| | | startOneOpcTaskChild(EDG_STORAGE_DEVICE_TWO_TASK, 2, cellFlag); |
| | | } |
| | | |
| | | private void startOneOpcTaskChild(String tableName, int device, int cellFlag) throws Exception { |
| | | edgStorageDeviceTaskHistoryService.getOne(new LambdaQueryWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, device)); |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(tableName); |
| | | if (task == null) { |
| | | log.info("任务表基础数据录入失败,请检查数据是否录入成功"); |
| | |
| | | log.info("玻璃异常处理"); |
| | | damageTask(task, tableName, device); |
| | | } |
| | | // } catch (Exception e) { |
| | | // log.info("执行任务过程中发生异常,任务字{},{}", task.getTaskState(), e.getMessage()); |
| | | // log.info("将启动字改为0"); |
| | | // task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY); |
| | | // edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | // } |
| | | // } catch(Exception e) |
| | | // |
| | | // { |
| | | // log.info("执行任务过程中发生异常,任务字{},{}", task.getTaskState(), e.getMessage()); |
| | | // log.info("将启动字改为0"); |
| | | // task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY); |
| | | // edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | // } |
| | | |
| | | } |
| | | |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void edgOneOpcTask() throws Exception { |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(EDG_STORAGE_DEVICE_ONE_TASK); |
| | | String glassId = task.getGlassId(); |
| | |
| | | edgTaskChild(glassId, 1); |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void edgTwoOpcTask() throws Exception { |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(EDG_STORAGE_DEVICE_TWO_TASK); |
| | | String glassId = task.getGlassId(); |
| | |
| | | } else { |
| | | glassIdTwo = glassId; |
| | | } |
| | | |
| | | } |
| | | |
| | | private boolean intoTask(EdgStorageDeviceTask task, String tableName, int deviceId) { |
| | |
| | | log.info("结束进片任务设备为{},结束时间为:{},共耗时:{}ms", deviceId, endDate, endDate.getTime() - startDate.getTime()); |
| | | return Boolean.FALSE; |
| | | } |
| | | EdgStorageCage edgStorageCage = edgStorageCageService.selectNearestEmpty(task.getCurrentCell(), Boolean.FALSE); |
| | | EdgStorageCage edgStorageCage = edgStorageCageService.selectNearestEmpty(task.getCurrentCell(), deviceId, Boolean.FALSE); |
| | | Assert.isTrue(null != edgStorageCage, "格子已满"); |
| | | log.info("4、将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | EdgStorageCageDetails details = new EdgStorageCageDetails(); |
| | |
| | | private boolean outTask(EdgStorageDeviceTask task, String tableName, int deviceId, int cellFlag) throws Exception { |
| | | Date startDate = new Date(); |
| | | //获取对应的设备状态信息 |
| | | ReadWriteEntity oneOutStateEntity = miloService.readFromOpcUa("WL1.WL1.OUTSTATE"); |
| | | ReadWriteEntity twoOutStateEntity = miloService.readFromOpcUa("WL2.WL2.OUTSTATE"); |
| | | ReadWriteEntity oneOutStateEntity = miloService.readFromOpcUa("WL1.WL1.slotState"); |
| | | ReadWriteEntity twoOutStateEntity = miloService.readFromOpcUa("WL2.WL2.slotState"); |
| | | //状态有3中情况:0空闲 1忙碌 2禁用 |
| | | String oneOutState = "0"; |
| | | String twoOutState = "0"; |
| | | String oneOutState = "2"; |
| | | String twoOutState = "2"; |
| | | if (null != oneOutStateEntity && null != oneOutStateEntity.getValue()) { |
| | | oneOutState = oneOutStateEntity.getValue().toString(); |
| | | } |
| | | if (null != twoOutStateEntity && null != twoOutStateEntity.getValue()) { |
| | | twoOutState = twoOutStateEntity.getValue().toString(); |
| | | } |
| | | if (Const.OUT_DISABLE_ALL.contains(oneOutState) && Const.OUT_DISABLE_ALL.contains(twoOutState)) { |
| | | |
| | | if ((Const.OUT_BUSY.equals(oneOutState) && Const.OUT_BUSY.equals(twoOutState)) || (Const.OUT_DISABLE.equals(oneOutState) && Const.OUT_DISABLE.equals(twoOutState))) { |
| | | log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState); |
| | | return Boolean.FALSE; |
| | | } |
| | | log.info("开始执行出片/直通任务,任务信息为:{},表名为:{},设备id:{},开始时间:{},一号线状态:{},二号线状态:{}", |
| | | task, tableName, deviceId, startDate, oneOutState, twoOutState); |
| | | EdgStorageCageDetails edgStorageCageDetails = null; |
| | | //获取当前需要走那条线 |
| | | int cell = 0; |
| | | if (cellFlag == 1) { |
| | |
| | | } else { |
| | | if (Const.OUT_FREE.equals(oneOutState)) { |
| | | cell = Const.ONE_OUT_TARGET_POSITION; |
| | | } else { |
| | | } else if (Const.OUT_FREE.equals(twoOutState)) { |
| | | cell = Const.TWO_OUT_TARGET_POSITION; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | } |
| | | } |
| | | if (Const.OUT_FREE.equals(oneOutState) && Const.OUT_FREE.equals(twoOutState)) { |
| | | if (!outChildTask(task, tableName, deviceId, cell, startDate)) { |
| | | cell = cell == Const.ONE_OUT_TARGET_POSITION ? Const.TWO_OUT_TARGET_POSITION : Const.ONE_OUT_TARGET_POSITION; |
| | | return outChildTask(task, tableName, deviceId, cell, startDate); |
| | | } |
| | | } else { |
| | | return outChildTask(task, tableName, deviceId, cell, startDate); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private boolean outChildTask(EdgStorageDeviceTask task, String tableName, int deviceId, int cell, Date startDate) { |
| | | EdgStorageCageDetails edgStorageCageDetails = null; |
| | | |
| | | //笼内是版图相差是否超过阈值 |
| | | boolean flag = queryMaxMinDiffByDevice(threshold, deviceId); |
| | |
| | | double maxLength = Math.max(minEdgDetails.getWidth(), minEdgDetails.getHeight()); |
| | | double minLength = Math.min(minEdgDetails.getWidth(), minEdgDetails.getHeight()); |
| | | if ((cell == 1 && maxLength >= minOneFirstLength && minLength >= minOneSecondLength) || |
| | | (cell == 2 && maxLength <= maxTwoFirstLength && minLength <= maxTwoSecondLength)) { |
| | | (cell == 2 && maxLength <= maxTwoFirstLength && minLength <= maxTwoSecondLength && minEdgDetails.getThickness() < maxThickness)) { |
| | | //玻璃小片同尺寸的离当前格子最近的玻璃小片 |
| | | edgStorageCageDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getWidth, minEdgDetails.getWidth()) |
| | |
| | | if (null != edgeData) { |
| | | GlassInfo glassOutInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, edgeData.getGlassIdOut())); |
| | | //笼内的玻璃的尺寸是否和上一次任务一致 |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), glassOutInfo.getWidth(), glassOutInfo.getHeight()); |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), glassOutInfo.getWidth(), glassOutInfo.getHeight(), cell, maxThickness); |
| | | if (null == edgStorageCageDetails && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, task.getGlassIdIn()) |
| | | .eq(GlassInfo::getWidth, glassOutInfo.getWidth()) |
| | | .eq(GlassInfo::getHeight, glassOutInfo.getHeight())); |
| | | if (null != glassInInfo) { |
| | | edgStorageCageDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInInfo, edgStorageCageDetails); |
| | | if (cell == 2 && glassInInfo.getThickness() < maxThickness) { |
| | | edgStorageCageDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInInfo, edgStorageCageDetails); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | //前面已经尺寸问题处理完毕,开始计算无相同尺寸的新玻璃小片 |
| | | if (null == edgStorageCageDetails) { |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsByLimitSize(deviceId, task.getCurrentCell(), 0, 0, |
| | | cell, minOneFirstLength, minOneSecondLength, maxTwoFirstLength, maxTwoSecondLength); |
| | | cell, minOneFirstLength, minOneSecondLength, maxTwoFirstLength, maxTwoSecondLength, maxThickness); |
| | | } |
| | | if (edgStorageCageDetails == null && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | //和上次任务不存在相同尺寸 |
| | |
| | | double minLength = Math.min(glassInInfo.getWidth(), glassInInfo.getHeight()); |
| | | if ((cell == 1 && maxLength >= minOneFirstLength && minLength >= minOneSecondLength) || |
| | | (cell == 2 && maxLength <= maxTwoFirstLength && minLength <= maxTwoSecondLength |
| | | && maxLength >= minTwoFirstLength && minLength >= minTwoSecondLength)) { |
| | | && maxLength >= minTwoFirstLength && minLength >= minTwoSecondLength && glassInInfo.getThickness() < maxThickness)) { |
| | | //玻璃小片同尺寸的离当前格子最近的玻璃小片 |
| | | edgStorageCageDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInInfo, edgStorageCageDetails); |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private String glassIdOne = ""; |
| | | private String glassIdTwo = ""; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void startOneOpcTask() { |
| | | startOneOpcTaskChild(EDG_STORAGE_DEVICE_ONE_TASK, 1); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void startTwoOpcTask() { |
| | | startOneOpcTaskChild(EDG_STORAGE_DEVICE_TWO_TASK, 2); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void edgOneOpcTask() throws Exception { |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(EDG_STORAGE_DEVICE_ONE_TASK); |
| | | String glassId = task.getGlassId(); |
| | |
| | | edgTaskChild(glassId, 1); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void edgTwoOpcTask() throws Exception { |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(EDG_STORAGE_DEVICE_TWO_TASK); |
| | | String glassId = task.getGlassId(); |
| | |
| | | if (null != edgeData) { |
| | | GlassInfo glassOutInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, edgeData.getGlassIdOut())); |
| | | //笼内的玻璃的尺寸是否和上一次任务一致 |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), glassOutInfo.getWidth(), glassOutInfo.getHeight()); |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), glassOutInfo.getWidth(), glassOutInfo.getHeight(), 0, 0); |
| | | if (null == edgStorageCageDetails && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, task.getGlassIdIn()) |
| | |
| | | } |
| | | } |
| | | if (null == edgStorageCageDetails) { |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), 0, 0); |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), 0, 0, 0, 0); |
| | | } |
| | | if (edgStorageCageDetails == null && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | //和上次任务不存在相同尺寸 |
| | |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
| | | password: 123456 |
| | | kangaroohy: |
| | | milo: |
| | | enabled: false |
| | | primary: default |
| | | config: |
| | | default: |
| | | endpoint: opc.tcp://192.168.2.100:49320 |
| | | security-policy: basic256sha256 |
| | | username: admin |
| | | password: 1qaz2wsx3edc4rfv |
| | |
| | | secondLength: 300 |
| | | glassGap: 2500 |
| | | cellLength: 2500 |
| | | maxThickness: 8 |
| | | sequence: |
| | | order: false |
| | | kangaroohy: |
| | | milo: |
| | | enabled: true |
| | | primary: default |
| | | config: |
| | | default: |
| | | endpoint: opc.tcp://10.153.19.150:49320 |
| | | security-policy: basic256sha256 |
| | | username: admin |
| | | password: 1qaz2wsx3edc4rfv |
| | | |
| | |
| | | <if test="height != 0"> |
| | | and t.height = #{height} |
| | | </if> |
| | | <if test="cell == 2"> |
| | | and t.thickness < #{maxThickness} |
| | | </if> |
| | | </where> |
| | | order by total_count desc, glass_count, abs(t.slot - #{currentSlot}) |
| | | ) |
| | |
| | | AND t1.state = 100 |
| | | AND t1.device_id = #{deviceId} |
| | | <if test="width != 0"> |
| | | and t.width = #{width} |
| | | and t1.width = #{width} |
| | | </if> |
| | | <if test="height != 0"> |
| | | and t.height = #{height} |
| | | and t1.height = #{height} |
| | | </if> |
| | | <if test="cell == 1"> |
| | | and #{minOneFirstLength} <= GREATEST(t.width, t.width) |
| | | and #{minOneSecondLength} <= least(t.width, t.width) |
| | | and #{minOneFirstLength} <= GREATEST(t1.width, t1.height) |
| | | and #{minOneSecondLength} <= least(t1.width, t1.height) |
| | | </if> |
| | | <if test="cell == 2"> |
| | | and #{maxTwoFirstLength} >= GREATEST(t.width, t.width) |
| | | and #{maxTwoSecondLength} >= least(t.width, t.width) |
| | | and #{maxTwoFirstLength} >= GREATEST(t1.width, t1.height) |
| | | and #{maxTwoSecondLength} >= least(t1.width, t1.height) |
| | | and t1.thickness < #{maxThickness} |
| | | </if> |
| | | </where> |
| | | ORDER BY abs(t.slot - #{currentCell}) |