Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
# Conflicts:
# hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
| | |
| | | </div> |
| | | </div> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | <el-col :span="4"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('hellow.countOutTwo')" style="width: 14vw"> |
| | | {{ countOutTwo }} |
| | | {{ countOutOne }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('hellow.totalAreaOutTwo')" style="width: 14vw"> |
| | | {{ totalAreaOutTwo }} |
| | | {{ totalAreaOutOne }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | |
| | | const tableDatax = ref([]) |
| | | const currentPage2 = ref(1) |
| | | const totalRecords = ref(0) |
| | | const countOutTwo = ref(0) |
| | | const totalAreaOutTwo = ref(0) |
| | | const countOutOne = ref(0) |
| | | const totalAreaOutOne = ref(0) |
| | | const glassId = ref(''); |
| | | const startSlot = ref(''); |
| | | const targetSlot = ref(''); |
| | |
| | | </el-table> |
| | | </el-dialog> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindbd" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindbd" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe :src="iframeUrl" marginwidth="2000px" marginheight="2000px" width="100%" height="750px" |
| | | frameborder="0"></iframe> |
| | | </el-dialog> |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindbd" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindbd" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | </el-card> |
| | | </div> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="10vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="10vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="projectNumber" fixed align="center" :label="$t('hellow.cardnumber')" min-width="20"/> |
| | | <el-table-column prop="productname" fixed align="center" :label="$t('large.productname')" min-width="20"/> |
| | | <el-table-column fixed="right" :label="$t('hellow.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button type="text" plain @click="handletake(scope.row)">{{ $t('hellow.claimquest') }}</el-button> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | } |
| | | }; |
| | | const parseData = (rawData) => { |
| | | return Object.keys(rawData).map(projectNumber => ({ |
| | | projectNumber, |
| | | records: rawData[projectNumber] |
| | | })); |
| | | return Object.entries(rawData).map(([compositeKey, records]) => { |
| | | const [projectNumber, productName] = compositeKey.split(':'); |
| | | return { |
| | | projectNumber, |
| | | productname: productName, |
| | | records: records.map(record => ({ |
| | | ...record, |
| | | })) |
| | | }; |
| | | }); |
| | | }; |
| | | const fetchFlowBind = async (flowCardId, layer, page) => { |
| | | try { |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="projectNumber" fixed align="center" :label="$t('hellow.cardnumber')" min-width="20"/> |
| | | <el-table-column prop="productname" fixed align="center" :label="$t('large.productname')" min-width="20"/> |
| | | <el-table-column fixed="right" :label="$t('hellow.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button type="text" plain @click="handletake(scope.row)">{{ $t('hellow.claimquest') }}</el-button> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | } |
| | | }; |
| | | const parseData = (rawData) => { |
| | | return Object.keys(rawData).map(projectNumber => ({ |
| | | projectNumber, |
| | | records: rawData[projectNumber] |
| | | })); |
| | | return Object.entries(rawData).map(([compositeKey, records]) => { |
| | | const [projectNumber, productName] = compositeKey.split(':'); |
| | | return { |
| | | projectNumber, |
| | | productname: productName, |
| | | records: records.map(record => ({ |
| | | ...record, |
| | | })) |
| | | }; |
| | | }); |
| | | }; |
| | | const fetchFlowBind = async (flowCardId, layer, page) => { |
| | | try { |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="projectNumber" fixed align="center" :label="$t('hellow.cardnumber')" min-width="20"/> |
| | | <el-table-column prop="productname" fixed align="center" :label="$t('large.productname')" min-width="20"/> |
| | | <el-table-column fixed="right" :label="$t('hellow.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button type="text" plain @click="handletake(scope.row)">{{ $t('hellow.claimquest') }}</el-button> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | } |
| | | }; |
| | | const parseData = (rawData) => { |
| | | return Object.keys(rawData).map(projectNumber => ({ |
| | | projectNumber, |
| | | records: rawData[projectNumber] |
| | | })); |
| | | return Object.entries(rawData).map(([compositeKey, records]) => { |
| | | const [projectNumber, productName] = compositeKey.split(':'); |
| | | return { |
| | | projectNumber, |
| | | productname: productName, |
| | | records: records.map(record => ({ |
| | | ...record, |
| | | })) |
| | | }; |
| | | }); |
| | | }; |
| | | const fetchFlowBind = async (flowCardId, layer, page) => { |
| | | try { |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%"> |
| | | <el-dialog v-model="blindb" top="5vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | |
| | | */ |
| | | @ApiModelProperty(value = "高") |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度") |
| | | private double thickness; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | |
| | | private Integer glassType; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 8) |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 钢化是否接受横放 |
| | | */ |
| | | @ApiModelProperty(value = "钢化是否接受横放", position = 10) |
| | |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | | |
| | | |
| | | // @Resource(name = "cacheGlassStartCallback") |
| | | // SubscriptionCallback cacheGlassStartCallback; |
| | | // |
| | | // @Resource(name = "cacheGlassTestCallback") |
| | | // SubscriptionCallback cacheGlassTestCallback; |
| | | |
| | | @Resource |
| | | EdgStorageDeviceTaskService edgStorageDeviceTaskService; |
| | | // @Resource |
| | | // EdgGlassTaskQueueInfoService edgGlassTaskQueueInfoService; |
| | | @Autowired |
| | | EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | |
| | | @Resource |
| | | GlassInfoService glassInfoService; |
| | | @Resource |
| | |
| | | private String glassInIdTwo = ""; |
| | | private String glassIdOne = ""; |
| | | private String glassIdTwo = ""; |
| | | |
| | | // @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | // public void startOneOpcTask() throws Exception { |
| | | // miloService.subscriptionFromOpcUa(Arrays.asList("mes.WL1.edg_storage_device_one_task[1].task_state"), cacheGlassStartCallback); |
| | | // } |
| | | // |
| | | // @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | // public void startTwoOpcTask() throws Exception { |
| | | // miloService.subscriptionFromOpcUa(Arrays.asList("mes.WL2.edg_storage_device_two_task[1].task_state"), cacheGlassStartCallback); |
| | | // } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void startOneOpcTask() { |
| | |
| | | if (2 == taskHistory.getTaskType()) { |
| | | remainWidth = 0; |
| | | } else { |
| | | EdgStorageCage storageCage = edgStorageCageService.getOne(new LambdaQueryWrapper<EdgStorageCage>() |
| | | .eq(EdgStorageCage::getDeviceId, device).eq(EdgStorageCage::getSlot, slot)); |
| | | EdgStorageCageDetails bigDetails = list.stream().filter(e -> e.getGlassId().equals(taskHistory.getGlassIdIn())).findFirst().orElse(null); |
| | | remainWidth = storageCage.getRemainWidth() - glassGap - (int) Math.max(bigDetails.getWidth(), bigDetails.getHeight()); |
| | | for (EdgStorageCageDetails item : list) { |
| | | remainWidth = remainWidth - glassGap - (int) Math.max(item.getWidth(), item.getHeight()); |
| | | } |
| | | if (remainWidth <= 0) { |
| | | remainWidth = 0; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | * @author makejava |
| | | * @since 2024-10-27 21:04:33 |
| | | */ |
| | | @ApiModel(description = "(EdgStorageDeviceTaskHistory)表实体类") |
| | | @SuppressWarnings("serial") |
| | | @Data |
| | | public class EdgStorageDeviceTaskHistory extends Model<EdgStorageDeviceTaskHistory> { |
| | | /** |
| | | * 工程表id |
| | | */ |
| | | @ApiModelProperty(value = "工程表id", position = 1) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 进片玻璃id |
| | | */ |
| | | @ApiModelProperty(value = "进片玻璃id", position = 2) |
| | | private String glassIdIn; |
| | | /** |
| | | * 出片玻璃id |
| | | */ |
| | | @ApiModelProperty(value = "出片玻璃id", position = 3) |
| | | private String glassIdOut; |
| | | /** |
| | | * 当前层号 |
| | | */ |
| | | @ApiModelProperty(value = "当前层号", position = 4) |
| | | private Integer currentCell; |
| | | /** |
| | | * 层号 |
| | | */ |
| | | @ApiModelProperty(value = "目标层号", position = 5) |
| | | private Integer startCell; |
| | | /** |
| | | * 预留层号 |
| | | */ |
| | | @ApiModelProperty(value = "预留层号", position = 6) |
| | | private Integer endCell; |
| | | /** |
| | | * 任务状态 0默认空任务 1 进片 2出片 3 直通 4执行中 5结束任务 6其他 |
| | | */ |
| | | @ApiModelProperty(value = "任务状态 0默认空任务 1 进片 2出片 3 直通 4执行中 5结束任务 6其他", position = 7) |
| | | private Integer taskState; |
| | | /** |
| | | * 任务状态 0默认空任务 1 进片 2出片 3 直通 4执行中 5结束任务 6其他 |
| | | */ |
| | | @ApiModelProperty(value = "任务状态 0默认空任务 1 进片 2出片 3 直通 4执行中 5结束任务 6其他", position = 8) |
| | | private Integer taskType; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间", position = 9) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间", position = 10) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateTime; |
| | |
| | | /** |
| | | * 设备信息 |
| | | */ |
| | | @ApiModelProperty(value = "设备信息", position = 11) |
| | | private Integer deviceId; |
| | | |
| | | |
| | |
| | | import com.mes.edgstoragecage.entity.vo.EdgSlotRemainVO; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.job.OpcCacheGlassTask; |
| | | import com.mes.opctask.entity.EdgStorageDeviceTask; |
| | | import com.mes.opctask.entity.EdgStorageDeviceTaskHistory; |
| | | import com.mes.opctask.mapper.EdgStorageDeviceTaskMapper; |
| | |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, deviceId) |
| | | .orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime).last("limit 1")); |
| | | if (taskHistory == null) { |
| | | return Boolean.FALSE; |
| | | } |
| | | Integer cell = taskHistory.getStartCell(); |
| | | Integer taskType = taskHistory.getTaskType(); |
| | | if (Const.GLASS_CACHE_TYPE_IN_ALL.contains(taskType)) { |
| | | String glassId = taskHistory.getGlassIdIn(); |
| | | edgStorageCageDetailsService.remove(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, cell) |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | } else { |
| | | String glassId = taskHistory.getGlassIdOut(); |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .set(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, cell) |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | } |
| | | if (taskHistory != null) { |
| | | Integer cell = taskHistory.getStartCell(); |
| | | Integer taskType = taskHistory.getTaskType(); |
| | | if (Const.GLASS_CACHE_TYPE_IN_ALL.contains(taskType)) { |
| | | String glassId = taskHistory.getGlassIdIn(); |
| | | edgStorageCageDetailsService.remove(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, cell) |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | } else { |
| | | String glassId = taskHistory.getGlassIdOut(); |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .set(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, cell) |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | } |
| | | |
| | | edgStorageDeviceTaskHistoryService.update(new LambdaUpdateWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, deviceId) |
| | | .set(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_FAILURE) |
| | | ); |
| | | //计算每个各自的剩余尺寸信息 |
| | | resetSlotRemainWidth(); |
| | | edgStorageDeviceTaskHistoryService.update(new LambdaUpdateWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, deviceId) |
| | | .set(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_FAILURE) |
| | | ); |
| | | //计算每个各自的剩余尺寸信息 |
| | | resetSlotRemainWidth(); |
| | | } |
| | | //最后更新任务,保证任务前的动作都做完 |
| | | EdgStorageDeviceTask task = new EdgStorageDeviceTask(); |
| | | task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY); |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("取消当前钢化") |
| | | @PostMapping("/cancelTemperingTask") |
| | | public Result<Boolean> cancelTemperingTask() { |
| | | boolean result = bigStorageCageDetailsService.cancelTemperingTask(); |
| | | if (result == true) { |
| | | return Result.build(200, "指定钢化成功", result); |
| | | } else { |
| | | return Result.build(200, "已存在钢化任务,请等待钢化完成再指定钢化", result); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("钢化/非钢化查询:0 非钢化 1:钢化") |
| | | @PostMapping("/selectTemperingGlass") |
| | | public Result<List<TemperingGlassCountDTO>> selectTemperingGlass(int isTempering) { |
| | |
| | | @ApiModelProperty(value = "玻璃类型", position = 8) |
| | | private Integer glassType; |
| | | |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 11) |
| | | private double thickness; |
| | | |
| | | @ApiModelProperty(value = "旋转角度", position = 12) |
| | | private Integer angle; |
| | | |
| | |
| | | List<BigStorageCageDetails> queryRealGlassInfo(BigStorageQueryVO bigStorageQueryVO); |
| | | |
| | | Map<Integer, List<BigStorageVO>> querybigStorageCageDetail(); |
| | | |
| | | /** |
| | | * 取消钢化任务 |
| | | * |
| | | * @return |
| | | */ |
| | | boolean cancelTemperingTask(); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Map<Integer, List<BigStorageVO>> querybigStorageCageDetail() { |
| | | List<BigStorageVO> bigStorageCages= baseMapper.querybigStorageCageDetail(); |
| | | List<BigStorageVO> bigStorageCages = baseMapper.querybigStorageCageDetail(); |
| | | return bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | } |
| | | |
| | | @Override |
| | | public boolean cancelTemperingTask() { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public String temperingSwitch(Boolean flag) { |
| | | redisUtil.setCacheObject("temperingSwitch", flag); |
| | | return "success"; |
| | |
| | | public List<Map<String, Object>> selectBigStorageCageUsage() { |
| | | QueryWrapper<BigStorageCage> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = " + slotWidth + " THEN 1 ELSE 0 END) / COUNT(device_id), 2)*100 AS percentage,SUM(CASE WHEN remain_width = " + slotWidth + " THEN 1 ELSE 0 END) AS count") |
| | | .eq("enable_state", Const.SLOT_ON) |
| | | .groupBy("device_id"); |
| | | List<Map<String, Object>> bigStorageCageUsages = baseMapper.selectMaps(wrapper); |
| | | |
| | |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskStateList()), BigStorageCageHistoryTask::getTaskState, request.getTaskStateList()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskTypeList()), BigStorageCageHistoryTask::getTaskType, request.getTaskTypeList()) |
| | | .between(BigStorageCageHistoryTask::getCreateTime, request.getBeginDate(), request.getEndDate()) |
| | | .orderByDesc(BigStorageCageHistoryTask::getCreateTime); |
| | | .orderByAsc(BigStorageCageHistoryTask::getId); |
| | | return this.page(page, wrapper); |
| | | } |
| | | |
| | |
| | | ReadWriteEntity countEntity = miloService.readFromOpcUa("DLP1A.DLP1A.glassCount"); |
| | | if (null == countEntity.getValue() || Integer.parseInt(countEntity.getValue() + "") != glassIdList.size()) { |
| | | log.info("当前大车进片玻璃数量{}与mes读取到的数量{}不匹配,结束进片任务", countEntity.getValue(), glassIdList.size()); |
| | | //向plc发送报警:当前大车进片玻璃数量与mes读取到的数量不匹配 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 1)); |
| | | return; |
| | | } |
| | | Map<String, Long> glassCountMap = glassIdList.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting())); |
| | | for (Map.Entry<String, Long> entry : glassCountMap.entrySet()) { |
| | | if (entry.getValue() > 1) { |
| | | log.info("进片玻璃{}存在相同,结束本次任务", entry.getKey()); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:同一车进片玻璃存在相同 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 2)); |
| | | return; |
| | | } |
| | | } |
| | |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); |
| | | if (CollectionUtil.isNotEmpty(detailsList)) { |
| | | log.info("理片笼存在相同的进片玻璃{},结束本次任务", detailsList); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:理片笼存在相同的进片玻璃 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 4)); |
| | | return; |
| | | } |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList)); |
| | | |
| | | if (glassInfoList.size() != inTaskList.size()) { |
| | | log.info("进片任务数量{}与玻璃数量{}不匹配,结束本次进片", inTaskList.size(), glassInfoList.size()); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:进片任务数量与系统查询到的玻璃数量不匹配 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 8)); |
| | | return; |
| | | } |
| | | //按照玻璃厚度分组,判断剩余格子是否可以存放 |
| | | Map<Double, Long> thickCountMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getThickness, Collectors.counting())); |
| | | if(glassInfoList.get(0).getThickness() < slotMaxthickness){ |
| | | if (glassInfoList.get(0).getThickness() < slotMaxthickness) { |
| | | for (Map.Entry<Double, Long> entry : thickCountMap.entrySet()) { |
| | | int count = bigStorageCageService.count(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON).eq(BigStorageCage::getRemainWidth, slotWidth) |
| | |
| | | .ge(BigStorageCage::getMaxThickness, entry.getKey())); |
| | | if (count < entry.getValue()) { |
| | | log.info("笼内格子剩余数量不足,结束本次进片"); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:笼内格子剩余数量不足 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 16)); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | //todo:超大尺寸 |
| | | //超大尺寸 |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() >= slotMaxthickness) { |
| | | int count = bigStorageCageDetailsService.count(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getSlot, THROUGH_SLOT) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | if (count > 0) { |
| | | log.info("直通片台存在玻璃,结束本次进片"); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:直通片台存在玻璃,无法继续直通 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 64)); |
| | | return; |
| | | } |
| | | } |
| | |
| | | //任务数据:获取车子存放玻璃最大数量,玻璃间隔 |
| | | List<T> outGlassList = list; |
| | | if (!THROUGH_SLOT.equals(list.get(0).getSlot())) { |
| | | List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId( |
| | | list.get(0).getEngineerId(), list.get(0).getTemperingLayoutId(), list.get(0).getTemperingFeedSequence()); |
| | | outGlassList = list.stream().filter(e -> glassIdList.contains(e.getGlassId())).collect(Collectors.toList()); |
| | | //todo:临时解决方案:出片时考虑玻璃碰撞,改为一片一出 |
| | | // 界面关闭调度开关 !Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType) |
| | | if (list.get(0).getThickness() >= 8) { |
| | | outGlassList = list.subList(0, 1); |
| | | } else { |
| | | List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId( |
| | | list.get(0).getEngineerId(), list.get(0).getTemperingLayoutId(), list.get(0).getTemperingFeedSequence()); |
| | | outGlassList = list.stream().filter(e -> glassIdList.contains(e.getGlassId())).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | Assert.isFalse(CollectionUtil.isEmpty(outGlassList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", outGlassList.size()); |
| | |
| | | T.TEMPERING_LAYOUT_ID, |
| | | COUNT(T.TEMPERING_FEED_SEQUENCE) AS COUNT |
| | | FROM GLASS_INFO T |
| | | LEFT JOIN DAMAGE T1 |
| | | ON T.ENGINEER_ID = T1.ENGINEER_ID |
| | | AND T.GLASS_ID = T1.GLASS_ID |
| | | AND (T1.TYPE = 8 |
| | | OR T1.TYPE = 9) |
| | | LEFT JOIN DAMAGE T1 |
| | | ON T.ENGINEER_ID = T1.ENGINEER_ID |
| | | AND T.GLASS_ID = T1.GLASS_ID |
| | | AND (T1.TYPE = 8 |
| | | OR T1.TYPE = 9) |
| | | WHERE T1.GLASS_ID IS NULL |
| | | GROUP BY T.ENGINEER_ID, |
| | | T.TEMPERING_LAYOUT_ID |
| | | T.TEMPERING_LAYOUT_ID |
| | | ) T2 |
| | | INNER JOIN (SELECT ENGINEER_ID, TEMPERING_LAYOUT_ID, COUNT(TEMPERING_FEED_SEQUENCE) AS COUNT |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
| | |
| | | total_count, |
| | | real_count, |
| | | ifnull(damage_count, 0) as damage_count, |
| | | total_count - real_count - ifnull(damage_count, 0) as lack_count |
| | | |
| | | case when total_count - real_count - ifnull(damage_count, 0) < 0 then 0 else |
| | | total_count - real_count - ifnull(damage_count, 0) end as lack_count |
| | | from big_details_temp t |
| | | inner join glass_info_temp t1 on t.engineer_id = t1.engineer_id and |
| | | t.tempering_layout_id = t1.tempering_layout_id |
| | |
| | | </select> |
| | | <select id="querybigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO"> |
| | | select bsc.device_id, bsc.slot, count(bscd.glass_id) as count |
| | | from big_storage_cage bsc left join big_storage_cage_details bscd |
| | | on bsc.slot=bscd.slot and bscd.state in (100, 102, 103, 104) |
| | | from big_storage_cage bsc |
| | | left join big_storage_cage_details bscd |
| | | on bsc.slot = bscd.slot and bscd.state in (100, 102, 103, 104) |
| | | group by bsc.device_id, bsc.slot |
| | | order by bsc.device_id, bsc.slot |
| | | </select> |
| | |
| | | //2、1号上片位是否有原片,原片尺寸是否和上片待上片的尺寸一致 |
| | | //3、1号无原片,且没有架子,2号上片位尺寸是否和带上片尺寸一致 |
| | | //4、不一致可能出现玻璃破损导致的上一架原片数量不够 |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void opcLoadGlassOne() { |
| | | opcLoadGlassChild(LOAD_GLASS_DEVICE_ONE_TASK, LOAD_GLASS_ONE_DEVICE); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void opcLoadGlassTwo() { |
| | | opcLoadGlassChild(LOAD_GLASS_DEVICE_TWO_TASK, LOAD_GLASS_TWO_DEVICE); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void opcLoadGlassOneFinish() { |
| | | opcLoadGlassFinishChid(LOAD_GLASS_DEVICE_ONE_TASK, LOAD_GLASS_ONE_DEVICE); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void opcLoadGlassTwoFinish() { |
| | | opcLoadGlassFinishChid(LOAD_GLASS_DEVICE_TWO_TASK, LOAD_GLASS_TWO_DEVICE); |
| | | } |
| | |
| | | /** |
| | | * 定时任务扫码已完成上片的工程,将工程状态改为已完成,同步pp表的工程表,状态改为300 |
| | | */ |
| | | @Scheduled(fixedDelay = 3000) |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void updateEngineerState() { |
| | | log.info("修改已完成工程状态任务开始执行"); |
| | | List<Engineering> engineerings = engineeringMapper.selectList(new LambdaQueryWrapper<Engineering>().eq(Engineering::getState, Const.ENGINEERING_RUNNING)); |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | |
| | | import com.mes.opctask.service.LoadGlassDeviceTaskService; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation; |
| | | import com.mes.rawglassstation.service.RawGlassStorageStationService; |
| | | import com.mes.tools.DateUtil; |
| | | import com.mes.tools.WebSocketServer; |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadGlassHome() { |
| | | @Scheduled(fixedDelay = 10000) |
| | | public void loadOneGlass() { |
| | | loadGlassChild("loadGlassRequestOne", 5, LOAD_GLASS_DEVICE_ONE_TASK, "loadGlassOne"); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 10) |
| | | public void loadTwoGlass() { |
| | | loadGlassChild("loadGlassRequestTwo", 6, LOAD_GLASS_DEVICE_TWO_TASK, "loadGlassTwo"); |
| | | } |
| | | |
| | | |
| | | private void loadGlassChild(String redisRequest, int stationCell, String tableName, String webSocketName) { |
| | | try { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.prioritylist(); |
| | | if (upPattenUsages != null) { |
| | | jsonObject.append("prioritylist", upPattenUsages); |
| | | //当前线路正在执行的工程 |
| | | Engineering engineering = engineeringService.getOne(new LambdaQueryWrapper<Engineering>().eq(Engineering::getStationCell, stationCell) |
| | | .eq(Engineering::getState, 1).last("limit 1")); |
| | | if (null != engineering) { |
| | | jsonObject.append("engineering", engineering); |
| | | } |
| | | //查询1号线的任务 |
| | | Engineering request = redisUtil.getCacheObject("loadGlassRequest"); |
| | | //获取当前线路正在执行的工程原片信息 |
| | | Engineering request = redisUtil.getCacheObject(redisRequest); |
| | | if (request == null) { |
| | | request = new Engineering(); |
| | | request.setStationCell(5); |
| | | request.setStationCell(stationCell); |
| | | } |
| | | List<UpPattenUsage> upPattenUsages1 = upPattenUsageService.selectLoadTask(request); |
| | | jsonObject.append("loadTask1", upPattenUsages1); |
| | | //查询2号线的任务 |
| | | Engineering request2 = redisUtil.getCacheObject("loadGlassRequest2"); |
| | | if (request2 == null) { |
| | | request2 = new Engineering(); |
| | | request2.setStationCell(6); |
| | | } |
| | | List<UpPattenUsage> upPattenUsages2 = upPattenUsageService.selectLoadTask(request2); |
| | | jsonObject.append("loadTask2", upPattenUsages2); |
| | | // 查询工位任务 |
| | | //联机状态 |
| | | LoadGlassDeviceTask LoadOneState = loadGlassDeviceTaskService.queryTaskMessage(LOAD_GLASS_DEVICE_ONE_TASK); |
| | | LoadGlassDeviceTask LoadTwoState = loadGlassDeviceTaskService.queryTaskMessage(LOAD_GLASS_DEVICE_TWO_TASK); |
| | | jsonObject.append("LoadOneState", LoadOneState.getInkageState()); |
| | | jsonObject.append("LoadTwoervice", LoadTwoState.getInkageState()); |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectLoadTask(request); |
| | | jsonObject.append("upPattenUsages", upPattenUsages); |
| | | |
| | | //联机状态 |
| | | LoadGlassDeviceTask LoadTask = loadGlassDeviceTaskService.queryTaskMessage(tableName); |
| | | jsonObject.append("inkageState", LoadTask.getInkageState()); |
| | | //工位信息 |
| | | List<RawGlassStorageDetails> rawGlassStorageDetailList = rawGlassStorageStationService.listRawGlassDetails(); |
| | | List<RawGlassStorageDetails> stationOneList = rawGlassStorageDetailList.stream().filter(item -> item.getDeviceId() == 5).collect(Collectors.toList()); |
| | | List<RawGlassStorageDetails> stationTwoList = rawGlassStorageDetailList.stream().filter(item -> item.getDeviceId() == 6).collect(Collectors.toList()); |
| | | jsonObject.append("stationOne", stationOneList); |
| | | jsonObject.append("stationTwo", stationTwoList); |
| | | //是否开始工程 |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | jsonObject.append("engineering", engineering); |
| | | //工位信息 |
| | | List<UpWorkstation> upWorkstations = upWorkstationService.list(); |
| | | jsonObject.append("list", upWorkstations); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | List<RawGlassStorageDetails> stationList = rawGlassStorageDetailList.stream().filter(item -> item.getDeviceId() == stationCell).collect(Collectors.toList()); |
| | | jsonObject.append("stationList", stationList); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get(webSocketName); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | // } |
| | | } else { |
| | | log.info("loadGlass is closed"); |
| | | } |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | // @Scheduled(fixedDelay = 5000) |
| | | public void loadGlassStatus() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | |
| | | } |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | // public void loadGlassIsRun() { |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // |
| | | // ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlassIsRun"); |
| | | // if (sendwServer != null) { |
| | | // for (WebSocketServer webserver : sendwServer) { |
| | | // if (webserver != null) { |
| | | // webserver.sendMessage(jsonObject.toString()); |
| | | // } else { |
| | | // log.info("loadGlassIsRun is closed"); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | public void overTask(String loadStatus, int state) { |
| | | |
| | |
| | | public String setRawGlassTaskRequest(Engineering request) { |
| | | // 调用 RedisUtil 保存 loadGlass |
| | | if (request == null) { |
| | | redisUtil.deleteObject("loadGlassRequest"); |
| | | redisUtil.deleteObject("loadGlassRequestOne"); |
| | | } else { |
| | | redisUtil.setCacheObject("loadGlassRequest", request); |
| | | redisUtil.setCacheObject("loadGlassRequestOne", request); |
| | | } |
| | | return "success"; |
| | | } |
| | |
| | | public String setRawGlassTaskRequest2(Engineering request) { |
| | | // 调用 RedisUtil 保存 loadGlass |
| | | if (request == null) { |
| | | redisUtil.deleteObject("loadGlassRequest2"); |
| | | redisUtil.deleteObject("loadGlassRequestTwo"); |
| | | } else { |
| | | redisUtil.setCacheObject("loadGlassRequest2", request); |
| | | redisUtil.setCacheObject("loadGlassRequestTwo", request); |
| | | } |
| | | return "success"; |
| | | } |
| | |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 产品名称 |
| | | */ |
| | | private String productName; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String filmsId; |
| | |
| | | |
| | | int queryLayerByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | void clearDirtyFlowCardData(@Param("flowCardId")String flowCardId, @Param("layer")int layer); |
| | | void clearDirtyFlowCardData(@Param("flowCardId") String flowCardId, @Param("layer") int layer); |
| | | |
| | | /** |
| | | * 按照流程卡获取产品名称 |
| | | * |
| | | * @param flowCardId |
| | | * @return |
| | | */ |
| | | String queryProductNameByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | } |
| | | |
| | |
| | | List<FlowCardGlassInfoDTO> dtos = new ArrayList<>(); |
| | | listMap.forEach((e, v) -> { |
| | | HollowBigStorageCageDetails cageDetails = v.get(0); |
| | | dtos.addAll(hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE)); |
| | | //按照流程卡获取对应的产品名称 |
| | | String productName = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId()); |
| | | List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE); |
| | | for (FlowCardGlassInfoDTO item : flowCardInfoList) { |
| | | item.setProductName(productName); |
| | | dtos.add(item); |
| | | } |
| | | }); |
| | | Map<String, FlowCardGlassInfoDTO> result = dtos.stream() |
| | | .collect(Collectors.toMap( |
| | |
| | | }, |
| | | (dto1, dto2) -> { |
| | | dto1.setRealCount(dto1.getRealCount() + dto2.getRealCount()); // 累加 realCount |
| | | dto1.setLayer(Math.max(dto1.getLayer(),dto2.getLayer())); // 累加 最大层数 |
| | | dto1.setLayer(Math.max(dto1.getLayer(), dto2.getLayer())); // 累加 最大层数 |
| | | return dto1; // 返回合并后的对象 |
| | | } |
| | | )); |
| | | return dtos.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId)); |
| | | return dtos.stream().collect(Collectors.groupingBy(e -> e.getFlowCardId() + ":" + e.getProductName())); |
| | | } |
| | | |
| | | @Override |
| | |
| | | }, |
| | | (dto1, dto2) -> { |
| | | dto1.setRealCount(dto1.getRealCount() + dto2.getRealCount()); // 累加 realCount |
| | | dto1.setLayer(Math.max(dto1.getLayer(),dto2.getLayer())); // 累加 最大层数 |
| | | dto1.setLayer(Math.max(dto1.getLayer(), dto2.getLayer())); // 累加 最大层数 |
| | | dto1.setSlotCount(dto1.getSlotCount() + dto2.getSlotCount()); |
| | | return dto1; // 返回合并后的对象 |
| | | } |
| | |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskStateList()), HollowBigStorageCageHistoryTask::getTaskState, request.getTaskStateList()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskTypeList()), HollowBigStorageCageHistoryTask::getTaskType, request.getTaskTypeList()) |
| | | .between(HollowBigStorageCageHistoryTask::getCreateTime, request.getBeginDate(), request.getEndDate()) |
| | | .orderByDesc(HollowBigStorageCageHistoryTask::getCreateTime); |
| | | .orderByAsc(HollowBigStorageCageHistoryTask::getId); |
| | | return this.page(page, wrapper); |
| | | } |
| | | |
| | |
| | | for (Map.Entry<String, Long> entry : glassCountMap.entrySet()) { |
| | | if (entry.getValue() > 1) { |
| | | log.info("进片玻璃{}存在相同,结束本次任务", entry.getKey()); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:同一车进片玻璃存在相同 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 2)); |
| | | return; |
| | | } |
| | | } |
| | |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); |
| | | if (CollectionUtil.isNotEmpty(detailsList)) { |
| | | log.info("理片笼存在相同的进片玻璃{},结束本次任务", detailsList); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:理片笼存在相同的进片玻璃 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 4)); |
| | | return; |
| | | } |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList)); |
| | | |
| | | if (glassInfoList.size() != inTaskList.size()) { |
| | | log.info("进片任务数量{}与玻璃数量{}不匹配,结束本次进片", inTaskList.size(), glassInfoList.size()); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:进片任务数量与系统查询到的玻璃数量不匹配 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 8)); |
| | | return; |
| | | } |
| | | //按照玻璃厚度分组,判断剩余格子是否可以存放 |
| | |
| | | .ge(HollowBigStorageCage::getMaxThickness, entry.getKey())); |
| | | if (count < entry.getValue()) { |
| | | log.info("笼内格子剩余数量不足,结束本次进片"); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:笼内格子剩余数量不足 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 16)); |
| | | return; |
| | | } |
| | | } |
| | | //todo:超大尺寸 |
| | | //超大尺寸 |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() > slotMaxthickness) { |
| | | int count = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT) |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | if (count > 0) { |
| | | log.info("直通片台存在玻璃,结束本次进片"); |
| | | //todo:向plc发送报警 |
| | | //向plc发送报警:直通片台存在玻璃,无法继续直通 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 64)); |
| | | return; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | private <T extends HollowBigStorageCageBaseInfo> Boolean hollowOutGlassByIsPair(List<T> list, int targetSlot, int isPair, int totalLayer, int isForce) { |
| | | private <T extends HollowBigStorageCageBaseInfo> Boolean hollowOutGlassByIsPair(List<T> list, int targetSlot, int isPair, int totalLayer, int isForce) throws Exception { |
| | | List<T> resultList = new ArrayList<>(); |
| | | List<T> tempList = new ArrayList<>(); |
| | | int taskType = Const.BIG_STORAGE_AFTER_OUT; |
| | |
| | | .ge(HollowBigStorageCage::getMaxThickness, list.get(0).getThickness()) |
| | | .eq(HollowBigStorageCage::getRemainWidth, slotWidth) |
| | | .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1")); |
| | | |
| | | if (null == storageCage) { |
| | | //向plc发送报警:直通片台存在玻璃,无法继续直通 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 16)); |
| | | Assert.isFalse(storageCage == null, "任务调度没有多余格子,结束调度任务"); |
| | | } |
| | | |
| | | targetSlot = storageCage.getSlot(); |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, 0).eq(HollowBigStorageCage::getSlot, targetSlot)); |
| | |
| | | @Resource |
| | | RedisUtil redisUtil; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void hollowGlassTask() { |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void hollowGlassTaskOne() { |
| | | hollowGlassTaskChild(930, "CMJ1.CMJ1.isFree", "HollowGlassOne"); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void hollowGlassTaskTwo() { |
| | | hollowGlassTaskChild(931, "ZKQ2.ZKQ2.isFree", "HollowGlassTwo"); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void hollowGlassTaskThree() { |
| | | //todo:暂无三线的空闲状态信号,临时标签空闲状态 |
| | | hollowGlassTaskChild(932, "ZKQ3.ZKQ3.isFree", "HollowGlassThree"); |
| | | } |
| | | |
| | | public void hollowGlassTaskChild(int cell, String isFreeTag, String websocketName) { |
| | | List<HollowGlassOutRelationInfo> taskList = hollowGlassOutRelationInfoService.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)); |
| | | .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START).eq(HollowGlassOutRelationInfo::getCell, cell)); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if (CollectionUtil.isNotEmpty(taskList)) { |
| | | List<Long> taskIdList = taskList.stream().map(HollowGlassOutRelationInfo::getId).collect(Collectors.toList()); |
| | | List<HollowGlassQueueInfo> list = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>().in(HollowGlassQueueInfo::getRelationId, taskIdList)); |
| | | Map<Integer, List<HollowGlassQueueInfo>> listMap = list.stream().collect(Collectors.groupingBy(HollowGlassQueueInfo::getCell)); |
| | | jsonObject.append("930", listMap.get(930)); |
| | | jsonObject.append("931", listMap.get(931)); |
| | | jsonObject.append("932", listMap.get(932)); |
| | | jsonObject.append("queueInfo", list); |
| | | } |
| | | try { |
| | | //930空闲信号 |
| | | ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree"); |
| | | jsonObject.append("freeOneRequestEntity", freeOneRequestEntity.getValue()); |
| | | //931空闲信号 |
| | | ReadWriteEntity freeTwoRequestEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree"); |
| | | jsonObject.append("freeTwoRequestEntity", freeTwoRequestEntity.getValue()); |
| | | ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa(isFreeTag); |
| | | jsonObject.append("freeRequest", freeOneRequestEntity.getValue()); |
| | | } catch (Exception e) { |
| | | log.error("opc存在异常", e); |
| | | } |
| | | |
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("HollowGlass"); |
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get(websocketName); |
| | | if (CollectionUtil.isNotEmpty(sendwServer)) { |
| | | for (WebSocketServer socketServer : sendwServer) { |
| | | if (socketServer != null && socketServer.session.isOpen()) { |
| | |
| | | //931空闲信号 |
| | | ReadWriteEntity freeTwoRequestEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree"); |
| | | jsonObject.append("freeTwoRequestEntity", freeTwoRequestEntity.getValue()); |
| | | //932空闲信号 |
| | | ReadWriteEntity freeThreeRequestEntity = miloService.readFromOpcUa("ZKQ3.ZKQ3.isFree"); |
| | | jsonObject.append("freeThreeRequestEntity", freeThreeRequestEntity.getValue()); |
| | | } catch (Exception e) { |
| | | //todo:不做任务处理 |
| | | } |
| | |
| | | from hollow_glass_relation_info |
| | | where flow_card_id = #{flowCardId} |
| | | </select> |
| | | <select id="queryProductNameByFlowCardId" resultType="java.lang.String"> |
| | | select product_name |
| | | from sd.order_detail |
| | | where (order_id, order_number) = ( |
| | | select min(order_id) as order_id, min(order_number) as order_number |
| | | from pp.flow_card |
| | | where process_id = #{flowCardId} |
| | | ) |
| | | limit 1 |
| | | </select> |
| | | |
| | | <update id="clearDirtyFlowCardData"> |
| | | update hollow_glass_relation_info |