瀏覽代碼

Merge branch 'feature-management-2021-9-16'

yq 3 年之前
父節點
當前提交
0a6a109ae1
共有 29 個文件被更改,包括 577 次插入116 次删除
  1. 30 2
      fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceAnalogVariableListController.java
  2. 8 3
      fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceAttributeController.java
  3. 10 10
      fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceController.java
  4. 19 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/DevopsWorkOrderController.java
  5. 1 1
      fiveep-controller/src/main/resources/application-dev.properties
  6. 0 0
      fiveep-controller/src/main/resources/static/doc/rpc/rpc-index.html
  7. 3 0
      fiveep-model/src/main/java/com/bizmatics/model/Device.java
  8. 0 8
      fiveep-model/src/main/java/com/bizmatics/model/DeviceAnalogVariableList.java
  9. 3 1
      fiveep-model/src/main/java/com/bizmatics/model/DeviceStatus.java
  10. 15 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/CorrespondDeviceVO.java
  11. 105 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/DeviceAnalogVariableListOneVo.java
  12. 24 4
      fiveep-model/src/main/java/com/bizmatics/model/vo/DeviceAnalogVariableListVo.java
  13. 62 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/ProcessingTime.java
  14. 64 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/ProcessingTimeVo.java
  15. 8 6
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/DeviceAnalogVariableListMapper.java
  16. 1 1
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/DeviceMapper.java
  17. 5 0
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/DevopsWorkOrderMapper.java
  18. 6 3
      fiveep-persistence/src/main/resources/mapper/mysql/DeviceAnalogVariableListMapper.xml
  19. 6 3
      fiveep-persistence/src/main/resources/mapper/mysql/DeviceMapper.xml
  20. 36 0
      fiveep-persistence/src/main/resources/mapper/mysql/DevopsWorkOrderMapper.xml
  21. 8 1
      fiveep-service/src/main/java/com/bizmatics/service/DeviceAnalogVariableListService.java
  22. 2 1
      fiveep-service/src/main/java/com/bizmatics/service/DeviceAttributeService.java
  23. 2 2
      fiveep-service/src/main/java/com/bizmatics/service/DeviceService.java
  24. 2 0
      fiveep-service/src/main/java/com/bizmatics/service/DevopsWorkOrderService.java
  25. 28 7
      fiveep-service/src/main/java/com/bizmatics/service/impl/DeviceAnalogVariableListServiceImpl.java
  26. 9 3
      fiveep-service/src/main/java/com/bizmatics/service/impl/DeviceAttributeServiceImpl.java
  27. 25 30
      fiveep-service/src/main/java/com/bizmatics/service/impl/DeviceServiceImpl.java
  28. 68 14
      fiveep-service/src/main/java/com/bizmatics/service/impl/DevopsWorkOrderServiceImpl.java
  29. 27 16
      fiveep-service/src/main/java/com/bizmatics/service/impl/PatrolInspectionDeviceServiceImpl.java

+ 30 - 2
fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceAnalogVariableListController.java

@@ -4,11 +4,14 @@ package com.bizmatics.controller.web;
 import com.bizmatics.common.core.bean.ApiResult;
 import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.model.DeviceAnalogVariableList;
+import com.bizmatics.model.vo.DeviceAnalogVariableListOneVo;
 import com.bizmatics.model.vo.DeviceAnalogVariableListVo;
 import com.bizmatics.service.DeviceAnalogVariableListService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * 设备变量列表
  *
@@ -60,7 +63,7 @@ public class DeviceAnalogVariableListController {
     }
 
     /**
-     * 站点管理-变量列表-列表查询
+     * 站点管理-变量列表-列表查询-禁用
      *
      * @param deviceCode 设备编号
      * @param screen     筛选条件
@@ -85,8 +88,33 @@ public class DeviceAnalogVariableListController {
      * @return
      */
     @PostMapping("variableListone")
-    public ApiResult<CommonPage<DeviceAnalogVariableList>> variableListone(@RequestBody DeviceAnalogVariableListVo deviceAnalogVariableListVo) {
+    public ApiResult<CommonPage<DeviceAnalogVariableListOneVo>> variableListone(@RequestBody DeviceAnalogVariableListVo deviceAnalogVariableListVo) {
         return ApiResult.success(deviceAnalogVariableListService.variableListone(deviceAnalogVariableListVo));
     }
+
+    /**
+     * 监控设备-变量列表-新增
+     *
+     * @param deviceAnalogVariableListId 变量列表ID 英文逗号隔开
+     * @param monitoringEquipmentId      监控设备ID
+     * @return
+     */
+    @GetMapping("variableListAddOne")
+    public ApiResult<Void> variableListAddOne(@RequestParam String deviceAnalogVariableListId,
+                                              @RequestParam Integer monitoringEquipmentId) {
+        deviceAnalogVariableListService.variableListAddOne(deviceAnalogVariableListId, monitoringEquipmentId);
+        return ApiResult.success();
+    }
+
+    /**
+     * 站点管理-变量列表-(监控设备为零)变量下拉框
+     * @return
+     */
+    @GetMapping("variableListDroplist")
+    public ApiResult<List<DeviceAnalogVariableList>> variableListDroplist() {
+
+        return ApiResult.success(deviceAnalogVariableListService.variableListDroplist());
+    }
+
 }
 

+ 8 - 3
fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceAttributeController.java

@@ -2,6 +2,7 @@ package com.bizmatics.controller.web;
 
 
 import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.model.DeviceAttribute;
 import com.bizmatics.model.vo.MonitorDeviceListVO;
 import com.bizmatics.service.DeviceAttributeService;
@@ -52,13 +53,17 @@ public class DeviceAttributeController {
      *
      * @param id     device_attribute表主键ID
      * @param siteId 点位ID
+     * @param size 条数
+     * @param current 页数
      * @return
      */
     @GetMapping("deviceNewsList")
-    public ApiResult<List<DeviceAttribute>> deviceNewsList(@RequestParam int siteId,
-                                                           @RequestParam(value = "id", required = false, defaultValue = "0") int id
+    public ApiResult<CommonPage<DeviceAttribute>> deviceNewsList(@RequestParam int siteId,
+                                                                 @RequestParam(value = "id", required = false, defaultValue = "0") int id,
+                                                                 @RequestParam(value = "size", required = false, defaultValue = "15") int size,
+                                                                 @RequestParam(value = "current", required = false, defaultValue = "1") int current
     ) {
-        return ApiResult.success(deviceAttributeService.deviceNewsList(id, siteId));
+        return ApiResult.success(deviceAttributeService.deviceNewsList(id, siteId, size, current));
     }
 
     /**

+ 10 - 10
fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceController.java

@@ -102,24 +102,24 @@ public class DeviceController {
     /**
      * 设备管理-通信设备-新增
      *
-     * @param correspondDeviceVOT
+     * @param device
      * @return
      */
     @PostMapping("correspondDeviceAdd")
-    public ApiResult<Void> correspondDeviceAdd(@RequestBody CorrespondDeviceVOT correspondDeviceVOT) {
-        deviceService.correspondDeviceAdd(correspondDeviceVOT);
+    public ApiResult<Void> correspondDeviceAdd(@RequestBody Device device) {
+        deviceService.correspondDeviceAdd(device);
         return ApiResult.success();
     }
 
     /**
      * 设备管理-通信设备-修改
      *
-     * @param correspondDeviceVOT
+     * @param device
      * @return
      */
     @PostMapping("correspondDeviceUpdate")
-    public ApiResult<Void> correspondDeviceUpdate(@RequestBody CorrespondDeviceVOT correspondDeviceVOT) {
-        deviceService.correspondDeviceUpdate(correspondDeviceVOT);
+    public ApiResult<Void> correspondDeviceUpdate(@RequestBody Device device) {
+        deviceService.correspondDeviceUpdate(device);
         return ApiResult.success();
     }
 
@@ -139,14 +139,14 @@ public class DeviceController {
      * 设备管理-通信设备-查询
      *
      * @param deviceName 设备名称
-     * @param size       
-     * @param current    
+     * @param size       
+     * @param current    
      * @return
      */
     @GetMapping("correspondDeviceList")
     public ApiResult<CommonPage<CorrespondDeviceVO>> correspondDeviceList(@RequestParam(required = false) String deviceName,
-                                                                          @RequestParam(value = "size", required = false, defaultValue = "1") int size,
-                                                                          @RequestParam(value = "current", required = false, defaultValue = "10") int current) {
+                                                                          @RequestParam(value = "size", required = false, defaultValue = "15") int size,
+                                                                          @RequestParam(value = "current", required = false, defaultValue = "1") int current) {
         return ApiResult.success(deviceService.correspondDeviceList(deviceName, size, current));
     }
 

+ 19 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/DevopsWorkOrderController.java

@@ -159,5 +159,24 @@ public class DevopsWorkOrderController {
         return ApiResult.success(devopsWorkOrderService.operationCensus(type));
     }
 
+
+    /**
+     * 运维管理-工作量统计-列表查询
+     * @param siteId 站点ID
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @param size 条数
+     * @param current 页数
+     * @return
+     */
+    @GetMapping("workloadStatisticsLits")
+    public ApiResult<CommonPage<ProcessingTimeVo>> workloadStatisticsLits(@RequestParam(required = false) Integer siteId,
+                                                          @RequestParam(required = false) String startTime,
+                                                          @RequestParam(required = false) String endTime,
+                                                          @RequestParam(value = "size", required = false, defaultValue = "15") Integer size,
+                                                          @RequestParam(value = "current", required = false, defaultValue = "1") Integer current
+    ) {
+        return ApiResult.success(devopsWorkOrderService.workloadStatisticsLits(siteId,startTime,endTime,size , current));
+    }
 }
 

+ 1 - 1
fiveep-controller/src/main/resources/application-dev.properties

@@ -1,7 +1,7 @@
 debug=true
 spring.main.lazy-initialization=false
 spring.main.allow-bean-definition-overriding=true
-temp.basedir=C:/Users/pc/Desktop
+temp.basedir=C:/Users/jichaobo/Desktop
 # application
 server.port=8010
 # mybatis-plus

文件差異過大導致無法顯示
+ 0 - 0
fiveep-controller/src/main/resources/static/doc/rpc/rpc-index.html


+ 3 - 0
fiveep-model/src/main/java/com/bizmatics/model/Device.java

@@ -42,6 +42,9 @@ public class Device implements Serializable {
      */
     private String deviceName;
 
+    /**
+     * 楼层
+     */
     private String floor;
     /**
      * 所属站点

+ 0 - 8
fiveep-model/src/main/java/com/bizmatics/model/DeviceAnalogVariableList.java

@@ -90,14 +90,6 @@ public class DeviceAnalogVariableList implements Serializable {
      * 1:启用、0:不启用
      */
     private Integer status;
-    /**
-     *  通信设备
-     */
-    private String deviceName;
-    /**
-     *  电力监控设备
-     */
-    private String monitorDeviceName;
 
     /**
      * 1.模拟量 2.状态量 3.参数量

+ 3 - 1
fiveep-model/src/main/java/com/bizmatics/model/DeviceStatus.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -47,7 +49,7 @@ public class DeviceStatus implements Serializable {
     /**
      * 发生时间
      */
-    private LocalDateTime statusTime;
+    private Date statusTime;
 
 
 }

+ 15 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/CorrespondDeviceVO.java

@@ -68,5 +68,20 @@ public class CorrespondDeviceVO{
      */
     private Integer onlineDuration;
 
+    /**
+     * sim卡号
+     */
+    private String sim;
+
+    /**
+     * 楼层
+     */
+    private Integer floor;
+
+    /**
+     * 设备类型
+     */
+    private Integer deviceType;
+
 
 }

+ 105 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/DeviceAnalogVariableListOneVo.java

@@ -0,0 +1,105 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 设备变量列表
+ * </p>
+ *
+ * @author ya
+ * @since 2021-09-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class DeviceAnalogVariableListOneVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 变量列表id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 设备编号
+     */
+    private String deviceCode;
+
+    /**
+     * 变量名
+     */
+    private String variableName;
+
+    /**
+     * 变量编码
+     */
+    private String variableCoding;
+
+    /**
+     * 监控设备
+     */
+    private Integer monitoringEquipment;
+
+    /**
+     * 通信设备
+     */
+    private Integer communicationEquipment;
+
+    /**
+     * 数据地址
+     */
+    private String dataAddress;
+
+    /**
+     * 数据类型
+     */
+    private String dataType;
+
+    /**
+     * 系数
+     */
+    private Float coefficient;
+
+    /**
+     * 存盘周期(分钟)
+     */
+    private Integer saveCycle;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 1:启用、0:不启用
+     */
+    private Integer status;
+    /**
+     *  通信设备
+     */
+    private String deviceName;
+    /**
+     *  电力监控设备
+     */
+    private String monitorDeviceName;
+
+    /**
+     * 1.模拟量 2.状态量 3.参数量
+     */
+    private Integer dataArea;
+}

+ 24 - 4
fiveep-model/src/main/java/com/bizmatics/model/vo/DeviceAnalogVariableListVo.java

@@ -1,13 +1,10 @@
 package com.bizmatics.model.vo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
-import java.time.LocalDateTime;
 
 /**
  * <p>
@@ -20,17 +17,40 @@ import java.time.LocalDateTime;
 @Data
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-public class DeviceAnalogVariableListVo  implements Serializable {
+public class DeviceAnalogVariableListVo implements Serializable {
 
+    /**
+     * 变量ID
+     */
     private Integer id;
 
+    /**
+     * 站点ID
+     */
     private Integer siteId;
 
+    /**
+     * 变量名称
+     */
     private String variableName;
 
+    /**
+     * 条数
+     */
     private Integer size;
 
+    /**
+     * 页数
+     */
     private Integer current;
 
+    /**
+     * 1.模拟量 2.状态量 3.参数量
+     */
     private Integer dataArea;
+
+    /**
+     * 监控设备ID
+     */
+    private Integer monitoringEquipment;
 }

+ 62 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/ProcessingTime.java

@@ -0,0 +1,62 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2021-07-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class ProcessingTime {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 人员表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 人员名称
+     */
+    private String inspectorsName;
+
+    /**
+     * 工单状态(1 待抢单,2 待指派,3 待接单,4 待处理,5 待关单,6 已完成)
+     */
+    private Integer workOrderStatus;
+
+    /**
+     * 站点ID
+     */
+    private Integer siteId;
+
+    /**
+     * 接单数量
+     */
+    private Integer count;
+
+    /**
+     * 处理时间/小时
+     */
+    private Integer processingTime;
+
+    /**
+     * 响应时间/小时
+     */
+    private Integer responseTime;
+}

+ 64 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/ProcessingTimeVo.java

@@ -0,0 +1,64 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2021-07-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class ProcessingTimeVo {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 人员表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 人员名称
+     */
+    private String inspectorsName;
+
+    /**
+     * 接单量
+     */
+    private Integer orderQuantity;
+
+    /**
+     * 完单量
+     */
+    private Integer completedQuantity;
+
+    /**
+     * 未完成
+     */
+    private Integer incomplete;
+
+    /**
+     * 响应时间/小时
+     */
+    private Integer responseTime;
+
+    /**
+     * 处理时间/小时
+     */
+    private Integer processingTime;
+
+    /**
+     * 客户评价
+     */
+    private String testimonials;
+}

+ 8 - 6
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/DeviceAnalogVariableListMapper.java

@@ -2,6 +2,7 @@ package com.bizmatics.persistence.mapper;
 
 import com.bizmatics.common.mvc.base.CrudMapper;
 import com.bizmatics.model.DeviceAnalogVariableList;
+import com.bizmatics.model.vo.DeviceAnalogVariableListOneVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -15,12 +16,13 @@ import java.util.List;
  * @since 2021-09-24
  */
 public interface DeviceAnalogVariableListMapper extends CrudMapper<DeviceAnalogVariableList> {
-    List<DeviceAnalogVariableList> variableList(@Param("siteId") Integer siteId,
-                                                @Param("id") Integer id,
-                                                @Param("variableName") String variableName,
-                                                @Param("startCurrent") Integer startCurrent,
-                                                @Param("current") Integer current,
-                                                @Param("dataArea") Integer dataArea);
+    List<DeviceAnalogVariableListOneVo> variableList(@Param("siteId") Integer siteId,
+                                                     @Param("id") Integer id,
+                                                     @Param("variableName") String variableName,
+                                                     @Param("startCurrent") Integer startCurrent,
+                                                     @Param("size") Integer size,
+                                                     @Param("dataArea") Integer dataArea,
+                                                     @Param("monitoringEquipment")Integer monitoringEquipment);
 
 
 }

+ 1 - 1
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/DeviceMapper.java

@@ -47,7 +47,7 @@ public interface DeviceMapper extends CrudMapper<Device> {
 
     List<CorrespondDeviceVO> CorrespondDeviceList(@Param("deviceName") String deviceName,
                                                   @Param("startCurrent") Integer startCurrent,
-                                                  @Param("current") Integer current);
+                                                  @Param("size") Integer size);
 
 
 }

+ 5 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/DevopsWorkOrderMapper.java

@@ -38,4 +38,9 @@ public interface DevopsWorkOrderMapper extends CrudMapper<DevopsWorkOrder> {
 
     List<Site> SiteList(@Param("userId") Integer userId,
                         @Param("name") String name);
+
+    List<ProcessingTime> workloadStatisticsLits(@Param("siteId") Integer siteId,
+                                                @Param("startTime") String startTime,
+                                                @Param("endTime") String endTime);
+
 }

+ 6 - 3
fiveep-persistence/src/main/resources/mapper/mysql/DeviceAnalogVariableListMapper.xml

@@ -18,7 +18,7 @@
         <result column="creator" property="creator" />
         <result column="enable" property="status" />
     </resultMap>
-    <select id="variableList" resultType="com.bizmatics.model.DeviceAnalogVariableList">
+    <select id="variableList" resultType="com.bizmatics.model.vo.DeviceAnalogVariableListOneVo">
         SELECT
         a.*, b.device_name,
         c.monitor_device_name
@@ -39,13 +39,16 @@
             <if test="dataArea != null and dataArea !=0">
                 and a.data_area = #{dataArea}
             </if>
+            <if test="monitoringEquipment != null and monitoringEquipment !=0">
+                and a.monitoring_equipment = #{monitoringEquipment}
+            </if>
             <if test="variableName != null and variableName !=''">
                 and a.variable_name LIKE CONCAT(CONCAT('%', #{variableName}), '%')
             </if>
         </where>
          order by a.id desc
-        <if test="startCurrent != null and current != null and current !=0">
-            LIMIT  #{startCurrent},#{current}
+        <if test="startCurrent != null and size != null and size !=0">
+            LIMIT  #{startCurrent},#{size}
         </if>
     </select>
 

+ 6 - 3
fiveep-persistence/src/main/resources/mapper/mysql/DeviceMapper.xml

@@ -116,7 +116,8 @@
         HOUR,
         a.install_time,
         now()
-        ),null) as onlineDuration
+        ),null) as onlineDuration,
+        a.sim,a.floor,a.device_type
         FROM
         device AS a
         JOIN device_status AS b ON a.device_code = b.device_code
