后台管理系统
项目介绍:
我们的程序可以通过各种不同的身份登陆,以操控不同等级的客户信息;面对着实时更新的动态信息,我们拥有动态图表,可以随时检测各地区不同类型客户的占比,也可以分类查看,快速修改和添加信息。
使用技术:
Spring+SpringMVC+css+js+springdata
这个项目建立在Spring框架上,其中使用了springdata自动创建sql语句,使用了IOC的@Autowired注释注入了每次登陆都需要查询的用户信息。
效果展示:
用户管理:
商机管理:
客户贡献分析:
核心代码:
管理用户信息:
@Controllerpublic class RoleController {@Autowiredprivate IRoleService roleService;/** * 分页查询所有的角色信息 * @return */@RequestMapping("toRole")public String toRole(HttpSession session) {Page<Role> roles = roleService.findAllRoles();session.setAttribute("roles", roles);return "pages/role";}/** * 根据下标做分页查询操作 * @return */@RequestMapping("findRoleByPageIndex")public String findRoleByPageIndex(HttpSession session,Integer pageIndex) {Page<Role> roles = roleService.findAllRoles(pageIndex);session.setAttribute("roles", roles);return "pages/role";}/** * 新增角色 * 1.如果需要返回给前台数据 可以给前台返回字符串 添加成功* 2.void */@RequestMapping("saveRole")@ResponseBodypublic String saveRole(Role role) {if(role.getId()==null) {roleService.saveRole(role);return "添加成功";}else{roleService.saveRole(role);return "修改成功";}} //根据id查找角色信息@RequestMapping("findRoleById")@ResponseBodypublic Role findRoleById(Integer id) {Role role = roleService.findRoleById(id);return role;}//根据角色id删除信息@RequestMapping("deleteRoleById")@ResponseBodypublic String deleteRoleById(Integer id) {System.out.println("id为:"+id);roleService.deleteRoleById(id);return "删除成功";}
}
客户贡献分析:
@Controllerpublic class ContributionController {@Autowiredprivate ICustomerContribtionService customerContribtionService;/** * 查找所有的客户 * @return */@RequestMapping("findCustomerContribution")@ResponseBodypublic List<CustomerContri_Consti> findCustomerContribution(String region) {List<CustomerContri_Consti> list = customerContribtionService.findCustomerContribution(region);System.out.println(list);return list;}