lyhzzz 2 лет назад
Родитель
Сommit
78699d8028

+ 1 - 1
src/main/java/com/fdkankan/manage_jp/service/ICameraDetailService.java

@@ -39,5 +39,5 @@ public interface ICameraDetailService extends MPJBaseService<CameraDetail> {
 
     List<CameraDetail> getListByCompanyName(String companyName);
 
-    void unbindUser(Long userId);
+    void unbindUser(Long userId,Long companyUserId);
 }

+ 2 - 2
src/main/java/com/fdkankan/manage_jp/service/impl/CameraDetailServiceImpl.java

@@ -147,10 +147,10 @@ public class CameraDetailServiceImpl extends MPJBaseServiceImpl<ICameraDetailMap
     }
 
     @Override
-    public void unbindUser(Long userId) {
+    public void unbindUser(Long userId,Long companyUserId) {
         LambdaUpdateWrapper<CameraDetail> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(CameraDetail::getUserId,userId);
-        wrapper.set(CameraDetail::getUserId,null);
+        wrapper.set(CameraDetail::getUserId,companyUserId);
         this.update(wrapper);
     }
 }

+ 1 - 1
src/main/java/com/fdkankan/manage_jp/service/impl/CompanyServiceImpl.java

@@ -276,7 +276,7 @@ public class CompanyServiceImpl extends ServiceImpl<ICompanyMapper, Company> imp
             if (bo.getSubUsers().stream().noneMatch(param -> user.getId().equals(param.getId()))) {
                 // 将场景重新绑定到企业账号下面
                 sceneProService.rebindUser(user.getId(),tbCompany.getManagerId());
-                cameraDetailService.unbindUser(user.getId());
+                cameraDetailService.unbindUser(user.getId(),tbCompany.getManagerId());
                 userService.removeById(user.getId());
             }
         });