public String resend() { String id = getRequest().getParameter("id"); NoteSend noteSend = noteSendManager.getById(this.id); String[] sendids = noteSend.getSendid().split(","); String[] sendnames = noteSend.getRecipient().split(","); // 发件人存档 noteSend.setCid(0); noteSend.setCdate(new Date()); noteSend.setSendid(sendid); noteSend.setNotestatus("nosee"); noteSend.setUuid(UUID.randomUUID().toString()); noteSendManager.save(noteSend); noteSend.setUrl("/pages/NoteSend/showNoteReceiveView.do?id=" + noteSend.getId()); // 收件人存档 for (int i = 0; i < sendids.length; i++) { NoteReceive noteReceive = new NoteReceive(); noteReceive.setCid(0); noteReceive.setCdate(new Date()); noteReceive.setRecipient(sendnames[i]); noteReceive.setSendid(sendids[i]); noteReceive.setNotestatus("nosee"); noteReceive.setUuid(UUID.randomUUID().toString()); noteReceive.setMessage(noteSend.getMessage()); noteReceive.setMsgTxt(noteSend.getMessage()); noteReceiveManager.save(noteReceive); noteReceive.setUrl( "/pages/NoteSend/showNoteReceiveView.do?id=" + noteReceive.getId() + "&uuid=" + noteReceive.getUuid()); noteReceiveManager.saveOrUpdate(noteReceive); } showMessage2("发送短信成功!", "/pages/NoteSend/list.do"); return LIST_ACTION; }
/** 保存新增对象 */ public String save() { try { String[] sendids = sendid.split(","); String[] sendnames = sendname.split(","); // 发件人存档 noteSend.setCid(getMySession().getUser().getId()); noteSend.setCdate(new Date()); noteSend.setRecipient("【发送】" + sendname); noteSend.setSendid(sendid); noteSend.setNotestatus("nosee"); noteSend.setType(0); noteSend.setUuid(UUID.randomUUID().toString()); noteSendManager.save(noteSend); noteSend.setUrl("/pages/NoteSend/showNoteReceiveView.do?id=" + noteSend.getId()); // 收件人存档 for (int i = 0; i < sendids.length; i++) { NoteReceive noteReceive = new NoteReceive(); noteReceive.setCid(getMySession().getUser().getId()); noteReceive.setCdate(new Date()); noteReceive.setRecipient(sendnames[i]); noteReceive.setSendid(sendids[i]); noteReceive.setFromid(noteSend.getId()); noteReceive.setNotestatus("nosee"); noteReceive.setUuid(UUID.randomUUID().toString()); noteReceive.setMessage(noteSend.getMessage()); noteReceive.setType(0); noteReceive.setMsgTxt(noteSend.getMessage()); noteReceiveManager.save(noteReceive); noteReceive.setUrl( "/pages/NoteSend/showNoteReceiveView.do?id=" + noteReceive.getId() + "&uuid=" + noteReceive.getUuid()); noteReceiveManager.saveOrUpdate(noteReceive); } showMessage2("发送短信成功!", "/pages/NoteSend/list.do"); } catch (Exception e) { // TODO: handle exception. showMessage2("发送短信失败!", "/pages/NoteSend/list.do"); } return LIST_ACTION; }