期未课程设计:使用SSM开发产品销售管理系统

98 阅读1分钟

本文己参与[新人创作礼]活动,一起开启掘金创作之路

 项目编号:KS005

本项目基于SSM框架(spring+springmvc+mybatis)进行开发实现,前端使用bootstrap+jsp来进行页面的开发实现,数据库采用MYSQL,开发工具为eclipse/idea.

项目主要实现了销售人员产品销售息的跟踪和统计功能,主要有两个角色:

销售经理角色:可以实现产品的添加,客户的添加,销售人员产品销售信息的统计,销售员跟单指导等操作。

销售员角色:主要实现产品销售情况的添加和维护跟踪,以及查看销售经理的指导意见

访问地址:http://localhost:8080/index.jsp  

管理员登陆:admin  /  admin

销售人员登陆: leon  /  admin  也可以自行注册用户登陆

主要功能展示如下:

  • 管理员登陆系统:
  1. 后台登陆页面

  1. 销售信息统计分析

  1. 销售经理跟单信息查询

  1. 对跟单的审批意见

  1. 其它功能的实现:添加客户,添加商品,查询订单

  • 销售人员注册登陆
  1. 注册

  1. 销售人员登陆

  1. 销售员跟单

  1. 经理指导意见

\

 部分实现代码:

package leon.sms.controller;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import leon.sms.mapper.InstructionMapper;
import leon.sms.pojo.Instruction;
import leon.sms.pojo.Project;
import leon.sms.pojo.User;
import leon.sms.service.ProjectService;

/** 
* @author znz
* @date 创建时间:2021年4月6日 下午3:21:04
* @version 1.0
* 类说明 :
* 
*/
@Controller
@RequestMapping("")
public class HomeController
{
	@Autowired
	ProjectService projectService;
	@Autowired
	InstructionMapper instructionMapper;
	
	@RequestMapping("homeTitle")
	public ModelAndView homeTitle()
	{
		ModelAndView mav = new ModelAndView();
		mav.setViewName("top");
		return mav;
	}
	
	@RequestMapping("homeLeft")
	public ModelAndView homeLeft(HttpSession httpSession)
	{
		ModelAndView mav = new ModelAndView();
		
		User user = (User) httpSession.getAttribute("user");
		if(user.isAdmin())//销售经理
		{
			System.out.println("此人是销售经理");
			mav.setViewName("home/adminLeft");
		}
		else//普通员工
		{
			System.out.println("此人是销售员工");
			mav.setViewName("home/staffLeft");
		}
		return mav;
	}
	
	@RequestMapping("homeMain")
	public ModelAndView homeMain()
	{
		ModelAndView mav = new ModelAndView();
		mav.setViewName("home/mainFrame/culture");
		return mav;
	}
	
	@RequestMapping("staffDocumentary")
	public ModelAndView staffDocumentary(HttpSession httpSession)
	{
		ModelAndView mav = new ModelAndView();
		mav.setViewName("home/mainFrame/staffDocumentary");
		
		User user = (User) httpSession.getAttribute("user");
		List<Project> list = projectService.searchByName(user.getName());
		mav.addObject("list", list);
		return mav;
	}
	
	@RequestMapping("instructions")
	public ModelAndView instructions(HttpSession httpSession)
	{
		ModelAndView mav = new ModelAndView();
		mav.setViewName("home/mainFrame/instructions");
		List<Instruction> list = instructionMapper.list(((User)httpSession.getAttribute("user")).getName());
		mav.addObject("list", list);
		
		return mav;
	}
	
	@RequestMapping("adminDocumentary")
	public ModelAndView adminDocumentary()
	{
		ModelAndView mav = new ModelAndView();
		mav.setViewName("home/mainFrame/adminDocumentary");
		mav.addObject("list", projectService.getAll());
		return mav;
	}
	
	@RequestMapping("others")
	public ModelAndView clientQuery()
	{
		ModelAndView mav = new ModelAndView();
		mav.setViewName("home/mainFrame/others");
		return mav;
	}
	
	@RequestMapping("addInstruction")
	public ModelAndView addInstruction(@RequestParam("adminName") String managerName,
			@RequestParam("staffName") String staffName, @RequestParam("content") String content)
	{
		ModelAndView mav = new ModelAndView();
		mav.setViewName("home/mainFrame/adminDocumentary");
		Instruction in = new Instruction( staffName, managerName, content);
		instructionMapper.add(in);
		return mav;
	}
}