sendmessagehandler.java

来自「采用JAVA开发」· Java 代码 · 共 68 行

JAVA
68
字号
/*
 * Created on 2004-8-7
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package com.gctech.smsmanage.handler;

import com.gctech.misc.sso.msg.AckMes;
import com.gctech.sms.client.SmsProxy;
import com.gctech.sms.msg.MTAck;
import com.gctech.sms.msg.MTInfo;

/**
 * <p>Title:下发短信处理类</p>
 * <p>Description:</p>
 * <p>Copyright: Copyright (c) Gctech 2004-8-7</p>
 * <p>Company: 吉芙德资讯有限公司</p>
 *
 * @version 1.0
 * @author liyi
 *
 */
public class SendMessageHandler {
	public static String handle(
		String serverIP,
		String ServerPort,
		String gateway,
		String desPhon,
		String content,
		String feePhon,
		String serviceId) {
		SmsProxy proxy = SmsProxy.getInstance();
		proxy.setHost(serverIP);
		proxy.setPort(Integer.valueOf(ServerPort).intValue());
		//组装MTInfo信息
		MTInfo info = new MTInfo();
		//下行短信内容
		info.content = content;
		info.feeTerminalType = 0;
		info.FeeterminalId = feePhon;
		info.destTerminalType = 0;
		info.sDestPhone = desPhon;
		info.bDestNo = 1;
		//是否需要应答
		info.bNeedReply = 1;
		//计费用户类型
		info.bFeeUserType = 1;
		//被计费用户的号码
		//信息格式
		info.bMsgFmt = 15;
		//费用
		info.FeeType = "";
		info.FeeCode = "";
		if ("".equals(serviceId))
			info.productID = "DZXH";
		else
			info.productID = serviceId;
		info.bDestNo = 1;
		info.ValidTime = "24";
		//网关
		info.gateway = Integer.valueOf(gateway).intValue();
		info.linkID = "";
		MTAck ack = proxy.sendMt(info);
		return (String) AckMes.getAckMap().get(new Integer(ack.status).toString());
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?