JX.Li пре 1 месец
родитељ
комит
b25230281e

+ 3 - 0
src/main/java/com/sooka/sponest/data/emergency/service/impl/TPatrolAlertServiceImpl.java

@@ -2,11 +2,13 @@ package com.sooka.sponest.data.emergency.service.impl;
 
 import com.ruoyi.common.datascope.annotation.DataScope;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
+import com.ruoyi.common.security.utils.SecurityUtils;
 import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.emergency.domain.TPatrolAlert;
 import com.sooka.sponest.data.emergency.mapper.TAttachMapper;
 import com.sooka.sponest.data.emergency.mapper.TPatrolAlertMapper;
 import com.sooka.sponest.data.emergency.service.TPatrolAlertService;
+import io.netty.handler.logging.LoggingHandler;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -33,6 +35,7 @@ public class TPatrolAlertServiceImpl  extends BaseServiceImpl implements TPatrol
     @Override
     public int insertTPatrolAlert(TPatrolAlert patrolAlert) {
         patrolAlert.setId(UUID.randomUUID().toString().replaceAll("-", ""));
+        patrolAlert.setDeptId(String.valueOf(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
         return mapper.insertTPatrolAlert(patrolAlert);
     }
 

+ 2 - 1
src/main/resources/mapper/emergency/system/TPatrolAlertMapper.xml

@@ -28,7 +28,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPatrolAlertById" parameterType="String" resultMap="TPatrolAlertResult">
         <include refid="selectTPatrolAlertVo"/>
         where id = #{id}
-        ${params.dataScope}
     </select>
 
     <insert id="insertTPatrolAlert" parameterType="TPatrolAlert">
@@ -36,11 +35,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>
             <if test="title != null">title,</if>
+            <if test="deptId != null">dept_id,</if>
             <if test="content != null">content,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="title != null">#{title},</if>
+            <if test="deptId != null">#{deptId},</if>
             <if test="content != null">#{content},</if>
          </trim>
     </insert>