Browse Source

2022-09-15 疏散线路,多楼层补充配置。

zhuchangxue 3 years ago
parent
commit
583d9a5de0

+ 1 - 0
zd-modules/zd-bottle-parent/zd-bottle/src/main/resources/mapper/UsegasApplyMapper.xml

@@ -53,6 +53,7 @@
                 and ua.lead_audit_staus = #{leadAuditStaus}
             </if>
         </where>
+        order by ua.create_time desc
     </select>
 
     <select id="selectApplyTabCount" parameterType="com.zd.bottle.domain.UsegasApply"

+ 46 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/EvacuationLine.java

@@ -1,5 +1,7 @@
 package com.zd.laboratory.domain.vo;
 
+import io.swagger.annotations.ApiModelProperty;
+
 import java.util.List;
 
 public class EvacuationLine {
@@ -17,6 +19,18 @@ public class EvacuationLine {
 
     private Long deptId;
 
+    @ApiModelProperty("院系名称")
+    private String deptName;
+
+    @ApiModelProperty("楼栋名称")
+    private String buildName;
+
+    @ApiModelProperty("楼栋名称")
+    private String floorName;
+
+    @ApiModelProperty("楼层id")
+    private Long floorId;
+
     public Integer getType() {
         return type;
     }
@@ -56,4 +70,36 @@ public class EvacuationLine {
     public void setDeptId(Long deptId) {
         this.deptId = deptId;
     }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getBuildName() {
+        return buildName;
+    }
+
+    public void setBuildName(String buildName) {
+        this.buildName = buildName;
+    }
+
+    public String getFloorName() {
+        return floorName;
+    }
+
+    public void setFloorName(String floorName) {
+        this.floorName = floorName;
+    }
+
+    public Long getFloorId() {
+        return floorId;
+    }
+
+    public void setFloorId(Long floorId) {
+        this.floorId = floorId;
+    }
 }

+ 5 - 5
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabExitLineServiceImpl.java

@@ -15,10 +15,7 @@ import com.zd.common.redis.service.RedisService;
 import com.zd.common.security.utils.SaveUtil;
 
 import com.zd.laboratory.domain.*;
-import com.zd.laboratory.domain.vo.EvacuationLine;
-import com.zd.laboratory.domain.vo.LabExitLightVO;
-import com.zd.laboratory.domain.vo.LabExitLineJoinVO;
-import com.zd.laboratory.domain.vo.LabExitLineVO;
+import com.zd.laboratory.domain.vo.*;
 import com.zd.laboratory.mapper.*;
 import com.zd.laboratory.mqtt.service.impl.SubMessageSendManager;
 import com.zd.laboratory.socket.command.Symbol;
@@ -525,9 +522,12 @@ public class LabExitLineServiceImpl implements ILabExitLineService
             EvacuationLine evacuationLine = redisService.getCacheObject(key);
             String keyLength = key.substring(key.indexOf(":")+1);
             evacuationLine.setSubId(keyLength);
-            LabSubject labSubject = labSubjectMapper.selectLabSubjectById(Long.parseLong(keyLength));
+            LabSubjectVO labSubject = labSubjectMapper.selectLabSubjectVoById(Long.parseLong(keyLength));
             evacuationLine.setDeptId(labSubject.getDeptId());
+            evacuationLine.setFloorId(labSubject.getFloorId());
             evacuationLine.setSubName(labSubject.getName());
+            evacuationLine.setBuildName(labSubject.getBuildName());
+            evacuationLine.setFloorName(labSubject.getFloorName());
             return evacuationLine;
         }
         return null;

+ 1 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectLayoutMapper.xml

@@ -196,6 +196,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
+        order by sl.lay_order asc
     </select>
 
     <select id="queryLayoutByFloorId" resultMap="subjectAndLayout">

+ 10 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/controller/SysDeptController.java

@@ -147,6 +147,16 @@ public class SysDeptController extends BaseController {
         return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
     }
 
+
+    /**
+     * 获取部门下拉树列表(获取登录人的部门父级部门)
+     */
+    @GetMapping("/treeselectByUser")
+    public AjaxResult treeselectByUser(SysDept dept) {
+        List<SysDept> depts = deptService.treeselectByUser(dept);
+        return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
+    }
+
     /**
      * 加载对应角色部门列表树
      */

+ 8 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/mapper/SysDeptMapper.java

@@ -22,6 +22,14 @@ public interface SysDeptMapper {
     public List<SysDept> selectDeptList(SysDept dept);
 
     /**
+     * 获取部门下拉树列表(获取登录人的部门父级部门)
+     *
+     * @param dept 部门信息
+     * @return 部门信息集合
+     */
+    public List<SysDept> treeselectByUser(SysDept dept);
+
+    /**
      * 根据角色ID查询部门树信息
      *
      * @param roleId            角色ID

+ 8 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/service/ISysDeptService.java

@@ -22,6 +22,14 @@ public interface ISysDeptService {
     public List<SysDept> selectDeptList(SysDept dept);
 
     /**
+     * 获取部门下拉树列表(获取登录人的部门父级部门)
+     *
+     * @param dept 部门信息
+     * @return 部门信息集合
+     */
+    public List<SysDept> treeselectByUser(SysDept dept);
+
+    /**
      * 查询部门管理数据 - 无数据权限
      *
      * @param dept 部门信息

+ 23 - 0
zd-modules/zd-modules-system/src/main/java/com/zd/system/service/impl/SysDeptServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.stream.Collectors;
 
 import com.zd.common.core.domain.per.PerPrefix;
 import com.zd.common.core.utils.SecurityUtils;
+import com.zd.common.security.service.TokenService;
 import com.zd.system.api.domain.SysDeptVO;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +36,9 @@ public class SysDeptServiceImpl implements ISysDeptService {
     @Autowired
     private SysRoleMapper roleMapper;
 
+    @Autowired
+    private TokenService tokenService;
+
     /**
      * 查询部门管理数据
      *
@@ -48,6 +52,25 @@ public class SysDeptServiceImpl implements ISysDeptService {
         return depts;
     }
 
+    /**
+     * 获取部门下拉树列表(获取登录人的部门父级部门)
+     *
+     * @param dept 部门信息
+     * @return 部门信息集合
+     */
+    @Override
+    public List <SysDept> treeselectByUser(SysDept dept) {
+        SysDept sysDept = deptMapper.selectDeptById(tokenService.getLoginUser().getSysUser().getDeptId());
+        if(sysDept.getParentId()==0){
+            dept.setParentId(sysDept.getDeptId());
+        }else{
+            dept.setParentId(sysDept.getParentId());
+        }
+
+        List<SysDept> depts = deptMapper.treeselectByUser(dept);
+        return depts;
+    }
+
 
     /**
      * 查询部门管理数据-无数据权限

+ 18 - 0
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -64,6 +64,24 @@
         order by d.parent_id, d.order_num
     </select>
 
+
+    <select id="treeselectByUser" parameterType="com.zd.system.api.domain.SysDept" resultMap="SysDeptResult">
+        <include refid="selectDeptVo"/>
+        where d.del_flag = '0'
+        <if test="parentId != null and parentId != 0">
+            AND find_in_set(#{parentId}, ancestors)
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND dept_name like concat('%', #{deptName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND status = #{status}
+        </if>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        order by d.parent_id, d.order_num
+    </select>
+
     <select id="selectDeptListByRoleId" resultType="java.lang.Integer">
         select d.dept_id
         from sys_dept d