|
@@ -15,6 +15,7 @@ import com.nationrel.modules.project.jar.service.PmTgService;
|
|
|
import com.nationrel.modules.project.jar.service.Rb0300142InitService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -63,53 +64,59 @@ public class Rb0300142InitServiceImpl implements Rb0300142InitService {
|
|
|
switch (selectStaffType) {
|
|
|
case 1:
|
|
|
// 获取当前项目成员信息
|
|
|
- String projectId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03001_PROJECT_ID));
|
|
|
- List<Map<String, Object>> pmProjectStaffs = pmProjectStaffMapper.selectPmProjectStaffsByProjectId(projectId, staffId);
|
|
|
- output.setStaffMap(pmProjectStaffs.get(0));
|
|
|
+// String projectId = input.getProjectId();
|
|
|
+ /* List<Map<String, Object>> pmProjectStaffs = pmProjectStaffMapper.selectPmProjectStaffsByProjectId(projectId, staffId);
|
|
|
+ if (CollectionUtils.isEmpty(pmProjectStaffs)) {
|
|
|
+ throw new OptimisticLockException(MessageId.W009803);
|
|
|
+ }*/
|
|
|
|
|
|
// 成员角色取得并设置到输出
|
|
|
output.setRoles(pmProjectRoleMapper.selectRoleByResourceType(ReliaFlowConstants.RESOURCE_PROJECT_TYPE));
|
|
|
break;
|
|
|
case 2:
|
|
|
- String tgId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03002_TG_ID));
|
|
|
+ String tgId = input.getTgId();
|
|
|
|
|
|
// 检查TG是否存在
|
|
|
pmTgService.checkTgExist(tgId);
|
|
|
|
|
|
// 获取当前TG成员信息
|
|
|
- List<Map<String, Object>> pmTgStaffs = pmTgStaffMapper.selectPmTgStaffsByTgId(tgId, staffId);
|
|
|
+// List<Map<String, Object>> pmTgStaffs = pmTgStaffMapper.selectPmTgStaffsByTgId(tgId, staffId);
|
|
|
|
|
|
// 检查成员信息是否存在
|
|
|
- if (pmTgStaffs == null || pmTgStaffs.size() <= 0) {
|
|
|
- throw new OptimisticLockException(MessageId.W009803);
|
|
|
- }
|
|
|
+// if (CollectionUtils.isEmpty(pmTgStaffs)) {
|
|
|
+// throw new OptimisticLockException(MessageId.W009803);
|
|
|
+// }
|
|
|
|
|
|
// 保存version number 到session
|
|
|
- Object versionNumber = pmTgStaffs.get(0).get(PmMapKeySet.KEY_S_PJ_VERSION_NO);
|
|
|
- SessionUtil.setAttribute(SessionKeys.RB_PJ_TG_STAFF_VERSION, versionNumber);
|
|
|
+// Object versionNumber = pmTgStaffs.get(0).get(PmMapKeySet.KEY_S_PJ_VERSION_NO);
|
|
|
+// SessionUtil.setAttribute(SessionKeys.RB_PJ_TG_STAFF_VERSION, versionNumber);
|
|
|
|
|
|
// 设置成员信息到输出
|
|
|
- output.setStaffMap(pmTgStaffs.get(0));
|
|
|
+// output.setStaffMap(pmTgStaffs.get(0));
|
|
|
output.setRoles(pmProjectRoleMapper.selectRoleByResourceType(ReliaFlowConstants.RESOURCE_TG_TYPE));
|
|
|
break;
|
|
|
case 3:
|
|
|
- String tgIdTask = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03002_TG_ID));
|
|
|
+ String tgIdTask = input.getTgId();
|
|
|
|
|
|
// 检查TG是否存在
|
|
|
pmTgService.checkTgExist(tgIdTask);
|
|
|
|
|
|
// 获取当前Task成员信息
|
|
|
- String taskId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03003_TASK_ID));
|
|
|
+ String taskId = input.getTaskId();
|
|
|
|
|
|
// 检查任务是否存在
|
|
|
pmTaskService.checkTaskExist(taskId);
|
|
|
|
|
|
- List<Map<String, Object>> pmTaskStaffs = pmTaskStaffMapper.selectPmTaskStaffsByTaskId(taskId, staffId);
|
|
|
- output.setStaffMap(pmTaskStaffs.get(0));
|
|
|
+ /*List<Map<String, Object>> pmTaskStaffs = pmTaskStaffMapper.selectPmTaskStaffsByTaskId(taskId, staffId);
|
|
|
+ if (CollectionUtils.isEmpty(pmTaskStaffs)) {
|
|
|
+ throw new OptimisticLockException(MessageId.W009803);
|
|
|
+ }*/
|
|
|
+
|
|
|
+// output.setStaffMap(pmTaskStaffs.get(0));
|
|
|
|
|
|
// 保存version number 到session
|
|
|
- Object versionNumberTask = pmTaskStaffs.get(0).get(PmMapKeySet.KEY_S_PJ_VERSION_NO);
|
|
|
- SessionUtil.setAttribute(SessionKeys.RB_PJ_TASK_MEMBER_EDIT_VERSION, versionNumberTask);
|
|
|
+// Object versionNumberTask = pmTaskStaffs.get(0).get(PmMapKeySet.KEY_S_PJ_VERSION_NO);
|
|
|
+// SessionUtil.setAttribute(SessionKeys.RB_PJ_TASK_MEMBER_EDIT_VERSION, versionNumberTask);
|
|
|
|
|
|
// 成员角色取得并设置到输出
|
|
|
output.setRoles(pmProjectRoleMapper.selectRoleByResourceType(ReliaFlowConstants.RESOURCE_TASK_TYPE));
|