?? manually_send.jsp
字號:
<jsp:directive.page import="com.easycolony.CommonUtil"/>
<jsp:directive.page import="com.easycolony.SpringUtil"/>
<jsp:directive.page import="com.easycolony.QueueDao"/><%@ include file="../tags.jsp"%>
<%
String filter = request.getParameter("filter");
String message = request.getParameter("message");
message = CommonUtil.base64Decode(message,"utf-8");
String sql = "";
String sqlPrefix = "select mobile from t_members_data where status=2 ";
String sqlFilter = "";
if(filter!=null && !"".equals(filter)){
filter = CommonUtil.base64Decode(request.getParameter("filter"),"utf-8");
String [] conditions = filter.split("#####");
for(int i=0;i< conditions.length; i++) {
String [] conditionSection = conditions[i].split(":::::");
String fieldName = conditionSection[0];
String fieldMatchValue = CommonUtil.base64Decode(conditionSection[1],"utf-8");
String fieldMatchOperator = conditionSection[2];
String sqlSect = "";
if(fieldMatchOperator.equals("deq")){
sqlSect = fieldName + "='" +fieldMatchValue.replaceAll("'","''")+"'";
}
else if(fieldMatchOperator.equals("dgt")){
sqlSect = fieldName + ">'" +fieldMatchValue.replaceAll("'","''")+"'";
}
else if(fieldMatchOperator.equals("dlt")){
sqlSect = fieldName + "<'" +fieldMatchValue.replaceAll("'","''")+"'";
}
else if(fieldMatchOperator.equals("neq")){
sqlSect = fieldName + "=" +fieldMatchValue.replaceAll("'","''");
}
else if(fieldMatchOperator.equals("ngt")){
sqlSect = fieldName + ">" +fieldMatchValue.replaceAll("'","''");
}
else if(fieldMatchOperator.equals("nlt")){
sqlSect = fieldName + "<" +fieldMatchValue.replaceAll("'","''");
}
else if(fieldMatchOperator.equals("teq")){
sqlSect = fieldName + "='" +fieldMatchValue.replaceAll("'","''")+"'";
}
else if(fieldMatchOperator.equals("tlike")){
sqlSect = fieldName + " like '%" +fieldMatchValue.replaceAll("'","''")+"%'";
}
if(!sqlSect.equals("")){
sqlFilter += " and "+ sqlSect;
}
}
}
sql = sqlPrefix + sqlFilter;
pageContext.setAttribute("sql",sql);
%>
<sql:query var="rs" scope="page" sql="${pageScope.sql }"></sql:query>
<%
StringBuffer mobileNumbers=new StringBuffer();
javax.servlet.jsp.jstl.sql.Result mobiles = (javax.servlet.jsp.jstl.sql.Result)
pageContext.getAttribute("rs");
java.util.Map [] rows = mobiles.getRows();
QueueDao queueDao = (QueueDao)SpringUtil.getBean(request,"queueDao");
int rowCount = mobiles.getRowCount();
int counter = 0;
for(int j=0;j<rowCount;j++){
java.util.Map row = rows[j];
counter ++;
if((rowCount-j)==1 || counter == QueueDao.MAX_BATCH_PHONE_NUMBERS){
mobileNumbers.append((String)row.get("mobile"));
queueDao.addMessageToQueue(mobileNumbers.toString(),message);
mobileNumbers = new StringBuffer();
counter = 0;
}else{
mobileNumbers.append((String)row.get("mobile")).append(";");
}
}
%>
<root>
<accept>true</accept>
</root>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -