瀏覽代碼

Merge remote-tracking branch 'origin/master_tuzuo' into master_tuzuo

lyq 5 月之前
父節點
當前提交
8016a47985

+ 30 - 6
src/main/java/com/sooka/sponest/data/digitalemergency/controller/EmergencyBigDataController.java

@@ -37,6 +37,30 @@ public class EmergencyBigDataController extends BaseController {
     @Autowired
     private IFireControlBigDataService fireControlBigDataService;
 
+    // 安全隐患
+    @ApiOperation(value = "安全隐患",notes = "安全隐患")
+    @GetMapping("/selectCentereventTEmergencyDangerList")
+    public AjaxResult selectCentereventTEmergencyDangerList() {
+        return AjaxResult.success(emergencyBigDataService.selectCentereventTEmergencyDangerList());
+    }
+
+    // 物资分析
+    @ApiOperation(value = "物资分析",notes = "物资分析")
+    @GetMapping("/getBigDataMaterial")
+    public AjaxResult getBigDataMaterial() {
+        return AjaxResult.success(emergencyBigDataService.getBigDataMaterial());
+    }
+
+
+    /**
+     * 企业信息
+     * */
+    @ApiOperation(value = "企业信息",notes = "企业信息")
+    @GetMapping("/selectEnterpriseList")
+    public AjaxResult selectEnterpriseList() {
+        return AjaxResult.success(emergencyBigDataService.selectEnterpriseList());
+    }
+
     /**
      * 获取行业高危行业分布
      *
@@ -44,8 +68,8 @@ public class EmergencyBigDataController extends BaseController {
      */
     @ApiOperation(value = "",notes = "")
     @GetMapping("/selectIndustryHighList")
-    public AjaxResult selectIndustryHighList(TBasicEnterindesmapCount tBasicEnterindesmapCount) {
-        return AjaxResult.success(emergencyBigDataService.selectIndustryHighList(tBasicEnterindesmapCount));
+    public AjaxResult selectIndustryHighList( ) {
+        return AjaxResult.success(emergencyBigDataService.selectIndustryHighList());
     }
 
     /**
@@ -171,8 +195,8 @@ public class EmergencyBigDataController extends BaseController {
      */
     @ApiOperation(value = "巡检分析",notes = "巡检分析")
     @GetMapping("/getBigDataInspectionAnalysis")
-    public R<List<Map<String,Object>>> getBigDataInspectionAnalysis(CentereventTEmergencyInspectionrecord inspectionrecord){
-        return R.ok(emergencyBigDataService.getBigDataInspectionAnalysis(inspectionrecord));
+    public AjaxResult getBigDataInspectionAnalysis(){
+        return AjaxResult.success(emergencyBigDataService.getBigDataInspectionAnalysis());
     }
 
     /*
@@ -183,7 +207,7 @@ public class EmergencyBigDataController extends BaseController {
      */
     @ApiOperation(value = "巡检内容分析",notes = "巡检内容分析")
     @GetMapping("/getBigDataInspectionContent")
-    public R<List<Map<String,Object>>> getBigDataInspectionContent(CentereventTEmergencyInspectionrecord inspectionrecord){
-        return R.ok(emergencyBigDataService.getBigDataInspectionContent(inspectionrecord));
+    public R<List<Map<String,Object>>> getBigDataInspectionContent(){
+        return R.ok(emergencyBigDataService.getBigDataInspectionContent());
     }
 }

+ 89 - 0
src/main/java/com/sooka/sponest/data/digitalemergency/domain/dto/TBusEnterpriseDto.java

@@ -0,0 +1,89 @@
+package com.sooka.sponest.data.digitalemergency.domain.dto;
+
+import com.ruoyi.common.core.annotation.Excel;
+import com.sooka.sponest.data.base.domain.BaseBusinessEntity;
+import lombok.Data;
+
+/**
+ * 企业对象 t_bus_enterprise
+ *
+ * @author ruoyi
+ * @date 2022-11-15
+ */
+@Data
+public class TBusEnterpriseDto extends BaseBusinessEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 企业ID */
+    private String busEnterpriseId;
+
+    /** 部门ID */
+    private Long deptId;
+
+    private String deptName;
+
+    /** 用户ID(录入人) */
+    private Long userId;
+
+    private String userName;
+
+    /** 账号(登录人的userid) */
+    private Long accountId;
+
+    /** 企业名称 */
+    @Excel(name = "企业名称")
+    private String businessName;
+
+    /** 经营地址 */
+    @Excel(name = "经营地址")
+    private String businessAddress;
+
+    /** 办公地址 */
+    @Excel(name = "办公地址")
+    private String officeAddress;
+
+    /** 组织机构代码 */
+    @Excel(name = "组织机构代码")
+    private String orgCode;
+
+    /** 主要负责人 */
+    @Excel(name = "主要负责人")
+    private String mainPerson;
+
+    /** 主要负责人电话 */
+    @Excel(name = "主要负责人电话")
+    private String mainPersonPhone;
+
+    /** 安全负责人 */
+    @Excel(name = "安全负责人")
+    private String headSecurity;
+
+    /** 安全负责人电话 */
+    @Excel(name = "安全负责人电话")
+    private String headSecurityPhone;
+
+    /** 属地监管人员 */
+    @Excel(name = "属地监管人员")
+    private String supervisor;
+
+    /** 区县行业主管部门 */
+    @Excel(name = "区县行业主管部门")
+    private String tradeDept;
+
+    /** 经度 */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /** $column.columnComment */
+    @Excel(name = "纬度")
+    private String latitude;
+
+    /** 数据状态 */
+    private String dataStatus;
+
+    private String enterpriseCode;
+
+    private String delFlag;
+
+}

+ 13 - 1
src/main/java/com/sooka/sponest/data/digitalemergency/mapper/EmergencyBigDataMapper.java

@@ -3,6 +3,7 @@ package com.sooka.sponest.data.digitalemergency.mapper;
 import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyEnterprises;
 import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyMaterial;
 import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyTeam;
+import com.sooka.sponest.data.digitalemergency.domain.dto.TBusEnterpriseDto;
 import com.sooka.sponest.data.digitalemergency.domain.vo.CenterdataTEmergencyEnterpriseMessageBody;
 import com.sooka.sponest.data.digitalemergency.domain.vo.DayBody;
 import com.sooka.sponest.data.digitalemergency.domain.vo.TBasicEnterindesmapCount;
@@ -20,12 +21,23 @@ import java.util.Map;
  */
 public interface EmergencyBigDataMapper {
 
+    // 获取物资分析
+    List<Map> getBigDataMaterial();
+
+    /**
+     * 获取企业分布
+     *
+     * @return
+     */
+    List<Map> selectEnterpriseList(TBusEnterpriseDto dto);
+
     /**
      * 获取行业高危分布情况
      *
      * @return
      */
     List<Map<String, Object>> selectIndustryHighList(TBasicEnterindesmapCount tBasicEnterindesmapCount);
+    List<Map<String, Object>> selectCentereventTEmergencyDangerList(TBasicEnterindesmapCount tBasicEnterindesmapCount);
 
     /**
      * 获取人员分布情况
@@ -108,7 +120,7 @@ public interface EmergencyBigDataMapper {
     /**
      * 巡检分析
      */
-    List<Map<String, Object>> getBigDataInspectionAnalysis(CentereventTEmergencyInspectionrecord inspectionrecord);
+    List<Map> getBigDataInspectionAnalysis(CentereventTEmergencyInspectionrecord inspectionrecord);
 
     /**
      * 巡检内容分析

+ 14 - 4
src/main/java/com/sooka/sponest/data/digitalemergency/service/IEmergencyBigDataService.java

@@ -23,14 +23,24 @@ public interface IEmergencyBigDataService {
      *
      * @return
      */
-    List selectIndustryHighList(TBasicEnterindesmapCount tBasicEnterindesmapCount);
+    List selectIndustryHighList( );
+
+    /**
+     * 获取企业分布
+     *
+     * @return
+     */
+    List selectEnterpriseList();
+    // 物资分析
+    List getBigDataMaterial();
+    List selectCentereventTEmergencyDangerList();
 
     /**
      * 获取人员分布情况
      *
      * @return
      */
-    List<Map<String,Object>> selectPersonnelList();
+    List selectPersonnelList();
 
     /**
      * 查询数据中台所有资源
@@ -98,7 +108,7 @@ public interface IEmergencyBigDataService {
      *
      * @return
      */
-    List<Map<String,Object>> getBigDataInspectionAnalysis(CentereventTEmergencyInspectionrecord inspectionrecord);
+    List getBigDataInspectionAnalysis();
 
     /*
      * 巡检内容分析
@@ -106,6 +116,6 @@ public interface IEmergencyBigDataService {
      * @author 韩福成
      * @date 2025/2/5 下午1:19
      */
-    List<Map<String,Object>> getBigDataInspectionContent(CentereventTEmergencyInspectionrecord inspectionrecord);
+    List<Map<String,Object>> getBigDataInspectionContent( );
 
 }

+ 31 - 11
src/main/java/com/sooka/sponest/data/digitalemergency/service/impl/EmergencyBigDataServiceImpl.java

@@ -6,6 +6,7 @@ import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyEnterprises;
 import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyMaterial;
 import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyTeam;
+import com.sooka.sponest.data.digitalemergency.domain.dto.TBusEnterpriseDto;
 import com.sooka.sponest.data.digitalemergency.domain.vo.CenterdataTEmergencyEnterpriseMessageBody;
 import com.sooka.sponest.data.digitalemergency.domain.vo.CenterdataTEmergencyPatrolpointBody;
 import com.sooka.sponest.data.digitalemergency.domain.vo.DayBody;
@@ -13,14 +14,12 @@ import com.sooka.sponest.data.digitalemergency.domain.vo.TBasicEnterindesmapCoun
 import com.sooka.sponest.data.digitalemergency.domain.CentereventTEmergencyInspectionrecord;
 import com.sooka.sponest.data.digitalemergency.mapper.EmergencyBigDataMapper;
 import com.sooka.sponest.data.digitalemergency.service.IEmergencyBigDataService;
+import com.sooka.sponest.data.emergency.domain.TBusEnterprise;
 import com.sooka.sponest.data.other.person.domain.CenterdataTEmergencyPerson;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @Auther: mjq
@@ -33,14 +32,35 @@ public class EmergencyBigDataServiceImpl extends BaseServiceImpl implements IEme
     @Autowired
     private EmergencyBigDataMapper emergencyBigDataMapper;
 
+    @Override
+    public List selectCentereventTEmergencyDangerList() {
+        TBasicEnterindesmapCount count = new TBasicEnterindesmapCount();
+        setSookaDataBase(count);
+        return emergencyBigDataMapper.selectCentereventTEmergencyDangerList(count);
+    }
+
+    // 物资分析
+    @Override
+    public List getBigDataMaterial() {
+        return emergencyBigDataMapper.getBigDataMaterial();
+    }
+
+    // 企业列表
+    @Override
+    public List selectEnterpriseList() {
+        TBusEnterpriseDto dto=new TBusEnterpriseDto();
+        setSookaDataBase(dto);
+        return emergencyBigDataMapper.selectEnterpriseList(dto);
+    }
+
     /**
      * 获取行业高危企业
      *
      * @return
      */
-    @DataScopeMutiDept(deptAlias = "z")
     @Override
-    public List<Map<String, Object>> selectIndustryHighList(TBasicEnterindesmapCount tBasicEnterindesmapCount) {
+    public List<Map<String, Object>> selectIndustryHighList() {
+        TBasicEnterindesmapCount tBasicEnterindesmapCount = new TBasicEnterindesmapCount();
         setSookaDataBase(tBasicEnterindesmapCount);
         return emergencyBigDataMapper.selectIndustryHighList(tBasicEnterindesmapCount);
     }
@@ -54,7 +74,7 @@ public class EmergencyBigDataServiceImpl extends BaseServiceImpl implements IEme
      * @author phy
      */
     @Override
-    public List<Map<String, Object>> selectPersonnelList() {
+    public List selectPersonnelList() {
         CenterdataTEmergencyPerson centerdataTEmergencyPerson=new CenterdataTEmergencyPerson();
         setSookaDataBase(centerdataTEmergencyPerson);
         return emergencyBigDataMapper.selectPersonnelList(centerdataTEmergencyPerson);
@@ -193,9 +213,9 @@ public class EmergencyBigDataServiceImpl extends BaseServiceImpl implements IEme
     /**
      * 巡检分析
      */
-    @DataScopeMutiDept(deptAlias = "d")
     @Override
-    public List<Map<String, Object>> getBigDataInspectionAnalysis(CentereventTEmergencyInspectionrecord inspectionrecord) {
+    public List getBigDataInspectionAnalysis( ) {
+        CentereventTEmergencyInspectionrecord inspectionrecord = new CentereventTEmergencyInspectionrecord();
         setSookaDataBase(inspectionrecord);
         return emergencyBigDataMapper.getBigDataInspectionAnalysis(inspectionrecord);
     }
@@ -206,9 +226,9 @@ public class EmergencyBigDataServiceImpl extends BaseServiceImpl implements IEme
      * @author 韩福成
      * @date 2025/2/5 下午1:19
      */
-    @DataScopeMutiDept(deptAlias = "d")
     @Override
-    public List<Map<String, Object>> getBigDataInspectionContent(CentereventTEmergencyInspectionrecord inspectionrecord) {
+    public List<Map<String, Object>> getBigDataInspectionContent() {
+        CentereventTEmergencyInspectionrecord inspectionrecord = new CentereventTEmergencyInspectionrecord();
         setSookaDataBase(inspectionrecord);
         return emergencyBigDataMapper.getBigDataInspectionContent(inspectionrecord);
     }

+ 52 - 31
src/main/resources/mapper/digitalemergency/EmergencyBigDataMapper.xml

@@ -4,6 +4,16 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sooka.sponest.data.digitalemergency.mapper.EmergencyBigDataMapper">
 
+    <select id="getBigDataMaterial" resultType="java.util.Map">
+        SELECT material_type AS `name`, sum(num) AS `value` FROM `t_bus_material` group by material_type DESC LIMIT 0,10
+    </select>
+    <select id="selectEnterpriseList" resultType="java.util.Map">
+        SELECT dept.dept_name AS `name`,count(ent.dept_id) AS `value` FROM `centerdata_t_emergency_enterprise` ent
+              LEFT JOIN ${database_system}.sys_dept dept ON dept.dept_id = ent.dept_id
+        WHERE dept.dept_name is not NULL
+        GROUP BY ent.dept_id ORDER BY count(ent.dept_id) desc LIMIT 10
+    </select>
+
     <select id="selectIndustryHighList" parameterType="TBasicEnterindesmapCount" resultType="java.util.Map">
         SELECT a.inspection_name AS name,
                COUNT(DISTINCT f.enterprise_id) AS value
@@ -22,17 +32,10 @@
             a.inspection_name
     </select>
 
-    <select id="selectPersonnelList" parameterType="CenterdataTEmergencyPerson" resultType="java.util.LinkedHashMap">
-        SELECT
-            COUNT( a.id ) AS value,
-            b.dict_label  AS name
-        FROM
-            centerdata_t_emergency_person a
-            LEFT JOIN ${database_system}.sys_dict_data d ON d.dict_value = a.user_type
-            RIGHT JOIN ${database_system}.sys_dict_data b ON b.dict_type = "emergency_personnel_job" AND b.dict_value=a.user_type
-       WHERE  b.dict_type = "emergency_personnel_job"
-        GROUP BY
-            b.dict_label
+    <select id="selectPersonnelList" resultType="java.util.Map">
+        SELECT dict.dict_label `name`,count(per.user_type) `value`  FROM `centerdata_t_emergency_person` per
+            LEFT JOIN ${database_system}.sys_dict_data dict ON dict.dict_value = per.user_type
+        GROUP BY per.user_type ORDER BY count(per.user_type) DESC
     </select>
 
     <select id="getEmergencyResourceCount" parameterType="CenterdataTEmergencyEnterprises"
@@ -239,35 +242,53 @@
 
     <select id="getBigDataPatrolPoints" resultType="java.util.LinkedHashMap" parameterType="CenterdataTEmergencyTeam">
         SELECT
-            a.enterprise_id enterpriseId,
-            b.name name,
-            count(a.id) value
+            b.name AS `name`,
+            count( a.id ) AS `value`
         FROM
             centerdata_t_emergency_patrolpoint a
                 left join centerdata_t_emergency_enterprise b on a.enterprise_id = b.id
-                LEFT JOIN ${database_system}.sys_dept d ON a.data_dept_id = d.dept_id
-        where 1=1 ${params.dataScope}
         GROUP BY
-            a.enterprise_id
+            a.enterprise_id limit 10
     </select>
 
-    <select id="getBigDataInspectionAnalysis" parameterType="CentereventTEmergencyInspectionrecord" resultType="java.util.Map">
-        SELECT
-            a.enterprise_id enterpriseId,
-            a.enterprise_name name,
-            count(a.id) value
-        FROM
-            centerevent_t_emergency_inspectionrecord a
-        group by a.enterprise_id
+    <select id="getBigDataInspectionAnalysis" resultType="java.util.Map">
+        SELECT a.* FROM (SELECT
+                             sdd.dict_label AS `name`,
+                             SUM(CASE WHEN insp.is_pass = 'N' THEN 1 ELSE 0 END) AS `value`
+                         FROM t_bus_inspection insp
+                                  LEFT JOIN ${database_system}.sys_dict_data sdd
+                                            ON sdd.dict_value = insp.items_type
+                         WHERE insp.items_type IS NOT NULL
+                         GROUP BY sdd.dict_label  ) a
+        UNION ALL
+        SELECT b.* FROM (
+                            SELECT
+                                bus_items_name AS `name`,
+                                COUNT(*) AS `value`
+                            FROM t_bus_inspection
+                            WHERE is_pass = 'N'
+                            GROUP BY bus_items_id, bus_items_name
+                            ORDER BY `value` DESC
+                                LIMIT 1) b
     </select>
 
-    <select id="getBigDataInspectionContent" parameterType="CentereventTEmergencyInspectionrecord" resultType="java.util.Map">
+    <select id="selectCentereventTEmergencyDangerList" resultType="java.util.Map">
+        SELECT sdd.dict_label AS `name`,COUNT(insp.items_type is null) AS `values` FROM `t_bus_inspection` insp
+            LEFT JOIN ${database_system}.sys_dict_data sdd ON sdd.dict_value = insp.items_type
+        WHERE insp.items_type IS NOT NULL
+        GROUP BY insp.items_type
+    </select>
+
+    <select id="getBigDataInspectionContent" resultType="java.util.Map">
         SELECT
-            a.inspectionitem_id inspectionitemId,
-            a.inspectionitem_name name,
-            count(a.id) value
+            bus_items_name AS `name`,
+            COUNT(*) AS `value`
         FROM
-            centerevent_t_emergency_inspectionrecord a
-        group by a.inspectionitem_id
+            t_bus_inspection
+        GROUP BY
+            bus_items_name
+        ORDER BY
+            `value` DESC
+            LIMIT 10
     </select>
 </mapper>