@@ -128,10 +129,12 @@
             </if>
         </where>
         order by a.id desc
-        <if test="current != null and current != 0 and startCurrent != null">
-            LIMIT #{startCurrent},#{current}
+        <if test="size != null and size != 0 and startCurrent != null">
+            LIMIT #{startCurrent},#{size}
         </if>
 
     </select>
 
+
+
 </mapper>

+ 36 - 0
fiveep-persistence/src/main/resources/mapper/mysql/DevopsWorkOrderMapper.xml

@@ -146,4 +146,40 @@
         </where>
     </select>
 
+    <select id="workloadStatisticsLits" resultType="com.bizmatics.model.vo.ProcessingTime">
+        SELECT
+        a.id,
+        a.inspectors_name,
+        c.work_order_status,
+        c.site_id,
+        COUNT(c.id) as count,
+        SUM(
+
+        IF (
+        c.work_order_status = 6,
+        timestampdiff(HOUR, c.create_time, now()),
+        0
+        )
+        ) as processing_time
+        FROM
+        patrol_inspectors AS a
+        JOIN devops_order_inspectors AS b ON a.id = b.inspectors_id
+        JOIN devops_work_order AS c ON b.work_order_id = c.id
+        <where>
+            a.status = 1
+            AND b.status = 1
+            AND c.status = 1
+            <if test="siteId != null and siteId != 0">
+                AND c.site_id = #{siteId}
+            </if>
+            <if test="endTime != null and startTime != null">
+                and c.create_time BETWEEN #{startTime} and #{endTime}
+            </if>
+        </where>
+        GROUP BY
+        a.id,
+        c.site_id,
+        c.work_order_status
+    </select>
+
 </mapper>

