package com.accp.crm.action;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.RequestAware;
import org.hibernate.HibernateException;
import com.accp.crm.biz.CustInfoBiz;
import com.accp.crm.biz.ServiceBiz;
import com.accp.crm.biz.SetypeBiz;
import com.accp.crm.biz.UsersBiz;
import com.accp.crm.pojo.CustInfo;
import com.accp.crm.pojo.Custlost;
import com.accp.crm.pojo.Service;
import com.accp.crm.pojo.Setype;
import com.accp.crm.pojo.Users;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
@SuppressWarnings("serial")
public class ServiceAction extends ActionSupport implements ModelDriven<Service>, RequestAware {
private Map<String, Object> request;
@Override
public void setRequest(Map<String, Object> request) {
this.request = request;
}
private Service service = new Service();
@Override
public Service getModel() {
return service;
}
private UsersBiz usersBiz;
private ServiceBiz serviceBiz;
private CustInfoBiz custInfoBiz;
public void setCustInfoBiz(CustInfoBiz custInfoBiz) {
this.custInfoBiz = custInfoBiz;
}
public void setUsersBiz(UsersBiz usersBiz) {
this.usersBiz = usersBiz;
}
public void setServiceBiz(ServiceBiz serviceBiz) {
this.serviceBiz = serviceBiz;
}
private SetypeBiz setypeBiz;
public void setSetypeBiz(SetypeBiz setypeBiz) {
this.setypeBiz = setypeBiz;
}
//新创建服务获取客户名称和服务类型
public String showUnameStype(){
try{
List<Setype> Stypelist = setypeBiz.selectAllSetype();
List<CustInfo> custlist = custInfoBiz.selectAllcuInfo();
request.put("Stypelist", Stypelist);
request.put("custlist", custlist);
return "showUnameStype";
}catch(HibernateException e){
e.printStackTrace();
return "error";
}
//
// List<Setype> Stypelist = setypeBiz.selectAllSetype();
//
// request.put("Stypelist", Stypelist);
// return "showUnameStype";
}
/**
* 执行添加服务
* @return
*/
public String add(){
// try{
// String status = "新创建";
// service.setStatus(status);
// serviceBiz.add(service);
// return "add";
// }catch(HibernateException e){
// e.printStackTrace();
// return "error";
// }
String status = "新创建";
service.setStatus(status);
serviceBiz.add(service);
service.setSrequest("");
service.setCustname("");
service.setTitle("");
return showUnameStype();
}
/**
* 分页查询第一页
* @return
*/
public String firstPage(){
try{
int total = serviceBiz.total("Service",service);
int totalPage = serviceBiz.totalPage(5, "Service",service);
List<Service> list = serviceBiz.selectByPage("Service", 1, 5,service);
List<Users> ulist = usersBiz.selectByRoleId(7);//7代表客服ID 查询所有客服姓名
request.put("ulist", ulist);
request.put("total", total);
request.put("list", list);
request.put("totalPage", totalPage);
request.put("currentPage", 1);
if(list.size() == 0){
request.put("mess", "查无记录");
}
return "firstPage";
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 分页查询下一页
* @return
*/
public String nextPage(){
int next = Integer.parseInt(ServletActionContext.getRequest().getParameter("next"));
try{
int total = serviceBiz.total("Service",service);
int totalPage = serviceBiz.totalPage(5, "Service",service);
List<Service> list = serviceBiz.selectByPage("Service", next, 5,service);
List<Users> ulist = usersBiz.selectByRoleId(7);//7代表客服ID 查询所有客服姓名
request.put("ulist", ulist);
request.put("total", total);
request.put("list", list);
request.put("totalPage", totalPage);
request.put("currentPage", next);
if(list.size() == 0){
request.put("mess", "查无记录");
}
return "nextPage";
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 分配服务处理
* @return
*/
public String dispatch(){
int sid = Integer.parseInt(ServletActionContext.getRequest().getParameter("sid"));
Service service = serviceBiz.selectById(sid);
Date duetime = new Date();
service.setDuetime(duetime);
service.setDueto(duer);
service.setStatus("已分配");
try{
serviceBiz.update(service);
service.setCustname("");
service.setTitle("");
service.setType("");
service.setCreatedate("");
service.setStatus("");
return allotfirstPage();
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 转向处理页面
* @return
*/
public String toDeal(){
int sid = Integer.parseInt(ServletActionContext.getRequest().getParameter("sid"));
try{
Service service = serviceBiz.selectById(sid);
request.put("service", service);
return "toDeal";
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 处理服务
* @return
*/
public String deal(){
int sid = Integer.parseInt(ServletActionContext.getRequest().getParameter("sid"));
Service service = serviceBiz.selectById(sid);
service.setSdeal(deal);
service.setDealdate(dealTime);
service.setDealer(dealby);
service.setStatus("已处理");
try{
serviceBiz.update(service);
service.setCustname("");
service.setTitle("");
service.setType("");
service.setCreatedate("");
service.setStatus("");
return distributefirstPage();
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 转向反馈页面
* @return
*/
public String toBack(){
int sid = Integer.parseInt(ServletActionContext.getRequest().getParameter("sid"));
try{
Service service = serviceBiz.selectById(sid);
request.put("service", service);
return "toBack";
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 处理反馈服务
* @return
*/
public String back(){
int sid = Integer.parseInt(ServletActionContext.getRequest().getParameter("sid"));
Service service = serviceBiz.selectById(sid);
service.setResult(sresult);
service.setSatisfy(ssatisfy);
if(service.getSatisfy().equals("☆☆")||service.getSatisfy().equals("☆")){
service.setStatus("已分配");
}else {
service.setStatus("已归档");
}
try{
serviceBiz.update(service);
service.setCustname("");
service.setTitle("");
service.setType("");
service.setCreatedate("");
service.setStatus("");
return feedbackfirstPage();
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 转向明细页面
* @return
*/
public String toDetail(){
int sid = Integer.parseInt(ServletActionContext.getRequest().getParameter("sid"));
try{
Service service = serviceBiz.selectById(sid);
request.put("service", service);
return "toDetail";
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 删除服务
* @return
*/
public String delete(){
int sid = Integer.parseInt(ServletActionContext.getRequest().getParameter("sid"));
try{
Service service = serviceBiz.selectById(sid);
serviceBiz.delete(service);
return allotfirstPage();
}catch (HibernateException e) {
e.printStackTrace();
return "error";
}
}
/**
* 统计新创建服务分页显示第一页
* @return
*/
public String allotfirstPage(){
// String custname = ServletActionContext.getRequest().getParameter("custname");
// String title = ServletActionContext.getRequest().getParameter("title");
//Service service = new Service();
//service.setCustname(custname);
//service.setTitle(title)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
导入项目后如果出现antlr-2.7.2.jar 和 antlr-2.7.6.jar 包冲突,请自行网络搜索解决, 数据库名 orcl 用户名 jiang 密码 jiang myeclipse 8.6 oracle10g tomcat 6.0 java 1.7 会用到的拓展jar包jfreechart.jar、poi.jar、itext.jar等都集成在lib文件夹里 系统登录管理员 用户名 admin 密码 admin unit_4_myhome.sql 这个为plsql导出的数据库文件,包括了需要用到的表和需要用到的序列, 导入的时候建议选用plsql的“工具”的“导入表”方式导入. 实现了统计图功能,分页子查询功能,生成excel文件功能,生成图文PDF文件等功能
资源推荐
资源详情
资源评论
收起资源包目录
北大青鸟 四单元 客户关系管理 系统 (566个子文件)
imgdefault.bmp 1KB
ServiceAction.class 13KB
ReptAction.class 10KB
PictypeAction.class 9KB
PicseAction.class 9KB
SalePlanAction.class 9KB
PdftypeAction.class 8KB
PdftotalAction.class 8KB
PdfseAction.class 8KB
ServiceDaoImpl.class 6KB
UsersAction.class 6KB
CustInfo.class 6KB
ServiceBizImpl.class 5KB
OrdersAction.class 5KB
SaleChanceAction.class 5KB
LostAction.class 5KB
CustInfoAction.class 5KB
RoleAction.class 5KB
DictionaryAction.class 5KB
OrdersDaoImpl.class 4KB
Service.class 4KB
CuregionAction.class 4KB
CulevelAction.class 4KB
SetypeAction.class 4KB
ActivityAction.class 4KB
LinkmanAction.class 4KB
SaleChance.class 4KB
CustInfoDaoImpl.class 3KB
CustInfoBizImpl.class 3KB
RoleBizImpl.class 3KB
StorageAction.class 3KB
ProductAction.class 3KB
SaleChanceBizImpl.class 3KB
UsersBizImpl.class 3KB
SaleChanceDaoImpl.class 3KB
OrdersBizImpl.class 3KB
LostDaoImpl.class 3KB
CuregionBizImpl.class 3KB
DictionaryBizImpl.class 3KB
CulevelBizImpl.class 3KB
SetypeBizImpl.class 3KB
Custlost.class 3KB
LostBizImpl.class 3KB
UsersDaoImpl.class 3KB
Linkman.class 2KB
BaseDaoImpl.class 2KB
DictionaryDaoImpl.class 2KB
Activity.class 2KB
Product.class 2KB
SalePlanDaoImpl.class 2KB
ActivityDaoImpl.class 2KB
LinkmanDaoImpl.class 2KB
Storage.class 2KB
ProductBizImpl.class 2KB
Orders.class 2KB
RoleInterceptor.class 2KB
CuregionDaoImpl.class 2KB
CulevelDaoImpl.class 2KB
RoleDaoImpl.class 2KB
SetypeDaoImpl.class 2KB
SalePlan.class 2KB
Orderdetail.class 2KB
Dictionary.class 2KB
StorageBizImpl.class 2KB
Users.class 2KB
SalePlanBizImpl.class 2KB
PowerDaoImpl.class 1KB
ProductDaoImpl.class 1KB
ActivityBizImpl.class 1KB
LinkmanBizImpl.class 1KB
Test.class 1KB
OrderdetailDaoImpl.class 1KB
Role.class 1KB
Power.class 1KB
ServiceBiz.class 1KB
Culevel.class 933B
OrdersBiz.class 930B
Curegion.class 924B
Setype.class 900B
OrderdetailBizImpl.class 875B
DictionaryBiz.class 874B
CustInfoBiz.class 864B
OrdersDao.class 847B
RoleBiz.class 823B
UsersBiz.class 811B
ServiceDao.class 771B
CuregionBiz.class 735B
CulevelBiz.class 724B
SetypeBiz.class 713B
CustInfoDao.class 673B
SalePlanDao.class 632B
SalePlanBiz.class 600B
SaleChanceBiz.class 594B
UsersDao.class 590B
DictionaryDao.class 556B
LostBiz.class 540B
ProductBiz.class 531B
SaleChanceDao.class 497B
CuregionDao.class 493B
CulevelDao.class 487B
共 566 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
- 七画杀2016-10-07谢谢,很有帮助
- jean52013142015-05-08非常可以,值得学习
jkjzq
- 粉丝: 2
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功