Browse Source

Merge branch 'dev' into dev-2.0

lyq 1 year ago
parent
commit
5ceeac598e

+ 1 - 1
data-ui/src/permission.js

@@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request'
 
 NProgress.configure({ showSpinner: false })
 
-const whiteList = ['/login', '/auth-redirect', '/bind', '/register','/integrated/index','/integrated/bigdata','/integrated/forest', '/integrated/fire-forest', '/integrated/monitor']
+const whiteList = ['/login', '/auth-redirect', '/bind', '/register','/integrated/index','/integrated/bigdata','/integrated/forest', '/integrated/fire-forest', '/integrated/monitor', '/40101']
 
 router.beforeEach((to, from, next) => {
   NProgress.start()

+ 5 - 0
data-ui/src/router/index.js

@@ -62,6 +62,11 @@ export const constantRoutes = [
     hidden: true
   },
   {
+    path: '/40101',
+    component: () => import('@/views/error/40101'),
+    hidden: true
+  },
+  {
     path: '',
     component: Layout,
     redirect: 'index',

+ 1 - 0
data-ui/src/utils/errorCode.js

@@ -2,5 +2,6 @@ export default {
   '401': '认证失败,无法访问系统资源',
   '403': '当前操作没有权限',
   '404': '访问资源不存在',
+  '40101': '授权已过期',
   'default': '系统未知错误,请反馈给管理员'
 }

+ 9 - 0
data-ui/src/utils/request.js

@@ -93,6 +93,15 @@ service.interceptors.response.use(res => {
       });
     }
       return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
+    } else if (code == 40101) {
+      store.dispatch('LogOut').then(() => {
+        location.href = '/40101';
+      })
+    } else if (code == 1307) {
+      Message({
+        message: msg,
+        type: 'error'
+      })
     } else if (code === 500) {
       Message({
         message: msg,

+ 1 - 2
data-ui/src/views/data/basicdata/firehydrant/index.vue

@@ -276,9 +276,8 @@
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
-      <ISuperMap ref="ISuperMap" v-if="ISuperMapvisible" @send="send"/>
     </el-dialog>
-
+    <ISuperMap ref="ISuperMap" v-if="ISuperMapvisible" @send="send"/>
     <!--详情 -->
     <el-dialog :title="title" :visible.sync="seeopen" width="800px" class="form-style" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">

+ 1 - 1
data-ui/src/views/data/basicdata/watercrane/index.vue

@@ -234,8 +234,8 @@
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
-      <ISuperMap ref="ISuperMap" v-if="ISuperMapvisible" @send="send"/>
     </el-dialog>
+    <ISuperMap ref="ISuperMap" v-if="ISuperMapvisible" @send="send"/>
     <!--详情 -->
     <el-dialog :title="title" :visible.sync="seeopen" width="700px" class="form-style" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">

+ 3 - 1
data-ui/src/views/data/generalbusiness/keyProjects/index.vue

@@ -1141,7 +1141,9 @@ export default {
       this.reset();
       const id = row.id || this.ids
       getProjects(id).then(response => {
-        response.data.park = response.data.park + ""
+        if (response.data.park !== null){
+          response.data.park = response.data.park + ""
+        }
         this.form = response.data;
         this.open = true;
         this.title = "修改重点工程";

+ 101 - 0
data-ui/src/views/error/40101.vue

@@ -0,0 +1,101 @@
+<template>
+  <div class="errPage-container">
+    <el-button icon="arrow-left" class="pan-back-btn" @click="back">
+      返回
+    </el-button>
+    <el-row>
+      <el-col :span="14">
+        <h1 class="text-jumbo text-ginormous">
+          项目授权已过期!
+        </h1>
+        <h2>对不起,此项目授权已过期,请联系管理员!</h2>
+<!--        <ul class="list-unstyled">-->
+<!--          <li class="link-type">-->
+<!--            <router-link to="/">-->
+<!--              回首页-->
+<!--            </router-link>-->
+<!--          </li>-->
+<!--        </ul>-->
+      </el-col>
+      <el-col :span="10">
+        <img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream.">
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import errGif from '@/assets/401_images/401.gif'
+import {MessageBox} from "element-ui";
+import store from "@/store";
+import {isRelogin} from "@/utils/request";
+
+export default {
+  name: 'Page40101',
+  data() {
+    return {
+      errGif: errGif + '?' + +new Date()
+    }
+  },
+  methods: {
+    back() {
+      if (!isRelogin.show) {
+        isRelogin.show = true;
+        MessageBox.confirm('授权已过期,您可以继续留在该页面,或者联系管理员重新授权!', '系统提示', {
+          confirmButtonText: '重新登录',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          isRelogin.show = false;
+          store.dispatch('LogOut').then(() => {
+            location.href = '/index';
+          })
+        }).catch(() => {
+          isRelogin.show = false;
+        });
+      }
+      return Promise.reject('请重新登录。')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  .errPage-container {
+    width: 800px;
+    max-width: 100%;
+    margin: 100px auto;
+    .pan-back-btn {
+      background: #008489;
+      color: #fff;
+      border: none!important;
+    }
+    .pan-gif {
+      margin: 0 auto;
+      display: block;
+    }
+    .pan-img {
+      display: block;
+      margin: 0 auto;
+      width: 100%;
+    }
+    .text-jumbo {
+      font-size: 60px;
+      font-weight: 700;
+      color: #484848;
+    }
+    .list-unstyled {
+      font-size: 14px;
+      li {
+        padding-bottom: 5px;
+      }
+      a {
+        color: #008489;
+        text-decoration: none;
+        &:hover {
+          text-decoration: underline;
+        }
+      }
+    }
+  }
+</style>

+ 2 - 5
src/main/java/com/sooka/sponest/data/commandcenter/domian/ProjectBody.java

@@ -7,7 +7,6 @@ import lombok.Data;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 @Data
 public class ProjectBody {
@@ -107,12 +106,10 @@ public class ProjectBody {
     private String secretaryPhone;
 
     private String deptId;
+
     private String deptName;
 
-    /**
-     * 数据列表
-     */
-    private List<Map<String, Object>> cameraList = new ArrayList<>();
+    private String cameraCode;
 
     /**
      * 进度图片列表

+ 2 - 4
src/main/java/com/sooka/sponest/data/commandcenter/mapper/CommandCenterMapper.java

@@ -56,8 +56,6 @@ public interface CommandCenterMapper {
      */
     List<ProjectBody> getKeyProjects(CommandCenterBO commandCenterBO);
 
-    List<Map<String, Object>> getKeyProjectsCamera(CommandCenterBO commandCenterBO);
-
     List<AreaBody> getImportAreaType(CommandCenterBO commandCenterBO);
 
     List<Map<String, Object>> getImportAreaList(CommandCenterBO commandCenterBO);
@@ -92,9 +90,9 @@ public interface CommandCenterMapper {
 
     List<Map<String, Object>> fireList(AgricultureViewBO agricultureViewBO);
 
-    List<Map<String,Object>> getLocation(AgricultureViewBO agricultureViewBO);
+    List<Map<String, Object>> getLocation(AgricultureViewBO agricultureViewBO);
 
-    List<Map<String,Object>> getLocationWithCamera(AgricultureViewBO agricultureViewBO);
+    List<Map<String, Object>> getLocationWithCamera(AgricultureViewBO agricultureViewBO);
 
     List<CenterdataTKeyProjectsSchedule> getKeyProjectsSchedule(CommandCenterBO commandCenterBO);
 }

+ 5 - 20
src/main/java/com/sooka/sponest/data/commandcenter/service/impl/ICommandCenterServiceImpl.java

@@ -22,7 +22,6 @@ import com.sooka.sponest.data.digitalresource.service.ICenterdataTFarmGridServic
 import com.sooka.sponest.data.digitalresource.service.IResourceViewService;
 import com.sooka.sponest.data.digitaltraffic.service.ITrafficViewService;
 import com.sooka.sponest.data.digitalwater.service.IWaterViewService;
-import com.sooka.sponest.data.generalbusiness.domain.CenterdataTForestImportarea;
 import com.sooka.sponest.data.generalbusiness.domain.CenterdataTForestNetworkprocessing;
 import com.sooka.sponest.data.generalbusiness.domain.CenterdataTKeyProjectsSchedule;
 import com.sooka.sponest.data.generalbusiness.mapper.CenterdataTForestImportareaMapper;
@@ -150,6 +149,7 @@ public class ICommandCenterServiceImpl extends BaseServiceImpl implements IComma
      * @return
      */
     @Override
+    @DataScopeMutiDept(deptAlias = "d")
     public List<ProjectBody> getKeyProjects(CommandCenterBO commandCenterBO) {
         setSookaDataBase(commandCenterBO);
         List<ProjectBody> projectBodies = commandCenterMapper.getKeyProjects(commandCenterBO);
@@ -161,40 +161,25 @@ public class ICommandCenterServiceImpl extends BaseServiceImpl implements IComma
         Map<String, Object> industryTypeMap = DictUtils.getDictCacheToMap("centerdata_industry_type");
         Map<String, Object> parkMap = DictUtils.getDictCacheToMap("centerdata_park");
         projectBodies.forEach(item -> {
-            if (!StringUtils.isEmpty(item.getEnvironment()) && environmentMap.containsKey(item.getEnvironment())){
+            if (!StringUtils.isEmpty(item.getEnvironment()) && environmentMap.containsKey(item.getEnvironment())) {
                 item.setEnvironment(environmentMap.get(item.getEnvironment()).toString());
             }
-            if (!StringUtils.isEmpty(item.getNature()) && zjNatureMap.containsKey(item.getNature())){
+            if (!StringUtils.isEmpty(item.getNature()) && zjNatureMap.containsKey(item.getNature())) {
                 item.setNature(zjNatureMap.get(item.getNature()).toString());
             }
-            if (!StringUtils.isEmpty(item.getIndustryType()) && industryTypeMap.containsKey(item.getIndustryType())){
+            if (!StringUtils.isEmpty(item.getIndustryType()) && industryTypeMap.containsKey(item.getIndustryType())) {
                 item.setIndustryType(industryTypeMap.get(item.getIndustryType()).toString());
             }
-            if (!StringUtils.isEmpty(item.getPark()) && parkMap.containsKey(item.getPark())){
+            if (!StringUtils.isEmpty(item.getPark()) && parkMap.containsKey(item.getPark())) {
                 item.setPark(parkMap.get(item.getPark()).toString());
             }
         });
-        List<Map<String, Object>> cameraList = commandCenterMapper.getKeyProjectsCamera(commandCenterBO);
-        projectBodies.forEach(project -> cameraList.forEach(item -> {
-            if (project.getProjectId().equals(MapUtils.getString(item, "projectId"))) {
-                project.getCameraList().add(item);
-            }
-        }));
         List<CenterdataTKeyProjectsSchedule> scheduleList = commandCenterMapper.getKeyProjectsSchedule(commandCenterBO);
         projectBodies.forEach(project -> scheduleList.forEach(schedule -> {
             if (project.getProjectId().equals(schedule.getKeyProjectsId())) {
                 project.getScheduleList().add(schedule);
             }
         }));
-        if ("true".equals(commandCenterBO.getState())){
-            List<ProjectBody> projectBodyList = new ArrayList<>();
-            projectBodies.forEach(project -> {
-                if (project.getCameraList().size()!=0) {
-                    projectBodyList.add(project);
-                }
-            });
-            return projectBodyList;
-        }
         return projectBodies;
     }
 

+ 9 - 0
src/main/java/com/sooka/sponest/data/index/domain/IndexViewInfo.java

@@ -18,6 +18,15 @@ public class IndexViewInfo extends BaseBusinessEntity {
     @ApiModelProperty(value = "基础数据列表-类别", required = false)
     private String category;
 
+    /*
+    * 基础数据列表-类别(英文)
+    *
+    * @author 韩福成
+    * @date 2023/12/19 16:39
+    */
+    @ApiModelProperty(value = "基础数据列表-类别(英文)", required = false)
+    private String categoryEnglish;
+
     /**
      * 基础数据列表-小类
      */

+ 4 - 1
src/main/java/com/sooka/sponest/data/index/domain/MenuInfo.java

@@ -59,7 +59,10 @@ public class MenuInfo extends BaseBusinessEntity {
     /*
     * 部门id
     */
-    @ApiModelProperty(value = "结束时间", required = false)
+    @ApiModelProperty(value = "部门id", required = false)
     private String deptIds;
 
+    //总数和更新数标识
+    private String mark;
+
 }

+ 6 - 2
src/main/java/com/sooka/sponest/data/index/service/impl/IndexViewServiceImpl.java

@@ -126,6 +126,7 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
             indexViewInfo.setUpdataCount(0L);
 
             indexViewInfo.setCategory(categoryMap.get(subclass));
+            indexViewInfo.setCategoryEnglish(subclass);
             indexViewInfo.setSubclass(subclassCount.get(subclass));
 
             List<MenuInfo> menuInfos = entry.getValue();
@@ -141,6 +142,7 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
                     menuInfo1.setStartDate(date[0]);
                     menuInfo1.setEndDate(date[1]);
                 }
+                menuInfo1.setMark("xiugai");
                 Long updateCount = indexViewMapper.getBasicDataCount(menuInfo1);
                 indexViewInfo.setUpdataCount(indexViewInfo.getUpdataCount() + updateCount);
 
@@ -156,6 +158,7 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
 
         IndexViewInfo indexViewInfo = new IndexViewInfo();
         indexViewInfo.setCategory("共有基础数据类型");
+        indexViewInfo.setCategoryEnglish("all");
         indexViewInfo.setSubclass((long) basicDataList.size());
         indexViewInfo.setCount(totalCount);
         basicList.add(indexViewInfo);
@@ -253,8 +256,8 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
         // 合并基础数据
         if (basicDataList != null) {
             for (int i = 0; i < basicDataList.size(); i++) {
-                systemInfoReportMap.put("basicDataSubclass" + i, basicDataList.get(i).getSubclass());
-                systemInfoReportMap.put("basicDataCount" + i, basicDataList.get(i).getCount());
+                systemInfoReportMap.put("basicDataSubclass-" + basicDataList.get(i).getCategoryEnglish(), basicDataList.get(i).getSubclass());
+                systemInfoReportMap.put("basicDataCount-" + basicDataList.get(i).getCategoryEnglish(), basicDataList.get(i).getCount());
             }
         }
         // 合并四长人数、巡护距离
@@ -363,6 +366,7 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
                     info1.setStartDate(date[0]);
                     info1.setEndDate(date[1]);
                 }
+                info1.setMark("xiugai");
                 updateCount += indexViewMapper.getBasicDataCount(info1);
             }
             td.put("count"+a,count);

+ 12 - 20
src/main/resources/mapper/commandcenter/CommandCentreMapper.xml

@@ -140,9 +140,9 @@
 
     <select id="getKeyProjects" parameterType="CommandCenterBO" resultType="ProjectBody">
         SELECT
-        id projectId,
-        longitude,
-        latitude,
+        a.id projectId,
+        a.longitude,
+        a.latitude,
         project_name projectName,
         project_target projectTarget,
         project_type projectType,
@@ -171,11 +171,13 @@
         secretary,
         secretary_duties secretaryDuties,
         secretary_phone secretaryPhone,
-        a.dept_id as deptId,
-        d.dept_name as deptName
+        a.dept_id deptId,
+        d.dept_name deptName,
+        GROUP_CONCAT(c.camera_code) cameraCode
         FROM centerdata_t_key_projects a
         LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
-        LEFT JOIN ${database_system}.sys_dept b on a.park = b.dept_id
+        LEFT JOIN ${database_system}.sys_dept b ON b.dept_id = a.park
+        LEFT JOIN centerdata_t_equipment_camera c ON c.business_id = a.id
         <where>
             <choose>
                 <when test="deptId != null and deptId != ''">and FIND_IN_SET( #{deptId}, CONCAT(d.ancestors,',',d.dept_id) )</when>
@@ -197,21 +199,11 @@
                 AND nature in (${params.nature})
             </if>
         </where>
-        ORDER BY a.create_time DESC
-    </select>
-
-    <select id="getKeyProjectsCamera" parameterType="CommandCenterBO" resultType="map">
-        SELECT a.business_id projectId,b.id cameraId,b.camera_code cameraCode,b.camera_name cameraName,b.camera_factory
-        cameraFactory,b.longitude,b.latitude,b.camera_radius cameraRadius
-        FROM centerdata_t_equipment_camera a
-        LEFT JOIN ${database_monitor}.centermonitor_t_camera b ON b.id = a.camera_id
-        where a.type = '0'
-        <if test="params.projectIds != null and params.projectIds.size > 0">
-            AND a.business_id IN
-            <foreach item="proid" collection="params.projectIds" open="(" separator="," close=")">
-                #{proid}
-            </foreach>
+        GROUP BY a.id
+        <if test="state != null and state != ''" >
+            HAVING cameraCode IS NOT NULL
         </if>
+        ORDER BY a.create_time DESC
     </select>
 
     <select id="getImportAreaType" parameterType="CommandCenterBO" resultType="AreaBody">

+ 14 - 3
src/main/resources/mapper/index/IndexViewMapper.xml

@@ -27,9 +27,20 @@
         left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
         <where>
             <if test="type != null and type != ''">and a.type = #{type}</if>
-            <if test="startDate != null and startDate != ''">and a.update_time &gt;= concat(#{startDate},' 00:00:00')</if>
-            <if test="endDate != null and endDate != ''">and a.update_time &lt;= concat(#{endDate},' 23:59:59')</if>
-            <if test="deptIds != null and deptIds != ''">and CONCAT(d.ancestors,',',a.dept_id) = #{deptIds}</if>
+            <choose>
+                <when test="mark != null  and mark != ''">
+                    <choose>
+                        <when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
+                            and a.update_time &gt;= concat(#{startDate},' 00:00:00')
+                            and a.update_time &lt;= concat(#{endDate},' 23:59:59')
+                        </when>
+                        <otherwise>
+                            and a.update_time is not null
+                        </otherwise>
+                    </choose>
+                </when>
+            </choose>
+            <if test="deptIds != null and deptIds != ''">and CONCAT(d.ancestors,',',a.dept_id) like concat('%', #{deptIds}, '%') </if>
         </where>
     </select>