• 首页
  • 栏目
  • CRM
  • Java项目:CRM客户关系管理系统(java+Springboot+maven+mysql)

Java项目:CRM客户关系管理系统(java+Springboot+maven+mysql)

  • 2021-12-11
  • Admin

Springboot项目CRM客户关系管理系统:

系统实现了CRM客户关系系统的基本功能,主要有看板(当月参与的业务机会、当月转化情况、将要结束的业务机会等)、业务机会(初步接触中、需求分析中、协商方案中、商业谈判中的业务机会)、客户管理、联系人管理、个人日报管理、查看团队日报、主数据管理(组织架构管理)、系统管理(用户管理、角色管理、菜单管理)。

 

 

 

 

 

 

角色控制层:

  1. /**
  2. * @author yy
  3. */
  4. @Controller
  5. @RequestMapping("/role")
  6. public class RoleController extends BaseController{
  7. private String prefix = "system/role/";
  8. @Autowired
  9. IUserService iUserService;
  10. @Autowired
  11. IRoleService iRoleService;
  12. @Autowired
  13. IPermissionService iPermissionService;
  14. /**
  15. *
  16. * @描述 页面跳转
  17. *
  18. * @date 2018/9/16 10:59
  19. */
  20. @RequestMapping("/tolist")
  21. @RequiresPermissions("role:list")
  22. public String tolist()
  23. {
  24. return prefix + "role";
  25. }
  26. /**
  27. *
  28. * @描述 ajax请求所有
  29. *
  30. * @date 2018/9/16 10:48
  31. */
  32. @RequestMapping("/ajaxlist")
  33. @ResponseBody
  34. public List list(Role role)
  35. {
  36. List roles = iRoleService.selectRoleList(role);
  37. return roles;
  38. }
  39. /**
  40. *
  41. * @描述 列表
  42. *
  43. * @date 2018/9/16 10:52
  44. */
  45. @RequestMapping("/tableList")
  46. @ResponseBody
  47. public TableDataInfo listPag(Role role)
  48. {
  49. //开启分页
  50. startPage();
  51. List roles = iRoleService.selectRoleList(role);
  52. return getDataTable(roles);
  53. }
  54. /**
  55. *
  56. * @描述 新增页面
  57. *
  58. * @date 2018/9/16 11:37
  59. */
  60. @RequestMapping("/toAdd")
  61. @RequiresPermissions("role:add")
  62. public String toAdd(Model model)
  63. {
  64. return prefix + "add";
  65. }
  66. /**
  67. *
  68. * @描述 批量删除
  69. *
  70. * @date 2018/9/16 11:53
  71. */
  72. @RequestMapping("/del")
  73. @RequiresPermissions("role:del")
  74. @Operlog(modal = "角色管理",descr = "删除角色")
  75. @ResponseBody
  76. public AjaxResult del(Integer[] ids)
  77. {
  78. try
  79. {
  80. iRoleService.deleteByPrimaryKeys(ids);
  81. }
  82. catch (Exception e)
  83. {
  84. return error(e.getMessage());
  85. }
  86. return success();
  87. }
  88. /**
  89. *
  90. * @描述 添加保存
  91. *
  92. * @date 2018/9/16 11:54
  93. */
  94. @RequestMapping("/addSave")
  95. @RequiresPermissions("role:update")
  96. @Operlog(modal = "角色管理",descr = "添加角色")
  97. @ResponseBody
  98. public AjaxResult addRole(Role role, Integer[] ids)
  99. {
  100. role.setCreateTime(new Date());
  101. int insert = 0;
  102. try
  103. {
  104. if (StringUtils.isEmpty(ids))
  105. {
  106. ids = new Integer[0];
  107. }
  108. insert = iRoleService.insert(role, ids);
  109. }
  110. catch (Exception e)
  111. {
  112. return error(e.getMessage());
  113. }
  114. //清空缓存
  115. ShiroUtils.clearCachedAuthorizationInfo();
  116. return result(insert);
  117. }
  118. /**
  119. *
  120. * @描述: 根据ID 获取u他的所有权限 做回显
  121. *
  122. * @params: roleId 角色Id
  123. * @return:
  124. * @date: 2018/9/27 14:04
  125. */
  126. @RequestMapping("/selectById/{roleId}")
  127. @ResponseBody
  128. public Role selectById(@PathVariable("roleId") Integer roleId)
  129. {
  130. Role role = iRoleService.selectByPrimaryKey(roleId);
  131. return role;
  132. }
  133. /**
  134. *
  135. * @描述 编辑修改页面
  136. *
  137. * @date 2018/9/16 14:06
  138. */
  139. @RequestMapping("/edit/{id}")
  140. @RequiresPermissions("role:update")
  141. public String edit(@PathVariable("id") Integer id, Model model)
  142. {
  143. Role role = iRoleService.selectByPrimaryKey(id);
  144. model.addAttribute("Role", role);
  145. return prefix + "edit";
  146. }
  147. /**
  148. *
  149. * @描述 编辑修改权限页面
  150. *
  151. * @date 2018/9/16 14:06
  152. */
  153. @RequestMapping("/editPower/{id}")
  154. @RequiresPermissions("role:update")
  155. public String editPower(@PathVariable("id") Integer id, Model model)
  156. {
  157. Role role = iRoleService.selectByPrimaryKey(id);
  158. model.addAttribute("Role", role);
  159. return prefix + "editPower";
  160. }
  161. /**
  162. *
  163. * @描述 修改角色信息保存
  164. *
  165. * @date 2018/9/16 16:12
  166. */
  167. @RequestMapping("/editSave")
  168. @RequiresPermissions("role:update")
  169. @Operlog(modal = "角色管理",descr = "修改角色信息")
  170. @ResponseBody
  171. public AjaxResult save(Role role)
  172. {
  173. int i = 0;
  174. try
  175. {
  176. i = iRoleService.updateByPrimaryKeySelective(role);
  177. }
  178. catch (Exception e)
  179. {
  180. return error(e.getMessage());
  181. }
  182. return result(i);
  183. }
  184. /**
  185. *
  186. * @描述 修改角色权限信息保存
  187. *
  188. * @date 2018/9/16 16:12
  189. */
  190. @RequestMapping("/editPowerSave")
  191. @RequiresPermissions("role:update")
  192. @Operlog(modal = "角色管理",descr = "修改角色权限")
  193. @ResponseBody
  194. public AjaxResult editPowerSave(Role role, Integer[] ids)
  195. {
  196. int i = 0;
  197. try
  198. {
  199. if (StringUtils.isEmpty(ids))
  200. {
  201. ids = new Integer[0];
  202. }
  203. i = iRoleService.updateByPrimaryKeyPowerSelective(role, ids);
  204. }
  205. catch (Exception e)
  206. {
  207. return error(e.getMessage());
  208. }
  209. //清空缓存
  210. ShiroUtils.clearCachedAuthorizationInfo();
  211. //如果用户正在修改的角色id 是当前用户的角色id 则刷新 subject的User信息
  212. if (role.getRoleId().equals(getRoleId()))
  213. {
  214. ShiroUtils.reloadUser(iUserService.selectByPrimaryKey(getUserId()));
  215. }
  216. return result(i);
  217. }
  218. /**
  219. * 校验名称唯一
  220. */
  221. @PostMapping("/checkRoleNameUnique")
  222. @ResponseBody
  223. public String checkDeptNameUnique(Role role)
  224. {
  225. String uniqueFlag = "0";
  226. if (role != null)
  227. {
  228. uniqueFlag = iRoleService.checkRoleNameUnique(role);
  229. }
  230. return uniqueFlag;
  231. }
  232. }

登录控制层:

  1. @RequestMapping("/login")
  2. public class LoginController extends BaseController{
  3. private static final Logger logger = LoggerFactory.getLogger(LoginController.class);
  4. private String prefix = "system/user/";
  5. @Autowired
  6. LoginService loginService;
  7. @Autowired
  8. IUserService userService;
  9. /**
  10. *
  11. * @描述: 执行登录操作
  12. *
  13. * @params: user:用户登录信息;
  14. * validateCode:验证码

联系站长

QQ:769220720

Copyright © SibooSoft All right reserved 津ICP备19011444号