项目编号:BS-XX-110
该系统采用SSH架构完成,主要对客户进行管理的系统!
运行环境
jdk7+tomcat7+mysql+eclipse4.5/IDEA
项目技术
spring+struts2+hibernate+html5+javascript
项目功能展示
登录页面
首页
销售管理
客户开发计划
客户信息管理
客户流失管理
服务管理
统计管理
数据字典管理
核心代码展示:
package com.crm.action;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.crm.dao.AdminDao;
import com.crm.entity.Admin;
import com.opensymphony.xwork2.ActionSupport;
public class AdminAction extends ActionSupport{
private Admin ad;
private AdminDao adao;
public Admin getAd() {
return ad;
}
public void setAd(Admin ad) {
this.ad = ad;
}
public AdminDao getAdao() {
return adao;
}
public void setAdao(AdminDao adao) {
this.adao = adao;
}
public String login(){
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession();
if(adao.Login(ad)){
session.setAttribute("admin",ad);
return "index";
}else{
request.setAttribute("msg", "<b>用户名密码有误!</b>");
return "login";
}
}
public String loginOut(){
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
HttpSession session = request.getSession();
session.invalidate();
String uri = request.getContextPath() + "/";
Cookie c = new Cookie("id","");
c.setPath(uri);
c.setMaxAge(0);
response.addCookie(c);
c = new Cookie("pwd","");
c.setPath(uri);
c.setMaxAge(0);
response.addCookie(c);
return "login";
}
}
package com.crm.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.crm.dao.FwglDao;
import com.crm.entity.Admin;
import com.crm.entity.Fuwuguanli;
import com.crm.entity.Zidian;
import com.opensymphony.xwork2.ActionSupport;
public class FwglAction extends ActionSupport{
private Fuwuguanli fwgl;
private FwglDao fwdao;
public Fuwuguanli getFwgl() {
return fwgl;
}
public void setFwgl(Fuwuguanli fwgl) {
this.fwgl = fwgl;
}
public FwglDao getFwdao() {
return fwdao;
}
public void setFwdao(FwglDao fwdao) {
this.fwdao = fwdao;
}
public String gotoadd(){
List<Zidian> d=fwdao.dengji();
HttpServletRequest req=ServletActionContext.getRequest();
req.setAttribute("zd", d);
return "fwgladd";
}
public String add(){
fwdao.save(fwgl);
return gotoadd();
}
public String findfwgl(){
List<Fuwuguanli> fwgl=fwdao.fwglxinxi();
List<Admin> a=fwdao.adminList();
HttpServletRequest req=ServletActionContext.getRequest();
req.setAttribute("fwgl", fwgl);
req.setAttribute("admin", a);
return "fwgl";
}
public String delfw(){
fwdao.delete(fwgl.getFwid());
return findfwgl();
}
public String fenpei(){
fwdao.fenpei(fwgl);
return findfwgl();
}
public String findfwcl(){
List<Fuwuguanli> fwcl=fwdao.fwclxinxi(fwgl);
HttpServletRequest req=ServletActionContext.getRequest();
req.setAttribute("fwcl", fwcl);
return "fwcl";
}
public String fwcldetail(){
Fuwuguanli fwcl=fwdao.fwcl(fwgl);
HttpServletRequest req=ServletActionContext.getRequest();
req.setAttribute("fwcl", fwcl);
return "fwcldetail";
}
public String fwcl(){
fwdao.gengxinfwcl(fwgl);
return findfwcl();
}
public String findfwfk(){
List<Fuwuguanli> fwfk=fwdao.fwfkxinxi(fwgl);
HttpServletRequest req=ServletActionContext.getRequest();
req.setAttribute("fwfk", fwfk);
return "fwfk";
}
public String fwfkdetail(){
Fuwuguanli fwfk=fwdao.fwfk(fwgl);
HttpServletRequest req=ServletActionContext.getRequest();
req.setAttribute("fwfk", fwfk);
return "fwfkdetail";
}
public String fwfk(){
int a = Integer.parseInt(fwgl.getManyidu());
if(a<3){
fwgl.setFwzhuangtai("已分配");
}else{
fwgl.setFwzhuangtai("已归档");
}
fwdao.gengxinfwfk(fwgl);
return findfwfk();
}
public String findfwgd(){
List<Fuwuguanli> fwgd=fwdao.fwgdxinxi(fwgl);
HttpServletRequest req=ServletActionContext.getRequest();
req.setAttribute("fwgd", fwgd);
return "fwgd";
}
public String fwgdList(){
Fuwuguanli fwgd=fwdao.fwgd(fwgl);
HttpServletRequest req=ServletActionContext.getRequest();
req.setAttribute("fwgd", fwgd);
return "fwgdList";
}
}