基于javaweb+mysql的springboot销售团队后台管理系统(java+springboot+freemarker+bootstrap+echarts+mysql+maven)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot销售团队后台管理系统(java+springboot+freemarker+bootstrap+echarts+mysql+maven)
项目介绍
该项目为后管系统,主要功能包括:
看板、业务机会管理、客户管理、联系人管理、我的日报、团队日报、主数据管理:组织架构管理;系统管理:用户管理、角色管理、菜单管理等;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7版本;
技术栈
-
后端:SpringBoot+mybatis
-
前端:FreeMarker+Angular+bootstrap+echarts+jQuery
使用说明
前台访问路径:http://localhost:8080/
登录账号:admin 登录密码:123456
public Contacts findById(@RequestBody Contacts contacts) {
return contactsService.findById(contacts.getContactsId());
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
@ResponseBody
public Result update(@RequestBody Contacts contacts) {
return contactsService.update(contacts);
}
}
@Controller
public class HomeController {
@Autowired
private HttpSession session;
@Autowired
private UserService userService;
@Autowired
private PowerTeamConfig powerTeamConfig;
@RequestMapping(value = "/", method = RequestMethod.GET)
public String signIn() {
return "sys/home";
}
@RequestMapping(value = "/signIn", method = RequestMethod.POST)
@ResponseBody
@Controller
@RequestMapping("/district")
public class DistrictController {
@Autowired
private DistrictService districtService;
@RequestMapping(value = "/findAllProvince", method = RequestMethod.POST)
@ResponseBody
public List<District> findAllProvince() {
return districtService.findAllProvince();
}
@RequestMapping(value = "/findCity", method = RequestMethod.POST)
@ResponseBody
public List<District> findCity(@RequestBody int provinceId) {
return districtService.findCity(provinceId);
}
@RequestMapping(value = "/findCounty", method = RequestMethod.POST)
@ResponseBody
public List<District> findCounty(@RequestBody int cityId) {
return districtService.findCounty(cityId);
}
}
@Controller
public class DailyReportController extends AuthorizedController {
@RequestMapping(value = "/dailyReport", method = RequestMethod.GET)
public String dailyReport() {
return "crm/dailyReport";
}
@RequestMapping(value = "/teamDailyReport", method = RequestMethod.GET)
public String teamDailyReport() {
return "crm/teamDailyReport";
}
}
@Controller
@RequestMapping("/dashboard")
public class DashboardController extends AuthorizedController {
@RequestMapping(value = "", method = RequestMethod.GET)
public String dashboard() {
return "sys/dashboard";
}
}
@Controller
@RequestMapping("/user")
public class UserController extends AuthorizedController {
@Autowired
private UserService userService;
@Autowired
private HttpSession session;
@RequestMapping(value = "", method = RequestMethod.GET)
public String index() {
return "sys/user";
}
@RequestMapping(value = "/find", method = RequestMethod.POST)
@ResponseBody
public PageInfo<User> find(@RequestBody QueryUserVo vo) {
return userService.find(vo);
}
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Result add(@RequestBody User user) {
return userService.insert(user);
}
@RequestMapping(value = "/remove", method = RequestMethod.POST)
@ResponseBody
public Result delete(@RequestBody List<Integer> ids) {
return userService.deleteByIds(ids);
}
@RequestMapping(value = "/findById", method = RequestMethod.POST)
@ResponseBody
public User findById(@RequestBody User user) {
@ResponseBody
public Result update(@RequestBody OrgUnit orgUnit) {
return orgUnitService.update(orgUnit);
}
@RequestMapping(value = "/remove", method = RequestMethod.POST)
@ResponseBody
public Result remove(@RequestBody OrgUnit orgUnit) {
return orgUnitService.delete(orgUnit.getOrgUnitId());
}
@RequestMapping(value = "/up", method = RequestMethod.POST)
@ResponseBody
public Result up(@RequestBody OrgUnit orgUnit) {
return orgUnitService.up(orgUnit.getOrgUnitId());
}
@RequestMapping(value = "/down", method = RequestMethod.POST)
@ResponseBody
public Result down(@RequestBody OrgUnit orgUnit) {
return orgUnitService.down(orgUnit.getOrgUnitId());
}
@RequestMapping(value = "/orgUser", method = RequestMethod.GET)
public String orgUser() {
return "masterData/orgUser";
}
@RequestMapping(value = "/orgUser/findUserNotInOrgUnit", method = RequestMethod.POST)
@ResponseBody
public PageInfo<User> findUserNotInOrgUnit(@RequestBody QueryOrgUnitUserVo vo) {
return orgUnitService.findUserNotInOrgUnit(vo);
}
@RequestMapping(value = "/orgUser/findUserInOrgUnit", method = RequestMethod.POST)
@ResponseBody
public PageInfo<OrgUnitUser> findUserInOrgUnit(@RequestBody QueryOrgUnitUserVo vo) {
return orgUnitService.findUserInOrgUnit(vo);
}
@RequestMapping(value = "/orgUser/add", method = RequestMethod.POST)
@ResponseBody
public Result addOrgUser(@RequestBody OrgUnitUser orgUnitUser) {
return orgUnitService.insertOrgUnitUser(orgUnitUser);
}
@RequestMapping(value = "/orgUser/remove", method = RequestMethod.POST)
@ResponseBody
public Result removeOrgUser(@RequestBody OrgUnitUser orgUnitUser) {
@Controller
@RequestMapping("/customer")
public class CustomerController extends AuthorizedController {
@Autowired
private CustomerService customerService;
@RequestMapping(value = "", method = RequestMethod.GET)
public String customer() {
return "crm/customer";
}
@RequestMapping(value = "/find", method = RequestMethod.POST)
@ResponseBody
public PageInfo<Customer> find(@RequestBody QueryCustomerVo vo) {
return customerService.find(vo);
}
@RequestMapping(value = "/findAllCustomerCategory", method = RequestMethod.POST)
@ResponseBody
public List<CustomerCategory> findAllCustomerCategory() {
return customerService.findAllCustomerCategory();
}
@RequestMapping(value = "/findAllIndustry", method = RequestMethod.POST)
@ResponseBody
public List<Industry> findAllIndustry() {
return customerService.findAllIndustry();
}
@RequestMapping(value = "/findAllSource", method = RequestMethod.POST)
@ResponseBody
public List<Source> findAllSource() {
return customerService.findAllSource();
}
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Result add(@RequestBody Customer customer) {
customer.setCreateBy(getUser().getUserId());
return customerService.insert(customer);
}
public String index() {
return "sys/menu";
}
@RequestMapping(value = "/findAllMenu", method = RequestMethod.POST)
@ResponseBody
public List<Menu> findAllMenu() {
return menuService.findAllMenu();
}
@RequestMapping(value = "/findAllMenuTree", method = RequestMethod.POST)
@ResponseBody
public List<TreeNode<Menu>> findAllMenuTree() {
return menuService.findAllMenuTree();
}
@RequestMapping(value = "/findUserMenuTree", method = RequestMethod.POST)
@ResponseBody
public List<TreeNode<Menu>> findUserMenuTree() {
return menuService.findUserMenuTree(getUser().getUserId());
}
@RequestMapping(value = "/findRoleMenu", method = RequestMethod.POST)
@ResponseBody
public List<Menu> findRoleMenu(@RequestBody Role role) {
return menuService.findRoleMenu(role.getRoleId());
}
@RequestMapping(value = "/checkMenuName", method = RequestMethod.POST)
@ResponseBody
public Result checkMenuName(@RequestBody Menu menu) {
return menuService.checkMenuName(menu);
}
@RequestMapping(value = "/checkMenuCode", method = RequestMethod.POST)
@ResponseBody
public Result checkMenuCode(@RequestBody Menu menu) {
return menuService.checkMenuCode(menu);
}
}
@RequestMapping(value = "/orgUser/findUserInOrgUnit", method = RequestMethod.POST)
@ResponseBody
public PageInfo<OrgUnitUser> findUserInOrgUnit(@RequestBody QueryOrgUnitUserVo vo) {
return orgUnitService.findUserInOrgUnit(vo);
}
@RequestMapping(value = "/orgUser/add", method = RequestMethod.POST)
@ResponseBody
public Result addOrgUser(@RequestBody OrgUnitUser orgUnitUser) {
return orgUnitService.insertOrgUnitUser(orgUnitUser);
}
@RequestMapping(value = "/orgUser/remove", method = RequestMethod.POST)
@ResponseBody
public Result removeOrgUser(@RequestBody OrgUnitUser orgUnitUser) {
return orgUnitService.deleteOrgUnitUser(orgUnitUser);
}
@RequestMapping(value = "/orgUser/setUnitHead", method = RequestMethod.POST)
@ResponseBody
public Result setUnitHead(@RequestBody OrgUnitUser orgUnitUser) {
return orgUnitService.setUnitHead(orgUnitUser);
}
@RequestMapping(value = "/orgUser/removeUnitHead", method = RequestMethod.POST)
@ResponseBody
public Result removeUnitHead(@RequestBody OrgUnitUser orgUnitUser) {
return orgUnitService.removeUnitHead(orgUnitUser);
}
}
}
@RequestMapping(value = "/updateContactsRole", method = RequestMethod.POST)
@ResponseBody
public Result updateContactsRole(@RequestBody ContactsRole contactsRole) {
return opportunityService.updateContactsRole(contactsRole);
}
@RequestMapping(value = "/removeContactsRole", method = RequestMethod.POST)
@ResponseBody
public Result removeContactsRole(@RequestBody ContactsRole contactsRole) {
return opportunityService.deleteContactsRole(contactsRole);
}
@RequestMapping(value = "/remove", method = RequestMethod.POST)
@ResponseBody
public Result remove(@RequestBody Opportunity opportunity) {
return opportunityService.delete(opportunity);
}
@RequestMapping(value = "/history", method = RequestMethod.GET)
public String history() {
return "crm/opportunityHistory";
}
@RequestMapping(value = "/history/view/{opportunityId}", method = RequestMethod.GET)
public ModelAndView view(@PathVariable int opportunityId) {
ModelAndView vm = new ModelAndView("crm/opportunityView");
vm.addObject("opportunityId", opportunityId);
return vm;
}
@RequestMapping(value = "/findMonthlyFunnel", method = RequestMethod.POST)
@ResponseBody
public List<Map> findMonthlyFunnel(@RequestBody QueryOpportunityVo vo) {
List<Integer> userIdList = new ArrayList<>();
userIdList.add(getUser().getUserId());
vo.setUserIdList(userIdList);
return opportunityService.findMonthlyFunnel(vo);
}
@RequestMapping(value = "/findMonthlyConversion", method = RequestMethod.POST)
@ResponseBody
@RequestMapping(value = "/menu/saveMenu", method = RequestMethod.POST)
@ResponseBody
public Result saveMenu(@RequestBody Map map) {
return roleService.saveRoleMenu((Integer) map.get("roleId"), (List<Integer>) map.get("menuIdList"));
}
@RequestMapping(value = "/fun/{roleId}", method = RequestMethod.GET)
public ModelAndView roleFun(@PathVariable int roleId) {
ModelAndView vm = new ModelAndView("sys/roleFun");
vm.addObject("roleId", roleId);
return vm;
}
}
@Controller
@RequestMapping("/orgUnit")
public class OrgUnitController extends AuthorizedController {
@Autowired
private OrgUnitService orgUnitService;
@RequestMapping(value = "", method = RequestMethod.GET)
public String index() {
return "masterData/orgUnit";
}
@RequestMapping(value = "/findAllOrgUnit", method = RequestMethod.POST)
@ResponseBody
public List<OrgUnit> findAllOrgUnit() {
return orgUnitService.findAllOrgUnit();
}
Object value = field.get(item);
if (value != null) {
cell.setCellValue((Byte) value);
}
} else if (fieldType == Long.class) {
Object value = field.get(item);
if (value != null) {
cell.setCellValue((Long) value);
}
} else if (fieldType == Short.class) {
Object value = field.get(item);
if (value != null) {
cell.setCellValue((Short) value);
}
}
}
}
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
workbook.write(response.getOutputStream());
response.flushBuffer();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@ResponseBody
public Result add(@RequestBody Customer customer) {
customer.setCreateBy(getUser().getUserId());
return customerService.insert(customer);
}
@RequestMapping(value = "/checkCustomerName", method = RequestMethod.POST)
@ResponseBody
public Result checkCustomerName(@RequestBody Customer customer) {
return customerService.checkCustomerName(customer);
}
@RequestMapping(value = "/findById", method = RequestMethod.POST)
@ResponseBody
public Customer findById(@RequestBody Customer customer) {
return customerService.findById(customer.getCustomerId());
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
@ResponseBody
public Result update(@RequestBody Customer customer) {
return customerService.update(customer);
}
@RequestMapping(value = "/dashboard/{customerId}", method = RequestMethod.GET)
public ModelAndView dashboard(@PathVariable int customerId) {
ModelAndView vm = new ModelAndView("crm/customerDashboard");
vm.addObject("customerId", customerId);
return vm;
}
@RequestMapping(value = "/updateStar", method = RequestMethod.POST)
@ResponseBody
public Result updateStar(@RequestBody Customer customer) {
return customerService.updateStar(customer);
}
@RequestMapping(value = "/updateLocation", method = RequestMethod.POST)
@ResponseBody
public Result updateLocation(@RequestBody Customer customer) {
return customerService.updateLocation(customer);
}
}
@Controller
@RequestMapping("/orgUnit")
public class OrgUnitController extends AuthorizedController {
@Autowired
private OrgUnitService orgUnitService;
@RequestMapping(value = "", method = RequestMethod.GET)
public String index() {
return "masterData/orgUnit";
}
@RequestMapping(value = "/findAllOrgUnit", method = RequestMethod.POST)
@ResponseBody
public List<OrgUnit> findAllOrgUnit() {
return orgUnitService.findAllOrgUnit();
}
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Result add(@RequestBody OrgUnit orgUnit) {
return orgUnitService.insert(orgUnit);
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
@ResponseBody
public Result update(@RequestBody OrgUnit orgUnit) {
return orgUnitService.update(orgUnit);
}
@RequestMapping(value = "/remove", method = RequestMethod.POST)
@ResponseBody
public Result remove(@RequestBody OrgUnit orgUnit) {
return orgUnitService.delete(orgUnit.getOrgUnitId());
}
@RequestMapping(value = "/up", method = RequestMethod.POST)
@ResponseBody
public Result up(@RequestBody OrgUnit orgUnit) {
return orgUnitService.up(orgUnit.getOrgUnitId());
}
@RequestMapping(value = "/down", method = RequestMethod.POST)
@ResponseBody
public Result down(@RequestBody OrgUnit orgUnit) {
return orgUnitService.down(orgUnit.getOrgUnitId());
@Controller
@RequestMapping("/orgUnit")
public class OrgUnitController extends AuthorizedController {
@Autowired
private OrgUnitService orgUnitService;
@RequestMapping(value = "", method = RequestMethod.GET)
public String index() {
return "masterData/orgUnit";
}
@RequestMapping(value = "/findAllOrgUnit", method = RequestMethod.POST)
@ResponseBody
public List<OrgUnit> findAllOrgUnit() {
return orgUnitService.findAllOrgUnit();
}
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Result add(@RequestBody OrgUnit orgUnit) {
return orgUnitService.insert(orgUnit);
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
@ResponseBody
public Result remove(@RequestBody OrgUnit orgUnit) {
return orgUnitService.delete(orgUnit.getOrgUnitId());
}
@RequestMapping(value = "/up", method = RequestMethod.POST)
@ResponseBody
public Result up(@RequestBody OrgUnit orgUnit) {
return orgUnitService.up(orgUnit.getOrgUnitId());
}
@RequestMapping(value = "/down", method = RequestMethod.POST)
@ResponseBody
public Result down(@RequestBody OrgUnit orgUnit) {
return orgUnitService.down(orgUnit.getOrgUnitId());
}
@RequestMapping(value = "/orgUser", method = RequestMethod.GET)
public String orgUser() {
return "masterData/orgUser";
}
@RequestMapping(value = "/orgUser/findUserNotInOrgUnit", method = RequestMethod.POST)
@ResponseBody
public PageInfo<User> findUserNotInOrgUnit(@RequestBody QueryOrgUnitUserVo vo) {
return orgUnitService.findUserNotInOrgUnit(vo);
}
@RequestMapping(value = "/orgUser/findUserInOrgUnit", method = RequestMethod.POST)
@ResponseBody
public PageInfo<OrgUnitUser> findUserInOrgUnit(@RequestBody QueryOrgUnitUserVo vo) {
return orgUnitService.findUserInOrgUnit(vo);
}
@RequestMapping(value = "/orgUser/add", method = RequestMethod.POST)
@ResponseBody
public Result addOrgUser(@RequestBody OrgUnitUser orgUnitUser) {
return orgUnitService.insertOrgUnitUser(orgUnitUser);
}
@RequestMapping(value = "/orgUser/remove", method = RequestMethod.POST)
@ResponseBody
public Result removeOrgUser(@RequestBody OrgUnitUser orgUnitUser) {
return orgUnitService.deleteOrgUnitUser(orgUnitUser);
}
@RequestMapping(value = "/orgUser/setUnitHead", method = RequestMethod.POST)
@Controller
@RequestMapping("/role")
public class RoleController extends AuthorizedController {
@Autowired
private RoleService roleService;
@RequestMapping(value = "", method = RequestMethod.GET)
public String index() {
return "sys/role";
}
@RequestMapping(value = "/findAll", method = RequestMethod.POST)
@ResponseBody
public List<Role> findAll() {
return roleService.findAll();
}
@RequestMapping(value = "/checkRoleName", method = RequestMethod.POST)
@ResponseBody
public Result existRoleName(@RequestBody Role role) {
return roleService.checkRoleName(role);
}
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Result add(@RequestBody Role role) {
return roleService.insert(role);
}
return userService.deleteByIds(ids);
}
@RequestMapping(value = "/findById", method = RequestMethod.POST)
@ResponseBody
public User findById(@RequestBody User user) {
return userService.findById(user.getUserId());
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
@ResponseBody
public Result update(@RequestBody User user) {
Result result = userService.update(user);
if (result.isSuccess() && user.getUserId() == getUser().getUserId()) {
session.setAttribute("User", userService.findById(getUser().getUserId()));
}
return result;
}
@RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
@ResponseBody
public Result updateStatus(@RequestBody User user) {
return userService.updateStatus(user);
}
@RequestMapping(value = "/checkUserName", method = RequestMethod.POST)
@ResponseBody
public Result checkUserName(@RequestBody User user) {
return userService.checkUserName(user);
}
@RequestMapping(value = "/resetPassword", method = RequestMethod.POST)
@ResponseBody
public Result resetPassword(@RequestBody User user) {
return userService.resetPassword(user);
}
@RequestMapping(value = "/profile", method = RequestMethod.GET)
public String profile() {
return "sys/profile";
}
@RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
@ResponseBody
public Result updatePassword(@RequestBody UpdatePasswordVo vo) {
return userService.updatePassword(vo);
}
}
@Controller
@RequestMapping("/role")
public class RoleController extends AuthorizedController {
@Autowired
private RoleService roleService;
@RequestMapping(value = "", method = RequestMethod.GET)
public String index() {
return "sys/role";
}
@RequestMapping(value = "/findAll", method = RequestMethod.POST)
@ResponseBody
public List<Role> findAll() {
return roleService.findAll();
}
@RequestMapping(value = "/checkRoleName", method = RequestMethod.POST)
@ResponseBody
public Result existRoleName(@RequestBody Role role) {
return roleService.checkRoleName(role);
}
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Result add(@RequestBody Role role) {
return roleService.insert(role);
}
@RequestMapping(value = "/remove", method = RequestMethod.POST)
@ResponseBody
public Result delete(@RequestBody List<Integer> ids) {
return roleService.deleteByIds(ids);