📄 submitordersupport.java
字号:
package com.sms.platform.switchcenter.support;
import org.apache.log4j.Logger;
import com.pub.backserver.net.ClientNet;
import com.sms.platform.switchcenter.parameter.SenderParameter;
import com.sms.platform.switchcenter.parameter.SwitchParameter;
import com.sms.protocol.standard12.Standard_Head;
import com.sms.protocol.standard12.Standard_Inner_Response;
import com.sms.protocol.standard12.Standard_Inner_Submit;
public class SubmitOrderSupport extends Support{
public static Logger log = Logger.getLogger(SubmitOrderSupport.class);
public SubmitOrderSupport(){
}
protected boolean resolve() {
SenderParameter sp = SenderParameter.getInstance();
Standard_Inner_Submit sis = (Standard_Inner_Submit) super.inner;
ClientNet cnb = null;
try {
int iMessageType = sis.getMessageType();
int iFeeType = sis.getFeeType();
ClientNet cno = null;
if (!(iMessageType == 0 && iFeeType == 0)) {
if (log.isDebugEnabled())
log.debug("checkOrder mobile :"
+ sis.getDestMobileAll() + " proid : "
+ sis.getProductID() + " servicecodeId :"
+ sis.getServiceCodeID() + " SeqID : "
+ sis.getSequenceId());
try {// 检测订购关系
cno = (ClientNet) SwitchParameter.getInstance().getObjPool()
.borrowObject();
int ordertype = cno.queryOrderList(sis
.getDestMobileOne(), sis.getProductID(),
sis.getServiceCodeID());
if (ordertype == sis.getProductID()) {// 有订购关系
if (log.isDebugEnabled())
log.debug("is order user proid is :"
+ sis.getDestMobileAll()
+ " type : " + ordertype
+ " SeqID : "
+ sis.getSequenceId());
} else if (ordertype == ClientNet.ERR_NOTFOUND) {
ObjectLog.log.debug(sis.toDataString());
Standard_Inner_Response sr = new Standard_Inner_Response(
sis);// 设置返回信息
sr.setState(Standard_Head.ERR_NOT_ORDER_USER); // 设置状态
// ObjectQueue.getInstanceResponse().add(sr);// 非订购用户
if (log.isDebugEnabled())
log.debug("no order user : "
+ sis.getDestMobileAll()
+ " type : " + ordertype
+ " SeqID : "
+ sis.getSequenceId());
return false;
} else {
// 发生其他错误压回重新发送
if (log.isDebugEnabled())
log.debug("ordercheck has other error :"
+ sis.getDestMobileAll()
+ " type : " + ordertype
+ " SeqID : "
+ sis.getSequenceId());
sis.setDesClientID(0);
// int stat = global.getSubmitQueue().put(sis);
return false;
}
} finally {
if (cno != null) {
// global.getObjPool().returnObject(cno);
}
if (cno == null) {
}
}
}
} catch (Exception e) {
return false;
} finally {
// if (cnb != null)
// global.getObjPool().returnObject(cnb);
}
return true;
}
protected void fail(){
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -