Преглед на файлове

删除用户接口添加删除系统用户表相关用户信息

sl преди 3 месеца
родител
ревизия
1e7f5acfe1

+ 5 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockUser/mapper/InterlockUserMapper.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.interlockUser.entity.InterlockUser;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.system.entity.SysUser;
 
 /**
  * @Description: 联锁管理系统用户表
@@ -18,4 +19,8 @@ public interface InterlockUserMapper extends BaseMapper<InterlockUser> {
     @Select("select * from interlock_user where username=#{wiseUser}")
     InterlockUser getInterlockUserByUserName(@Param("wiseUser") String wiseUser);
 
+    //根据联锁新用户名删除系统自带用户表的用户信息
+    @Select("delete from sys_user where username=#{wiseUser}")
+    SysUser delSysUserByUserName(@Param("wiseUser") String wiseUser);
+
 }

+ 11 - 8
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockUser/service/impl/InterlockUserServiceImpl.java

@@ -18,9 +18,11 @@ import org.jeecg.modules.iotedgeCollectData.entity.IoTEdgeDevices;
 import org.jeecg.modules.iotedgeCollectData.mapper.IotedgeCollectDataMapper;
 import org.jeecg.modules.iotedgeCollectData.service.IIotedgeCollectDataService;
 import org.jeecg.modules.iotedgeCollectData.service.RestClientService;
+import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.entity.SysUserRole;
 import org.jeecg.modules.system.mapper.SysUserRoleMapper;
 import org.jeecg.modules.system.service.ISysUserRoleService;
+import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -29,10 +31,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.xml.ws.ServiceMode;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @Description: 联锁管理系统用户表
@@ -46,6 +45,10 @@ public class InterlockUserServiceImpl extends ServiceImpl<InterlockUserMapper, I
 
     @Autowired
     @SuppressWarnings("all")
+    private ISysUserService sysUserService;
+
+    @Autowired
+    @SuppressWarnings("all")
     private ISysUserRoleService sysUserRoleService;
 
     @Autowired
@@ -254,11 +257,11 @@ public class InterlockUserServiceImpl extends ServiceImpl<InterlockUserMapper, I
                 }
             }
         }
-
-
-       deleteSSOIoTEdgeUser(id,eiToken);
-
+//       deleteSSOIoTEdgeUser(id,eiToken);
+        InterlockUser interlockUser = this.getById(id);//根据id找用户名
+        interlockUserMapper.delSysUserByUserName(interlockUser.getUsername());//根据用户名删除系统用户
         this.removeById(id);
+
         //删除方法1  删除用户权限
         QueryWrapper<InterlockSystemLimit> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("interlock_user_id",id);