作者主页:Designer 小郑 作者简介:3年JAVA全栈开发经验,专注JAVA技术、系统定制、远程指导,致力于企业数字化转型,CSDN博客专家,阿里云社区专家博主,蓝桥云课讲师。
基于JAVA+Vue+SpringBoot+MySQL的CRM客户管理系统,包含了客户管理、客户分析、商品管理、客户跟踪、客户消费模块,还包含系统自带的用户管理、部门管理、角色管理、菜单管理、日志管理、数据字典管理、文件管理、图表展示等基础模块,CRM客户管理系统基于角色的访问控制,给客户管理员、工作人员使用,可将权限精确到按钮级别,您可以自定义角色并分配权限,系统适合设计精确的权限约束需求。
CRM客户管理系统的系统设计是一个基于系统分析结果的过程,使用科学的系统理念和方法来设计一个新系统,该系统可以最大限度地实现所需的目的。系统设计主要是功能设计,创建理想系统并制定设计计划;将系统划分为若干子系统;子系统和整个系统的详细设计和评估;演示系统方案并预测性能效果,本系统主要从五个功能模块分析。
@RequestMapping(value = "/getByPage", method = RequestMethod.GET)
@ApiOperation(value = "查询客户")
public Result<IPage<Customer>> getByPage(@ModelAttribute Customer customer ,@ModelAttribute PageVo page){
QueryWrapper<Customer> qw = new QueryWrapper<>();
if(!ZwzNullUtils.isNull(customer.getType())) {
qw.eq("type",customer.getType());
}
if(!ZwzNullUtils.isNull(customer.getTitle())) {
qw.like("title",customer.getTitle());
}
IPage<Customer> data = iCustomerService.page(PageUtil.initMpPage(page),qw);
return new ResultUtil<IPage<Customer>>().setData(data);
}
@RequestMapping(value = "/insert", method = RequestMethod.POST)
@ApiOperation(value = "新增客户跟踪")
public Result<CustomerItem> insert(CustomerItem customerItem){
Customer customer = iCustomerService.getById(customerItem.getCustomerId());
if(customer == null) {
return ResultUtil.error("客户不存在");
}
User currUser = securityUtil.getCurrUser();
customerItem.setCustomerName(customer.getTitle());
customerItem.setDate(DateUtil.now());
customerItem.setUserId(currUser.getId());
customerItem.setUserName(currUser.getNickname());
iCustomerItemService.saveOrUpdate(customerItem);
return new ResultUtil<CustomerItem>().setData(customerItem);
}
@RequestMapping(value = "/insert", method = RequestMethod.POST)
@ApiOperation(value = "新增客户消费")
public Result<CustomerOrder> insert(CustomerOrder customerOrder){
Customer customer = iCustomerService.getById(customerOrder.getUserId());
if(customer == null) {
return ResultUtil.error("客户不存在");
}
customerOrder.setUserName(customer.getTitle());
Commodity commodity = iCommodityService.getById(customerOrder.getCommodityId());
if(commodity == null) {
return ResultUtil.error("商品不存在");
}
if(commodity.getNumber() == null) {
commodity.setNumber(BigDecimal.ZERO);
}
if(customerOrder.getNumber().compareTo(commodity.getNumber()) > 0) {
return ResultUtil.error("库存不足");
}
commodity.setNumber(commodity.getNumber().subtract(customerOrder.getNumber()));
iCommodityService.saveOrUpdate(commodity);
customerOrder.setTitle(commodity.getTitle());
customerOrder.setType(commodity.getType());
customerOrder.setPrice(commodity.getPrice());
customerOrder.setImage(commodity.getImage());
customerOrder.setUserId(customer.getId());
customerOrder.setUserName(customer.getTitle());
customerOrder.setDate(DateUtil.now());
iCustomerOrderService.saveOrUpdate(customerOrder);
return new ResultUtil<CustomerOrder>().setData(customerOrder);
}
@RequestMapping(value = "/getByPage", method = RequestMethod.GET)
@ApiOperation(value = "查询商品")
public Result<IPage<Commodity>> getByPage(@ModelAttribute Commodity commodity ,@ModelAttribute PageVo page){
QueryWrapper<Commodity> qw = new QueryWrapper<>();
if(!ZwzNullUtils.isNull(commodity.getTitle())) {
qw.like("title",commodity.getTitle());
}
if(!ZwzNullUtils.isNull(commodity.getType())) {
qw.eq("type",commodity.getType());
}
IPage<Commodity> data = iCommodityService.page(PageUtil.initMpPage(page),qw);
return new ResultUtil<IPage<Commodity>>().setData(data);
}
@RequestMapping(value = "/insert", method = RequestMethod.POST)
@ApiOperation(value = "新增商品购买")
public Result<CommodityBuy> insert(CommodityBuy commodityBuy){
Commodity commodity = iCommodityService.getById(commodityBuy.getCommodityId());
if(commodity == null) {
return ResultUtil.error("商品不存在");
}
User currUser = securityUtil.getCurrUser();
commodityBuy.setTitle(commodity.getTitle());
commodityBuy.setType(commodity.getType());
commodityBuy.setPrice(commodity.getPrice());
commodityBuy.setImage(commodity.getImage());
commodityBuy.setUserId(currUser.getId());
commodityBuy.setUserName(currUser.getNickname());
commodityBuy.setDate(DateUtil.now());
iCommodityBuyService.saveOrUpdate(commodityBuy);
if(commodity.getNumber() == null) {
commodity.setNumber(BigDecimal.ZERO);
}
commodity.setNumber(commodity.getNumber().add(commodityBuy.getNumber()));
iCommodityService.saveOrUpdate(commodity);
return new ResultUtil<CommodityBuy>().setData(commodityBuy);
}
下载本系统代码或使用本系统的用户,必须同意以下内容,否则请勿下载!