Bladeren bron

2023-4-3 添加一个签到离开后,可以查询小程序上传的图片,添加定时排风的数据权限,部分sql优化调整。

chaiyunlong 2 jaren geleden
bovenliggende
commit
3ad7232efe

+ 23 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabPhotoInspectionController.java

@@ -3,9 +3,7 @@ package com.zd.laboratory.controller;
 import com.zd.common.core.annotation.Log;
 import com.zd.common.core.annotation.Log;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.log.BusinessType;
-import com.zd.common.core.utils.DictUtils;
-import com.zd.common.core.utils.ExcelUtil;
-import com.zd.common.core.utils.SecurityUtils;
+import com.zd.common.core.utils.*;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.laboratory.domain.LabPhotoInspection;
 import com.zd.laboratory.domain.LabPhotoInspection;
 import com.zd.laboratory.domain.LabSubject;
 import com.zd.laboratory.domain.LabSubject;
@@ -46,6 +44,9 @@ public class LabPhotoInspectionController extends BaseController {
     @Autowired
     @Autowired
     private ILabSubjectService subjectService;
     private ILabSubjectService subjectService;
 
 
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
+
     /**
     /**
      * 查询拍照检查附件列表
      * 查询拍照检查附件列表
      */
      */
@@ -110,7 +111,26 @@ public class LabPhotoInspectionController extends BaseController {
         return ResultData.success(labPhotoInspectionService.selectLabPhotoInspectionById(id));
         return ResultData.success(labPhotoInspectionService.selectLabPhotoInspectionById(id));
     }
     }
 
 
+    @GetMapping(value = "/detial/{id}")
+    public TableDataInfo getDetail(@PathVariable("id") Long id) {
+        LabPhotoInspection photoInspection = labPhotoInspectionService.selectLabPhotoInspectionById(id);
+        List<Map<String,String>> allList = new ArrayList <>();
+        imgList(allList,photoInspection.getSubUrl(),"实验室照片");
+        imgList(allList,photoInspection.getGarbageUrl(),"垃圾桶清理后照片");
+        imgList(allList,photoInspection.getDangerousUrl(),"使用危险设备照片");
+        imgList(allList,photoInspection.getSourceRiskUrl(),"危险源设备使用登记本照片");
+        return getDataTable(allList);
+    }
+
 
 
+    public void imgList(List<Map<String,String>> allList,String imgUrl,String imgName){
+        if(StringUtils.isNotNull(imgUrl) && !"".equals(imgUrl)){
+            Map<String,String> imgMap = new HashMap <>();
+            imgMap.put("imgName", imgName);
+            imgMap.put("imgUrl", fileConfigUtils.getFileDomainAdmin()+imgUrl);
+            allList.add(imgMap);
+        }
+    }
 
 
     /**
     /**
      * 获取离开实验室拍照附件列表
      * 获取离开实验室拍照附件列表

+ 11 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabOnlineSubVO.java

@@ -28,6 +28,9 @@ public class LabOnlineSubVO {
     @ApiModelProperty("在线人数")
     @ApiModelProperty("在线人数")
     private Integer online;
     private Integer online;
 
 
+    @ApiModelProperty("根据实验室,合并多用户到一个字段上")
+    private String groupUserName;
+
     public String getName() {
     public String getName() {
         return name;
         return name;
     }
     }
@@ -67,4 +70,12 @@ public class LabOnlineSubVO {
     public void setOnline(Integer online) {
     public void setOnline(Integer online) {
         this.online = online;
         this.online = online;
     }
     }
+
+    public String getGroupUserName() {
+        return groupUserName;
+    }
+
+    public void setGroupUserName(String groupUserName) {
+        this.groupUserName = groupUserName;
+    }
 }
 }

+ 3 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabTimedExhaustServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
 import com.alibaba.fastjson.TypeReference;
+import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.utils.StringUtils;
@@ -14,6 +15,7 @@ import com.zd.laboratory.mapper.LabTimedExhaustJoinsubMapper;
 import com.zd.laboratory.mapper.LabTimedExhaustMapper;
 import com.zd.laboratory.mapper.LabTimedExhaustMapper;
 import com.zd.laboratory.service.ILabTimedExhaustService;
 import com.zd.laboratory.service.ILabTimedExhaustService;
 import com.zd.model.constant.BaseConstants;
 import com.zd.model.constant.BaseConstants;
+import com.zd.model.domain.per.PerPrefix;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
@@ -58,6 +60,7 @@ public class LabTimedExhaustServiceImpl implements ILabTimedExhaustService {
      * @return 定时排风集合
      * @return 定时排风集合
      */
      */
     @Override
     @Override
