Java 實(shí)戰(zhàn)項(xiàng)目之CRM客戶管理系統(tǒng)的實(shí)現(xiàn)流程
一、項(xiàng)目簡述
功能包括: 用戶管理,系統(tǒng)管理,客戶管理,客戶服務(wù),客戶關(guān)懷, 銷售機(jī)會,統(tǒng)計(jì)管理等等。
二、項(xiàng)目運(yùn)行
環(huán)境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
項(xiàng)目技術(shù): JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
員工操作:
/** * @author 員工操作 */ @RestController @RequestMapping("/employee") @CrossOrigin @Slf4j public class EmployeeController { @Autowired private EmployeeService employeeService; @Autowired private DepartmentService departmentService; @Autowired private JobService jobService; @Autowired private EduLevelMapper eduLevelMapper; @Autowired private EmployeeMapper employeeMapper; /** * 搜索接口 */ @GetMapping("/search") public Result search(@RequestParam(name = "name", required = false,defaultValue = "") String name, @RequestParam(name = "current", required = false, defaultValue = "1") Integer current, @RequestParam(name = "size", required = false, defaultValue = "10") Integer size) { return employeeService.list(current, size, name); } /** * 分頁查詢接口 * * @param current * @param size * @return */ @GetMapping("/list") public Result list(@RequestParam(name = "current", required = false, defaultValue = "1") Integer current, @RequestParam(name = "size", required = false, defaultValue = "10") Integer size) { return employeeService.list(current, size, null); } /** * 根據(jù)id獲取員工具體信息 * @param id * @return */ @GetMapping("/getUserById") public EmployeeDTO getUserAllInfoById(@RequestParam(name = "id") Integer id) { return employeeService.getUserById(id); } /** * 根據(jù)員工獲取信息 * @param id * @return */ @GetMapping("/getEmployeeById") public Employee getUserById(@RequestParam(name = "id") Integer id) { return employeeMapper.selectById(id); } /** * 增加員工接口 * * @param employee * @return */ @PostMapping("/add") public Map<String, Object> addUser(@RequestBody Employee employee) { log.info(employee.toString()); return employeeService.add(employee); } /** * 更新用戶 * @param employee * @return */ @PostMapping("/update") public Map<String, Object> updateUser(@RequestBody Employee employee) { log.info(employee.toString()); return employeeService.update(employee); } /** * 刪除用戶 * @param id * @return */ @GetMapping("/delete") public Result deleteEmployeeById(@RequestParam(name = "id") Integer id) { return employeeService.deleteEmployeeById(id); } /** * 辭退員工 * * @param id * @return */ @GetMapping("/dismiss") public Map<String, Object> dismissEmployeeById(@RequestParam(name = "id") Integer id) { return employeeService.dismissEmployeeById(id); } /** * 得到所以工作,部門,學(xué)歷信息 * * @return */ @GetMapping("/otherInfo") public Result getAllOtherInfo() { Map<String, Object> info = new HashMap<>(); info.put("departments", departmentService.selectAll()); info.put("jobs", jobService.selectAll()); info.put("eduLevels", eduLevelMapper.selectList(null)); return Result.success(info); } @GetMapping("/map") public Result getMap() { return employeeService.getMap(); } }
人事管理相關(guān)接口:
/** * 人事管理相關(guān)接口 */ @RestController @CrossOrigin @RequestMapping("/personnel") public class PersonnelController { @Autowired private PersonnelService personnelService; /** * 所以人事記錄接口 * @param current * @param size * @return */ @GetMapping("/list") public Result list(@RequestParam(name = "current", required = false, defaultValue = "1") Integer current, @RequestParam(name = "size", required = false, defaultValue = "10") Integer size) { return personnelService.list(current, size); } }
服務(wù)端:
/** * websocket 服務(wù)端 * 注意: websocket 不能被代理,還有下面幾個(gè)注解修飾的方法必須是public的 */ @Component @ServerEndpoint("/websocket/login") @Slf4j public class WebSocketServer { // static Log log = LogFactory.get(WebSocketServer.class); /** * 記錄連接數(shù)量 */ private static int onlineCount = 0; /** * juc中的線程安全容器 */ private static CopyOnWriteArraySet<WebSocketServer> webSocketSet = new CopyOnWriteArraySet<>(); /** * 存放websocket 中的會話 */ private Session session; /** * 連接建立成功調(diào)用的方法 */ @OnOpen public void onOpen(Session session) { this.session = session; webSocketSet.add(this); addOnlineCount(); log.info("新增一個(gè)websocket連接,現(xiàn)在連接數(shù)" + getOnlineCount()); } /** * websocket 連接斷開調(diào)用的方法 */ @OnClose public void onClose() { webSocketSet.remove(this); subOnlineCount(); log.info("斷開websocket一個(gè)連接,現(xiàn)在連接數(shù):" + getOnlineCount()); } /** * 收到消息調(diào)用此方法 * * @param message * @param session */ @OnMessage public void onMessage(String message, Session session) { log.info("websocket 收到消息了: " + message); try { sendInfo("hello, too!!!", "text"); } catch (IOException e) { e.printStackTrace(); } } /** * 發(fā)生錯誤調(diào)用的方法 * * @param session * @param throwable */ @OnError public void onError(Session session, Throwable throwable) { log.error("發(fā)送錯誤, "); throwable.printStackTrace(); } /** * 實(shí)現(xiàn)主動推送消息到客戶端 */ public void sendMessage(String message) throws IOException { if (session != null) { this.session.getBasicRemote().sendText(message); } else { log.info("session為空"); } } public static void sendInfo(Object message, String type) throws IOException { log.info("推送消息到窗口,推送內(nèi)容:" + message); Map<String, Object> resultMap = new HashMap<>(); resultMap.put("type", type); resultMap.put("message", message); JSONObject jsonObject = JSONUtil.parseObj(resultMap); for (WebSocketServer item : webSocketSet) { try { //這里可以設(shè)定只推送給這個(gè)sid的,為null則全部推送 item.sendMessage(jsonObject.toString()); } catch (IOException e) { continue; } } } public static synchronized int getOnlineCount() { return onlineCount; } public static synchronized void addOnlineCount() { WebSocketServer.onlineCount++; } public static synchronized void subOnlineCount() { WebSocketServer.onlineCount--; } }
以上就是Java 實(shí)戰(zhàn)項(xiàng)目之CRM客戶管理系統(tǒng)的實(shí)現(xiàn)流程的詳細(xì)內(nèi)容,更多關(guān)于Java CRM客戶管理系統(tǒng)的資料請關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
SpringBoot開發(fā)案例之打造私有云網(wǎng)盤的實(shí)現(xiàn)
這篇文章主要介紹了SpringBoot開發(fā)案例之打造私有云網(wǎng)盤的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-04-04springboot+thymeleaf+mybatis實(shí)現(xiàn)甘特圖的詳細(xì)過程
這篇文章主要介紹了springboot+thymeleaf+mybatis實(shí)現(xiàn)甘特圖的詳細(xì)過程,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-07-07mybatis使用pageHelper插件進(jìn)行查詢分頁
這篇文章主要介紹了mybatis使用pageHelper插件進(jìn)行查詢分頁,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-08-08鴻蒙HarmonyOS App開發(fā)造輪子之自定義圓形圖片組件的實(shí)例代碼
這篇文章主要介紹了鴻蒙HarmonyOS App開發(fā)造輪子之自定義圓形圖片組件,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-01-01Mybatis中#{}和${}傳參的區(qū)別及#和$的區(qū)別小結(jié)
這篇文章主要介紹了Mybatis中#{}和${}傳參的區(qū)別及#和$的區(qū)別小結(jié) 的相關(guān)資料,非常不錯,具有參考借鑒價(jià)值,需要的朋友可以參考下2016-07-07淺談Java數(shù)據(jù)結(jié)構(gòu)之稀疏數(shù)組知識總結(jié)
今天帶大家了解一下Java稀疏數(shù)組的相關(guān)知識,文中有非常詳細(xì)的介紹及代碼示例,對正在學(xué)習(xí)java的小伙伴們有很好地幫助,需要的朋友可以參考下2021-05-05