⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 customersaction.java

📁 简易的客服管理系统,采用easyJweb框架,实现简单的功能
💻 JAVA
字号:
package com.easycrm.asp.action;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;


import com.easycrm.asp.business.*;
import com.easyjf.util.CommUtil;
import com.easyjf.web.Module;
import com.easyjf.web.WebForm;
import com.easyjf.web.tools.DbPageList;
import com.easyjf.web.tools.IPageList;
public class CustomersAction extends BaseAction {
	
	
	public IPageList doQuery(WebForm form, int currentPage, int pageSize) {
		ActiveUser u=(ActiveUser)this.getCurrentUser(form);		
		String scope="belongDept=?";
		Collection paras=new ArrayList();		
		paras.add(u.getDept());
		
		
		String title=CommUtil.null2String(form.get("queryTitle"));		
		
		String sn=CommUtil.null2String(form.get("querySn"));		
		String dizhi=CommUtil.null2String(form.get("queryDizhi"));
		
		
		if(!title.equals(""))
		{
			scope+=" and title like ?";
			paras.add("%"+title+"%");
		}
		
		if(!sn.equals(""))
		{
			scope+=" and sn=?";
			paras.add(sn);
		}
		if(!dizhi.equals(""))
		{
			scope+=" and dizhi like ?";
			paras.add("%"+dizhi+"%");
		}
		
		String orderType=CommUtil.null2String(form.get("orderType"));
		String orderField=CommUtil.null2String(form.get("orderField"));			
		if(orderField.equals(""))
		{
		orderField="";
		orderType="desc";				
		}	
		if(!orderField.equals(""))
		{
		scope +=" order by "+orderField;
		if(!orderType.equals(""))scope+=" "+orderType;
		}
		DbPageList pList=new DbPageList(Customers.class,scope,paras);
		pList.doList(currentPage,pageSize);		
		return pList;
	}
	
	public Object form2Obj(WebForm form) {
		String cid=CommUtil.null2String(form.get("cid"));
		Customers obj=null;
		if(cid.equals(""))
		{
			obj=(Customers)form.toPo(Customers.class);
			obj.setRiqi(new Date());
			
			
		}
		else
		{
			obj=Customers.read(cid);
			form.toPo(obj);
		}		
		if(obj!=null)obj.setBelongDept(((ActiveUser)this.getCurrentUser(form)).getDept());			
		return obj;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -