Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | "dataType": "word", |
| | | "parameteInfor": [{ |
| | | "codeId": "D01ID", |
| | | "addressIndex": "0", |
| | | "addressIndex": "32", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | bigStorageCageDetailsService.temperingSwitch(flag); |
| | | return Result.build(200, "修改成功", redisUtil.getCacheObject("temperingSwitch")); |
| | | } |
| | | |
| | | @ApiOperation("流程卡查询") |
| | | @PostMapping("/selectFlowCardByCache") |
| | | public Result selectFlowCardByCache() { |
| | | List<Map<String, Object>> flowCardIdCount=bigStorageCageDetailsService.listMaps( |
| | | new QueryWrapper<BigStorageCageDetails>() |
| | | .select("flow_card_id,layer,count(*) as count") |
| | | .eq("state", Const.GLASS_STATE_IN) |
| | | .eq("tempering_layout_id",0) |
| | | .groupBy("flow_card_id,layer") |
| | | ); |
| | | return Result.build(200, "查询成功", flowCardIdCount); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | |
| | | } |
| | | jsonObject.append("temperingSwitch", temperingSwitch); |
| | | |
| | | |
| | | } |
| | | |
| | | public void queryDataSource2() throws InterruptedException { |
| | | //出片队列 |
| | | List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list(); |
| | | List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list( |
| | | new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .inSql(TemperingGlassInfo::getEngineerId,"select distinct engineer_id from tempering_glass_info where state<4") |
| | | ); |
| | | jsonObject.append("temperingGlassInfoList", temperingGlassInfoList); |
| | | |
| | | } |
| | |
| | | String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); |
| | | String d05ToMES = plcParameterObject.getPlcParameter("D05ToMES").getValue(); |
| | | log.info("执行空车送片任务,获取到的大车状态为{},卧转立状态分别为d03:{},d05:{}", e01Status, d03ToMES, d05ToMES); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTasks = bigStorageCageFeedTaskService.list( |
| | | new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .ne(BigStorageCageFeedTask::getTargetSlot, 0) |
| | | .lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT) |
| | | ); |
| | | if (bigStorageCageFeedTasks.size() > 0) { |
| | | Date endDate = new Date(); |
| | | log.info("大车有正在执行的任务{},结束送片任务,任务结束时间:{},共耗时:{}ms,结束扫码任务", bigStorageCageFeedTasks, endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | if (REQUEST_WORD.equals(e01Status)) { |
| | | Date endDate = new Date(); |
| | | log.info("进片大车非空闲,结束送片任务,任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | |
| | | for (int i = 1; i <= taskList.size(); i++) { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), taskList.get(i - 1).getTargetSlot()); |
| | | log.info("向plc发送第{}片玻璃已完成", i); |
| | | log.info("向plc发送第{}片玻璃已完成,起始位置是{},目标位置是", i, taskList.get(i - 1).getLine(), taskList.get(i - 1).getTargetSlot()); |
| | | } |
| | | int returnData = 0; |
| | | int count = 1; |
| | |
| | | List<Integer> workList = new ArrayList(); |
| | | if (flag08) { |
| | | if (!"2".equals(glassStatus11)) { |
| | | workList.addAll(Const.G11_WORK_STATION); |
| | | List<Integer> wroklistOne = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, Const.SLOT_ON).in(DownWorkstation::getWorkstationId, Const.G11_WORK_STATION)) |
| | | .stream() |
| | | .map(DownWorkstation::getWorkstationId) |
| | | .collect(Collectors.toList()); |
| | | workList.addAll(wroklistOne); |
| | | } |
| | | } else { |
| | | if (!"2".equals(glassStatus06)) { |
| | | workList.addAll(Const.G06_WORK_STATION); |
| | | List<Integer> wroklistTwo = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, Const.SLOT_ON).in(DownWorkstation::getWorkstationId, Const.G06_WORK_STATION)) |
| | | .stream() |
| | | .map(DownWorkstation::getWorkstationId) |
| | | .collect(Collectors.toList()); |
| | | workList.addAll(wroklistTwo); |
| | | } |
| | | } |
| | | List<Integer> workStationAll = Arrays.asList(1, 2, 3, 4, 5, 6); |