yuanchao 3 долоо хоног өмнө
parent
commit
5877900445

+ 25 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotopeationfill/IotOpeationFillController.java

@@ -427,9 +427,11 @@ public class IotOpeationFillController {
         IotOpeationFillDO fillDO2 = iotOpeationFillService.orderDO(fillDO);
 
         List<IotOpeationFillDO> reportList = new ArrayList<>();
+        List<IotOpeationFillDO> reportList1 = new ArrayList<>();
 
         if(fillDO2!=null){
             reportList = iotOpeationFillService.reportList(fillDO2);
+            reportList1 = iotOpeationFillService.reportList1(fillDO2);
         }
 
         List<IotModelTemplateAttrsDO1> resut = new ArrayList<>();
@@ -442,7 +444,11 @@ public class IotOpeationFillController {
 
                 //根据日报取值设备赋值
                 if(reportList.size()>0){
+
                     List<IotOpeationFillDO> cxLixt = reportList.stream().filter(e->e.getOrgName().equals(attrsDO.getName())).collect(Collectors.toList());
+                    //虚拟设备取值
+                    List<IotOpeationFillDO> cxLixt1 = reportList1.stream().filter(e->e.getOrgName().equals(attrsDO.getName())).collect(Collectors.toList());
+
                     if(cxLixt.size()>0){
                         // 使用Map按orgName分组存储累加结果
                         Map<String, String> orgNameToFillContent = new HashMap<>();
@@ -486,6 +492,25 @@ public class IotOpeationFillController {
 
                         }
                     }
+
+                    if(cxLixt1.size()>0){
+                        for (IotOpeationFillDO reportData : cxLixt1) {
+                            IotDeviceRunLogDO report = new IotDeviceRunLogDO();
+                            report.setDeviceId(reportData.getDeviceId());
+                            report.setPointName(reportData.getOrgName());
+                            report.setCreateTime(reportData.getCreateTime());
+                            IotDeviceRunLogDO reportCx = iotOpeationFillService.reportData(report);
+
+                            String currentContent = "";
+                            if(reportCx==null){
+                                attrsDO.setFillContent("");
+                            }else{
+                                currentContent = reportCx.getFillContent() != null ? reportCx.getFillContent() : "";
+                                attrsDO.setFillContent(currentContent);
+                            }
+                        }
+                    }
+
                 }
 
                 attrsDO.setIsCollection(0);

+ 10 - 25
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotOpeationFillMapper.xml

@@ -1005,37 +1005,22 @@
 
     <select id="reportList1" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
-        select
-            distinct
+        SELECT DISTINCT
             a.device_id,
             a.device_code,
             a.device_name,
             a.create_time,
-            b.name org_name
-        from
-            rq_iot_opeation_fill a,
+            b.name AS org_name
+        FROM
+            rq_iot_opeation_fill a
+                INNER JOIN
             rq_iot_model_template_attrs b
-        where
-            a.device_category_id = b.device_category_id
-          and
-            a.order_id = #{orderId}
-          and is_report = 1
-          and b.daily_report = 0
-          and b.name not in
-          (
-            select
-                distinct
-                b.name
-            from
-                rq_iot_opeation_fill a,
-                rq_iot_model_template_attrs b
-            where
+            ON
                 a.device_category_id = b.device_category_id
-              and
-                a.order_id = #{orderId}
-              and is_report = 0
-              and b.daily_report = 1
-          )
+        WHERE
+            a.order_id = #{orderId}
+          and
+            a.is_report = 1
     </select>
 
     <select id="reportData" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO"

+ 1 - 1
yudao-server/src/main/resources/application-dev.yaml

@@ -78,7 +78,6 @@ spring:
     host: localhost # 地址
     port: 6379 # 端口
     database: 0  # 数据库索引
-    password: 123456
 
 --- #################### 定时任务相关配置 ####################
 
@@ -290,3 +289,4 @@ oa:
   cpk: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApmtQUp9M82/z22P7am5owQCknjQnjF4U4ckEh7XVtJVQZrZx7d1lCPfoYrwOKEM4DEV7khW6++4Zv5caJ/9nqPn4QFwCqJWVmCEm9vC1BA6i2yfa4bmTxdR1/oeU/Af9pDFlvv5GC9XyilO7CIKu19Ce50v7aN6h1Tjix+h5Ba8e12XAEpEZk9pFroEYfR4lrecvi1pQOwRw8YzDRC4lhGNOo5Cen1rGjk7dwzzgs4uEv9ZyPZoVJnty5P9JE/ctboEf3x4jbqIliuCRgOyXYsLlp+N282CKcWZ35URkGw2orKyG1U6L1hNoj7kkpvAo8Zagf97SdZ0nYdRBIHv6PQIDAQAB
   oaSecret: kryfoa20250905@szh
   user: OAuser
+  userid: 1234