wangfei
2025-10-11 d3df1630ad3e1c71b61d177ee818d5c5c94e97c0
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
@@ -4,6 +4,8 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer;
import com.kangaroohy.milo.service.MiloService;
import com.mes.alarm.entity.ProductAlarmInfo;
import com.mes.alarm.service.ProductAlarmInfoService;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.bigstorage.entity.dto.BigStorageSummaryDTO;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
@@ -72,11 +74,22 @@
    @Resource
    private WebSocketUtils webSocketUtils;
    private JSONObject jsonObject = new JSONObject();
    @Resource
    private ProductAlarmInfoService productAlarmInfoService;
    public void queryDataSource1() throws Exception {
        S7DataDLPOne s7DataDLPOne = s7SerializerDLPOne.read(S7DataDLPOne.class);
        S7DataDLPTwo s7DataWLTwo = s7SerializerDLPTwo.read(S7DataDLPTwo.class);
    private static final String ALARM_MODULE = "钢化";
    private static final String ALARM_TYPE = "钢化大理片";
    private static final String ALARM_CODE_SIZE = "sizeSame";
    private static final String ALARM_CODE_ID = "idSame";
    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)
                .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE)));
        List<Double> carPostion = new ArrayList<>();
        carPostion.add(0.25);
        carPostion.add(0.5);
@@ -84,6 +97,8 @@
        //界面展示笼子信息
        jsonObject.append("bigStorageCageInfos", bigStorageCageDetailsService.querybigStorageCageDetail());
        S7DataDLPOne s7DataDLPOne = s7SerializerDLPOne.read(S7DataDLPOne.class);
        S7DataDLPTwo s7DataWLTwo = s7SerializerDLPTwo.read(S7DataDLPTwo.class);
        try {
            //进片任务数据
            List<BigStorageTaskVO> inTaskList = new ArrayList();
@@ -233,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>()
@@ -252,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);