基于javaweb和mysql的ssm客户管理系统(java+ssm+jsp+easyui+highcharts+mysql)
·
基于javaweb和mysql的ssm客户管理系统(java+ssm+jsp+easyui+highcharts+mysql)
私信源码获取及调试交流
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM客户管理系统(java+ssm+jsp+easyui+highcharts+mysql)
项目介绍
本项目包含管理员、销售主管、客户经理、高管等角色;
主要包含以下功能: 营销管理:营销机会管理、客户开发计划; 客户管理:客户信息管理、客户流失管理; 服务管理:服务创建、服务分配、服务处理、服务反馈、服务归档; 统计报表:客户贡献分析、客户构成分析、客户服务分析、客户流失分析; 基础数据管理:数据字典管理、产品信息查询、用户信息管理; 系统管理:修改密码、安全退出;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7/8.0等版本均可;
技术栈
- 后端:Spring springmvc mybatis 2. 前端:JSP+css+javascript+jQuery+easyUI+highcharts
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目; 3. 将项目中applicationContext.xml配置文件中的数据库配置改为自己的配置,然后运行; 4. 运行成功后,在浏览器中输入:http://localhost:8080/CRM/ 管理员账号密码:admin/123 销售主管账号密码:json1234/123 客户经理账号密码:xiaoming/123
if(resultTotal>0){
result.put("success", true);
}else{
result.put("success", false);
}
ResponseUtil.write(response, result);
return null;
}
/**
* 删除客户
* @param ids
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/delete")
public String delete(@RequestParam(value="ids")String ids,HttpServletResponse response)throws Exception{
String []idsStr=ids.split(",");
for(int i=0;i<idsStr.length;i++){
customerService.delete(Integer.parseInt(idsStr[i]));
}
JSONObject result=new JSONObject();
result.put("success", true);
ResponseUtil.write(response, result);
return null;
}
/**
* 通过ID查找实体
* @param id
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/findById")
public String findById(@RequestParam(value="id")String id,HttpServletResponse response)throws Exception{
Customer customer=customerService.findById(Integer.parseInt(id));
JSONObject jsonObject=JSONObject.fromObject(customer);
ResponseUtil.write(response, jsonObject);
return null;
}
/**
* 查询客户分析贡献
* @param page
* @param rows
*/
@RequestMapping("/delete")
public String delete(@RequestParam(value="ids")String ids,HttpServletResponse response)throws Exception{
String []idsStr=ids.split(",");
for(int i=0;i<idsStr.length;i++){
customerService.delete(Integer.parseInt(idsStr[i]));
}
JSONObject result=new JSONObject();
result.put("success", true);
ResponseUtil.write(response, result);
return null;
}
/**
* 通过ID查找实体
* @param id
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/findById")
public String findById(@RequestParam(value="id")String id,HttpServletResponse response)throws Exception{
Customer customer=customerService.findById(Integer.parseInt(id));
JSONObject jsonObject=JSONObject.fromObject(customer);
ResponseUtil.write(response, jsonObject);
return null;
}
/**
* 查询客户分析贡献
* @param page
* @param rows
* @param s_customer
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/findCustomerGx")
public String findCustomerGx(@RequestParam(value="page",required=false)String page,@RequestParam(value="rows",required=false)String rows,String name,HttpServletResponse response)throws Exception{
PageBean pageBean=new PageBean(Integer.parseInt(page),Integer.parseInt(rows));
Map<String,Object> map=new HashMap<String,Object>();
map.put("name", StringUtil.formatLike(name));
map.put("start", pageBean.getStart());
map.put("size", pageBean.getPageSize());
List<CustomerGx> customerGxList=customerService.findCustomerGx(map);
Long total=customerService.getTotalCustomerGx(map);
JSONObject result=new JSONObject();
JSONArray jsonArray=JSONArray.fromObject(customerGxList);
/**
* 客户流失Controller层
*
*/
@Controller
@RequestMapping("/customerLoss")
public class CustomerLossController {
@Resource
private CustomerLossService customerLossService;
/**
* 分页条件查询客户流失
* @param page
* @param rows
* @param s_customerLoss
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/list")
public String list(@RequestParam(value="page",required=false)String page,@RequestParam(value="rows",required=false)String rows,CustomerLoss s_customerLoss,HttpServletResponse response)throws Exception{
PageBean pageBean=new PageBean(Integer.parseInt(page),Integer.parseInt(rows));
Map<String,Object> map=new HashMap<String,Object>();
map.put("cusName", StringUtil.formatLike(s_customerLoss.getCusName()));
map.put("cusManager", StringUtil.formatLike(s_customerLoss.getCusManager()));
map.put("state", s_customerLoss.getState());
map.put("start", pageBean.getStart());
map.put("size", pageBean.getPageSize());
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/delete")
public String delete(@RequestParam(value="ids")String ids,HttpServletResponse response)throws Exception{
String []idsStr=ids.split(",");
for(int i=0;i<idsStr.length;i++){
customerService.delete(Integer.parseInt(idsStr[i]));
}
JSONObject result=new JSONObject();
result.put("success", true);
ResponseUtil.write(response, result);
return null;
}
/**
* 通过ID查找实体
* @param id
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/findById")
public String findById(@RequestParam(value="id")String id,HttpServletResponse response)throws Exception{
Customer customer=customerService.findById(Integer.parseInt(id));
JSONObject jsonObject=JSONObject.fromObject(customer);
ResponseUtil.write(response, jsonObject);
return null;
}
/**
* 查询客户分析贡献
* @param page
* @param rows
* @param s_customer
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/findCustomerGx")
public String findCustomerGx(@RequestParam(value="page",required=false)String page,@RequestParam(value="rows",required=false)String rows,String name,HttpServletResponse response)throws Exception{
PageBean pageBean=new PageBean(Integer.parseInt(page),Integer.parseInt(rows));
Map<String,Object> map=new HashMap<String,Object>();
map.put("name", StringUtil.formatLike(name));
map.put("start", pageBean.getStart());
map.put("size", pageBean.getPageSize());
List<CustomerGx> customerGxList=customerService.findCustomerGx(map);
Long total=customerService.getTotalCustomerGx(map);
Map<String,Object> map=new HashMap<String,Object>();
map.put("cusId", cusId);
map.put("start", pageBean.getStart());
map.put("size", pageBean.getPageSize());
List<Order> orderList=orderService.find(map);
JsonConfig jsonConfig=new JsonConfig();
jsonConfig.setExcludes(new String[]{"order"});
jsonConfig.registerJsonValueProcessor(java.util.Date.class, new DateJsonValueProcessor("yyyy-MM-dd"));
JSONObject result=new JSONObject();
Long total=orderService.getTotal(map);
JSONArray jsonArray=JSONArray.fromObject(orderList,jsonConfig);
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(response, result);
return null;
}
/**
* 通过ID查找实体
* @param id
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/findById")
public String findById(@RequestParam(value="id")String id,HttpServletResponse response)throws Exception{
Order order=orderService.findById(Integer.parseInt(id));
JsonConfig jsonConfig=new JsonConfig();
jsonConfig.setExcludes(new String[]{"order"});
jsonConfig.registerJsonValueProcessor(java.util.Date.class, new DateJsonValueProcessor("yyyy-MM-dd"));
JSONObject jsonObject=JSONObject.fromObject(order,jsonConfig);
ResponseUtil.write(response, jsonObject);
return null;
}
}
ResponseUtil.write(response, result);
return null;
}
/**
* 修改客户开发状态
* @param id
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/updateSaleChanceDevResult")
public String updateSaleChanceDevResult(@RequestParam(value="id")String id,@RequestParam(value="devResult")String devResult,HttpServletResponse response)throws Exception{
SaleChance saleChance=new SaleChance();
saleChance.setId(Integer.parseInt(id));
saleChance.setDevResult(Integer.parseInt(devResult));
int resultTotal=saleChanceService.update(saleChance);
JSONObject result=new JSONObject();
if(resultTotal>0){
result.put("success", true);
}else{
result.put("success", false);
}
ResponseUtil.write(response, result);
return null;
}
}
/**
*/
@Controller
@RequestMapping("/cusDevPlan")
public class CusDevPlanController {
@Resource
private CusDevPlanService cusDevPlanService;
@Resource
private SaleChanceService saleChanceService;
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); //true:允许输入空值,false:不能为空值
}
/**
* 分页条件查询客户开发计划
* @param page
* @param rows
* @param s_cusDevPlan
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/list")
public String list(@RequestParam(value="saleChanceId",required=false)String saleChanceId,HttpServletResponse response)throws Exception{
Map<String,Object> map=new HashMap<String,Object>();
map.put("saleChanceId", saleChanceId);
List<CusDevPlan> cusDevPlanList=cusDevPlanService.find(map);
JSONObject result=new JSONObject();
JsonConfig jsonConfig=new JsonConfig();
jsonConfig.setExcludes(new String[]{"saleChance"});
jsonConfig.registerJsonValueProcessor(java.util.Date.class, new DateJsonValueProcessor("yyyy-MM-dd"));
JSONArray jsonArray=JSONArray.fromObject(cusDevPlanList,jsonConfig);
result.put("rows", jsonArray);
ResponseUtil.write(response, result);
return null;
public String customerManagerComboList(HttpServletResponse response)throws Exception{
Map<String,Object> map=new HashMap<String,Object>();
map.put("roleName", "客户经理");
List<User> userList=userService.find(map);
JSONArray row=JSONArray.fromObject(userList);
ResponseUtil.write(response, row);
return null;
}
/**
* 添加或者修改用户
* @param user
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/save")
public String save(User user,HttpServletResponse response)throws Exception{
int resultTotal=0; // 操作的记录条数
if(user.getId()==null){
resultTotal=userService.add(user);
}else{
resultTotal=userService.update(user);
}
JSONObject result=new JSONObject();
if(resultTotal>0){
result.put("success", true);
}else{
result.put("success", false);
}
ResponseUtil.write(response, result);
return null;
}
/**
* 删除用户
* @param ids
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/delete")
public String delete(@RequestParam(value="ids")String ids,HttpServletResponse response)throws Exception{
String []idsStr=ids.split(",");
for(int i=0;i<idsStr.length;i++){
userService.delete(Integer.parseInt(idsStr[i]));
}
/**
* 客户Controller层
*
*/
@Controller
@RequestMapping("/customer")
public class CustomerController {
@Resource
private CustomerService customerService;
/**
* 分页条件查询客户
* @param page
* @param rows
* @param s_customer
/**
* 订单Controller层
*
*/
@Controller
@RequestMapping("/order")
public class OrderController {
@Resource
private OrderService orderService;
/**
* 分页条件查询订单
* @param page
* @param rows
* @param s_order
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/list")
public String list(@RequestParam(value="page",required=false)String page,@RequestParam(value="rows",required=false)String rows,@RequestParam(value="cusId",required=false)String cusId,HttpServletResponse response)throws Exception{
PageBean pageBean=new PageBean(Integer.parseInt(page),Integer.parseInt(rows));
Map<String,Object> map=new HashMap<String,Object>();
map.put("cusId", cusId);
map.put("start", pageBean.getStart());
map.put("size", pageBean.getPageSize());
List<Order> orderList=orderService.find(map);
JsonConfig jsonConfig=new JsonConfig();
jsonConfig.setExcludes(new String[]{"order"});
jsonConfig.registerJsonValueProcessor(java.util.Date.class, new DateJsonValueProcessor("yyyy-MM-dd"));
JSONObject result=new JSONObject();
Long total=orderService.getTotal(map);
JSONArray jsonArray=JSONArray.fromObject(orderList,jsonConfig);
result.put("rows", jsonArray);
ResponseUtil.write(response, jsonArray);
return null;
}
}
/**
* 销售机会Controller层
*
*/
@Controller
@RequestMapping("/saleChance")
public class SaleChanceController {
@Resource
private SaleChanceService saleChanceService;
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
result.put("success", false);
}
ResponseUtil.write(response, result);
return null;
}
}
/**
* 数据字典Controller层
*
*/
@Controller
@RequestMapping("/dataDic")
public class DataDicController {
@Resource
private DataDicService dataDicService;
/**
* 分页条件查询数据字典
* @param page
*
*/
@Controller
@RequestMapping("/user")
public class UserController {
@Resource
private UserService userService;
/**
* 用户登录
* @param user
* @param request
* @return
* @throws Exception
*/
@RequestMapping("/login")
public String login(User user,HttpServletRequest request)throws Exception{
User resultUser=userService.login(user);
if(resultUser==null){
request.setAttribute("user", user);
request.setAttribute("errorMsg", "用户名或密码错误!");
return "login";
}else{
HttpSession session=request.getSession();
session.setAttribute("currentUser", resultUser);
return "redirect:/main.jsp";
}
}
/**
* 分页条件查询用户
* @param page
* @param rows
* @param s_user
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/list")
public String list(@RequestParam(value="page",required=false)String page,@RequestParam(value="rows",required=false)String rows,User s_user,HttpServletResponse response)throws Exception{
PageBean pageBean=new PageBean(Integer.parseInt(page),Integer.parseInt(rows));
* @throws Exception
*/
@RequestMapping("/login")
public String login(User user,HttpServletRequest request)throws Exception{
User resultUser=userService.login(user);
if(resultUser==null){
request.setAttribute("user", user);
request.setAttribute("errorMsg", "用户名或密码错误!");
return "login";
}else{
HttpSession session=request.getSession();
session.setAttribute("currentUser", resultUser);
return "redirect:/main.jsp";
}
}
/**
* 分页条件查询用户
* @param page
* @param rows
* @param s_user
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/list")
public String list(@RequestParam(value="page",required=false)String page,@RequestParam(value="rows",required=false)String rows,User s_user,HttpServletResponse response)throws Exception{
PageBean pageBean=new PageBean(Integer.parseInt(page),Integer.parseInt(rows));
Map<String,Object> map=new HashMap<String,Object>();
map.put("userName", StringUtil.formatLike(s_user.getUserName()));
map.put("start", pageBean.getStart());
map.put("size", pageBean.getPageSize());
List<User> userList=userService.find(map);
Long total=userService.getTotal(map);
JSONObject result=new JSONObject();
JSONArray jsonArray=JSONArray.fromObject(userList);
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(response, result);
return null;
}
/**
* 获取客户经理信息 下拉框数据用到
* @param response
* @return
}
/**
* 用户注销
* @param session
* @return
* @throws Exception
*/
@RequestMapping("/logout")
public String logout(HttpSession session)throws Exception{
session.invalidate();
return "redirect:/login.jsp";
}
}
/**
* 客户开发计划Controller层
*
*/
@Controller
@RequestMapping("/cusDevPlan")
public class CusDevPlanController {
int resultTotal=0; // 操作的记录条数
if(dataDic.getId()==null){
resultTotal=dataDicService.add(dataDic);
}else{
resultTotal=dataDicService.update(dataDic);
}
JSONObject result=new JSONObject();
if(resultTotal>0){
result.put("success", true);
}else{
result.put("success", false);
}
ResponseUtil.write(response, result);
return null;
}
/**
* 删除数据字典
* @param ids
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/delete")
public String delete(@RequestParam(value="ids")String ids,HttpServletResponse response)throws Exception{
String []idsStr=ids.split(",");
for(int i=0;i<idsStr.length;i++){
dataDicService.delete(Integer.parseInt(idsStr[i]));
}
JSONObject result=new JSONObject();
result.put("success", true);
ResponseUtil.write(response, result);
return null;
}
}
Long total=dataDicService.getTotal(map);
JSONObject result=new JSONObject();
JSONArray jsonArray=JSONArray.fromObject(dataDicList);
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(response, result);
return null;
}
/**
* 根据数据字典名称查找,用户下拉框
* @param dataDicName
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/dataDicComboList")
public String dataDicComboList(String dataDicName,HttpServletResponse response)throws Exception{
JSONArray jsonArray=new JSONArray();
Map<String,Object> map=new HashMap<String,Object>();
map.put("dataDicName", dataDicName);
List<DataDic> dataDicList=dataDicService.find(map);
JSONArray rows=JSONArray.fromObject(dataDicList);
jsonArray.addAll(rows);
ResponseUtil.write(response, jsonArray);
return null;
}
/**
* 查询所有的数据字典名称
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/findDataDicName")
public String dataDicNameComboList(HttpServletResponse response)throws Exception{
JSONArray jsonArray=new JSONArray();
List<DataDic> dataDicList=dataDicService.findAll();
JSONArray rows=JSONArray.fromObject(dataDicList);
jsonArray.addAll(rows);
ResponseUtil.write(response, jsonArray);
return null;
}
/**
* 分页条件查询用户
* @param page
* @param rows
* @param s_user
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/list")
public String list(@RequestParam(value="page",required=false)String page,@RequestParam(value="rows",required=false)String rows,User s_user,HttpServletResponse response)throws Exception{
PageBean pageBean=new PageBean(Integer.parseInt(page),Integer.parseInt(rows));
Map<String,Object> map=new HashMap<String,Object>();
map.put("userName", StringUtil.formatLike(s_user.getUserName()));
map.put("start", pageBean.getStart());
map.put("size", pageBean.getPageSize());
List<User> userList=userService.find(map);
Long total=userService.getTotal(map);
JSONObject result=new JSONObject();
JSONArray jsonArray=JSONArray.fromObject(userList);
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(response, result);
return null;
}
/**
* 获取客户经理信息 下拉框数据用到
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/customerManagerComboList")
public String customerManagerComboList(HttpServletResponse response)throws Exception{
Map<String,Object> map=new HashMap<String,Object>();
map.put("roleName", "客户经理");
List<User> userList=userService.find(map);
JSONArray row=JSONArray.fromObject(userList);
ResponseUtil.write(response, row);
return null;
}






更多推荐



所有评论(0)