Browse Source

电子信息牌bug修改

xuxiaofei 2 years ago
parent
commit
cd66a6e634

+ 5 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubjectController.java

@@ -402,6 +402,11 @@ public class LabSubjectController extends BaseController {
         return ResultData.success(labSubjectService.multipleDetpBysubList(ids));
     }
 
+    @GetMapping("/cardInfo/subList")
+    public ResultData cardinfoSubList(LabSubject labSubject) {
+        return ResultData.success(labSubjectService.cardinfoSubList(labSubject));
+    }
+
     /**
      * 获取实验室气瓶数量详细信息
      */

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpCardInfoController.java

@@ -47,7 +47,7 @@ public class LabXxpCardInfoController extends BaseController
     @ApiOperation(value = "查询电子信息牌列表")
     public TableDataInfo<XxpCardInfo> list(XxpCardInfo xxpCardInfo)
     {
-        startPage();
+        startPage("create_time","descending");
         List<XxpCardInfo> list = xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
         return getDataTable(list);
     }

+ 1 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyDetailedController.java

@@ -60,6 +60,7 @@ public class LabXxpClassifyDetailedController extends BaseController
     public TableDataInfo<XxpClassifyDetailVO> list(XxpClassifyDetailVO classifyDetailed)
     {
         startPage();
+        classifyDetailed.setRemark("list");
         List<XxpClassifyDetailVO> list = classifyDetailedService.selectXxpClassifyDetailedList(classifyDetailed);
         return getDataTable(list);
     }

+ 8 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpCardInfo.java

@@ -72,6 +72,10 @@ public class XxpCardInfo extends BaseEntity {
     @ApiModelProperty(value = "设备状态")
     private Integer operate;
 
+    @Excel(name = "授权方式")
+    @ApiModelProperty(value = "授权方式")
+    private Integer authType;
+
     /**
      * 实验室id
      */
@@ -229,4 +233,8 @@ public class XxpCardInfo extends BaseEntity {
     public void setSubjectId(Long subjectId) {
         this.subjectId = subjectId;
     }
+
+    public Integer getAuthType() {        return authType;    }
+
+    public void setAuthType(Integer authType) {        this.authType = authType;    }
 }

+ 7 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSubjectMapper.java

@@ -272,6 +272,13 @@ public interface LabSubjectMapper {
      */
     public List<LabSubject> multipleDetpBysubList(Long[] ids);
 
+    /***
+     * 实验室列表查询-信息牌使用
+     * @param labSubject
+     * @return
+     */
+    public List<LabSubject> cardinfoSubList(LabSubject labSubject);
+
     List<LabSubject> getByIds(List<Long> ids);
 
 

+ 7 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabSubjectService.java

@@ -290,4 +290,11 @@ public interface ILabSubjectService {
      * @return
      */
     String getSubjectNameById(Long id);
+
+    /***
+     * 实验室列表查询-信息牌使用
+     * @param labSubject
+     * @return
+     */
+    public List<LabSubject> cardinfoSubList(LabSubject labSubject);
 }

+ 11 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectServiceImpl.java

@@ -558,4 +558,15 @@ public class LabSubjectServiceImpl implements ILabSubjectService {
     public String getSubjectNameById(Long id) {
         return labSubjectMapper.getSubjectNameById(id);
     }
+
+    /***
+     * 实验室列表查询-信息牌使用
+     * @param labSubject
+     * @return
+     */
+    @Override
+    @DataScope(deptAlias = "d" , permi = PerPrefix.LABORATORY_SUBJECT)
+    public List<LabSubject> cardinfoSubList(LabSubject labSubject) {
+        return labSubjectMapper.cardinfoSubList(labSubject);
+    }
 }

+ 7 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/XxpCardInfoServiceImpl.java

@@ -75,8 +75,8 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
         xxpCardInfo.setCreateBy(sysUser.getNickName());
         xxpCardInfo.setCreateTime(new Date());
         xxpCardInfo.setUserId(sysUser.getUserId());
-        xxpCardInfo.setDeptId(sysUser.getDept().getDeptId());
-        xxpCardInfo.setDeptName(sysUser.getDept().getDeptName());
+        xxpCardInfo.setDeptId(xxpCardInfo.getDeptId());
+        xxpCardInfo.setDeptName(xxpCardInfo.getDeptName());
         if(StringUtils.isNull(xxpCardInfo.getLocation()) ){
             xxpCardInfo.setCardName("电子信息牌");
         }else{
@@ -96,6 +96,11 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
         xxpCardInfo.setUpdateBy(sysUser.getNickName());
         xxpCardInfo.setUpdateTime(new Date());
+        if(StringUtils.isNull(xxpCardInfo.getLocation()) ){
+            xxpCardInfo.setCardName("电子信息牌");
+        }else{
+            xxpCardInfo.setCardName(xxpCardInfo.getLocation()+"电子信息牌");
+        }
         return xxpCardInfoMapper.updateXxpCardInfo(xxpCardInfo);
     }
 

+ 52 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectMapper.xml

@@ -1081,6 +1081,58 @@
         </foreach>
     </select>
 
+    <!--安全信息牌新增实验室列表 -->
+    <select id="cardinfoSubList" parameterType="com.zd.laboratory.domain.LabSubject" resultMap="LabSubjectResult">
+        SELECT
+        s.id,
+        s.name,
+        s.floor_id,
+        s.layout_id,
+        s.build_id,
+        s.sub_dept,
+        s.`level`,
+        s.check_out,
+        s.check_in,
+        s.room,
+        s.dept_id,
+        d.dept_name,
+        s.admin_id,
+        s.is_del,
+        s.create_time,
+        s.user_id,
+        s.create_by,
+        s.update_time,
+        s.update_by,
+        s.remark,
+        s.sub_dept,
+        s.check_out,
+        s.check_in,
+        s.safe_user_id,
+        s.safe_signs,
+        s.hazard_category,
+        s.risk_measure,
+        s.outfire,
+        s.qr_code,
+        s.safe_user_id,
+        s.skipped,
+        s.check_count,
+        s.sign_time
+        FROM
+        lab_subject s
+        LEFT JOIN sys_dept d ON d.dept_id = s.dept_id
+        <where>
+            <if test="deptId != null ">and ( dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
+                ,ancestors )) or dept_id = #{deptId} )
+            </if>
+            <if test="name != null and name !=''">
+                and s.name like concat('%', #{name}, '%')
+            </if>
+            and id not in( select subject_id from xxp_card_info <if test="id != null ">where subject_id != #{id}</if> )
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+
     <select id="getByIds" resultType="com.zd.laboratory.domain.LabSubject">
         select * from lab_subject
         <where>

+ 16 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpCardInfoMapper.xml

@@ -12,6 +12,7 @@
         <result property="collegeId" column="college_id"/>
         <result property="location" column="location"/>
         <result property="operate" column="operate"/>
+        <result property="authType" column="auth_type"/>
         <result property="subjectId" column="subject_id"/>
         <result property="subjectName" column="subject_name"/>
         <result property="deptId" column="dept_id"/>
@@ -32,6 +33,7 @@
                college_id,
                location,
                operate,
+               auth_type,
                subject_id,
                subject_name,
                dept_id,
@@ -55,9 +57,12 @@
             <if test="collegeId != null">and t.college_id = #{collegeId}</if>
             <if test="location != null and location != '' ">and t.location = #{location}</if>
             <if test="operate != null ">and t.operate = #{operate}</if>
+            <if test="authType != null ">and t.auth_type = #{authType}</if>
             <if test="subjectId != null ">and t.subject_id = #{subjectId}</if>
             <if test="subjectName != null ">and t.subject_name = #{subjectName}</if>
-            <if test="deptId != null ">and t.dept_id = #{deptId}</if>
+            <if test="deptId != null ">and ( t.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE
+                find_in_set(#{deptId} ,ancestors )) or t.dept_id = #{deptId} )
+            </if>
             <if test="deptName != null ">and t.dept_name = #{deptName}</if>
             <if test="isStart != null ">and t.is_start = #{isStart}</if>
             <if test="userId != null ">and t.user_id = #{userId}</if>
@@ -65,6 +70,13 @@
             <if test="createTime != null ">and t.create_time = #{createTime}</if>
             <if test="updateBy != null ">and t.update_by = #{updateBy}</if>
             <if test="updateTime != null">and t.update_time =#{updateTime}</if>
+            <if test="searchValue != null and searchValue != ''">
+                and (
+                t.card_name like concat('%', #{searchValue}, '%')
+                or t.card_num like concat('%', #{searchValue}, '%')
+                or t.subject_name like concat('%', #{searchValue}, '%')
+                )
+            </if>
         </where>
     </select>
 
@@ -82,6 +94,7 @@
             <if test="collegeId != null">college_id,</if>
             <if test="location != null">location,</if>
             <if test="operate != null">operate,</if>
+            <if test="authType != null">auth_type,</if>
             <if test="subjectId != null">subject_id,</if>
             <if test="subjectName != null">subject_name,</if>
             <if test="deptId != null">dept_id,</if>
@@ -100,6 +113,7 @@
             <if test="collegeId != null">#{collegeId},</if>
             <if test="location != null">#{location},</if>
             <if test="operate != null">#{operate},</if>
+            <if test="authType != null">#{authType},</if>
             <if test="subjectId != null">#{subjectId},</if>
             <if test="subjectName != null">#{subjectName},</if>
             <if test="deptId != null">#{deptId},</if>
@@ -122,6 +136,7 @@
             <if test="collegeId != null">college_id = #{collegeId},</if>
             <if test="location != null">location = #{location},</if>
             <if test="operate != null">operate = #{operate},</if>
+            <if test="authType != null">auth_type = #{authType},</if>
             <if test="subjectId != null">subject_id = #{subjectId},</if>
             <if test="subjectName != null">subject_name = #{subjectName},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>

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

@@ -58,6 +58,7 @@
                 and t.create_time &lt;= str_to_date(#{endTime}, '%Y-%m-%d')
             </if>
         </where>
+        <if test="remark =='list' "> order by isnull(sort),sort,is_collective desc ,create_time desc</if>
     </select>
 
     <select id="selectXxpClassifyDetailedById" resultMap="XxpClassifyDetailedResult">

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

@@ -62,7 +62,7 @@
             order by t.create_time desc
         </if>
         <if test="remark == 'sort' ">
-            order by t.sort desc
+            order by isnull(t.sort) ,t.sort
         </if>
     </select>
 

+ 1 - 1
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -1050,7 +1050,7 @@
             ancestors) ))
         </if>
        <if test="nickName != null and nickName != ''">
-            AND u.nick_name = #{nickName}
+            AND u.nick_name like concat('%', #{nickName}, '%')
         </if>
         <if test="userType != null and userType != ''">
             AND u.user_type = #{userType}