public InterviewNoticeDto getInterviewReceiveNoticeById(Long id) { InterviewNoticeDto result = applyJobDao.getInterviewReceiveNoticeById(id); if (result != null) { result.setStatus(ApplicationConstant.NOTICE_READ); applyJobDao.updateInterviewReceiveNoticeStatus(result); } return result; }
public String sendInterviewNotice() { LoginUserInfoDto userInfo = getLoginUserInfo(); if (userInfo == null) { sendInterviewNoticeStatus = ApplicationConstant.COMMON_UNLOGON; return "sendInterviewNotice"; } else { String userType = userInfo.getUserType(); if (userType == null || "".equalsIgnoreCase(userType)) { sendInterviewNoticeStatus = "permissionDenied"; return "sendInterviewNotice"; } else { if (ApplicationConstant.USER_TYPE_PERSONAL.equalsIgnoreCase(userType)) { sendInterviewNoticeStatus = "userTypeError"; return "sendInterviewNotice"; } } } ApplyJobInfoVo applyJobInfoVo = applyJobService.getApplyJobInfoById(new Long(jobId)); Long receiverId = new Long(applyJobInfoVo.getUserId()); Long senderId = userInfo.getId(); Date currentDate = new Date(); InterviewNoticeDto interviewNoticeDto = new InterviewNoticeDto(); interviewNoticeDto.setSenderId(senderId); interviewNoticeDto.setReceiverId(receiverId); interviewNoticeDto.setTitle(ApplicationConstant.INTERVIEW_NOTICE_TITLE); interviewNoticeDto.setMessage(ApplicationConstant.INTERVIEW_NOTICE_MESSAGE); interviewNoticeDto.setNoticeDate(currentDate); interviewNoticeDto.setStatus("0"); interviewNoticeDto.setJobName(applyJobInfoVo.getExpectedPosition()); if (applyJobService.saveInterviewNotice(interviewNoticeDto, userInfo)) sendInterviewNoticeStatus = SUCCESS; else sendInterviewNoticeStatus = "serviceOutOfDate"; return "sendInterviewNotice"; }
public boolean saveInterviewNotice( InterviewNoticeDto interviewNoticeDto, LoginUserInfoDto loginUserInfo) { // 扣除相应服务次数 SysOrderDto dto = new SysOrderDto(); dto.setService3Remains(new Long(1)); boolean result = sysOrderService.verifyAuthority( dto, loginUserInfo, ApplicationConstant.SERVICE_ITEM_NAME_RECRUIT_CODE, "3", 1); if (result) { // 分别在发件箱、收件箱保存站内信 saveInterviewSendNotice(interviewNoticeDto); saveInterviewReceiveNotice(interviewNoticeDto); // 如果个人用户设置了自动回复站内信,给企业用户回复站内信息 Long personalUserId = interviewNoticeDto.getReceiverId(); AutoShortMsgConfigDto autoShortMsgConfigDto = shortMessageService.getAutoShortMsgConfigByUserId(personalUserId); if (autoShortMsgConfigDto != null) { ShortMessageDto shortMessageDto = new ShortMessageDto(); shortMessageDto.setSenderId(personalUserId); shortMessageDto.setReceiverId(loginUserInfo.getId()); shortMessageDto.setReceiveDate(new Date()); shortMessageDto.setTitle(autoShortMsgConfigDto.getTitle()); shortMessageDto.setType("1"); shortMessageDto.setStatus(ApplicationConstant.NOTICE_UNREAD); shortMessageDto.setMessage(autoShortMsgConfigDto.getMsg()); shortMessageService.saveReceiveMsg(shortMessageDto); } } return result; }