Browse Source

运行记录填报1

yuanchao 2 months ago
parent
commit
d358e7684a

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

@@ -170,20 +170,38 @@ public class IotOpeationFillController {
     @PreAuthorize("@ss.hasPermission('rq:iot-opeation-fill:query')")
     @PreAuthorize("@ss.hasPermission('rq:iot-opeation-fill:query')")
     public CommonResult<List<IotOpeationFillDO>> getIotOpeationFillPage(@Valid IotOpeationFillRespVO pageReqVO) {
     public CommonResult<List<IotOpeationFillDO>> getIotOpeationFillPage(@Valid IotOpeationFillRespVO pageReqVO) {
         List<IotOpeationFillDO> fillList = new ArrayList<>();
         List<IotOpeationFillDO> fillList = new ArrayList<>();
-        if(pageReqVO.getDeviceId()!=null){
-            /**
+       /* if(pageReqVO.getDeviceId()!=null){
+            *//**
              * 根据设备ID和OrderId返回
              * 根据设备ID和OrderId返回
-             */
+             *//*
             fillList = iotOpeationFillService.fillListByDeptId(pageReqVO);
             fillList = iotOpeationFillService.fillListByDeptId(pageReqVO);
-        }else{
+        }else{*/
             /**
             /**
              * 根据OrderId返回
              * 根据OrderId返回
              */
              */
             fillList = iotOpeationFillService.fillListByUserId(pageReqVO);
             fillList = iotOpeationFillService.fillListByUserId(pageReqVO);
-        }
+
+        return success(BeanUtils.toBean(fillList, IotOpeationFillDO.class));
+    }
+
+    @GetMapping("/orderPage")
+    @Operation(summary = "获得运行记录填报分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-opeation-fill:query')")
+    public CommonResult<List<IotOpeationFillDO>> getOrderPage(@Valid IotOpeationFillRespVO pageReqVO) {
+        List<IotOpeationFillDO> fillList = new ArrayList<>();
+        /* if(pageReqVO.getDeviceId()!=null){
+         *//**
+         * 根据设备ID和OrderId返回
+         *//*
+
+        }else{*/
+        fillList = iotOpeationFillService.fillListByDeptId(pageReqVO);
+
+
         return success(BeanUtils.toBean(fillList, IotOpeationFillDO.class));
         return success(BeanUtils.toBean(fillList, IotOpeationFillDO.class));
     }
     }
 
 
+
     @GetMapping("/page1")
     @GetMapping("/page1")
     @Operation(summary = "获得运行记录填报分页")
     @Operation(summary = "获得运行记录填报分页")
     @PreAuthorize("@ss.hasPermission('rq:iot-opeation-fill:query')")
     @PreAuthorize("@ss.hasPermission('rq:iot-opeation-fill:query')")
@@ -287,8 +305,10 @@ public class IotOpeationFillController {
                 }
                 }
             }
             }
         }else{
         }else{
-            if(logList.size()>0){
-                for (IotModelTemplateAttrsDO attrsDO:list) {
+
+            for (IotModelTemplateAttrsDO attrsDO:list) {
+                if(logList.size()>0){
+
                     for (IotDeviceRunLogDO log:logList) {
                     for (IotDeviceRunLogDO log:logList) {
                         if(log.getPointName().equals(attrsDO.getName())){
                         if(log.getPointName().equals(attrsDO.getName())){
                             attrsDO.setFillContent(log.getFillContent());
                             attrsDO.setFillContent(log.getFillContent());
@@ -300,10 +320,19 @@ public class IotOpeationFillController {
                         }
                         }
 
 
                     }
                     }
-               }
-            }else{
 
 
-            }
+                }else{
+                    attrsDO.setFillContent("0.0");
+                    attrsDO.setTotalRunTime(maxLog.get(0).getTotalRunTime());
+                    /**
+                     * 设置为非数采
+                     */
+                    attrsDO.setIsCollection(0);
+
+                }
+
+           }
+
         }
         }