欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Java 實(shí)戰(zhàn)項(xiàng)目之CRM客戶管理系統(tǒng)的實(shí)現(xiàn)流程

 更新時(shí)間:2021年11月15日 14:59:27   作者:qq_1334611189  
讀萬卷書不如行萬里路,只學(xué)書上的理論是遠(yuǎn)遠(yuǎn)不夠的,只有在實(shí)戰(zhàn)中才能獲得能力的提升,本篇文章手把手帶你用java+SSM+jsp+mysql+maven實(shí)現(xiàn)一個(gè)CRM客戶管理系統(tǒng),大家可以在過程中查缺補(bǔ)漏,提升水平

一、項(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)文章

最新評論