Browse Source

运行记录模板优化

yuanchao 2 tuần trước cách đây
mục cha
commit
e54c97dffd

+ 10 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodeltemplateattrs/vo/IotModelTemplateAttrsPageReqVO.java

@@ -76,6 +76,16 @@ public class IotModelTemplateAttrsPageReqVO extends PageParam {
     @Schema(description = "物属性", example = "zyj")
     private String modelAttr;
 
+    /**
+     * 阈值
+     */
+    private int threshold;
+
+    /**
+     * 累计属性ID
+     */
+    private Long sumId;
+
     /**
      * 扩展属性
      */

+ 7 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodeltemplateattrs/vo/IotModelTemplateAttrsRespVO.java

@@ -106,4 +106,11 @@ public class IotModelTemplateAttrsRespVO {
 
     @Schema(description = "累计运行公里数", example = "2398.2")
     private BigDecimal totalMileage;
+
+    private int threshold;
+
+    /**
+     * 累计属性ID
+     */
+    private Long sumId;
 }

+ 10 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodeltemplateattrs/vo/IotModelTemplateAttrsSaveReqVO.java

@@ -65,4 +65,14 @@ public class IotModelTemplateAttrsSaveReqVO {
     @Schema(description = "物属性", example = "zyj")
     private String modelAttr;
 
+    /**
+     * 阈值
+     */
+    private int threshold;
+
+    /**
+     * 累计属性ID
+     */
+    private Long sumId;
+
 }

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

@@ -325,6 +325,23 @@ public class IotOpeationFillController {
             }
         }
 
+        IotOpeationFillRespVO fill = new IotOpeationFillRespVO();
+
+        /**
+         * 遍历主表数据,拿到id,根据id查询子表获取子表设备名称+设备编码
+         */
+        for (IotOpeationFillOrderDO orderDO : fillList.getList()) {
+            fill.setOrderId(orderDO.getId());
+            List<IotOpeationFillDO> dList = iotOpeationFillService.fillListByDeptId(fill);
+            if(dList.size()>0){
+                List<String> detail = new ArrayList<>();
+                for (IotOpeationFillDO fillDO:dList) {
+                    String a = fillDO.getDeviceCode()+"/"+fillDO.getDeviceName();
+                    detail.add(a);
+                }
+                orderDO.setFillList(detail.toString().substring(1, detail.toString().length() - 1));
+            }
+        }
         return success(BeanUtils.toBean(fillList, IotOpeationFillOrderDO.class));
     }
 

+ 9 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotmodeltemplateattrs/IotModelTemplateAttrsDO.java

@@ -105,6 +105,15 @@ public class IotModelTemplateAttrsDO extends BaseDO {
     private String modelAttr;
     private String fillContent;
     private BigDecimal totalRunTime;
+    /**
+     * 阈值
+     */
+    private int threshold;
+
+    /**
+     * 累计属性ID
+     */
+    private Long sumId;
 
 
 

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotopeationfill/IotOpeationFillOrderDO.java

@@ -43,5 +43,6 @@ public class IotOpeationFillOrderDO extends BaseDO {
     private String userName;
     private Integer userId;
     private String mobile;
+    private String fillList;
 
 }