serviceorderselectaction.java
来自「基于Sturts+Spring+Hibernate的一个高级销售管理系统。内容丰」· Java 代码 · 共 139 行
JAVA
139 行
package com.yuanchung.sales.struts;
import java.util.List;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.ajaxtags.helpers.AjaxXmlBuilder;
import org.ajaxtags.servlets.BaseAjaxAction;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import com.yuanchung.sales.util.Constants;
public class ServiceOrderSelectAction extends BaseAjaxAction {
public String getXmlContent(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String fieldRequest = request.getParameter("field");
System.out.println("-----------------" + fieldRequest);
int field = Integer.parseInt(fieldRequest);
System.out.println("-----------------" + field);
List<String> cityList = new ArrayList<String>();
cityList.add(Constants.NONE);
switch (field) {
// 编号
case 1:
cityList.add(Constants.EQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 制单人
case 2:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 制单时间
case 3:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.GREATER);
cityList.add(Constants.LOWER);
cityList.add(Constants.GREATEROREQ);
cityList.add(Constants.LOWEROREQ);
break;
// 完成时间
case 4:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.GREATER);
cityList.add(Constants.LOWER);
cityList.add(Constants.GREATEROREQ);
cityList.add(Constants.LOWEROREQ);
break;
// 截止日期
case 5:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.GREATER);
cityList.add(Constants.LOWER);
cityList.add(Constants.GREATEROREQ);
cityList.add(Constants.LOWEROREQ);
break;
// 客户名称
case 6:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 联系人
case 7:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 问题类型
case 8:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 故障级别
case 9:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 来源
case 10:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 工程师
case 11:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 回访人
case 12:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
break;
// 回访时间
case 13:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.GREATER);
cityList.add(Constants.LOWER);
cityList.add(Constants.GREATEROREQ);
cityList.add(Constants.LOWEROREQ);
break;
// 状态
case 14:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
break;
}
// 该类用于辅助生成XML响应
AjaxXmlBuilder builder = new AjaxXmlBuilder();
for (String city : cityList) {
builder = builder.addItem(city, city);
}
System.out.println(builder);
return builder.toString();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?