——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明





基于javaweb的SSM+Mavencrm客户管理系统crm系统(java+ssm+jsp+mysql+maven)
一、项目简述
功能包括: 用户管理,系统管理,客户管理,客户服务,客户关怀, 销售机会,统计管理等等。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| if(permission.getTitle() != null && !"".equals(permission.getTitle())) { PermissionExample permissionExample = new PermissionExample(); Criteria criteria = permissionExample.createCriteria(); criteria.andIdNotEqualTo(permission.getId()); criteria.andTitleEqualTo(permission.getTitle()); long count = permissionService.countByPermissionExample(permissionExample); if(count > 0) { maps.put("code", 200); maps.put("msg", "该权限名称已存在!"); return maps; } }
if(permission.getPid() != null && permission.getPid() == 0) { boolean result = permissionService.updatePermissionSetTopPermission(permission); if(result == false) { maps.put("code", 200); maps.put("msg", "更新失败!"); return maps; } permission.setPid(null); } try { boolean result = permissionService.updatePermissionByPrimaryKeySelective(permission); if(result == true) { maps.put("code", 0); CacheUtil.delete("roleMenu-" + user.getRoleId()); CacheUtil.delete("rolePermission-"+user.getRoleId());
}else { maps.put("code", 200); maps.put("msg", "修改失败"); } }catch (Exception e) { maps.put("code", 200); if(e instanceof org.springframework.dao.DuplicateKeyException) { maps.put("msg", "权限编码不能有重复"); }else { maps.put("msg", e.getMessage()); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Map<String, Object> map = new HashMap<String, Object>(16); boolean success = false; try { User user = (User) request.getSession().getAttribute("user"); customerCare.setManagerId(user.getId()); if(customerCareService.insertCustomerCare(customerCare)) { success = true; } } catch (Exception e) { e.printStackTrace(); } map.put("success", success); map.put("code", 0); return map; }
@Operation(name="根据编号查找客户关怀记录") @RequestMapping("/findCustomerCareById") @ResponseBody public Map<String, Object> findCustomerCareById(Integer id){ Map<String, Object> map = new HashMap<String, Object>(16); boolean success = false; CustomerCare customerCare = null; try { customerCare = customerCareService.selectCustomerCareByPrimaryKey(id); Linkman linkman = linkmanService.selectLinkmanByPrimaryKey(customerCare.getLinkmanId()); customerCare.setLinkman(linkman);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Map<String, Object> map = new HashMap<String,Object>(16);
user = this.getUser(request);
if(user == null || user.getId() == null) { map.put("code", -1); map.put("msg", "用户不存在,无法执行操作."); return map; }
CustomerExample example = new CustomerExample(); Criteria criteria = example.createCriteria();
if(page == null || page <= 0) { page = 1; } if(limit == null || limit <= 0) { limit = 10; } String all = "all"; if(!all.equals(findtype)) { example.setLimit(limit); Long offset = new Long((page-1)*limit); example.setOffset(offset); }
criteria.andManagerIdEqualTo(user.getId());
criteria.andDeleteStatusEqualTo(0); System.out.println(customer);
if(customer != null) { if(customer.getName() != null) { criteria.andNameLike("%" + customer.getName() + "%"); } if(customer.getType() != null && !"".equals(customer.getType())) { criteria.andTypeEqualTo(customer.getType());
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| * @return * @exception Nothing * @since 1.8 * */ @RequiresAuthentication @Operation(name = "统计公司新增的客户量") @RequestMapping("/countCustomer") @ResponseBody public Map<String, Object> countCustomerIncrease(int day) {
System.err.println(day + "+++++++++++++");
Map<String, Object> maps = new HashMap<String, Object>(16);
List<Map<String, Object>> increase = reportService.countCustomerIncrease(day);
List<Map<String, Object>> decrease = reportService.countCustomerDecrease(day);
maps.put("increase", increase); maps.put("decrease", decrease); maps.put("code", 0); return maps; }
@Operation(name = "统计客户经理新增的客户与跟进") @RequiresPermissions("16001") @RequestMapping("/countCustomerByUser") @ResponseBody public Map<String, Object> countByDate(String action, Integer selectType, String date, HttpServletRequest request) {
Map<String, Object> map = new HashMap<String, Object>(16); List<Map<String, Object>> list = null; if (action == null || selectType == null || date == null) { map.put("msg", "非法操作"); map.put("code", -1); return map; }
HttpSession session = request.getSession(); User user = (User) session.getAttribute("user");
String dictName = ""; String dateStr = "";
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
@SuppressWarnings("unchecked") @Operation(name="获取用户角色的权限菜单") @RequiresAuthentication @RequestMapping("/getRolePermissionMenu") @ResponseBody public Map<String, Object> getRolePermissionMenu(HttpServletRequest request){ Map<String, Object> maps = new HashMap<String, Object>(16); User user = (User)request.getSession().getAttribute("user"); List<Permission> userPermissions = null; logger.info(user.toString()); String roleMenu = "roleMenu-"; if(CacheUtil.get(roleMenu+user.getRoleId()) != null) { userPermissions = (List<Permission>) CacheUtil.get("roleMenu-"+user.getRoleId()); }else { List<Permission> permissions = permissionService.selectTreePermission(); RolePermissionExample rolePermissionExample = new RolePermissionExample(); rolePermissionExample.createCriteria().andRoleIdEqualTo(user.getRoleId()); List<RolePermission> rolePermissions = rolePermissionService.selectByRolePermissionExample(rolePermissionExample); int size = rolePermissions.size();
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| limit = 10; } String all = "all"; if(!all.equals(type)) { example.setLimit(limit); Long offset = new Long((page-1)*limit); example.setOffset(offset); } if(linkman.getCustomerId() != null) { criteria.andCustomerIdEqualTo(linkman.getCustomerId()); }else { map.put("code", -2); map.put("msg", "客户ID不存在"); return map; } Long count = linkmanService.countByLinkmanExample(example); List<Linkman> list = linkmanService.selectByLinkmanExample(example); map.put("data", list); map.put("count", count); map.put("code", 0); return map; }
@RequiresPermissions("7001") @Operation(name="添加联系人") @RequestMapping("add") @ResponseBody public Map<String, Object> addLinkman(Linkman linkman){ Map<String, Object> map = new HashMap<String,Object>(16); if(linkman == null || linkman.getName() == null || linkman.getCustomerId() == null || linkman.getBirthday() == null || linkman.getLevel() == null) { map.put("status",false);
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=181422302105200fy
https://javayms.pages.dev?id=181422302105200fy