@Test public void test2() { TodoDetailDO todoDetailDO = todoDao.queryTodoDetailById(24l); TodoDetailVO todoDetailVO = new TodoDetailVO(todoDetailDO); todoServiceImpl.invokeTodoDetailVO(todoDetailVO); System.err.println(todoDetailVO); emailService.doSendSubmitTodo(todoDetailVO); }
public void invokeTodoDetailVO(TodoDetailVO todoDetailVO) { int id = (int) todoDetailVO.getTodoId(); switch (id) { case 1: List<TodoKeyboxDetailDO> todoKeyboxDetailList = todoDao.queryTodoKeyboxDetailByTodoDetailId(todoDetailVO.getId()); List<TodoKeyboxDetailVO> todoKeyboxDetailVOList = new ArrayList<>(); for (TodoKeyboxDetailDO todoItem : todoKeyboxDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoKeyboxDetailVO todoKeyboxDetailVO = new TodoKeyboxDetailVO(todoItem, serverGroupDO); todoKeyboxDetailVOList.add(todoKeyboxDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoKeyboxDetailVO.getContent()); } todoDetailVO.setTodoKeyboxDetailList(todoKeyboxDetailVOList); break; case 2: List<TodoCiUserGroupDetailDO> todoCiUserGroupDetailList = todoDao.queryTodoCiUserGroupDetailByTodoDetailId(todoDetailVO.getId()); List<TodoCiUserGroupDetailVO> todoCiUserGroupDetailVOList = new ArrayList<>(); for (TodoCiUserGroupDetailDO todoItem : todoCiUserGroupDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoCiUserGroupDetailVO todoCiUserGroupDetailVO = new TodoCiUserGroupDetailVO(todoItem, serverGroupDO); todoCiUserGroupDetailVOList.add(todoCiUserGroupDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoCiUserGroupDetailVO.getContent()); } todoDetailVO.setTodoCiUserGroupDetailList(todoCiUserGroupDetailVOList); break; case 3: List<TodoSystemAuthDetailDO> todoSystemAuthDetailList = todoDao.queryTodoSystemAuthDetailByTodoDetailId(todoDetailVO.getId()); List<TodoSystemAuthDetailDO> todoDetailList = new ArrayList<>(); if (todoSystemAuthDetailList.size() == 0) { initTodoSystemAuthDetail(todoDetailVO); } else { for (TodoSystemAuthDetailDO todoItem : todoSystemAuthDetailList) { if (todoItem.getName().equals("getway")) { todoDetailVO.setTodoSystemAuthGetway(todoItem); } else { todoDetailList.add(todoItem); } if (todoItem.isNeed()) { todoDetailVO.setContent(todoDetailVO.getContent() + todoItem.getContent()); } } todoDetailVO.setTodoSystemAuthDetailList(todoDetailList); } break; default: } TodoDO todoDO = todoDao.queryTodoInfoById(todoDetailVO.getTodoId()); todoDetailVO.setTodoDO(todoDO); invokeAssigneeUsers(todoDetailVO); if (todoDetailVO.getAssigneeUserId() != 0) todoDetailVO.setAssigneeUserDO(acqTodoUserDO(todoDetailVO.getAssigneeUserId())); todoDetailVO.setInitiatorUserDO(acqTodoUserDO(todoDetailVO.getInitiatorUserId())); try { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:m:s"); Date createDate = format.parse(todoDetailVO.getGmtCreate()); todoDetailVO.setTimeView(TimeViewUtils.format(createDate)); } catch (Exception e) { } }
TodoServiceImpl implements TodoService { public void invokeTodoDetailVO(TodoDetailVO todoDetailVO) { int id = (int) todoDetailVO.getTodoId(); switch (id) { case 1: List<TodoKeyboxDetailDO> todoKeyboxDetailList = todoDao.queryTodoKeyboxDetailByTodoDetailId(todoDetailVO.getId()); List<TodoKeyboxDetailVO> todoKeyboxDetailVOList = new ArrayList<>(); for (TodoKeyboxDetailDO todoItem : todoKeyboxDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoKeyboxDetailVO todoKeyboxDetailVO = new TodoKeyboxDetailVO(todoItem, serverGroupDO); todoKeyboxDetailVOList.add(todoKeyboxDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoKeyboxDetailVO.getContent()); } todoDetailVO.setTodoKeyboxDetailList(todoKeyboxDetailVOList); break; case 2: List<TodoCiUserGroupDetailDO> todoCiUserGroupDetailList = todoDao.queryTodoCiUserGroupDetailByTodoDetailId(todoDetailVO.getId()); List<TodoCiUserGroupDetailVO> todoCiUserGroupDetailVOList = new ArrayList<>(); for (TodoCiUserGroupDetailDO todoItem : todoCiUserGroupDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoCiUserGroupDetailVO todoCiUserGroupDetailVO = new TodoCiUserGroupDetailVO(todoItem, serverGroupDO); todoCiUserGroupDetailVOList.add(todoCiUserGroupDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoCiUserGroupDetailVO.getContent()); } todoDetailVO.setTodoCiUserGroupDetailList(todoCiUserGroupDetailVOList); break; case 3: List<TodoSystemAuthDetailDO> todoSystemAuthDetailList = todoDao.queryTodoSystemAuthDetailByTodoDetailId(todoDetailVO.getId()); List<TodoSystemAuthDetailDO> todoDetailList = new ArrayList<>(); if (todoSystemAuthDetailList.size() == 0) { initTodoSystemAuthDetail(todoDetailVO); } else { for (TodoSystemAuthDetailDO todoItem : todoSystemAuthDetailList) { if (todoItem.getName().equals("getway")) { todoDetailVO.setTodoSystemAuthGetway(todoItem); } else { todoDetailList.add(todoItem); } if (todoItem.isNeed()) { todoDetailVO.setContent(todoDetailVO.getContent() + todoItem.getContent()); } } todoDetailVO.setTodoSystemAuthDetailList(todoDetailList); } break; default: } TodoDO todoDO = todoDao.queryTodoInfoById(todoDetailVO.getTodoId()); todoDetailVO.setTodoDO(todoDO); invokeAssigneeUsers(todoDetailVO); if (todoDetailVO.getAssigneeUserId() != 0) todoDetailVO.setAssigneeUserDO(acqTodoUserDO(todoDetailVO.getAssigneeUserId())); todoDetailVO.setInitiatorUserDO(acqTodoUserDO(todoDetailVO.getInitiatorUserId())); try { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:m:s"); Date createDate = format.parse(todoDetailVO.getGmtCreate()); todoDetailVO.setTimeView(TimeViewUtils.format(createDate)); } catch (Exception e) { } } }
TodoServiceImpl implements TodoService { public void invokeTodoDetailVO(TodoDetailVO todoDetailVO) { int id = (int) todoDetailVO.getTodoId(); switch (id) { case 1: List<TodoKeyboxDetailDO> todoKeyboxDetailList = todoDao.queryTodoKeyboxDetailByTodoDetailId(todoDetailVO.getId()); List<TodoKeyboxDetailVO> todoKeyboxDetailVOList = new ArrayList<>(); for (TodoKeyboxDetailDO todoItem : todoKeyboxDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoKeyboxDetailVO todoKeyboxDetailVO = new TodoKeyboxDetailVO(todoItem, serverGroupDO); todoKeyboxDetailVOList.add(todoKeyboxDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoKeyboxDetailVO.getContent()); } todoDetailVO.setTodoKeyboxDetailList(todoKeyboxDetailVOList); break; case 2: List<TodoCiUserGroupDetailDO> todoCiUserGroupDetailList = todoDao.queryTodoCiUserGroupDetailByTodoDetailId(todoDetailVO.getId()); List<TodoCiUserGroupDetailVO> todoCiUserGroupDetailVOList = new ArrayList<>(); for (TodoCiUserGroupDetailDO todoItem : todoCiUserGroupDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoCiUserGroupDetailVO todoCiUserGroupDetailVO = new TodoCiUserGroupDetailVO(todoItem, serverGroupDO); todoCiUserGroupDetailVOList.add(todoCiUserGroupDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoCiUserGroupDetailVO.getContent()); } todoDetailVO.setTodoCiUserGroupDetailList(todoCiUserGroupDetailVOList); break; case 3: List<TodoSystemAuthDetailDO> todoSystemAuthDetailList = todoDao.queryTodoSystemAuthDetailByTodoDetailId(todoDetailVO.getId()); List<TodoSystemAuthDetailDO> todoDetailList = new ArrayList<>(); if (todoSystemAuthDetailList.size() == 0) { initTodoSystemAuthDetail(todoDetailVO); } else { for (TodoSystemAuthDetailDO todoItem : todoSystemAuthDetailList) { if (todoItem.getName().equals("getway")) { todoDetailVO.setTodoSystemAuthGetway(todoItem); } else { todoDetailList.add(todoItem); } if (todoItem.isNeed()) { todoDetailVO.setContent(todoDetailVO.getContent() + todoItem.getContent()); } } todoDetailVO.setTodoSystemAuthDetailList(todoDetailList); } break; default: } TodoDO todoDO = todoDao.queryTodoInfoById(todoDetailVO.getTodoId()); todoDetailVO.setTodoDO(todoDO); invokeAssigneeUsers(todoDetailVO); if (todoDetailVO.getAssigneeUserId() != 0) todoDetailVO.setAssigneeUserDO(acqTodoUserDO(todoDetailVO.getAssigneeUserId())); todoDetailVO.setInitiatorUserDO(acqTodoUserDO(todoDetailVO.getInitiatorUserId())); try { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:m:s"); Date createDate = format.parse(todoDetailVO.getGmtCreate()); todoDetailVO.setTimeView(TimeViewUtils.format(createDate)); } catch (Exception e) { } }  }
TodoServiceImpl implements TodoService { public void invokeTodoDetailVO(TodoDetailVO todoDetailVO) { int id = (int) todoDetailVO.getTodoId(); switch (id) { case 1: List<TodoKeyboxDetailDO> todoKeyboxDetailList = todoDao.queryTodoKeyboxDetailByTodoDetailId(todoDetailVO.getId()); List<TodoKeyboxDetailVO> todoKeyboxDetailVOList = new ArrayList<>(); for (TodoKeyboxDetailDO todoItem : todoKeyboxDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoKeyboxDetailVO todoKeyboxDetailVO = new TodoKeyboxDetailVO(todoItem, serverGroupDO); todoKeyboxDetailVOList.add(todoKeyboxDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoKeyboxDetailVO.getContent()); } todoDetailVO.setTodoKeyboxDetailList(todoKeyboxDetailVOList); break; case 2: List<TodoCiUserGroupDetailDO> todoCiUserGroupDetailList = todoDao.queryTodoCiUserGroupDetailByTodoDetailId(todoDetailVO.getId()); List<TodoCiUserGroupDetailVO> todoCiUserGroupDetailVOList = new ArrayList<>(); for (TodoCiUserGroupDetailDO todoItem : todoCiUserGroupDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoCiUserGroupDetailVO todoCiUserGroupDetailVO = new TodoCiUserGroupDetailVO(todoItem, serverGroupDO); todoCiUserGroupDetailVOList.add(todoCiUserGroupDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoCiUserGroupDetailVO.getContent()); } todoDetailVO.setTodoCiUserGroupDetailList(todoCiUserGroupDetailVOList); break; case 3: List<TodoSystemAuthDetailDO> todoSystemAuthDetailList = todoDao.queryTodoSystemAuthDetailByTodoDetailId(todoDetailVO.getId()); List<TodoSystemAuthDetailDO> todoDetailList = new ArrayList<>(); if (todoSystemAuthDetailList.size() == 0) { initTodoSystemAuthDetail(todoDetailVO); } else { for (TodoSystemAuthDetailDO todoItem : todoSystemAuthDetailList) { if (todoItem.getName().equals("getway")) { todoDetailVO.setTodoSystemAuthGetway(todoItem); } else { todoDetailList.add(todoItem); } if (todoItem.isNeed()) { todoDetailVO.setContent(todoDetailVO.getContent() + todoItem.getContent()); } } todoDetailVO.setTodoSystemAuthDetailList(todoDetailList); } break; default: } TodoDO todoDO = todoDao.queryTodoInfoById(todoDetailVO.getTodoId()); todoDetailVO.setTodoDO(todoDO); invokeAssigneeUsers(todoDetailVO); if (todoDetailVO.getAssigneeUserId() != 0) todoDetailVO.setAssigneeUserDO(acqTodoUserDO(todoDetailVO.getAssigneeUserId())); todoDetailVO.setInitiatorUserDO(acqTodoUserDO(todoDetailVO.getInitiatorUserId())); try { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:m:s"); Date createDate = format.parse(todoDetailVO.getGmtCreate()); todoDetailVO.setTimeView(TimeViewUtils.format(createDate)); } catch (Exception e) { } }  @Override BusinessWrapper<Boolean> saveTodoConfig(TodoConfigDO todoConfigDO); @Override BusinessWrapper<Boolean> delTodoConfig(long itemId); @Override TableVO<List<TodoConfigVO>> queryConfigPage(String queryName, long parent, int valid, int page, int length); @Override List<TodoConfigDO> queryChildrenById(long parentId); @Override TableVO<List<TodoDailyVO>> queryTodoPage(TodoDailyQueryDO queryDO, int page, int length); @Override BusinessWrapper<Boolean> saveTodoItem(TodoDailyDO dailyDO); @Override TableVO<List<TodoDailyVO>> queryTodoProcessPage(TodoDailyQueryDO queryDO, int page, int length); @Override TodoDailyVO queryTodoById(long id); @Override List<TodoGroupVO> queryTodoGroup(); @Override TodoDetailVO queryTodoDetail(long id); @Override TodoDetailVO establishTodo(long todoId); @Override BusinessWrapper<Boolean> saveKeyboxDetail(TodoKeyboxDetailDO todoKeyboxDetailDO); @Override BusinessWrapper<Boolean> saveCiUserGroupDetail(TodoCiUserGroupDetailDO ciUserGroupDetailDO); @Override BusinessWrapper<Boolean> submitTodoDetail(long id); @Override BusinessWrapper<Boolean> delKeyboxDetail(long todoKeyboxDetailId); @Override BusinessWrapper<Boolean> delCiUserGroupDetail(long todoCiUserGroupDetailId); @Override BusinessWrapper<Boolean> setTodoSystemAuth(long todoSystemAuthDetailId); List<TodoDetailVO> queryMyTodoJob(String username); @Override List<TodoDetailVO> queryMyTodoJob(); @Override BusinessWrapper<Boolean> revokeTodoDetail(long id); @Override BusinessWrapper<Boolean> processingTodoDetail(long id); @Override List<TodoDetailVO> queryCompleteTodoJob(); List<TodoDetailVO> queryCompleteTodoJob(String username); void invokeTodoDetailVO(TodoDetailVO todoDetailVO); }
TodoServiceImpl implements TodoService { public void invokeTodoDetailVO(TodoDetailVO todoDetailVO) { int id = (int) todoDetailVO.getTodoId(); switch (id) { case 1: List<TodoKeyboxDetailDO> todoKeyboxDetailList = todoDao.queryTodoKeyboxDetailByTodoDetailId(todoDetailVO.getId()); List<TodoKeyboxDetailVO> todoKeyboxDetailVOList = new ArrayList<>(); for (TodoKeyboxDetailDO todoItem : todoKeyboxDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoKeyboxDetailVO todoKeyboxDetailVO = new TodoKeyboxDetailVO(todoItem, serverGroupDO); todoKeyboxDetailVOList.add(todoKeyboxDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoKeyboxDetailVO.getContent()); } todoDetailVO.setTodoKeyboxDetailList(todoKeyboxDetailVOList); break; case 2: List<TodoCiUserGroupDetailDO> todoCiUserGroupDetailList = todoDao.queryTodoCiUserGroupDetailByTodoDetailId(todoDetailVO.getId()); List<TodoCiUserGroupDetailVO> todoCiUserGroupDetailVOList = new ArrayList<>(); for (TodoCiUserGroupDetailDO todoItem : todoCiUserGroupDetailList) { ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(todoItem.getServerGroupId()); TodoCiUserGroupDetailVO todoCiUserGroupDetailVO = new TodoCiUserGroupDetailVO(todoItem, serverGroupDO); todoCiUserGroupDetailVOList.add(todoCiUserGroupDetailVO); todoDetailVO.setContent(todoDetailVO.getContent() + todoCiUserGroupDetailVO.getContent()); } todoDetailVO.setTodoCiUserGroupDetailList(todoCiUserGroupDetailVOList); break; case 3: List<TodoSystemAuthDetailDO> todoSystemAuthDetailList = todoDao.queryTodoSystemAuthDetailByTodoDetailId(todoDetailVO.getId()); List<TodoSystemAuthDetailDO> todoDetailList = new ArrayList<>(); if (todoSystemAuthDetailList.size() == 0) { initTodoSystemAuthDetail(todoDetailVO); } else { for (TodoSystemAuthDetailDO todoItem : todoSystemAuthDetailList) { if (todoItem.getName().equals("getway")) { todoDetailVO.setTodoSystemAuthGetway(todoItem); } else { todoDetailList.add(todoItem); } if (todoItem.isNeed()) { todoDetailVO.setContent(todoDetailVO.getContent() + todoItem.getContent()); } } todoDetailVO.setTodoSystemAuthDetailList(todoDetailList); } break; default: } TodoDO todoDO = todoDao.queryTodoInfoById(todoDetailVO.getTodoId()); todoDetailVO.setTodoDO(todoDO); invokeAssigneeUsers(todoDetailVO); if (todoDetailVO.getAssigneeUserId() != 0) todoDetailVO.setAssigneeUserDO(acqTodoUserDO(todoDetailVO.getAssigneeUserId())); todoDetailVO.setInitiatorUserDO(acqTodoUserDO(todoDetailVO.getInitiatorUserId())); try { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:m:s"); Date createDate = format.parse(todoDetailVO.getGmtCreate()); todoDetailVO.setTimeView(TimeViewUtils.format(createDate)); } catch (Exception e) { } }  @Override BusinessWrapper<Boolean> saveTodoConfig(TodoConfigDO todoConfigDO); @Override BusinessWrapper<Boolean> delTodoConfig(long itemId); @Override TableVO<List<TodoConfigVO>> queryConfigPage(String queryName, long parent, int valid, int page, int length); @Override List<TodoConfigDO> queryChildrenById(long parentId); @Override TableVO<List<TodoDailyVO>> queryTodoPage(TodoDailyQueryDO queryDO, int page, int length); @Override BusinessWrapper<Boolean> saveTodoItem(TodoDailyDO dailyDO); @Override TableVO<List<TodoDailyVO>> queryTodoProcessPage(TodoDailyQueryDO queryDO, int page, int length); @Override TodoDailyVO queryTodoById(long id); @Override List<TodoGroupVO> queryTodoGroup(); @Override TodoDetailVO queryTodoDetail(long id); @Override TodoDetailVO establishTodo(long todoId); @Override BusinessWrapper<Boolean> saveKeyboxDetail(TodoKeyboxDetailDO todoKeyboxDetailDO); @Override BusinessWrapper<Boolean> saveCiUserGroupDetail(TodoCiUserGroupDetailDO ciUserGroupDetailDO); @Override BusinessWrapper<Boolean> submitTodoDetail(long id); @Override BusinessWrapper<Boolean> delKeyboxDetail(long todoKeyboxDetailId); @Override BusinessWrapper<Boolean> delCiUserGroupDetail(long todoCiUserGroupDetailId); @Override BusinessWrapper<Boolean> setTodoSystemAuth(long todoSystemAuthDetailId); List<TodoDetailVO> queryMyTodoJob(String username); @Override List<TodoDetailVO> queryMyTodoJob(); @Override BusinessWrapper<Boolean> revokeTodoDetail(long id); @Override BusinessWrapper<Boolean> processingTodoDetail(long id); @Override List<TodoDetailVO> queryCompleteTodoJob(); List<TodoDetailVO> queryCompleteTodoJob(String username); void invokeTodoDetailVO(TodoDetailVO todoDetailVO);  }