@Override @Transactional public String selectLastCode(TsmSendMessage tsmSendMessage) { String message = "0"; try { TsmSendMessage tsmSendMessage2 = new TsmSendMessage(); tsmSendMessage2 = tsmSendMessageDao.selectLastCode(tsmSendMessage); if (tsmSendMessage2 != null) { tsmSendMessage2.setTsmSendState("1"); tsmSendMessageDao.update(tsmSendMessage2); message = "1"; } return message; } catch (Exception e) { return message; } }
@Override @Transactional public String sendMessage(TsmSendMessage tsmSendMessage) { String message = "0"; try { tsmSendMessage.setTsmSendState("2"); tsmSendMessage.setTsmSendTime(new Date()); tsmSendMessage.setTsmSendUuid(UUID.randomUUID().toString()); // String flag = MessageSendUtil.sendMessage(tsmSendMessage.getTsmSendMobile(), // tsmSendMessage.getTsmSendCode()); boolean flag = sendMail(tsmSendMessage.getTsmSendMobile(), tsmSendMessage.getTsmSendCode()); if (flag) { message = "1"; tsmSendMessageDao.insert(tsmSendMessage); } return message; } catch (Exception e) { return message; } }