hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/controller/BigStorageCageHistoryTaskController.java
@@ -45,4 +45,10 @@ public Result<List<RunTime>> queryRunTimes(String days) { return Result.success(bigStorageCageHistoryTaskService.queryRunTimes(days)); } @ApiOperation(value = "查询大理片界面所有信息", notes = "查询大理片界面所有信息") @GetMapping("/queryAllMessage") public Result<String> queryAllMessage() { return Result.success(bigStorageCageHistoryTaskService.queryAllMessage()); } } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/service/BigStorageCageHistoryTaskService.java
@@ -23,5 +23,7 @@ DailyProductionVO queryBigDailyProduction(BigStorageCageHistoryRequest request); List<RunTime> queryRunTimes(String days); String queryAllMessage(); } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragecagetask/service/impl/BigStorageCageHistoryTaskServiceImpl.java
@@ -10,11 +10,13 @@ import com.mes.bigstoragecagetask.entity.request.BigStorageCageHistoryRequest; import com.mes.bigstoragecagetask.mapper.BigStorageCageHistoryTaskMapper; import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; import com.mes.job.OPCPlcSlicecage; import com.mes.largenscreen.entity.DailyProductionVO; import com.mes.largenscreen.entity.RunTime; import com.mes.tools.DateUtil; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.List; @@ -26,6 +28,9 @@ */ @Service public class BigStorageCageHistoryTaskServiceImpl extends ServiceImpl<BigStorageCageHistoryTaskMapper, BigStorageCageHistoryTask> implements BigStorageCageHistoryTaskService { @Resource OPCPlcSlicecage opcPlcSlicecage; @Override public Page<BigStorageCageHistoryTask> queryBigStorageCageHistoryTask(BigStorageCageHistoryRequest request) { @@ -58,9 +63,20 @@ } @Override public List<RunTime> queryRunTimes(String days){ public List<RunTime> queryRunTimes(String days) { return baseMapper.queryRunTimes(days); } @Override public String queryAllMessage() { try { opcPlcSlicecage.plcStorageCageTask(); return "success"; } catch (Exception exception) { exception.printStackTrace(); } return "fail"; } } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
@@ -83,9 +83,9 @@ private static final String ALARM_CODE_SIZE = "sizeSame"; private static final String ALARM_CODE_ID = "idSame"; private JSONObject jsonObject = new JSONObject(); public void queryDataSource1() throws Exception { public JSONObject queryDataSource1() throws Exception { JSONObject jsonObject = new JSONObject(); jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>() .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW) .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE) @@ -248,10 +248,11 @@ //当前指定工程 jsonObject.append("temperingEngineerId", redisUtil.getCacheObject("temperingEngineerId")); return jsonObject; } public void queryDataSource2() throws InterruptedException { JSONObject jsonObject = new JSONObject(); //出片队列 List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list( new LambdaQueryWrapper<TemperingGlassInfo>() @@ -267,9 +268,8 @@ */ @Scheduled(fixedDelay = 3000) public void plcStorageCageTask() throws Exception { jsonObject = new JSONObject(); //查询使用数据源1查询数据 queryDataSource1(); JSONObject jsonObject = queryDataSource1(); //查询使用数据源2查询数据 // queryDataSource2(); webSocketUtils.sendToWeb("slicecage", jsonObject); hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
@@ -11,7 +11,6 @@ import com.mes.pp.service.OptimizeProjectService; import com.mes.rawglassdetails.entity.RawGlassStorageDetails; import com.mes.rawglassstation.service.RawGlassStorageStationService; import com.mes.tools.WebSocketServer; import com.mes.tools.WebSocketUtils; import com.mes.uppattenusage.entity.UpPattenUsage; import com.mes.uppattenusage.service.UpPattenUsageService; @@ -24,7 +23,6 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -147,7 +145,7 @@ } private void loadGlassChild(String redisRequest, int stationCell, String tableName, String webSocketName) { public String loadGlassChild(String redisRequest, int stationCell, String tableName, String webSocketName) { try { JSONObject jsonObject = new JSONObject(); //当前线路正在执行的工程 @@ -177,6 +175,7 @@ } catch (Exception e) { e.printStackTrace(); } return "success"; } hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/loadglassdevicetaskhistory/controller/LoadGlassDeviceTaskHistoryController.java
@@ -2,22 +2,25 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mes.job.PlcLoadGlassTask; import com.mes.loadglassdevicetaskhistory.entity.request.LoadGlassRequest; import com.mes.opctask.entity.LoadGlassDeviceTaskHistory; import com.mes.opctask.entity.request.LoadGlassDeviceTaskHistoryRequest; import com.mes.opctask.service.LoadGlassDeviceTaskHistoryService; import com.mes.pp.service.OptimizeProjectService; import com.mes.uppattenusage.entity.UpPattenUsage; import com.mes.utils.Result; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; import javax.annotation.Resource; /** * <p> * 前端控制器 * 前端控制器 * </p> * * @author wf @@ -27,6 +30,8 @@ @RequestMapping("/loadglassdevicetaskhistory") public class LoadGlassDeviceTaskHistoryController { @Resource PlcLoadGlassTask plcLoadGlassTask; @Autowired private LoadGlassDeviceTaskHistoryService loadGlassDeviceTaskHistoryService; @@ -36,5 +41,12 @@ return Result.build(200, "查询成功", loadGlassDeviceTaskHistoryService.queryLoadGlassHistoryTask(request)); } @ApiOperation("查询线路所有数据") @PostMapping("/queryAllMessage") //查询现在上片机的玻璃信息 public Result<String> queryAllMessage(@RequestBody @Validated LoadGlassRequest request) { return Result.build(200, "查询成功", plcLoadGlassTask.loadGlassChild(request.getRedisRequest(), request.getStationCell(), request.getTableName(), request.getWebSocketName())); } } hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/loadglassdevicetaskhistory/entity/request/LoadGlassRequest.java
New file @@ -0,0 +1,22 @@ package com.mes.loadglassdevicetaskhistory.entity.request; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @Author : zhoush * @Date: 2025/10/11 11:04 * @Description: */ @Data public class LoadGlassRequest { @ApiModelProperty(value = "redis名字(loadGlassRequestOne loadGlassRequestTwo)", position = 1) private String redisRequest; @ApiModelProperty(value = "线路(5 6)", position = 2) private int stationCell; @ApiModelProperty(value = "线路表名(LOAD_GLASS_DEVICE_ONE_TASK LOAD_GLASS_DEVICE_TWO_TASK)", position = 3) private String tableName; @ApiModelProperty(value = "websocket(loadGlassOne loadGlassTwo)", position = 4) private String webSocketName; }