Java项目:springboot crm客户关系管理系统

作者主页:源码空间站2022

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

CRM-智能办公

项目介绍

- 本应用是一个客户关系管理系统,主要包括五大模块,分别是营销管理,客户管理,服务管理,统计报表和系统管理,为客户关系管理提供简单的数据管理与分析

- 技术选型方面,该项目是一个`SpringBoot`的单体应用,项目使用`SpringBoot2`框架快速开发,数据访问层使用`Mybatis`框架,页面渲染引擎使用`Freemarker`,页面样式使用`Layui`,日志方面选用的是`logback`,统计报表部分使用的是`ECharts`,数据库使用的Mysql 8.0版本;

安装教程

1.  在mysql(默认为mysql8)中创建名为`crm`的数据库,并执行源码根目录的`crm.sql`脚本生成数据库表以及数据
2.  将项目源码导入idea中,指定项目的jdk版本为jdk8或以上,并标记为maven项目,下载所需依赖
3.  修改`application.yml`中针对于数据库的配置(主要是数据库名和数据库密码)
4.  修改logback.xml中,第4行,日志文件的存储地址,改为自己的路径;

5.  启动项目测试是否正常,默认启动地址首页为`http://localhost:1212/crm`,默认数据库中的管理员为`admin`,密码为`123456`,可在登录系统之后自行修改用户密码

运行截图

Java项目:springboot crm客户关系管理系统_第1张图片

Java项目:springboot crm客户关系管理系统_第2张图片

Java项目:springboot crm客户关系管理系统_第3张图片

Java项目:springboot crm客户关系管理系统_第4张图片

Java项目:springboot crm客户关系管理系统_第5张图片

Java项目:springboot crm客户关系管理系统_第6张图片

Java项目:springboot crm客户关系管理系统_第7张图片

代码相关

客户信息管理控制器

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

    @Autowired
    private CustomerService customerService;

    @Autowired
    private ResultInfo resultInfo;

    /**
     * 跳转到客户信息管理首页
     * @return
     */
    @GetMapping("/customer")
    public String customer() {
        return "customer/customer";
    }

    /**
     * 跳转到新增或修改页面
     * @param id
     * @param model
     * @return
     */
    @GetMapping("/toAddAndUpdatePage")
    public String toAddAndUpdatePage(@Nullable Integer id, Model model) {
        if (id != null) {
            // 修改
            // 获取客户信息
            Customer customer = customerService.selectByPrimaryKey(id);
            AssertUtil.isTrue(customer == null, "获取客户信息失败");
            model.addAttribute("customer", customer);
        }
        return "customer/addAndUpdate";
    }

    /**
     * 获取客户信息列表
     * @param customerQuery
     * @return
     */
    @GetMapping("/customerList")
    @ResponseBody
    public Map findCustomers(@Nullable CustomerQuery customerQuery) {
        return customerService.findCustomers(customerQuery);
    }

    /**
     * 新增客户信息
     * @param customer
     * @return
     */
    @PostMapping("/addCustomer")
    @ResponseBody
    public ResultInfo addCustomer(Customer customer) {
        customerService.addCustomer(customer);
        resultInfo.setAll(200, "添加客户信息成功", null);
        return resultInfo;
    }

    /**
     * 修改客户信息
     * @param customer
     * @return
     */
    @PostMapping("/updateCustomer")
    @ResponseBody
    public ResultInfo updateCustomer(Customer customer) {
        customerService.updateCustomer(customer);
        resultInfo.setAll(200, "更新客户信息成功", null);
        return resultInfo;
    }

    /**
     * 批量删除客户信息
     * @param ids
     * @return
     */
    @PostMapping("/deleteCustomer")
    @ResponseBody
    public ResultInfo deleteCustomer(@RequestParam("ids") Integer[] ids) {
        customerService.deleteCustomerByIds(ids);
        resultInfo.setAll(200, "删除客户信息成功", null);
        return resultInfo;
    }

    /**
     * 查询所有客户级别
     * @return
     */
    @GetMapping("/getLevels")
    @ResponseBody
    public List findLevels() {
        return customerService.findLevels();
    }

    /**
     * 跳转到客户订单详情页面
     * @param customerId
     * @return
     */
    @GetMapping("/toCustomerOrderPage")
    public String toCustomerOrderPage(@RequestParam("customerId") Integer customerId,Model model) {
        // 校验参数
        AssertUtil.isTrue(customerId == null, "客户id不能为空");
        // 封装客户信息
        Customer customer = customerService.selectByPrimaryKey(customerId);
        AssertUtil.isTrue(customer == null, "查询客户信息失败");
        model.addAttribute("customer", customer);
        return "customerOrder/customerOrder";
    }

}

如果也想学习本系统,下面领取。回复:029springboot 

你可能感兴趣的:(springboot,java,spring,boot,spring)