예제 #1
0
 /**
  * 定时检查是否有新消息
  *
  * @return
  * @throws Exception
  */
 @LoginValidation(validate = YN.N)
 public String getNewMessage() throws Exception {
   Map<String, String> paramMap = new HashMap<String, String>();
   paramMap.put("receiverId", Sessions.getSysUser().getId());
   paramMap.put("isRead", "0");
   List<OaIntenalMessage> list = intenalMessageService.findList(paramMap);
   if (list != null && list.size() > 0) {
     OaIntenalMessage omsg = list.get(0);
     Renders.renderJson(omsg.getId() + "|" + omsg.getMsgTitle());
   } else {
     Renders.renderJson("");
   }
   return NONE;
 }
예제 #2
0
 public String save() throws Exception {
   String uploadPath = "uploadfile/oa/message";
   if (StringUtils.isEmpty(id)) {
     if (iMsgList != null && iMsgList.size() > 0) {
       intenalMessageService.save(
           iMsgList, uploadPath, getUpload(), getUploadFileName(), getUploadContentType());
     }
     Renders.renderJson(Renders.SAVE_SUCCESS);
   } else {
     intenalMessageService.update(
         intenalMessage, uploadPath, getUpload(), getUploadFileName(), getUploadContentType());
     Renders.renderJson(Renders.UPDATE_SUCCESS);
   }
   return NONE;
 }
예제 #3
0
 public String delete() throws Exception {
   String ids = Servlets.getRequest().getParameter("ids");
   String[] arrayIds = ids.split(",");
   int updateCount = intenalMessageService.batchUpdateOrDelete(arrayIds);
   if (updateCount == arrayIds.length) {
     Renders.renderJson(Renders.DELETE_SUCCESS);
   }
   return NONE;
 }