|
@@ -247,4 +247,31 @@ public class BmProjectController extends BaseController {
|
|
|
Map<String, Object> stringObjectMap = bmProjectService.selectProjectContractEharts(year);
|
|
|
return AjaxResult.success(stringObjectMap);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 首页-统计数字(只根据当前登录人的部门)
|
|
|
+ */
|
|
|
+ @PostMapping("/indexInfo")
|
|
|
+ public AjaxResult indexInfo (BmProject bmProject) {
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
+ Long deptId = -1L;
|
|
|
+ if (ObjectUtil.isNotNull(loginUser)) {
|
|
|
+ List<SysRole> roles = loginUser.getUser().getRoles();
|
|
|
+ boolean flag = false;
|
|
|
+ if (roles.size() > 0) {
|
|
|
+ for (SysRole role : roles) {
|
|
|
+ String roleKey = role.getRoleKey();
|
|
|
+ if (StringUtils.isNotBlank(roleKey) && ("manage".equals(roleKey) || "admin".equals(roleKey))) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag) {
|
|
|
+ deptId = loginUser.getUser().getDeptId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ bmProject.setDeptId(deptId);
|
|
|
+ return bmProjectService.indexInfo(bmProject);
|
|
|
+ }
|
|
|
}
|