package com.crm.cust.action;
import com.crm.common.entity.CstActivity;
import com.crm.common.entity.CstCustomer;
import com.crm.common.entity.CstLinkman;
import com.crm.common.entity.OrderLine;
import com.crm.common.entity.Orders;
import com.crm.cust.biz.ActivityBiz;
import com.crm.cust.biz.CustomerBiz;
import com.crm.cust.biz.LinkmanBiz;
import com.crm.cust.biz.OrdersBiz;
import com.crm.util.Page;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
/**
* 客户信息管理action
*
* @author 邓华骏
*
*/
public class CustomerAction extends ActionSupport {
HttpServletResponse response = ServletActionContext.getResponse();
/**
*
*/
private static final long serialVersionUID = -1771604123774212904L;
@SuppressWarnings("unchecked")
private List customerList;// 列表
private String id;//
private String cust_No;
@SuppressWarnings("unchecked")
private List dictList;
CstCustomer customer = new CstCustomer();
CstLinkman linkman = new CstLinkman();
CstActivity activity = new CstActivity();
Orders orders = new Orders();
OrderLine line=new OrderLine();
private CustomerBiz customerBiz;
private LinkmanBiz linkmanBiz;
private ActivityBiz activityBiz;
private OrdersBiz ordersBiz;
private Page page;
public CustomerAction() {
page = new Page();
}
/**
* 转向客户信息页面
*
* @return 客户信息页面字符串
* @throws Exception
*/
@SuppressWarnings("unchecked")
public String toList() throws Exception {
dictList = this.customerBiz.getList("from BasDic"
+ "t dict where dict.dictType='地区'");
List list = customerBiz.searchPage(page, null);
page.setTotalRow(this.customerBiz.getCount(null));
page.setPageList(list);
return "list";
}
@SuppressWarnings("unchecked")
public String doList() throws Exception {
dictList = this.customerBiz.getList("from BasDic"
+ "t dict where dict.dictType='地区'");
List list = customerBiz.searchPage(page, customer);
page.setTotalRow(this.customerBiz.getCount(customer));
page.setPageList(list);
return "list";
}
/**
* 转向编辑客户信息页面
*
* @return 编辑客户信息页面字符串
* @throws Exception
*/
public String toEdit() throws Exception {
dictList = this.customerBiz.getList("from BasDic"
+ "t dict where dict.dictType='地区'");
customer = customerBiz.loadCstCustomer(id);
return "edit";
}
/**
* 修改客户信息
*
* @return 成功:success页面, 失败:error页面,否则:404页面
* @throws Exception
*/
public String doEdit() throws Exception {
boolean flag = customerBiz.updateCstCustomer(customer);
if (flag) {
response
.getWriter()
.write(
"<script>location.href='cust_customer_toList.action'</script>");
} else {
response.getWriter().write(
"<script>alert('修改客户信息失败!');location.go(-1)</script>");
}
return null;
}
/**
* 删除客户信息
*
* @return 成功:success页面, 失败:error页面,否则:404页面
* @throws Exception
*/
public String doDeleteList() throws Exception {
boolean flag = true;
customer.setCustNo(id);
CstCustomer cust = this.customerBiz.loadCstCustomer(id);
//cust.setCustStatus("1");
//flag = customerBiz.updateCstCustomer(cust);
flag=customerBiz.delCstCustomer(cust);
if (flag) {
response
.getWriter()
.write(
"<script>location.href='cust_customer_toList.action'</script>");
} else {
response.getWriter().write(
"<script>alert('删除客户信息失败!');location.go(-1)</script>");
}
return null;
}
/**
* 转向联系人信息页面
*
* @return 联系人信息页面字符串
* @throws Exception
*/
public String toLinkman() throws Exception {
customer = customerBiz.loadCstCustomer(id);// 加载客户信息
customerList = linkmanBiz.searchAll(linkman, id);// 根据得到的客户编号查询客户的联系人信息
return "linkman";
}
/**
* 转向编辑联系人信息页面
*
* @return 编辑联系人信息页面字符串
* @throws Exception
*/
public String toLinkman_edit() throws Exception {
linkman = linkmanBiz.getCstLinkmanById(Integer.parseInt(id));
return "linkman_edit";
}
/**
* 更新联系人信息
*
* @return
* @throws Exception
*/
public String doLinkman_edit() throws Exception {
customer.setCustNo(id);
linkman.setCstCustomer(customer);//把编号封装到linkman实体对中
boolean flag = linkmanBiz.updateCstLinkman(linkman);
if (flag) {
response.getWriter().write(
"<script>location.href='cust_customer_toLinkman.action?id="
+ id + "'</script>");
} else {
response.getWriter().write(
"<script>alert('更新联系人信息失败!');location.go(-1)</script>");
}
return null;
}
/**
* 执行删除联系人操作
*
* @return 联系人信息页面字符串
* @throws Exception
*/
public String doDelLinkman() throws Exception {
boolean flag = linkmanBiz.delCstLinkman(Integer.parseInt(id));
if (flag) {
response.getWriter().write(
"<script>location.href='cust_customer_toLinkman.action?id="
+ cust_No + "'</script>");
} else {
response.getWriter().write(
"<script>alert('删除联系人失败!');location.go(-1)</script>");
}
return null;
}
/**
* 转向新建联系人信息页面
*
* @return 联系人信息页面字符串
* @throws Exception
*/
public String toLinkman_add() throws Exception {
HttpServletRequest request = (HttpServletRequest) ActionContext
.getContext().get(ServletActionContext.HTTP_REQUEST);
String custNo = request.getParameter("id");
request.setAttribute("custNo", custNo);
return "linkman_add";
}
/**
* 增加联系人
*
* @return
* @throws Exception
*/
public String doLinkman_add() throws Exception {
customer.setCustNo(id);
linkman.setCstCustomer(customer);
boolean flag = linkmanBiz.addCstLinkman(linkman);
if (flag) {
response.getWriter().write(
"<script>location.href='cust_customer_toLinkman.action?id="
+ id + "'</script>");
} else {
response.getWriter().write(
"<script>alert('增加联系人失败!');location.go(-1)</script>");
}
return null;
}
/**
* 转向交往记录信息页面
*
* @return 交往记录信息页面字符串
* @throws Exception
*/
public String toActivities() throws Exception {
customer = customerBiz.loadCstCustomer(id);// 加载客户信息
customerList = activityBiz.searchAll(activity, id);
return "activities";
}
/**
* 转向编辑交往记录页面
*
* @return 编辑交往记录页面字符串
* @throws Exception
*/
public String toActivities_edit() throws Exception {
activity = activityBiz.getCstActivityById(Integer.parseInt(id));
return "activities_edit";
}
/**
* 更新交往记录的信息
*
* @return
* @throws Exception
*/
public String doActivities_edit() throws Exception {
customer.setCustNo(id);
activity.setCstCustomer(customer);
boolean flag = activityBiz.updateCstActivity(activity);
if (flag) {
response.getWriter().write(
"<script>location.href='cust_customer_toActivities.action?id="
+ id + "'</script>");
} else {
response.getWriter().write(
"<script>alert('更新交往记录信息失败!');location.go(-1)</script>");
}
return null;
}
/**
* 执行删除交往记录
*
* @return 交往记录页面字符串
* @throws Exception
*/
public String doDelActivities() throws Exception {
boolean flag = activityBiz.delCstActivity(Integer.parseInt(id));
if (flag) {
response.getWriter().write(
"<script>location.href='cust_customer_toActivities.action?id="
+ cust_No + "'</script>");
} else {
response.getWriter().write(
"<script>alert('删除交往记录失败!');location.go(-1)</script>");
}
return null;
}
/**
* �
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
java项目 客户关系管理系统(crm) (517个子文件)
CustomerAction.class 11KB
PlanAction.class 10KB
CstCustomer.class 8KB
RoleAction.class 7KB
ServiceAction.class 7KB
ChanceAction.class 6KB
UserManagerAction.class 6KB
CstService.class 6KB
BasdAction.class 6KB
UserAction.class 6KB
ReptDaoImpl.class 6KB
ReptAction.class 5KB
SalChance.class 5KB
CreateExcelBizImpl.class 5KB
CustomerDaoImpl.class 4KB
RoleBizImpl.class 4KB
ExcelInfoBizImpl.class 4KB
PlanDaoImpl.class 4KB
LostAction.class 4KB
BaseHibernateDAO.class 4KB
RoleDaoImpl.class 4KB
ServiceDaoImpl.class 4KB
ExcelCstCustomerAction.class 4KB
ExcelContributeAction.class 4KB
ExcelCstLostAction.class 4KB
ExcelCstServiceAction.class 4KB
ChanceDaoImpl.class 4KB
CstLost.class 4KB
BasdDaoImpl.class 4KB
UserBizImpl.class 3KB
UserDaoImpl.class 3KB
RightInterceptor.class 3KB
ChanceBizImpl.class 3KB
LostDaoImpl.class 3KB
Product.class 3KB
ReptBizImpl.class 3KB
CstLinkman.class 3KB
BasdBizImpl.class 3KB
VerifyCode.class 3KB
StorageDaoImple.class 3KB
PlanBizImpl.class 3KB
CstActivity.class 3KB
ProductDaoImple.class 3KB
CustomerBizImpl.class 2KB
CodeImageServlet.class 2KB
ServiceBizImpl.class 2KB
SysRole.class 2KB
SysUser.class 2KB
OrderLine.class 2KB
LinkmanDaoImpl.class 2KB
ExcelBizImpl.class 2KB
Orders.class 2KB
Page.class 2KB
Storage.class 2KB
SysRight.class 2KB
ActivityDaoImpl.class 2KB
RoleTest.class 2KB
ActivityBizImpl.class 2KB
UserTest.class 2KB
SalPlan.class 2KB
OrdersDaoImpl.class 2KB
LinkmanBizImpl.class 2KB
LostBizImpl.class 2KB
OrdersBizImpl.class 2KB
BasDict.class 2KB
StorageBizImple.class 2KB
ProductBizImple.class 1KB
MD5Util.class 1KB
SetCharacterEncodingFilter.class 1KB
CustomerTest.class 1KB
TimeTool.class 1KB
SysRoleRight.class 1KB
ReptDao.class 858B
ReptBiz.class 855B
HtmlUtil.class 812B
RoleBiz.class 725B
RoleDao.class 722B
ExcelBiz.class 720B
CustomerDao.class 638B
ReptTest.class 627B
GlobalsConstUtil.class 625B
ChanceBiz.class 625B
ChanceDao.class 605B
CreateExcelBiz.class 601B
PlanDao.class 598B
CustomerBiz.class 574B
PlanBiz.class 571B
UserBiz.class 562B
BasdBiz.class 541B
ServiceDao.class 534B
ServiceBiz.class 534B
ActivityBiz.class 530B
BasdDao.class 521B
LinkmanDao.class 519B
LinkmanBiz.class 519B
LostDao.class 513B
LostBiz.class 513B
UserDao.class 505B
ActivityDao.class 505B
OrdersDao.class 452B
共 517 条
- 1
- 2
- 3
- 4
- 5
- 6
ddsheng1128
- 粉丝: 25
- 资源: 37
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页