




已阅读5页,还剩26页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
EAS短信平台使用介绍1相关介绍。金蝶通讯平台主要为业务系统提供收发手机短信、电子邮件等提供底层的通讯支持。各个业务系统通过调用金蝶通讯平台相关接口或与金蝶通讯平台通信来实现这些消息的收发,金蝶通讯平台是一个独立的产品。 EAS短信平台是eas系统中的一个模块,是通过接口与金蝶通讯平台相连接,实现在eas中短信包括邮件消息的收发、查看和管理功能的模块,eas的各业务系统可以调用此模块中的方法实现具体业务功能。2. 数据表:发送短信的表:T_MO_SendMoMsg 接受短信的表:T_MO_RecMoMsg4消息发送工具类: MsgUtil 说明:具体业务系统可以直接调用这个类中的如下方法实现短信的发送以及回复。 msgGroupSend(Context ctx,String title,int priority,boolean revertible,String content,List userList,int msgType, KDMessageAttachment attachment) 说明:短信或邮件群发 Ctx:上下文 Title:短信或邮件标题 Priority:优先级,分为低、一般、高,取法为AppMsgUtil.getPriorityEnum(priority) revertible :是否可回复 content:消息内容 userList:接收人的ID列表,List中存放的是接收人的ID。Attachment:发邮件时的附件 msgType:消息类型,分为邮件、短信等,从BOSMsgTypeEnu中取。boolean newMsgMobile(Context ctx, boolean revertible, String title, String content, int priority, UserInfo receiveUserInfo, String receiveMoNumber)说明:短信发送receiveUserInfo:消息接收人对象,存放接收人相关信息receiveMoNumber:接收手机号码void msgMoblieByUserMap(Context ctx,Map map,int priority,boolean revertible)说明:短信发送,map中存放的是personId和信息内容boolean msgSend(Context ctx, String title, int priority, boolean revertible, String content, String personId, int msgType, KDMessageAttachment attachment, String assignID)说明:发送短信或邮件msgType:BOSMsgTypeEnum类型的常量值 personId:接收人IDassignID:工作流任务IDboolean mobileMsgSend(Context ctx,String title,int priority,boolean revertible,String content,String receiveMobileNumber,String assignID)说明:短信发送receiveMobileNumber:接受手机号码boolean sendMail(Context ctx,String title,int priority,boolean revertible,String content,String address,KDMessageAttachment attachment,String assignID)说明:邮件发送Address:邮件接收地址boolean sendMobileMsg(Context ctx, String title, int priority, boolean revertible, String content, String receiveMobileNumber, String assignID)说明:短信发送,没有判断通讯平台是否连接,用mobileMsgSend方法替代此方法。boolean newMsgMobileDerect(Context ctx, boolean canback, String content, UserInfo receiveUserInfo)说明:手工发送短信,指定接收的用户Canback:是否可回复boolean newMsgMobileDerect(Context ctx, boolean canback, String content, String receiveMobileNumber)说明:手工发送短信,指定接收的用户的手机号码boolean newMsgMobileDerect(Context ctx, SendMessageParamInfo msgInfo)说明:发送短信msgInfo:SendMessageParamInfo类型的对象,保存了一些短信参数信息,例如canback是否可回复,isAppendRevert是否附带“可回复/不可回复“,isAppendUserName是否附带个人姓名,isAppendCompanyName是否附带公司名称,isAppendNumber回复短信时是否附带回复人手机号码,isAppendPersonName回复短信时是否附带回复人姓名boolean newMsgMobileDerect(Context ctx, boolean canback, boolean isAppendRevert, boolean isAppendUserName, boolean isAppendCompanyName, String content, String receiveMobileNumber)说明:发送短信boolean newMsgMobileDirect(Context ctx, boolean canback, boolean isAppendNumber, boolean isAppendPersonName, String content, String receiveMobileNumber, UserInfo receiveUserInfo)说明:发送短信5消息接收及解析重要类:业务系统根据这些类执行特定的业务逻辑1 AbstractBaseBizFunction类说明:执行短信业务功能接口的缺省实现抽象类,同时实现主发/回复两种短信的业务功能接口,建议所有消息执行业务功能的实现类都继承于此类。业务系统实例可以参考以下类: 主发短信业务:boolean beforeExecSendAction(BizFuncParamObj paramObj)方法说明:主发短信执行业务功能前的操作,具体业务类可以重载这个方法实现在主发短信执行业务功能执行前的逻辑处理,默认返回true, 业务实现类可返回false,即取消此次的短信业务执行。BizReturnObj executeSendAction(BizFuncParamObj paramObj)方法说明:主发短信执行业务功能,具体业务类重载这个方法实现主发短信执行业务功能,BizReturnObj是由业务实现类负责返回给移动商务的结果类, returnObj.isSucceed()返回true表示执行成功,false表示执行失败。boolean afterExecSendAction(BizFuncParamObj paramObj,BizReturnObj bizReturnObj)方法说明:主发短信执行业务功能后的操作,具体业务类可以重载这个方法实现在主发短信执行业务功能执行后的逻辑处理,默认返回true, 业务实现类可返回false,即取消此次的短信业务执行。回复短信业务:boolean validate(BizFuncParamObj paramObj)方法说明:校验回复短信要执行的是否是本业务功能,由业务系统具体实现。boolean beforeExecReplyAction(BizFuncParamObj paramObj)方法说明:回复短信执行业务功能前的操作,由业务系统具体实现,业务实现类可返回false,即取消此次的短信业务执行。BizReturnObj executeReplyAction(BizFuncParamObj paramObj)方法说明:回复短信执行业务功能,具体业务类重载这个方法实现回复短信执行业务功能,BizReturnObj是由业务实现类负责返回给移动商务的结果类, returnObj.isSucceed()返回true表示执行成功,false表示执行失败。boolean afterExecReplyAction(BizFuncParamObj paramObj,BizReturnObj bizReturnObj)方法说明:回复短信执行业务功能后的操作,具体业务类可以重载这个方法实现在回复短信执行业务功能执行后的逻辑处理,默认返回true, 业务实现类可返回false,即取消此次的短信业务执行。6.短信平台在业务系统中的使用 业务功能命令定义: 系统平台短信管理短信业务配置 Eas平台现有的业务功能有:通讯录名称,查询信用额度报表查询等等。 例如在此界面定义了通讯录查询的业务命令为aaa,保存后,启动通讯平台及eas服务器,通讯录查询的短信业务格式为 “命令 用户名“,并且此业务为主发业务,之前不需要预先执行相关业务。所以可以直接在短信平太模拟器中发送短信如下: 手机号码要是一个eas系统用户,yaya是要查询的人名,AT_SCM_SQL_0113是配置Socket设备时填的短语 。系统截获短信解析后会执行相关的查询业务逻辑,返回对应的查询信息。如下图: 真实手机发送短信命令时,直接编辑具体内容,不需要用“短语*+命令“的格式。另外这里的短信命令在接收人外部短信编辑界面可以设置命令快捷键,当向此用户发送业务命令时,可以用快捷键的数字代替业务命令 7 开发步骤1.在T_MO_BizFunction业务功能表中添加有关业务功能的描述记录,以便在业务功能命令定义的时候在功能下拉类表中选功能。示例脚本:-通讯录if not exists(select * from T_MO_BizFunction where fid =/SJUxQEUEADgBAXcwKgQDa2Jzdc=)insert into T_MO_BizFunction(FID,FFUNCTION,FIMPLCLASSNAME,FBIZMODULEID,FCOMMANDOBJID, FQUERYPANELCLASSNAME) values(/SJUxQEUEADgBAXcwKgQDa2Jzdc=,通讯录名称,com.kingdee.eas.basedata.person.app.PersonMobileBizFunction, MJGsAo5Xx6vgQAB/AQB6364CdCs=,/SJUxQEUEADgBAXZwKgQDZaTAzY=, null); if not exists(select * from T_MO_CommandObject where fid =/SJUxQEUEADgBAXZwKgQDZaTAzY=)insert into T_MO_CommandObject(FID,FCOMMANDNUMBER,FCOMMANDNAME) values(/SJUxQEUEADgBAXZwKgQDZaTAzY=,QP01,通讯录查询);2.编写业务类继承AbstractBaseBizFunction实现其中的某些方法,执行具体的业务逻辑。可以用参数BizFuncParamObj中得到经过解析的短信内容、参数已经其他信息将需要返回给通讯平台的信息保存在BizReturnObj中,到达返回信息的目的。示例类:通讯录查询的业务功能/* * (#)com.kingdee.eas.basedata.person.app.PersonMobileBizFunction.java * * 金蝶国际软件集团有限公司版权所有. */package com.kingdee.eas.basedata.person.app;import com.kingdee.eas.basedata.person.IPersonFacade;import com.kingdee.eas.basedata.person.PersonFacadeFactory;import .AbstractBaseBizFunction;import .BizFuncParamObj;import .BizReturnObj;/* * 描述:职员信息提供给短信平台调用的接口 * author Eric Xie date: 2008-08-18 * version EAS6.0SP */public class PersonMobileBizFunction extends AbstractBaseBizFunction /短信查询指令 public static String PERSON_QUERY_COMMAND = QP01;/* (非 Javadoc) * 主发短信执行业务功能 * see .ISendMsgFunction#executeSendAction(.BizFuncParamObj) */public BizReturnObj executeSendAction(BizFuncParamObj paramObj)if (paramObj.getCommandParams().length =0) BizReturnObj bizReturnObj = new BizReturnObj(); bizReturnObj.setErrorText(没有输入要查询的人名!); bizReturnObj.setSucceed(false); bizReturnObj.setMustReply(true); return bizReturnObj;String name = paramObj.getCommandParams()0;String retnMsg = null;tryIPersonFacade iPF = PersonFacadeFactory.getLocalInstance(paramObj.getCtx();retnMsg = iPF.getAddressList(name);catch(Exception e)e.printStackTrace(); BizReturnObj bizReturnObj = new BizReturnObj(); bizReturnObj.setErrorText(系统错误请联系管理员!); bizReturnObj.setSucceed(false); bizReturnObj.setMustReply(true); return bizReturnObj;BizReturnObj bizReturnObj = new BizReturnObj();bizReturnObj.setErrorText();bizReturnObj.setReturnText(retnMsg);bizReturnObj.setSucceed(true);bizReturnObj.setMustReply(true);/ 缺省处理return bizReturnObj;示例二:回复型消息审批public class BIZMessageHandler extends AbstractBaseBizFunction private static final Logger logger = Logger.getLogger(BIZMessageHandler.class); private static final String RESOURCE = cessresource;private static String COMMNAD_STR = myinprocess;private static String PAGENUMBER = pageNum=;private static String ASSIGN_ID = assignID;private static int STEP = 3; /每条短信显示的条数private static String SLIP = #; /自定义串中的属性分隔符private static String DECISION = decision=;/* (非 Javadoc) * see .AbstractBaseBizFunction#afterExecReplyAction(.BizFuncParamObj, .BizReturnObj) */public boolean afterExecReplyAction(BizFuncParamObj paramObj, BizReturnObj bizReturnObj) / TODO 自动生成方法存根return super.afterExecReplyAction(paramObj, bizReturnObj);/* (非 Javadoc) * see .AbstractBaseBizFunction#afterExecSendAction(.BizFuncParamObj, .BizReturnObj) */public boolean afterExecSendAction(BizFuncParamObj paramObj, BizReturnObj bizReturnObj) / TODO 自动生成方法存根return super.afterExecSendAction(paramObj, bizReturnObj);/* (非 Javadoc) * see .AbstractBaseBizFunction#beforeExecReplyAction(.BizFuncParamObj) */public boolean beforeExecReplyAction(BizFuncParamObj paramObj) / TODO 自动生成方法存根return super.beforeExecReplyAction(paramObj);/* (非 Javadoc) * see .AbstractBaseBizFunction#beforeExecSendAction(.BizFuncParamObj) */public boolean beforeExecSendAction(BizFuncParamObj paramObj) / TODO 自动生成方法存根return super.beforeExecSendAction(paramObj);/* (非 Javadoc) * see .AbstractBaseBizFunction#executeReplyAction(.BizFuncParamObj) */public BizReturnObj executeReplyAction(BizFuncParamObj paramObj)BizReturnObj returnObj = null;String command = paramObj.getCommand().toLowerCase(); /本消息的父消息,即,本短信所要回复的短信CoreSendMessageInfo coreSendMessageInfo = null; if (paramObj.getReceiveMsg() instanceof ReceiveMobileMessageInfo) coreSendMessageInfo = (ReceiveMobileMessageInfo)paramObj.getReceiveMsg().getParentMsg(); else if (paramObj.getReceiveMsg() instanceof EmailReceiveMessageInfo) coreSendMessageInfo = (EmailReceiveMessageInfo)paramObj.getReceiveMsg().getParentMsg(); char numKey = command.toLowerCase().charAt(0); switch (numKey) case 0: /获取待办消息,并根据页数生成 回复消息对象 returnObj = execQuery(paramObj,coreSendMessageInfo); break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: /error_number int recordNum = Integer.parseInt(numKey + ); if(recordNum STEP) return createReturnObjForError(paramObj,ResourceBase.getString(RESOURCE,error_number, paramObj.getCtx().getLocale(); else /执行进一步查询的操作,返回决策项等提示信息 returnObj = execQueryDetail(paramObj,coreSendMessageInfo,recordNum); break; case y: case n: if(paramObj.getCommandParams().length -1 ? lastPageNum:0;/获取该用户的待办消息 IRowSet rowset;tryrowset = getMyInProccess(paramObj.getCtx(),paramObj.getUserID();catch (BOSException e)logger.error(Has some error when getInProccess ( + paramObj.getReceiveMsg().getContent() + ); + e.toString(); return createReturnObjForError(paramObj,ResourceBase.getString(RESOURCE,hasserror_inprocess, paramObj.getCtx().getLocale(); /无待办消息 if(rowset = null | rowset.size() = 0) returnObj = new BizReturnObj(); returnObj.setReturnText(ResourceBase.getString(RESOURCE,hasNoneInprocess, paramObj.getCtx().getLocale(); returnObj.setErrorText(); returnObj.setCustomStr(); returnObj.setSucceed(true); returnObj.setMustReply(true); else /从上次查询页数+1开始,生成回复的消息文本,返回回复消息对象 returnObj = makeQueryReplyObj(paramObj,rowset,lastPageNum + 1); return returnObj;private BizReturnObj createReturnObjForError(BizFuncParamObj paramObj,String errorTxt)BizReturnObj returnObj = new BizReturnObj(); returnObj.setReturnText(); returnObj.setErrorText(errorTxt); returnObj.setCustomStr(); returnObj.setSucceed(false); returnObj.setMustReply(true); return returnObj;/* * 从自定义串中获取指定的属性,例如上次查询的页数,指定记录号码的工作流任务ID * param lastCustomStr * return */private String getPropertyFromCustomStr(String lastCustomStr,String PropertyName) String num = null; int lastPageNumber = -1; int i = lastCustomStr.indexOf(PropertyName); if(i -1) int j = lastCustomStr.indexOf(SLIP,i + PropertyName.length() ); if(j -1) num = lastCustomStr.substring(i + PropertyName.length(),j); else num = lastCustomStr.substring(i + PropertyName.length(); /CustomStr return num;/* (非 Javadoc) * see .AbstractBaseBizFunction#executeSendAction(.BizFuncParamObj) */public BizReturnObj executeSendAction(BizFuncParamObj paramObj)/获取待办消息,并根据页数生成 回复消息对象BizReturnObj bizReturnObj = execQuery(paramObj,null); /缺省处理return bizReturnObj; /* (非 Javadoc) * see .AbstractBaseBizFunction#validate(.BizFuncParamObj) */public boolean validate(BizFuncParamObj paramObj)/if(super.validate(paramObj)/String command = paramObj.getCommand().toLowerCase(); /本消息的父消息,即,本短信所要回复的短信CoreSendMessageInfo coreSendMessageInfo = null; if (paramObj.getReceiveMsg() instanceof ReceiveMobileMessageInfo) coreSendMessageInfo = (ReceiveMobileMessageInfo)paramObj.getReceiveMsg().getParentMsg(); else if (paramObj.getReceiveMsg() instanceof EmailReceiveMessageInfo) coreSendMessageInfo = (EmailReceiveMessageInfo)paramObj.getReceiveMsg().getParentMsg(); /主发查询消息的校验 if(coreSendMessageInfo = null) /主发询查的消息,必须符合查询的命令if(COMMNAD_STR.equals(command)return true; /回复处理消息的校验else /回复处理的消息,必须是09,Y/N中的一个 char numKey = command.toLowerCase().charAt(0); switch (numKey) case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case y: case n: return true; default: /return false;/* * 获取该用户的待办消息 * * param ctx * param userId * return * throws BOSException */private IRowSet getMyInProccess(Context ctx,String userId) throws BOSException IMessageCenter iMessageCenter = MessageCenterFactory.getLocalIn
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025-2026学年山东省淄博第十中学物理高三第一学期期末学业水平测试试题
- 防爆枪枪支管理办法
- 鹿邑静态化管理办法
- 《缉毒特情管理办法》
- 新质生产力发展突破路径
- 农业保险监管政策-洞察及研究
- 企业安全培训简报模板课件
- 三角梅种植工程规划与施工方案
- 企业安全培训手册课件
- 冲压冲床安全生产培训课件
- 2025年医疗质量管理质控培训考核试题(含答案)
- 小学科学新教科版二年级上册第一单元 造房子教案(共6课)(2025秋)
- GB/T 2820.5-2025往复式内燃机驱动的交流发电机组第5部分:发电机组
- 《人工智能基础》课件-AI的前世今生:她从哪里来
- ISO28000:2022供应链安全管理体系
- 营造林技能竞赛试题及答案
- 科比受伤及励志
- JIS G4305-2021 冷轧不锈钢板材、薄板材和带材
- SMT元器件焊接强推力测试标准doc
- ELA基础介绍PPT课件
- SAP Analytics Cloud分析云解决方案
评论
0/150
提交评论