/** * タスク担当者を返す * * @param taskId タスクID * @return タスク担当者のリスト */ public static List<ProjectTaskMemberResultData> getProjectTaskMembers(String taskId) { List<ProjectTaskMemberResultData> members = new ArrayList<ProjectTaskMemberResultData>(); try { SelectQuery<EipTProjectTaskMember> query = Database.query(EipTProjectTaskMember.class); query.setQualifier( ExpressionFactory.matchExp(EipTProjectTaskMember.EIP_TPROJECT_TASK_PROPERTY, taskId)); query.orderAscending(EipTProjectTaskMember.USER_ID_PROPERTY); List<EipTProjectTaskMember> list = query.fetchList(); for (EipTProjectTaskMember member : list) { ALEipUser user = ALEipUtils.getALEipUser(member.getUserId()); ProjectTaskMemberResultData data = new ProjectTaskMemberResultData(); data.initField(); data.setUserId(user.getUserId().getValue()); data.setUserName(user.getAliasName().getValue()); BigDecimal workload = new BigDecimal(df.format(member.getWorkload())); data.setWorkload(workload); members.add(data); } } catch (Exception ex) { logger.error("Exception", ex); } return members; }
/** * プロジェクトオブジェクトよりプロジェクトResult情報を返す * * @param model プロジェクトオブジェクト * @return プロジェクトResult情報 */ public static ProjectResultData getProjectResultData(EipTProject model) { try { // 登録者 ALEipUser adminUser = ALEipUtils.getALEipUser(model.getAdminUserId()); ProjectResultData data = new ProjectResultData(); data.initField(); data.setProjectId(model.getProjectId()); // プロジェクトID data.setProjectName(model.getProjectName()); // プロジェクト名 data.setExplanation(model.getExplanation()); // 説明 data.setAdminUserId(model.getAdminUserId()); // 管理者ID data.setAdminUserName(adminUser.getAliasName().getValue()); // 管理者名 data.setProgressFlg(model.getProgressFlg()); // 進捗率入力フラグ data.setProgressRate(model.getProgressRate()); // 進捗率 data.setCreateDate(model.getCreateDate()); // 作成日 data.setUpdateDate(model.getUpdateDate()); // 更新日 data.setTaskUpdateDate(model.getUpdateDate()); // タスク更新日(初期値) return data; } catch (Exception ex) { logger.error("Exception", ex); return null; } }
/** * @param userId * @return */ public String getUserFullName(String userId) { try { ALEipUser user = ALEipUtils.getALEipUser(Integer.valueOf(userId).intValue()); return user.getAliasName().getValue(); } catch (Exception e) { return ""; } }
/** * @param map * @return */ @Override protected Object getResultData(EipTNoteMap map) { try { EipTNote record = map.getEipTNote(); NoteClientResultData rd = new NoteClientResultData(); rd.initField(); rd.setNoteId(record.getNoteId().intValue()); rd.setClientName(ALCommonUtils.compressString(record.getClientName(), getStrLength())); rd.setCompanyName(ALCommonUtils.compressString(record.getCompanyName(), getStrLength())); rd.setNoteStat(map.getNoteStat()); rd.setAcceptDate(record.getAcceptDate()); String subject = ""; if (record.getSubjectType().equals("0")) { subject = ALCommonUtils.compressString(record.getCustomSubject(), getStrLength()); } else if (record.getSubjectType().equals("1")) { subject = ALLocalizationUtils.getl10n("NOTE_CALL_AGAIN_NO_PERIOD"); } else if (record.getSubjectType().equals("2")) { subject = ALLocalizationUtils.getl10n("NOTE_MAIL_CALL_BACK"); } else if (record.getSubjectType().equals("3")) { subject = ALLocalizationUtils.getl10n("NOTE_MAIL_TELL_ME"); } else if (record.getSubjectType().equals("4")) { subject = ALLocalizationUtils.getl10n("NOTE_MAIL_TAKE_A_MESSAGE"); } rd.setSubject(subject); if (NoteUtils.NOTE_STAT_NEW.equals(map.getNoteStat())) { rd.setNoteStat(NoteUtils.NOTE_STAT_NEW); rd.setNoteStatImage("images/note/note_new_message.gif"); rd.setNoteStatImageDescription(ALLocalizationUtils.getl10n("NOTE_NEW_MESSAGE")); } else if (NoteUtils.NOTE_STAT_UNREAD.equals(map.getNoteStat())) { rd.setNoteStat(NoteUtils.NOTE_STAT_UNREAD); rd.setNoteStatImage("images/note/note_unread_message.gif"); rd.setNoteStatImageDescription(ALLocalizationUtils.getl10n("NOTE_UNREAD_MESSAGE")); } else { rd.setNoteStat(NoteUtils.NOTE_STAT_READ); rd.setNoteStatImage("images/note/note_read_message.gif"); rd.setNoteStatImageDescription(ALLocalizationUtils.getl10n("NOTE_READ_MESSAGE")); } ALEipUser user = ALEipUtils.getALEipUser(Integer.valueOf(record.getOwnerId()).intValue()); rd.setSrcUserId(record.getOwnerId()); rd.setSrcUserFullName(user.getAliasName().getValue()); return rd; } catch (RuntimeException e) { logger.error("note", e); return null; } catch (Exception ex) { logger.error("note", ex); return null; } }
/** * タスクコメントリストを返す * * @param taskId タスクID * @return タスクコメントのリスト */ public static List<ProjectTaskCommentResultData> getProjectTaskCommentList(String taskId) { List<ProjectTaskCommentResultData> commentList = new ArrayList<ProjectTaskCommentResultData>(); try { SelectQuery<EipTProjectTaskComment> query = Database.query(EipTProjectTaskComment.class); query.setQualifier( ExpressionFactory.matchExp(EipTProjectTaskComment.EIP_TPROJECT_TASK_PROPERTY, taskId)); List<EipTProjectTaskComment> list = query.fetchList(); /** ファイル操作オブジェクト */ ProjectFile<EipTProjectTaskCommentFile, EipTProjectTaskComment> pfile = new ProjectFile<EipTProjectTaskCommentFile, EipTProjectTaskComment>( EipTProjectTaskCommentFile.class); for (EipTProjectTaskComment comment : list) { ALEipUser user = ALEipUtils.getALEipUser(comment.getTurbineUser().getUserId()); ProjectTaskCommentResultData data = new ProjectTaskCommentResultData(); data.initField(); data.setCommentId(comment.getCommentId()); data.setTaskId(comment.getTaskId()); data.setComment(comment.getComment()); data.setCreateUserId(user.getUserId().getValue()); data.setCreateUser(user.getAliasName().getValue()); data.setCreateDate(comment.getCreateDate()); data.setUpdateDate(comment.getUpdateDate()); data.setHasPhoto(user.hasPhoto()); // ファイルリスト List<EipTProjectTaskCommentFile> filelist = pfile .getSelectQueryForFiles( EipTProjectTaskComment.COMMENT_ID_PK_COLUMN, Integer.valueOf(comment.getCommentId())) .fetchList(); data.setAttachmentFiles(pfile.getFileList(filelist)); commentList.add(data); } } catch (Exception ex) { logger.error("Exception", ex); } return commentList; }
public static Map<String, String> getProjectMemberMap(Integer projectId) { Map<String, String> map = new HashMap<String, String>(); List<EipTProjectMember> result = getProjectMember(projectId); if (result.isEmpty()) { return map; } List<Integer> idList = new ArrayList<Integer>(); for (EipTProjectMember member : result) { idList.add(member.getUserId()); } List<ALEipUser> users = getALEipUsers(idList); for (EipTProjectMember member : result) { for (ALEipUser user : users) { if (user.getUserId().getValueWithInt() == member.getUserId().intValue()) { map.put(user.getUserId().toString(), user.getAliasName().toString()); continue; } } } return map; }