源码获取:俺的博客首页 "资源" 里下载!

项目介绍

本项目包含管理员、销售主管、客户经理、高管等角色;

主要包含以下功能:
营销管理:营销机会管理、客户开发计划;
客户管理:客户信息管理、客户流失管理;
服务管理:服务创建、服务分配、服务处理、服务反馈、服务归档;
统计报表:客户贡献分析、客户构成分析、客户服务分析、客户流失分析;
基础数据管理:数据字典管理、产品信息查询、用户信息管理;
系统管理:修改密码、安全退出;

环境需要

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等版本均可;


技术栈

1. 后端:Spring springmvc mybatis
2. 前端:JSP+css+javascript+jQuery+easyUI+highcharts


使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;
3. 将项目中applicationContext.xml配置文件中的数据库配置改为自己的配置,然后运行;
4. 运行成功后,在浏览器中输入:http://localhost:8080/CRM/
管理员账号密码:admin/123
销售主管账号密码:json1234/123
客户经理账号密码:xiaoming/123
 

 

 

 

 

 

客户管理控制层:

@Controller
@RequestMapping("/customer")
public class CustomerController extends AuthorizedController {

    @Autowired
    private CustomerService customerService;

    @RequestMapping(value = "", method = RequestMethod.GET)
    public String customer() {
        return "crm/customer";
    }

    @RequestMapping(value = "/find", method = RequestMethod.POST)
    @ResponseBody
    public PageInfo<Customer> find(@RequestBody QueryCustomerVo vo) {
        return customerService.find(vo);
    }

    @RequestMapping(value = "/findAllCustomerCategory", method = RequestMethod.POST)
    @ResponseBody
    public List<CustomerCategory> findAllCustomerCategory() {
        return customerService.findAllCustomerCategory();
    }

    @RequestMapping(value = "/findAllIndustry", method = RequestMethod.POST)
    @ResponseBody
    public List<Industry> findAllIndustry() {
        return customerService.findAllIndustry();
    }

