后台管理系统项目

后台管理系统

项目介绍:
我们的程序可以通过各种不同的身份登陆,以操控不同等级的客户信息;面对着实时更新的动态信息,我们拥有动态图表,可以随时检测各地区不同类型客户的占比,也可以分类查看,快速修改和添加信息。

使用技术:
Spring+SpringMVC+css+js+springdata
这个项目建立在Spring框架上,其中使用了springdata自动创建sql语句,使用了IOC的@Autowired注释注入了每次登陆都需要查询的用户信息。

效果展示:

用户管理:
用户管理
商机管理:
在这里插入图片描述客户贡献分析:
在这里插入图片描述

核心代码:
管理用户信息:

@Controller
public class RoleController {
@Autowired
private 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")
@ResponseBody
public String saveRole(Role role) {
	if(role.getId()==null) {
		roleService.saveRole(role);
		return "添加成功";
	}else{
		roleService.saveRole(role);
		return "修改成功";
	}
} 

//根据id查找角色信息
@RequestMapping("findRoleById")
@ResponseBody
public Role findRoleById(Integer id) {
	Role role = roleService.findRoleById(id);
	return role;
}

//根据角色id删除信息
@RequestMapping("deleteRoleById")
@ResponseBody
public String deleteRoleById(Integer id) {
	System.out.println("id为:"+id);
	roleService.deleteRoleById(id);
	return "删除成功";
}

}

客户贡献分析:

@Controller
public class ContributionController {

@Autowired
private ICustomerContribtionService customerContribtionService;


/**
 * 查找所有的客户
 * @return
 */
@RequestMapping("findCustomerContribution")
@ResponseBody
public List<CustomerContri_Consti> findCustomerContribution(String region) {
	
	List<CustomerContri_Consti> list = customerContribtionService.findCustomerContribution(region);
	
	System.out.println(list);
	
	return list;
}

猜你喜欢

转载自blog.csdn.net/weixin_44168948/article/details/107261072