+    @DataScope(deptAlias = "s", userAlias = "te", permi = PerPrefix.LABORATORY_EXHAUST)
     public List <LabTimedExhaust> selectLabTimedExhaustList(LabTimedExhaust labTimedExhaust) {
     public List <LabTimedExhaust> selectLabTimedExhaustList(LabTimedExhaust labTimedExhaust) {
         return labTimedExhaustMapper.selectLabTimedExhaustList(labTimedExhaust);
         return labTimedExhaustMapper.selectLabTimedExhaustList(labTimedExhaust);
     }
     }

+ 2 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabBigViewMapper.xml

@@ -102,7 +102,8 @@
         WHERE d.parent_id = 0 AND FIND_IN_SET(dt.dept_id,t.`ancestors`)) groupDeptName,
         WHERE d.parent_id = 0 AND FIND_IN_SET(dt.dept_id,t.`ancestors`)) groupDeptName,
         (SELECT sc.classified_name FROM lab_safe_classified sc WHERE sc.id = s.level) AS classifiedName,
         (SELECT sc.classified_name FROM lab_safe_classified sc WHERE sc.id = s.level) AS classifiedName,
         (SELECT sc.type_name FROM lab_safe_classtype sc WHERE sc.id = s.type_id) AS typeName,
         (SELECT sc.type_name FROM lab_safe_classtype sc WHERE sc.id = s.type_id) AS typeName,
-        COUNT(DISTINCT sar.join_user_id) AS online
+        COUNT(DISTINCT sar.join_user_id) AS online,
+        GROUP_CONCAT((select su.nick_name from sys_user su where su.user_id = sar.`join_user_id`)) groupUserName
         FROM lab_subject s LEFT JOIN lab_subject_access_record sar ON sar.subject_id = s.id
         FROM lab_subject s LEFT JOIN lab_subject_access_record sar ON sar.subject_id = s.id
         LEFT JOIN sys_dept t ON s.`dept_id` = t.`dept_id`
         LEFT JOIN sys_dept t ON s.`dept_id` = t.`dept_id`
         <where>
         <where>

+ 1 - 2
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabControlMapper.xml

@@ -56,8 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from
         from
           lab_control cl
           lab_control cl
           INNER JOIN lab_subject s on  s.id = cl.subject_id
           INNER JOIN lab_subject s on  s.id = cl.subject_id
-          INNER JOIN lab_building bd ON bd.id = s.floor_id
-          INNER JOIN sys_dept dt ON dt.dept_id = bd.dept_id
+          INNER JOIN sys_dept dt ON dt.dept_id = s.dept_id
           )xx
           )xx
     </sql>
     </sql>
 
 

+ 2 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabTimedExhaustMapper.xml

@@ -48,6 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null  and deptId != ''">
             <if test="deptId != null  and deptId != ''">
                 and s.dept_id = #{deptId}
                 and s.dept_id = #{deptId}
             </if>
             </if>
+            <!-- 数据范围过滤 -->
+            ${params.dataScope}
         </where>
         </where>
         ORDER BY te.`create_time` desc
         ORDER BY te.`create_time` desc
     </select>
     </select>

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

@@ -315,7 +315,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         </where>
         GROUP BY t.violation_type
         GROUP BY t.violation_type
         ) lv ON dd.violation_name = lv.violation_type
         ) lv ON dd.violation_name = lv.violation_type
-        ORDER BY COUNT DESC
     </select>
     </select>
 
 
     <select id="columnar" resultType="com.zd.laboratory.domain.vo.LabViolationColumnarVO">
     <select id="columnar" resultType="com.zd.laboratory.domain.vo.LabViolationColumnarVO">