
# 短信业务支持接入第三方短信平台二开拓展
1,扩展BizConfigUI 类,二开BizConfigUICTEx类继承标准类,开放自定义接口开发,就能在短信业务配置界面看到自定义按钮配置。

2,仿照维那多网关类,实现自定义网关(需要对接第三方短信平台)
参考标准实现类(维那多发送短信实现类):
com.kingdee.eas.mobile.framework.WeinaduoMobileGatewayProvider

基本实现4个接口:
a,_testConnection(测试连接接口)
b, _displayBalance(查询余额接口)
c, _sendMessage(发送短信)
d, _receiveMessage(接收短信)
**多网关接口实现抽现类,屏蔽EAS的细节,各网关实现类从此类继承
com.kingdee.eas.mobile.framework.AbastractMobileGatewayProvider
客户二开的实现类继承这个就行(类似维那多实现类接口)
标准实现类接口说明(可以了解一下):
**通信网关实现类接口,各网关按此接口实现相应的功能
com.kingdee.eas.mobile.framework.IMobileGatewayProvider
/**
* 将EAS数据中保存的短信息发送到网关
* @param sendMoMsgInfo 要发送的短信息
* @param mobileConfigInfo 连接第三方短信网关的配置信息
* @param ctx 运行上下文
* @return
* @throws EASBizException
* @throws BOSException
*/
public boolean sendMessage(SendMobileMessageInfo sendMoMsgInfo, final MobileConfigInfo mobileConfigInfo, final Context ctx) throws EASBizException, BOSException ;
/**
* 将EAS数据中保存的邮件信息发送出去
*
* 因EAS原短信与邮件都在同一接口中,所以此接口仍按原有规则保留
*
* @param emailSendMessageInfo 要发送的邮件信息
* @param ctx 运行时上下文
* @return
* @throws EASBizException
* @throws BOSException
*/
public boolean sendMail(EmailSendMessageInfo emailSendMessageInfo, final Context ctx) throws EASBizException, BOSException;
/**
* EAS从第三方短信网关拉取短信
* @param mobileConfigInfo 连接第三方短信网关的配置信息
* @param ctx 运行时上下文
* @throws BOSException
*/
public void receiveMessage(final MobileConfigInfo mobileConfigInfo, final Context ctx) throws BOSException;
/**
* 测试第三方短信网关是否能正常连通
* @param mobileConfigInfo 连接第三方短信网关的配置信息
* @return true-正常 false-不正常
* @throws EASBizException
* @throws BOSException
*/
public boolean testConnection(final MobileConfigInfo mobileConfigInfo) throws EASBizException, BOSException;
/**
* 显示帐户在第三方短信网关短信余额
*
* 此接口预留,此接口主要与短信余额预警起同类作用,但一般第三方网关平台应该要实现余额预警功能,所以查看余额也就不显得那么重要了
*
* @param mobileConfigInfo 连接第三方短信网关的配置信息
* @return 余额提示信息,如”短信余额:100条“,”短信余额:50元“,”短信余额:不支持余额查询“
* @throws EASBizException
* @throws BOSException
*/
public String displayBalance(final MobileConfigInfo mobileConfigInfo) throws EASBizException, BOSException;
/**
* 直接发送邮件,不保存发送记录到数据库中
*
* 替换原有的sendMail(KDMessage, String)
*
* 因EAS原短信与邮件都在同一接口中,所以此接口仍按原有规则保留
*
* @param ctx 运行时上下文
* @param title 邮件标题
* @param content 邮件内容
* @param contentMimeType 媒体类型
* @param receiver 收件人,多邮箱时用半角;号分隔
* @param secretReceiver 暗送人,多邮箱时用半角;号分隔
* @param copyReceiver 抄送人,多邮箱时用半角;号分隔
* @param attachment 附件
* @return
* @throws BOSException
* @throws EASBizException
*/
public boolean sendMail(Context ctx, String title, String content, MimeTypeEnum contentMimeType, String receiver,
String secretReceiver, String copyReceiver, KDMessageAttachment[] attachment) throws BOSException, EASBizException;
/**
* 直接发送短信,不保存发送记录到数据库中
* @param content 短信内容
* @param receiver 接收人手机号
* @param mobileConfigInfo 连接第三方短信网关的配置信息
* @param ctx 运行时上下文
* @return
* @throws BOSException
* @throws EASBizException
*/
public boolean sendMessage(String content, String receiver, final MobileConfigInfo mobileConfigInfo, final Context ctx) throws BOSException, EASBizException;
/*=======================================以下为兼容旧的com.kingdee.bos.message.client.BizInterface接口,各网关类实现时可继承AbastractMobileGatewayProvider类即不用实现以下方法了*/
/**
* 为兼容旧的com.kingdee.bos.message.client.BizInterface接口,各网关类实现时可继承{@link #AbastractMobileGatewayProvider}类即不用实现些方法了
*
* @see com.kingdee.bos.message.client.BizInterface#addConnectMonitor(com.kingdee.bos.message.client.ConnectMonitor)
*/
public void addConnectMonitor(ConnectMonitor arg0);
/**
* 为兼容旧的com.kingdee.bos.message.client.BizInterface接口,各网关类实现时可继承{@link #AbastractMobileGatewayProvider}类即不用实现些方法了
*
* @see com.kingdee.bos.message.client.BizInterface#addMsgListener(com.kingdee.bos.message.client.KDMsgListener)
*/
public void addMsgListener(KDMsgListener arg0);
/**
* 为兼容旧的com.kingdee.bos.message.client.BizInterface接口,各网关类实现时可继承{@link #AbastractMobileGatewayProvider}类即不用实现些方法了
*
* @see com.kingdee.bos.message.client.BizInterface#connect(java.lang.String, int, java.lang.String, java.lang.String)
*/
public boolean connect(String hostname, int port, String loginName, String password);
/**
* 为兼容旧的com.kingdee.bos.message.client.BizInterface接口,各网关类实现时可继承{@link #AbastractMobileGatewayProvider}类即不用实现些方法了
*
* @see com.kingdee.bos.message.client.BizInterface#disConnect()
*/
public void disConnect();
/**
* 为兼容旧的com.kingdee.bos.message.client.BizInterface接口,各网关类实现时可继承{@link #AbastractMobileGatewayProvider}类即不用实现些方法了
*
* @see com.kingdee.bos.message.client.BizInterface#isConnected()
*/
public boolean isConnected() ;
/**
* 为兼容旧的com.kingdee.bos.message.client.BizInterface接口,各网关类实现时可继承{@link #AbastractMobileGatewayProvider}类即不用实现些方法了
*
* 发送短信到第三方短信网关
* (non-Javadoc)
* @see com.kingdee.bos.message.client.BizInterface#sendMessage(com.kingdee.bos.message.common.KDMessage)
*/
public boolean sendMessage(KDMessage arg0);
3,配置自定义网关实现类,测试连接,如果连接成功,则点击启动按钮把移动商务平台启动起来。
