浏览代码

--add sendConsultMail();add sendConsultSMS();

zzy.zhiyuan.foxmail 8 年之前
父节点
当前提交
6327827e26
共有 1 个文件被更改,包括 45 次插入1 次删除
  1. 45 1
      src/main/java/com/ekexiu/portal/service/SysService.java

+ 45 - 1
src/main/java/com/ekexiu/portal/service/SysService.java

@ -82,6 +82,10 @@ public class SysService {
82 82
	private String orgRegMailReplaceKey;
83 83
	private String orgRegMailReplaceContentTempalte;
84 84
	private long timeLimitWithOrgRegMail = 10 * 60 * 1000;
85
	
86
	private String sendConsultMailSubject;
87
	private String sendConsultMailContentTemplate;
88
	private String sendConsultSMSContentTemplate;
85 89
86 90
	private String bindMobilePhoneReplaceKey;
87 91
	private String bindMobilePhoneContentTemplate;
@ -267,6 +271,30 @@ public class SysService {
267 271
		this.bindMobilePhoneReplaceKey = bindMobilePhoneReplaceKey;
268 272
	}
269 273
274
	public String getSendConsultMailSubject() {
275
		return sendConsultMailSubject;
276
	}
277
278
	public void setSendConsultMailSubject(String sendConsultMailSubject) {
279
		this.sendConsultMailSubject = sendConsultMailSubject;
280
	}
281
282
	public String getSendConsultMailContentTemplate() {
283
		return sendConsultMailContentTemplate;
284
	}
285
286
	public void setSendConsultMailContentTemplate(String sendConsultMailContentTemplate) {
287
		this.sendConsultMailContentTemplate = sendConsultMailContentTemplate;
288
	}
289
290
	public String getSendConsultSMSContentTemplate() {
291
		return sendConsultSMSContentTemplate;
292
	}
293
294
	public void setSendConsultSMSContentTemplate(String sendConsultSMSContentTemplate) {
295
		this.sendConsultSMSContentTemplate = sendConsultSMSContentTemplate;
296
	}
297
270 298
	public String getBindMobilePhoneContentTemplate() {
271 299
		return bindMobilePhoneContentTemplate;
272 300
	}
@ -1223,7 +1251,7 @@ public class SysService {
1223 1251
			JfwAppContext.removeCachedObject(key);
1224 1252
		}
1225 1253
	}
1226
1254
	
1227 1255
	@Get
1228 1256
	@Path("/vcWithBind")
1229 1257
	public String reqBindBindMobilePhone(@JdbcConn(false) Connection con, String userid, String mobilePhone) throws JfwBaseException, SQLException {
@ -1566,6 +1594,22 @@ public class SysService {
1566 1594
		this.mailservice.sendSimpleMail(email, mailContent, null, this.inviteMailSubject);
1567 1595
	}
1568 1596
	
1597
	public void sendConsultMail(String mail) throws SQLException, JfwBaseException{
1598
		try {
1599
			mailservice.sendSimpleMail(mail, this.sendConsultMailContentTemplate, null, this.sendConsultMailSubject);
1600
		} catch (Exception e) {
1601
			throw new JfwBaseException(10011, "send mail to " + mail + " error", e);
1602
		}
1603
	}
1604
	
1605
	public void sendConsultSMS(String mobilePhone) throws SQLException, JfwBaseException{
1606
		try {
1607
			this.mobilePhoneServcie.sendMessage(mobilePhone, this.sendConsultSMSContentTemplate, null, null);
1608
		} catch (Exception e) {
1609
			throw new JfwBaseException(10012, "send mobile phone message to " + mobilePhone + " error", e);
1610
		}
1611
	}
1612
	
1569 1613
	public static void main(String[] args) {
1570 1614
		System.out.println(String.format("%04d", new Random().nextInt(10000)));
1571 1615
	}