|
|
@@ -97,6 +97,9 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
|
|
|
@Autowired
|
|
|
OrganizationUserServiceImpl organizationUserServiceImpl;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ RoleServiceImpl roleServiceImpl;
|
|
|
+
|
|
|
/**
|
|
|
* 保存项目信息
|
|
|
*
|
|
|
@@ -144,17 +147,37 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
|
|
|
String oid = initOrgContent.getContent();
|
|
|
organization = new Organization();
|
|
|
BeanUtils.copyProperties(param, organization);
|
|
|
+ initEntityNoCheckOid(organization);
|
|
|
+
|
|
|
organization.setOid(oid);
|
|
|
organization.setProjectOid(oid);
|
|
|
organization.setAboutOid(currentOid);
|
|
|
organization.setCreateUserId(getCurrentUserId());
|
|
|
- initEntity(organization);
|
|
|
organizationDao.save(organization);
|
|
|
}
|
|
|
organizationUserServiceImpl.orgBindManager(organization, userAccounts);
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 当前用户能查看 项目分页数据
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @param pageable
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResultContent<Page<ProjectOrgModel>> pageProject(OrganizationSearchParam param, Pageable pageable) {
|
|
|
+ initSearchParam(param);
|
|
|
+ String userId = getCurrentUserId();
|
|
|
+ Boolean isSuperAdmin = roleServiceImpl.isSuperAdmin(userId);
|
|
|
+ if (isSuperAdmin == null || !isSuperAdmin) {
|
|
|
+ // 不是平台管理员,只能查看自己为项目负责人的数据
|
|
|
+ param.setManagerUserId(userId);
|
|
|
+ }
|
|
|
+ Page<Organization> page = organizationDao.page(pageable, param);
|
|
|
+ return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toProjectModel));
|
|
|
+ }
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
|
@@ -760,27 +783,6 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
|
|
|
return orgs;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 分页数据
|
|
|
- *
|
|
|
- * @param param
|
|
|
- * @param pageable
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public ResultContent<Page<OrganizationModel>> pageProject(OrganizationSearchParam param, Pageable pageable) {
|
|
|
- List<Long> times = param.getTimes();
|
|
|
- if (ObjectUtils.isNotEmpty(times) && times.size() == 2) {
|
|
|
- Long startTime = times.get(0);
|
|
|
- startTime = DateUtils.getDayStartTime(startTime);
|
|
|
- Long endTime = times.get(1);
|
|
|
- endTime = DateUtils.getDayEndTime(endTime);
|
|
|
- param.setStartTime(startTime);
|
|
|
- param.setEndTime(endTime);
|
|
|
- }
|
|
|
- Page<Organization> page = organizationDao.page(pageable, param);
|
|
|
- return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toProjectModel));
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 查询所有可用的项目
|