+ 8 - 1
fiveep-service/src/main/java/com/bizmatics/service/DeviceAnalogVariableListService.java

@@ -3,8 +3,11 @@ package com.bizmatics.service;
 import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.common.mvc.base.CrudService;
 import com.bizmatics.model.DeviceAnalogVariableList;
+import com.bizmatics.model.vo.DeviceAnalogVariableListOneVo;
 import com.bizmatics.model.vo.DeviceAnalogVariableListVo;
 
+import java.util.List;
+
 /**
  * 设备变量列表 服务类
  *
@@ -20,7 +23,11 @@ public interface DeviceAnalogVariableListService extends CrudService<DeviceAnalo
 
     CommonPage<DeviceAnalogVariableList> variableList(String deviceCode, String screen, int size, int current);
 
-    CommonPage<DeviceAnalogVariableList> variableListone(DeviceAnalogVariableListVo deviceAnalogVariableListVo);
+    CommonPage<DeviceAnalogVariableListOneVo> variableListone(DeviceAnalogVariableListVo deviceAnalogVariableListVo);
+
+    void variableListAddOne(String deviceAnalogVariableListId, Integer monitoringEquipmentId);
+
+    List<DeviceAnalogVariableList> variableListDroplist();
 
 
 }

+ 2 - 1
fiveep-service/src/main/java/com/bizmatics/service/DeviceAttributeService.java

@@ -1,5 +1,6 @@
 package com.bizmatics.service;
 
+import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.common.mvc.base.CrudService;
 import com.bizmatics.model.DeviceAttribute;
 import com.bizmatics.model.vo.MonitorDeviceListVO;
@@ -18,7 +19,7 @@ public interface DeviceAttributeService extends CrudService<DeviceAttribute> {
 
     void deviceNewsUpdate(DeviceAttribute deviceAttribute);
 
-    List<DeviceAttribute> deviceNewsList(int id, int siteId);
+    CommonPage<DeviceAttribute> deviceNewsList(Integer id, Integer siteId,Integer size,Integer current);
 
     void deviceNewsDel(int id);
 

+ 2 - 2
fiveep-service/src/main/java/com/bizmatics/service/DeviceService.java

@@ -42,9 +42,9 @@ public interface DeviceService extends CrudService<Device> {
 
     List<Device> dataManagementDeviceList(int siteId, int deviceType);
 
-    void correspondDeviceAdd(CorrespondDeviceVOT correspondDeviceVOT);
+    void correspondDeviceAdd(Device device);
 
-    void correspondDeviceUpdate(CorrespondDeviceVOT correspondDeviceVOT);
+    void correspondDeviceUpdate(Device device);
 
     void correspondDeviceDel(int id);
 

+ 2 - 0
fiveep-service/src/main/java/com/bizmatics/service/DevopsWorkOrderService.java

@@ -34,4 +34,6 @@ public interface DevopsWorkOrderService extends CrudService<DevopsWorkOrder> {
     List<PatrolInspectionTeamOneVo> PatrolInspectionTeamList();
 
     List<OpexStatisticsVo> operationCensus(String type);
+
+    CommonPage<ProcessingTimeVo> workloadStatisticsLits(Integer siteId, String startTime, String endTime,Integer size , Integer current);
 }

+ 28 - 7
fiveep-service/src/main/java/com/bizmatics/service/impl/DeviceAnalogVariableListServiceImpl.java

@@ -8,6 +8,7 @@ import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.common.mvc.base.AbstractCrudService;
 import com.bizmatics.model.DeviceAnalogVariableList;
 import com.bizmatics.model.system.SysUser;
+import com.bizmatics.model.vo.DeviceAnalogVariableListOneVo;
 import com.bizmatics.model.vo.DeviceAnalogVariableListVo;
 import com.bizmatics.persistence.mapper.DeviceAnalogVariableListMapper;
 import com.bizmatics.service.DeviceAnalogVariableListService;
@@ -66,17 +67,37 @@ public class DeviceAnalogVariableListServiceImpl extends AbstractCrudService<Dev
     }
 
     @Override
-    public CommonPage<DeviceAnalogVariableList> variableListone(DeviceAnalogVariableListVo deviceAnalogVariableListVo) {
-        int start_current = (deviceAnalogVariableListVo.getSize() - 1) * deviceAnalogVariableListVo.getCurrent();
-        List<DeviceAnalogVariableList> deviceAnalogVariableListOne = baseMapper.variableList(deviceAnalogVariableListVo.getSiteId(), deviceAnalogVariableListVo.getId(),
-                deviceAnalogVariableListVo.getVariableName(), null, null, deviceAnalogVariableListVo.getDataArea());
+    public CommonPage<DeviceAnalogVariableListOneVo> variableListone(DeviceAnalogVariableListVo deviceAnalogVariableListVo) {
+        int start_current = (deviceAnalogVariableListVo.getCurrent() - 1) * deviceAnalogVariableListVo.getSize();
+        List<DeviceAnalogVariableListOneVo> deviceAnalogVariableListOne = baseMapper.variableList(deviceAnalogVariableListVo.getSiteId(), deviceAnalogVariableListVo.getId(),
+                deviceAnalogVariableListVo.getVariableName(), null, null, deviceAnalogVariableListVo.getDataArea(),deviceAnalogVariableListVo.getMonitoringEquipment());
         int total = 0;
         if (deviceAnalogVariableListOne.size() > 0) {
             total = deviceAnalogVariableListOne.size();
         }
-        List<DeviceAnalogVariableList> deviceAnalogVariableList = baseMapper.variableList(deviceAnalogVariableListVo.getSiteId(), deviceAnalogVariableListVo.getId(),
-                deviceAnalogVariableListVo.getVariableName(), start_current, deviceAnalogVariableListVo.getCurrent(), deviceAnalogVariableListVo.getDataArea());
-        return new CommonPage<>(deviceAnalogVariableList, total, deviceAnalogVariableListVo.getCurrent(), deviceAnalogVariableListVo.getSize());
+        List<DeviceAnalogVariableListOneVo> deviceAnalogVariableList = baseMapper.variableList(deviceAnalogVariableListVo.getSiteId(), deviceAnalogVariableListVo.getId(),
+                deviceAnalogVariableListVo.getVariableName(), start_current, deviceAnalogVariableListVo.getSize(), deviceAnalogVariableListVo.getDataArea(),deviceAnalogVariableListVo.getMonitoringEquipment());
+        return new CommonPage<>(deviceAnalogVariableList, total, deviceAnalogVariableListVo.getSize(), deviceAnalogVariableListVo.getCurrent());
+    }
+
+    @Override
+    public void variableListAddOne(String deviceAnalogVariableListId,Integer monitoringEquipmentId) {
+        DeviceAnalogVariableList deviceAnalogVariableList = new DeviceAnalogVariableList();
+        String[] idarr = deviceAnalogVariableListId.split("");
+
+        for (int i = 0; i < idarr.length; i++) {
+            deviceAnalogVariableList.setId(Integer.parseInt(idarr[i]));
+            deviceAnalogVariableList.setMonitoringEquipment(monitoringEquipmentId);
+            this.updateById(deviceAnalogVariableList);
+        }
+    }
+
+    @Override
+    public List<DeviceAnalogVariableList> variableListDroplist() {
+        LambdaQueryWrapper<DeviceAnalogVariableList> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DeviceAnalogVariableList::getMonitoringEquipment, 0).eq(DeviceAnalogVariableList::getStatus, 1);
+        List<DeviceAnalogVariableList> DeviceAnalogVariableListDroplist = this.list(queryWrapper);
+        return DeviceAnalogVariableListDroplist;
     }
 
 

+ 9 - 3
fiveep-service/src/main/java/com/bizmatics/service/impl/DeviceAttributeServiceImpl.java

@@ -1,8 +1,12 @@
 package com.bizmatics.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.common.mvc.base.AbstractCrudService;
+import com.bizmatics.model.DeviceAnalogVariableList;
 import com.bizmatics.model.DeviceAttribute;
 import com.bizmatics.model.system.SysUser;
 import com.bizmatics.model.vo.MonitorDeviceListVO;
@@ -44,14 +48,16 @@ public class DeviceAttributeServiceImpl extends AbstractCrudService<DeviceAttrib
     }
 
     @Override
-    public List<DeviceAttribute> deviceNewsList(int id, int siteId) {
+    public  CommonPage<DeviceAttribute> deviceNewsList(Integer id, Integer siteId,Integer size,Integer current) {
+        IPage<DeviceAttribute> page = new Page<DeviceAttribute>(current, size);
         LambdaQueryWrapper<DeviceAttribute> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(DeviceAttribute::getStatus, 1).eq(DeviceAttribute::getSiteId, siteId);
         if (id != 0) {
             queryWrapper.eq(DeviceAttribute::getId, id);
         }
-        List<DeviceAttribute> deviceAttributeList = this.list(queryWrapper);
-        return deviceAttributeList;
+        page = this.page(page, queryWrapper);
+        this.ToCommonPage(page);
+        return new CommonPage<>(page.getRecords(), page.getTotal(), page.getSize(),page.getCurrent());
     }
 
     @Override

+ 25 - 30
fiveep-service/src/main/java/com/bizmatics/service/impl/DeviceServiceImpl.java

@@ -9,14 +9,17 @@ import com.bizmatics.common.mvc.base.AbstractCrudService;
 import com.bizmatics.model.Device;
 import com.bizmatics.model.DeviceAnalogVariableList;
 import com.bizmatics.model.DeviceList;
+import com.bizmatics.model.DeviceStatus;
 import com.bizmatics.model.system.SysUser;
 import com.bizmatics.model.vo.CorrespondDeviceListVO;
 import com.bizmatics.model.vo.CorrespondDeviceVO;
 import com.bizmatics.persistence.mapper.DeviceMapper;
 import com.bizmatics.service.DeviceAnalogVariableListService;
 import com.bizmatics.service.DeviceService;
+import com.bizmatics.service.DeviceStatusService;
 import com.bizmatics.service.enums.DeviceStatusCode;
 import com.bizmatics.service.enums.DeviceType;
+import com.bizmatics.service.es.RtAnalogService;
 import com.bizmatics.service.util.SecurityUtils;
 import com.bizmatics.service.vo.CorrespondDeviceVOT;
 import com.bizmatics.service.vo.DeviceCountVO;
@@ -40,6 +43,8 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
 
     @Autowired
     private DeviceAnalogVariableListService deviceAnalogVariableListService;
+    @Autowired
+    private DeviceStatusService deviceStatusService;
 
     @Override
     public DeviceCountVO selectDeviceCount(Date startTime, Date endTime) {
@@ -103,45 +108,35 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
         LambdaQueryWrapper<Device> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(Device::getEnable, 1).eq(Device::getSiteId, siteId);
         List<Device> deviceList = this.list(queryWrapper);
+
+//        LambdaQueryWrapper<DeviceAnalogVariableList> queryWrapperOne = Wrappers.lambdaQuery();
+//        queryWrapperOne.eq(DeviceAnalogVariableList::getStatus, 1).eq(DeviceAnalogVariableList::getSiteId, siteId);
+//        List<DeviceAnalogVariableList> deviceAnalogVariableList = this.list(queryWrapperOne);
+
+
         return deviceList;
     }
 
     @Override
-    public void correspondDeviceAdd(CorrespondDeviceVOT correspondDeviceVOT) {
+    public void correspondDeviceAdd(Device device) {
         SysUser user = SecurityUtils.getLoginUser().getUser();
-        Device device = correspondDeviceVOT.getDevice();
         device.setEnable(1);
         device.setInstallTime(new Date());
         device.setCreator(user.getUserName());
-        List<DeviceAnalogVariableList> DeviceAnalogVariableList = correspondDeviceVOT.getDeviceAnalogVariableList();
         this.save(device);
-        int ID = device.getId();
-        if (DeviceAnalogVariableList.size() > 0) {
-            for (int i = 0; i < DeviceAnalogVariableList.size(); i++) {
-                DeviceAnalogVariableList.get(i).setCommunicationEquipment(ID);
-                DeviceAnalogVariableList.get(i).setCreateTime(new Date());
-                DeviceAnalogVariableList.get(i).setCreator(user.getUserName());
-                DeviceAnalogVariableList.get(i).setStatus(1);
-                deviceAnalogVariableListService.save(DeviceAnalogVariableList.get(i));
-            }
-        }
+        String deviceCode = device.getDeviceCode();
+        Integer siteId = device.getSiteId();
+        DeviceStatus deviceStatus = new DeviceStatus();
+        deviceStatus.setDeviceStatus(1);
+        deviceStatus.setDeviceCode(deviceCode);
+        deviceStatus.setStatusTime(new Date());
+        deviceStatus.setSiteId(siteId);
+        deviceStatusService.save(deviceStatus);
     }
 
     @Override
-    public void correspondDeviceUpdate(CorrespondDeviceVOT correspondDeviceVOT) {
-        SysUser user = SecurityUtils.getLoginUser().getUser();
-        List<DeviceAnalogVariableList> DeviceAnalogVariableList = correspondDeviceVOT.getDeviceAnalogVariableList();
-        this.updateById(correspondDeviceVOT.getDevice());
-        int ID = correspondDeviceVOT.getDevice().getId();
-        if (DeviceAnalogVariableList.size() > 0) {
-            for (int i = 0; i < DeviceAnalogVariableList.size(); i++) {
-                DeviceAnalogVariableList.get(i).setCommunicationEquipment(ID);
-                DeviceAnalogVariableList.get(i).setCreateTime(new Date());
-                DeviceAnalogVariableList.get(i).setCreator(user.getUserName());
-                DeviceAnalogVariableList.get(i).setStatus(1);
-                deviceAnalogVariableListService.save(DeviceAnalogVariableList.get(i));
-            }
-        }
+    public void correspondDeviceUpdate(Device device) {
+        this.updateById(device);
     }
 
     @Override
@@ -159,9 +154,9 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
         if (correspondDeviceListOne.size() > 0) {
             total = correspondDeviceListOne.size();
         }
-        int startCurrent = (size - 1) * current;
-        List<CorrespondDeviceVO> correspondDeviceList = baseMapper.CorrespondDeviceList(deviceName, startCurrent, current);
-        return new CommonPage<>(correspondDeviceList, total, current, size);
+        int startCurrent = (current - 1) * size;
+        List<CorrespondDeviceVO> correspondDeviceList = baseMapper.CorrespondDeviceList(deviceName, startCurrent, size);
+        return new CommonPage<>(correspondDeviceList, total, size, current);
     }
 
     @Override

+ 68 - 14
fiveep-service/src/main/java/com/bizmatics/service/impl/DevopsWorkOrderServiceImpl.java

@@ -626,21 +626,75 @@ public class DevopsWorkOrderServiceImpl extends AbstractCrudService<DevopsWorkOr
         return cal.getTime();
     }
 
-    public static String getQuarter() {
-        Calendar c = Calendar.getInstance();
-        int month = c.get(c.MONTH) + 1;
-        int quarter = 0;
-        if (month >= 1 && month <= 3) {
-            quarter = 1;
-        } else if (month >= 4 && month <= 6) {
-            quarter = 2;
-        } else if (month >= 7 && month <= 9) {
-            quarter = 3;
-        } else {
-            quarter = 4;
+    @Override
+    public CommonPage<ProcessingTimeVo> workloadStatisticsLits(Integer siteId,String startTime,String endTime,Integer size , Integer current){
+        List<ProcessingTime> processingTimeList = baseMapper.workloadStatisticsLits(siteId, startTime, endTime);
+
+        LambdaQueryWrapper<PatrolInspectors> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(PatrolInspectors::getStatus, 1);
+        List<PatrolInspectors> patrolInspectorsList =  patrolInspectorsService.list(queryWrapper);
+        List<ProcessingTimeVo> Active1 = new ArrayList<ProcessingTimeVo>(); // 存放页面需要展示的数据
+        List<ProcessingTimeVo> processingTimeVoList1 = new ArrayList<>();
+
+        if (patrolInspectorsList.size()>0){
+            for (int i = 0; i < patrolInspectorsList.size(); i++) {
+                ProcessingTimeVo processingTimeVo1 = new ProcessingTimeVo();
+                Map<String, Object> map = new HashMap<>();
+                Integer orderQuantity = 0;
+                Integer completedQuantity = 0;
+                Integer incomplete = 0;
+                Integer responseTime = 0;
+                Integer processingTime = 0;
+                if (processingTimeList.size()>0){
+                    for (Integer j = 0; j < processingTimeList.size(); j++) {
+                        if (patrolInspectorsList.get(i).getId()==processingTimeList.get(j).getId()){
+                            switch (processingTimeList.get(j).getWorkOrderStatus()) {
+                                case 4:
+                                    orderQuantity += processingTimeList.get(j).getCount();
+                                    incomplete += processingTimeList.get(j).getCount();
+                                    break;
+                                case 5:
+                                    incomplete += processingTimeList.get(j).getCount();
+                                    orderQuantity += processingTimeList.get(j).getCount();
+                                    break;
+                                case 6:
+                                    orderQuantity += processingTimeList.get(j).getCount();
+                                    completedQuantity += processingTimeList.get(j).getCount();
+                                    processingTime=processingTimeList.get(j).getProcessingTime();
+                                    break;
+                                default:
+                            }
+                        }
+                    }
+
+                    processingTimeVo1.setId(patrolInspectorsList.get(i).getId());
+                    processingTimeVo1.setInspectorsName(patrolInspectorsList.get(i).getInspectorsName());
+                    processingTimeVo1.setOrderQuantity(orderQuantity);
+                    processingTimeVo1.setCompletedQuantity(completedQuantity);
+                    processingTimeVo1.setIncomplete(incomplete);
+                    processingTimeVo1.setResponseTime(responseTime);
+                    processingTimeVo1.setProcessingTime(processingTime);
+                    processingTimeVo1.setTestimonials("");
+                }else {
+                    processingTimeVo1.setId(patrolInspectorsList.get(i).getId());
+                    processingTimeVo1.setInspectorsName(patrolInspectorsList.get(i).getInspectorsName());
+                    processingTimeVo1.setOrderQuantity(orderQuantity);
+                    processingTimeVo1.setCompletedQuantity(completedQuantity);
+                    processingTimeVo1.setIncomplete(incomplete);
+                    processingTimeVo1.setResponseTime(responseTime);
+                    processingTimeVo1.setProcessingTime(processingTime);
+                    processingTimeVo1.setTestimonials("");
+                }
+
+                processingTimeVoList1.add(processingTimeVo1);
+            }
+            int currIdx = (current > 1 ? (current -1) * size: 0);
+            for (int i = 0; i < size && i < processingTimeVoList1.size() - currIdx; i++) { // 判断条件十分巧妙,防止List取值越界
+                ProcessingTimeVo active = processingTimeVoList1.get(currIdx + i);
+                Active1.add(active);
+            }
         }
-        return quarter + "";
+        return new CommonPage<>(Active1, processingTimeVoList1.size(), size, current);
     }
 
-
 }

+ 27 - 16
fiveep-service/src/main/java/com/bizmatics/service/impl/PatrolInspectionDeviceServiceImpl.java

@@ -1,5 +1,9 @@
 package com.bizmatics.service.impl;
 
+import com.bizmatics.common.core.exception.BusinessCheckException;
+import com.bizmatics.common.core.exception.BusinessException;
+import com.bizmatics.common.core.util.FileUtils;
+import com.bizmatics.common.spring.util.GlobalUtils;
 import com.bizmatics.model.PatrolInspectionDevice;
 import com.bizmatics.model.system.SysUser;
 import com.bizmatics.model.vo.PatrolInspectionDeviceVo;
@@ -67,24 +71,31 @@ public class PatrolInspectionDeviceServiceImpl extends AbstractCrudService<Patro
             System.out.println("文件为空空");
         }
 
-        String fileName = file.getOriginalFilename();  // 文件名
-        String suffixName = fileName.substring(fileName.lastIndexOf("."));  // 后缀名
-//        String filePath = "D://temp-rainy//"; // 上传后的路径
-        fileName = UUID.randomUUID() + suffixName; // 新文件名
-
-        String destFileName = request.getServletContext().getRealPath("") + "uploaded" + File.separator + fileName;
-        File dest = new File(destFileName);
-//        File dest = new File(filePath + fileName);
-        if (!dest.getParentFile().exists()) {
-            dest.getParentFile().mkdirs();
-        }
+        File file1 = FileUtils.getFile(GlobalUtils.getTempBaseDir(), file.getOriginalFilename());
         try {
-            file.transferTo(dest);
-        } catch (IOException e) {
-            e.printStackTrace();
+            file.transferTo(file1);
+        }catch (Exception e){
+            throw new BusinessException("文件上传异常", e);
         }
-        String filename = "/uploaded/" + fileName;
-        return filename;
+
+//        String fileName = file.getOriginalFilename();  // 文件名
+//        String suffixName = fileName.substring(fileName.lastIndexOf("."));  // 后缀名
+////        String filePath = "D://temp-rainy//"; // 上传后的路径
+//        fileName = UUID.randomUUID() + suffixName; // 新文件名
+//
+//        String destFileName = request.getServletContext().getRealPath("") + "uploaded" + File.separator + fileName;
+//        File dest = new File(destFileName);
+////        File dest = new File(filePath + fileName);
+//        if (!dest.getParentFile().exists()) {
+//            dest.getParentFile().mkdirs();
+//        }
+//        try {
+//            file.transferTo(dest);
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+//        String filename = "/uploaded/" + fileName;
+        return file.getOriginalFilename();
     }
 
 }

部分文件因文件數量過多而無法顯示