    @RequestMapping(value = "/findAllSource", method = RequestMethod.POST)
    @ResponseBody
    public List<Source> findAllSource() {
        return customerService.findAllSource();
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ResponseBody
    public Result add(@RequestBody Customer customer) {
        customer.setCreateBy(getUser().getUserId());
        return customerService.insert(customer);
    }

    @RequestMapping(value = "/checkCustomerName", method = RequestMethod.POST)
    @ResponseBody
    public Result checkCustomerName(@RequestBody Customer customer) {
        return customerService.checkCustomerName(customer);
    }

    @RequestMapping(value = "/findById", method = RequestMethod.POST)
    @ResponseBody
    public Customer findById(@RequestBody Customer customer) {
        return customerService.findById(customer.getCustomerId());
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ResponseBody
    public Result update(@RequestBody Customer customer) {
        return customerService.update(customer);
    }

    @RequestMapping(value = "/dashboard/{customerId}", method = RequestMethod.GET)
    public ModelAndView dashboard(@PathVariable int customerId) {
        ModelAndView vm = new ModelAndView("crm/customerDashboard");
        vm.addObject("customerId", customerId);
        return vm;
    }

    @RequestMapping(value = "/updateStar", method = RequestMethod.POST)
    @ResponseBody
    public Result updateStar(@RequestBody Customer customer) {
        return customerService.updateStar(customer);
    }

    @RequestMapping(value = "/updateLocation", method = RequestMethod.POST)
    @ResponseBody
    public Result updateLocation(@RequestBody Customer customer) {
        return customerService.updateLocation(customer);
    }
}

用户管理控制层:

@Controller
@RequestMapping("/user")
public class UserController extends AuthorizedController {

    @Autowired
    private UserService userService;

    @Autowired
    private HttpSession session;

    @RequestMapping(value = "", method = RequestMethod.GET)
    public String index() {
        return "sys/user";
    }

    @RequestMapping(value = "/find", method = RequestMethod.POST)
    @ResponseBody
    public PageInfo<User> find(@RequestBody QueryUserVo vo) {
        return userService.find(vo);
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ResponseBody
    public Result add(@RequestBody User user) {
        return userService.insert(user);
    }

    @RequestMapping(value = "/remove", method = RequestMethod.POST)
    @ResponseBody
    public Result delete(@RequestBody List<Integer> ids) {
        return userService.deleteByIds(ids);
    }

    @RequestMapping(value = "/findById", method = RequestMethod.POST)
    @ResponseBody
    public User findById(@RequestBody User user) {
        return userService.findById(user.getUserId());
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ResponseBody
    public Result update(@RequestBody User user) {
        Result result = userService.update(user);
        if (result.isSuccess() && user.getUserId() == getUser().getUserId()) {
            session.setAttribute("User", userService.findById(getUser().getUserId()));
        }
        return result;
    }

    @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
    @ResponseBody
    public Result updateStatus(@RequestBody User user) {
        return userService.updateStatus(user);
    }

    @RequestMapping(value = "/checkUserName", method = RequestMethod.POST)
    @ResponseBody
    public Result checkUserName(@RequestBody User user) {
        return userService.checkUserName(user);
    }

    @RequestMapping(value = "/resetPassword", method = RequestMethod.POST)
    @ResponseBody
    public Result resetPassword(@RequestBody User user) {
        return userService.resetPassword(user);
    }

    @RequestMapping(value = "/profile", method = RequestMethod.GET)
    public String profile() {
        return "sys/profile";
    }

    @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
    @ResponseBody
    public Result updatePassword(@RequestBody UpdatePasswordVo vo) {
        return userService.updatePassword(vo);
    }
}

角色管理控制层:

@Controller
@RequestMapping("/role")
public class RoleController extends AuthorizedController {

    @Autowired
    private RoleService roleService;

    @RequestMapping(value = "", method = RequestMethod.GET)
    public String index() {
        return "sys/role";
    }

    @RequestMapping(value = "/findAll", method = RequestMethod.POST)
    @ResponseBody
    public List<Role> findAll() {
        return roleService.findAll();
    }

    @RequestMapping(value = "/checkRoleName", method = RequestMethod.POST)
    @ResponseBody
    public Result existRoleName(@RequestBody Role role) {
        return roleService.checkRoleName(role);
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ResponseBody
    public Result add(@RequestBody Role role) {
        return roleService.insert(role);
    }

    @RequestMapping(value = "/remove", method = RequestMethod.POST)
    @ResponseBody
    public Result delete(@RequestBody List<Integer> ids) {
        return roleService.deleteByIds(ids);
    }

    @RequestMapping(value = "/findById", method = RequestMethod.POST)
    @ResponseBody
    public Role findById(@RequestBody Role role) {
        return roleService.findById(role.getRoleId());
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ResponseBody
    public Result update(@RequestBody Role role) {
        return roleService.update(role);
    }

    @RequestMapping(value = "/user/{roleId}", method = RequestMethod.GET)
    public ModelAndView roleUser(@PathVariable int roleId) {
        ModelAndView vm = new ModelAndView("sys/roleUser");
        vm.addObject("roleId", roleId);
        return vm;
    }

    @RequestMapping(value = "/user/findUserInRole", method = RequestMethod.POST)
    @ResponseBody
    public PageInfo<User> findUserInRole(@RequestBody QueryRoleUserVo vo) {
        return roleService.findUserInRole(vo);
    }

    @RequestMapping(value = "/user/remove", method = RequestMethod.POST)
    @ResponseBody
    public Result deleteRoleUser(@RequestBody RoleUser roleUser) {
        return roleService.deleteRoleUser(roleUser);
    }

    @RequestMapping(value = "/user/findUserNotInRole", method = RequestMethod.POST)
    @ResponseBody
    public PageInfo<User> findUserNotInRole(@RequestBody QueryRoleUserVo vo) {
        return roleService.findUserNotInRole(vo);
    }

    @RequestMapping(value = "/user/add", method = RequestMethod.POST)
    @ResponseBody
    public Result addRoleUser(@RequestBody RoleUser roleUser) {
        return roleService.insertRoleUser(roleUser);
    }

    @RequestMapping(value = "/menu/{roleId}", method = RequestMethod.GET)
    public ModelAndView roleMenu(@PathVariable Integer roleId) {
        ModelAndView mv = new ModelAndView("sys/roleMenu");
        mv.addObject("roleId", roleId);
        return mv;
    }

    @RequestMapping(value = "/menu/saveMenu", method = RequestMethod.POST)
    @ResponseBody
    public Result saveMenu(@RequestBody Map map) {
        return roleService.saveRoleMenu((Integer) map.get("roleId"), (List<Integer>) map.get("menuIdList"));
    }

    @RequestMapping(value = "/fun/{roleId}", method = RequestMethod.GET)
    public ModelAndView roleFun(@PathVariable int roleId) {
        ModelAndView vm = new ModelAndView("sys/roleFun");
        vm.addObject("roleId", roleId);
        return vm;
    }
}

源码获取:俺的博客首页 "资源" 里下载!

Logo

本社区面向用户介绍CSDN开发云部门内部产品使用和产品迭代功能,产品功能迭代和产品建议更透明和便捷

更多推荐