| | |
| | | import com.ruili.wcp.data.entity.management.User; |
| | | import com.ruili.wcp.service.config.ViewService; |
| | | import com.ruili.wcp.service.management.DeptService; |
| | | import com.ruili.wcp.service.management.RoleService; |
| | | import com.ruili.wcp.service.management.UserService; |
| | | import com.ruili.wcp.web.common.UserFriendlyException; |
| | | import com.ruili.wcp.web.model.easyui.TreeVO; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 档案浏览控制器 |
| | |
| | | |
| | | @Autowired |
| | | DeptService deptService; |
| | | @Autowired |
| | | RoleService roleService; |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(FileViewController.class); |
| | | |
| | |
| | | Session session = currentUser.getSession(); |
| | | User user = (User) session.getAttribute("user"); |
| | | //先判断是否是档案管理员 如果是直接可以浏览 |
| | | |
| | | Long userId = user.getUserId(); |
| | | List<Dept> deptList = deptService.getSubDeptListByUserId(userId); |
| | | for (Dept dept : deptList) { |
| | | String deptName = dept.getDeptName(); |
| | | if (deptName.contains("档案管理员")) { |
| | | return true; |
| | | } |
| | | Set<String> roles = user.getRoles(); |
| | | if (roles.contains("档案管理员")) { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | // List<Dept> deptList = deptService.getSubDeptListByUserId(userId); |
| | | // for (Dept dept : deptList) { |
| | | // String deptName = dept.getDeptName(); |
| | | // if (deptName.contains("档案管理员")) { |
| | | // return true; |
| | | // } |
| | | // } |
| | | |
| | | // QueryWrapper<UtilizationUser> utilizationUserQueryWrapper = new QueryWrapper<>(); |
| | | // utilizationUserQueryWrapper.eq("user_id", userId); |
| | | // UtilizationUser utilizationUser = utilizationUserService.getOne(utilizationUserQueryWrapper); |