📄 quaryaction.java
字号:
package com.xuntian.material.action.quary;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.xuntian.material.bean.ItemBean;
import com.xuntian.material.bean.MsgBean;
import com.xuntian.material.bean.entity.ItemEntity;
import com.xuntian.material.bean.entity.MsgEntity;
import com.xuntian.material.exception.BaseInfoException;
import com.xuntian.material.exception.ConnectPoolException;
import com.xuntian.material.model.service.BaseService;
import com.xuntian.material.model.service.baseinfo.MsgService;
import com.xuntian.material.model.service.quary.QuaryService;
import com.xuntian.material.sql.Dictionary;
import com.xuntian.material.struts.MAction;
public final class QuaryAction extends MAction {
/**
* author zym
*/
public ActionForward head(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws BaseInfoException {
request.setAttribute("search.item",getOragMap(request));
return mapping.findForward("head");
}
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws BaseInfoException {
BaseService service = new QuaryService();
List<List<String>> data=service.search(form);
request.setAttribute("search.quary.data",data);
return mapping.findForward("list");
}
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws BaseInfoException {
return mapping.findForward("add");
}
public ActionForward edit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws BaseInfoException {
return mapping.findForward("edit");
}
public ActionForward save(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws BaseInfoException {
return null;
}
public ActionForward delete(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws BaseInfoException {
return null;
}
public ActionForward detail(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws BaseInfoException {
BaseService itemService = new QuaryService();
itemService.fill(form);
return mapping.findForward("detail");
}
protected Map<Integer,String> getOragMap(HttpServletRequest request) {
Map<Integer, String> clsMap = new HashMap<Integer, String>();
try {
List<ItemBean> items = new ItemEntity(null).queryList();
for(ItemBean item:items){
clsMap.put(new Integer(item.getItemID()),item.getItemName());
}
} catch (ConnectPoolException e) {
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return clsMap;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -