|
@@ -1,7 +1,11 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.diagbot.dto.UserRoleInfoFindDTO;
|
|
|
import com.diagbot.entity.User;
|
|
|
+import com.diagbot.entity.UserHospital;
|
|
|
import com.diagbot.entity.UserRole;
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.service.UserRoleService;
|
|
|
import com.diagbot.service.impl.UserRoleServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
@@ -9,11 +13,14 @@ import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.UserHospitalInfoVO;
|
|
|
import com.diagbot.vo.UserInfoVO;
|
|
|
+import com.diagbot.vo.UserRoleInfoCancelVO;
|
|
|
+import com.diagbot.vo.UserRoleInfoFindVO;
|
|
|
import com.diagbot.vo.UserRoleInfoVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author wangfeng
|
|
@@ -55,4 +62,32 @@ public class UserRoleFacade extends UserRoleServiceImpl {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ public List<UserRoleInfoFindDTO> getUserRoles(UserRoleInfoFindVO userRoleInfoFindVO) {
|
|
|
+ List<UserRoleInfoFindDTO> data = userRoleService.getUserRoleAlls(userRoleInfoFindVO);
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param userRoleInfoCancelVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public boolean cancelUserRole(UserRoleInfoCancelVO userRoleInfoCancelVO) {
|
|
|
+ UpdateWrapper<UserRole> userRoleUpdate = new UpdateWrapper<>();
|
|
|
+ userRoleUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("user_id", userRoleInfoCancelVO.getUserId())
|
|
|
+ .eq("id", userRoleInfoCancelVO.getId())
|
|
|
+ .eq("role_id", -1);
|
|
|
+ boolean res = userRoleService.remove(userRoleUpdate);
|
|
|
+ UpdateWrapper<User> userUpdate = new UpdateWrapper<>();
|
|
|
+ userUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("id", userRoleInfoCancelVO.getUserId());
|
|
|
+ res = userFacade.remove(userUpdate);
|
|
|
+ UpdateWrapper<UserHospital> userHospitalUpdate = new UpdateWrapper<>();
|
|
|
+ userHospitalUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("user_id", userRoleInfoCancelVO.getUserId())
|
|
|
+ .eq("hospital_id", userRoleInfoCancelVO.getHospitalId());
|
|
|
+ res = userHospitalFacade.remove(userHospitalUpdate);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|