📄 smssubmitreport.java
字号:
package com.tssx.ebiz.sgip;
import java.io.*;
/**
* <p>类名: SMSSubmitReport</p>
* <p>功能: </p>
* <p>版权: Copyright (c) 2002</p>
* <p>公司: 深讯信科</p>
* <p>版本: 1.0</p>
* @程序 xuke
* @修改纪录
*/
public class SMSSubmitReport extends SMSData{
private int submitSeqAddr;
private int submitSeqDate;
private int submitSequence;
// int submitSequenceNumber;// 12 Integer 该命令所涉及的Submit或deliver命令的序列号
private int reportType;// 1 Integer Report命令类型0:对先前一条Submit命令的状态报告1:对先前一条前转Deliver命令的状态报告
private String userNumber;// 21 Text 接收短消息的手机号,手机号码前加“86”国别标志
private int state;// 1 Integer 该命令所涉及的短消息的当前执行状态0:发送成功1:等待发送2:发送失败
private int errorCode;// 1 Integer 当State=2时为错误码值,否则为0
private String reserve;// 8 Text 保留,扩展用
public SMSSubmitReport(){
super();
}
public int getSubmitSeqAddr() {
return submitSeqAddr;
}
public void setSubmitSeqAddr(int newSubmitSeqAddr) {
submitSeqAddr = newSubmitSeqAddr;
}
public int getSubmitSeqDate() {
return submitSeqDate;
}
public void setSubmitSeqDate(int newSubmitSeqDate) {
submitSeqDate = newSubmitSeqDate;
}
public int getSubmitSequence() {
return submitSequence;
}
public void setSubmitSequence(int newSubmitSequence) {
submitSequence = newSubmitSequence;
}
public int getReportType() {
return reportType;
}
public void setReportType(int newReportType) {
reportType = newReportType;
}
public int getState() {
return state;
}
public void setState(int newState) {
state = newState;
}
public int getErrorCode() {
return errorCode;
}
public void setErrorCode(int newErrorCode) {
errorCode = newErrorCode;
}
public String getUserNumber() {
return userNumber;
}
public void setUserNumber(String newUserNumber) {
userNumber = newUserNumber;
}
public String getReserve() {
return reserve;
}
public void setReserve(String newReserve) {
reserve = newReserve;
}
public synchronized void read(DataInputStream m_is) throws SgipException,IOException {
int i=0;
byte[] head1=new byte[4];
// m_is.read(head1,0,4);
head1[0]=m_is.readByte();
head1[1]=m_is.readByte();
head1[2]=m_is.readByte();
head1[3]=m_is.readByte();
this.messageLength=(head1[0] & 0xff) << 24 | (head1[1] & 0xff) << 16 | (head1[2] & 0xff) << 8 | head1[3] & 0xff;//29
byte[] head2=new byte[4];
// m_is.read(head2,4,4);
head2[0]=m_is.readByte();
head2[1]=m_is.readByte();
head2[2]=m_is.readByte();
head2[3]=m_is.readByte();
this.commandID=(head2[0] & 0xff) << 24 | (head2[1] & 0xff) << 16 | (head2[2] & 0xff) << 8 | head2[3] & 0xff;
// if(this.commandID!=CommandID.SGIP_BIND_RESP){
// throw new SgipException();
// }
byte[] head3=new byte[4];
// m_is.read(head3,8,4);
head3[0]=m_is.readByte();
head3[1]=m_is.readByte();
head3[2]=m_is.readByte();
head3[3]=m_is.readByte();
this.seqAddr=(head3[0] & 0xff) << 24 | (head3[1] & 0xff) << 16 | (head3[2] & 0xff) << 8 | head3[3] & 0xff;
byte[] head4=new byte[4];
// m_is.read(head4,12,4);
head4[0]=m_is.readByte();
head4[1]=m_is.readByte();
head4[2]=m_is.readByte();
head4[3]=m_is.readByte();
this.seqDate=(head4[0] & 0xff) << 24 | (head4[1] & 0xff) << 16 | (head4[2] & 0xff) << 8 | head4[3] & 0xff;
byte[] head5=new byte[4];
// m_is.read(head5,16,4);
head5[0]=m_is.readByte();
head5[1]=m_is.readByte();
head5[2]=m_is.readByte();
head5[3]=m_is.readByte();
this.sequence=(head5[0] & 0xff) << 24 | (head5[1] & 0xff) << 16 | (head5[2] & 0xff) << 8 | head5[3] & 0xff;
byte[] body1=new byte[4];
body1[0]=m_is.readByte();
body1[1]=m_is.readByte();
body1[2]=m_is.readByte();
body1[3]=m_is.readByte();
this.submitSeqAddr=(body1[0] & 0xff) << 24 | (body1[1] & 0xff) << 16 | (body1[2] & 0xff) << 8 | body1[3] & 0xff;
byte[] body2=new byte[4];
body2[0]=m_is.readByte();
body2[1]=m_is.readByte();
body2[2]=m_is.readByte();
body2[3]=m_is.readByte();
this.submitSeqDate=(body2[0] & 0xff) << 24 | (body2[1] & 0xff) << 16 | (body2[2] & 0xff) << 8 | body2[3] & 0xff;
byte[] body3=new byte[4];
body3[0]=m_is.readByte();
body3[1]=m_is.readByte();
body3[2]=m_is.readByte();
body3[3]=m_is.readByte();
this.submitSequence=(body3[0] & 0xff) << 24 | (body3[1] & 0xff) << 16 | (body3[2] & 0xff) << 8 | body3[3] & 0xff;
byte body4=m_is.readByte();
this.reportType=body4;
byte[] body5=new byte[21];
i=0;
while(i<body5.length){
body5[i]=m_is.readByte();
i++;
}
this.userNumber=new String(body5);
byte body6=m_is.readByte();
this.state=body6;
byte body7=m_is.readByte();
this.errorCode=body7;
byte[] body8=new byte[8];
i=0;
while(i<body8.length){
body8[i]=m_is.readByte();
i++;
}
this.reserve=new String(body8);
// SMSSubmitReportThread smssubmitreportthread=new SMSSubmitReportThread(seqAddr,seqDate,sequence,messageLength,commandID,
// submitSeqAddr,submitSeqDate,submitSequence,reportType,userNumber,state,errorCode,reserve);
// Thread newThread = new Thread(smssubmitreportthread);
// newThread.start();
// System.out.println("----------submitreport begin----------");
// System.out.println("messageLength:"+messageLength);
// System.out.println("commandID:"+commandID);
// System.out.println("seqAddr:"+seqAddr);
// System.out.println("seqDate:"+seqDate);
// System.out.println("sequence:"+sequence);
// System.out.println("submitSeqAddr:"+submitSeqAddr);
// System.out.println("submitSeqDate:"+submitSeqDate);
// System.out.println("submitSequence:"+submitSequence);
// System.out.println("reportType:"+reportType);
// System.out.println("userNumber:"+userNumber);
// System.out.println("state:"+state);
// System.out.println("errorCode:"+errorCode);
// System.out.println("reserve:"+reserve);
// System.out.println("----------submitreport end----------");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -