SmsServiceImpl implements SmsRemoteService { public void sendSms(SMS_TEMPLATE st,String mobile,Map<String, Object> parameters){ ComSmsTemplate cst = comSmsTemplateDAO.selectByPrimaryKey(st.name()); String content = null; if(cst != null) { try { content = StringUtil.composeMessage(cst.getContent(), parameters); SmsContent sms = new SmsContent(content, mobile); String channel= generateChannel(mobile,cst.getChannel(),cst.getChannelCMCC(),cst.getChannelCUC(),cst.getChannelCT()); sms.setChannel(channel); smsContentDAO.save(sms); } catch (Exception e) { e.printStackTrace(); LOG.error("replace sms template content error!!!!!!!!!!!!!!!!"); } } else { LOG.error("get none template id "+st.name()); } }  void insert(SmsContent smsContent); void sendSms(SMS_TEMPLATE st,String mobile,Map<String, Object> parameters); @Override void sendSms(String content, String mobile); void sendQunFaSms(String content, String mobile); void sendSms(String content, String mobile, Date date); void sendSms(String content, String mobile, Integer priority); void sendSmsWithType(String content, String mobile, String type); void sendSms(String content, String mobile, int priority,
			String type, Date date); @Override void sendSms(String content, String mobile, int priority, String type, Date date, String userId); SmsContent sendSmsContent(String content, String mobile, int priority, String type, Date date, String userId); void sendSms(final String content, final String[] mobiles); void sendSms(final String content, final String[] mobiles,
			final Date date); void sendSms(final String content, final String[] mobiles,
			final Integer priority); void sendSms(final String content, final String[] mobiles,
			final String type); void sendSms(final String content, final String[] mobiles,
			final int priority, String type, Date date); @Override void sendSms(final String content, final String[] mobiles, final int priority,
			final String type, final Date date, final String userId); @SuppressWarnings({ "rawtypes", "unchecked" }) Page queryPaginationSms(String mobile, Date startDate, Date endDate,
			int status, int start, int limit); @SuppressWarnings({"unchecked" }) @Override Page<SmsContentLog> queryPaginationSms(Map<String, Object> parameterObject, int start, int limit); void reSend(Long id); @Override void sendSmsInWorking(String content, String mobile); @Override void sendMMSms(String[] texts, byte[][] pictures, byte[][] mids,
			String mobile, String type); @Override void sendMMSms(SmsMMS mms, String mobile, String type); @Override List<SmsContent> queryWaittingSendSms(Map<String, Object> parameters); @SuppressWarnings("unchecked") @Override List<SmsContentLog> querySendedSms(Map<String, Object> parameters); @Override void updateFailureCount(Serializable id); @Override void moveSmsFromWaittingToSended(SmsContent smsContent); @Override void batchMoveSmsFromWaittingToSended(Map<String, Object> parameters); @Override void updateReport(List<SmsStatusReport> reportStatusList); @Override long count(final Map<String, Object> parameters); void moveContentLogToHis(Map<String, Object> parm); @Override void saveSmsReceive(SmsReceive smsReceive); @Override void reSendSms(Serializable id); @Override List<SmsLogStat> queryStat(final Map<String, Object> parm); @Override long queryMMSStat(final Map<String, Object> parm); @Override List<SmsContent> queryByParam(Map<String, Object> param); int getStartWorkingtime(); void setStartWorkingtime(final int startWorkingtime); int getEndWorkingtime(); void setEndWorkingtime(final int endWorkingtime); void sendMMSms(byte[][] is); List<SmsContentLog> getSmsLogListByParams(Map<String, Object> params); Long getSmsLogListCountByParams(Map<String, Object> params); void reSendSms(Long id,String channel,String tableName,Map<Object, Object> extendParam); int update(SmsContent smsContent); int updateSmsLog(SmsContentLog smsContentLog); List<SmsContentLog> getSmsLogList(Map<String, Object> paramMap); List<SmsContentLog> getResendSmsLogList();  }
@Test public void test() throws Exception { Map parameters = new HashMap(); parameters.put("code", "1234"); String content = comSmsTemplateService.getSmsContent(Constant.SMS_SSO_TEMPLATE.SMS_MOBILE_AUTHENTICATION_CODE.name(), parameters); smsRemoteService.sendSms(content, "18602115672",1); }