From 27eb2df01ab873bc7f1451ff5865ed66b2876159 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 02 十一月 2024 16:58:59 +0800
Subject: [PATCH] 去掉dmpvar相关的代码

---
 smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java |   73 ++++--------------------------------
 1 files changed, 8 insertions(+), 65 deletions(-)

diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java
index cde5f80..243498e 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java
@@ -87,7 +87,6 @@
 import com.qianwen.smartman.modules.smis.service.ICalendarService;
 import com.qianwen.smartman.modules.smis.service.ICommonGroupOfItemService;
 import com.qianwen.smartman.modules.smis.service.ICommonGroupService;
-import com.qianwen.smartman.modules.smis.service.IDmpVariablesService;
 import com.qianwen.smartman.modules.smis.service.IMachineService;
 import com.qianwen.smartman.modules.smis.service.IWorkstationOfMachineService;
 import com.qianwen.smartman.modules.smis.service.IWorkstationService;
@@ -135,8 +134,7 @@
     private WorkstationMapper workstationMapper;
     @Autowired
     private OssBuilder ossBuilder;
-    @Autowired
-    private IDmpVariablesService dmpVariablesService;
+    
 
     @Autowired
     private IWorkstationWorkbenchService workbenchService;
@@ -589,65 +587,11 @@
         return manualBuildIPage(query, buildProperties(result, dto.getDeviceStatus()));
     }
 
-    @Override 
-    public List<RealTimeStatusVO> getRealTimeProperties(Long workstationId, Long machineId) {
-        List<RealTimeStatusVO> properties = new ArrayList<>();
-        Map<String, Object> map = WorkstationCache.getWorkstationRealTime(String.valueOf(workstationId));
-        List<DmpVariablesVO> list = this.dmpVariablesService.getDmpVariablesByWorkstationId(workstationId);
-        if (CollectionUtil.isNotEmpty(list)) {
-            list.forEach(dmpVariablesVO -> {
-                RealTimeStatusVO vo = new RealTimeStatusVO();
-                vo.setKey(dmpVariablesVO.getName());
-                vo.setName(dmpVariablesVO.getDescription());
-                vo.setUnit(dmpVariablesVO.getDmpType());
-                vo.setSort(dmpVariablesVO.getIdx());
-                vo.setWcsDataType(dmpVariablesVO.getWcsDataType());
-                vo.setBigScreen(dmpVariablesVO.getBigScreen());
-                vo.setRealTimeData(dmpVariablesVO.getRealTimeData());
-                if (map.containsKey(dmpVariablesVO.getName())) {
-                    TelemetryDataResponseDTO t = (TelemetryDataResponseDTO) MapUtils.getObject(map, dmpVariablesVO.getName());
-                    vo.setValue(t.getV());
-                }
-                properties.add(vo);
-            });
-        }
-        return properties;
-    }
+   
 
     public Map<Long, List<RealTimeStatusVO>> getRealTimeProperties(List<Long> workstationIdList) {
         Map<Long, List<RealTimeStatusVO>> properties = new HashMap<>();
-        //鍦ㄨ繖閲岋紒锛侊紒锛�
-        //椤堕《椤堕《
-        //List<DmpVariablesVO> list = this.dmpVariablesService.getDmpVariablesByWorkstationIds(workstationIdList);
-        //this.wsDpService.getDatapointsByWorkstationIds();
-        //if (Func.isNotEmpty(list)) {
-        	/*
-            Map<Long, List<DmpVariablesVO>> dmpVariablesMap =list.stream().collect(Collectors.groupingBy((v0) -> {
-                return v0.getWorkstationId();
-            }));
-            dmpVariablesMap.forEach((workstationId, dmpVariablesVOList) -> {
-                ArrayList<RealTimeStatusVO> arrayList = new ArrayList<>();
-                Map<String, Object> map = WorkstationCache.getWorkstationRealTime(String.valueOf(workstationId));//搴旇鏈夋暟鎹紝鍥犱负缂撳瓨娌℃湁锛岀洿鎺ユ煡鐨剄ueryLastParameter
-                dmpVariablesVOList.forEach(dmpVariablesVO -> {
-                    RealTimeStatusVO vo = new RealTimeStatusVO();
-                    vo.setKey(dmpVariablesVO.getName());
-                    vo.setName(dmpVariablesVO.getDescription());
-                    vo.setUnit(dmpVariablesVO.getDmpType());
-                    vo.setSort(dmpVariablesVO.getIdx());
-                    vo.setWcsDataType(dmpVariablesVO.getWcsDataType());
-                    vo.setBigScreen(dmpVariablesVO.getBigScreen());
-                    vo.setRealTimeData(dmpVariablesVO.getRealTimeData());
-                    if (map.containsKey(dmpVariablesVO.getName())) {
-                        TelemetryDataResponseDTO t = (TelemetryDataResponseDTO) MapUtils.getObject(map, dmpVariablesVO.getName());
-                        vo.setValue(t.getV());
-                    }
-                    arrayList.add(vo);
-                });
-                properties.put(workstationId, arrayList);
-            });
-            */
-        	
-        //}
+        
         //yangys淇敼锛屾敼涓烘暟鎹偣浣嶇殑鏂瑰紡
         for(Long workstationId: workstationIdList) {
     		
@@ -667,7 +611,7 @@
 	    			RealTimeStatusVO vo = new RealTimeStatusVO();
 	    			prop = cfgRow.getString("dpName");
 	                vo.setKey(prop);
-	                
+	                /*
 	                label = prop;
 	                if(StringUtils.equals("DeviceStatus", prop)) {
 	                	label = "鐘舵��";
@@ -675,11 +619,9 @@
 	                	label = "浜ч噺";
 	                }else if(StringUtils.equals("AlarmNo", prop)) {
 	                	label = "鍛婅鍙�";
-	                }
-	                vo.setName(label);
-	                //vo.setUnit(headRow.getString("dpUnit"));
+	                }*/
+	                vo.setName(cfgRow.getString("dpLabel"));
 	                vo.setSort(i);
-	                //vo.setWcsDataType(dmpVariablesVO.getWcsDataType());
 	                vo.setBigScreen(false);
 	                vo.setRealTimeData(true);
 	                
@@ -1041,7 +983,7 @@
         }
         return null;
     }
-
+    /*
     @Override 
     public List<DmpVariablesVO> getDmpVariables(String workstationId, String machineId) {
         if (Func.isBlank(machineId)) {
@@ -1052,6 +994,7 @@
             return v0.getRealTimeData();
         }).collect(Collectors.toList());
     }
+    */
 
     private void checkWorkstation(WorkstationSubmitVO workstationSubmitVO) {
         if (Func.isNotEmpty(workstationSubmitVO.getCode()) && workstationSubmitVO.getCode().length() > 24) {

--
Gitblit v1.9.3