Java 实战项目之CRM客户管理系统的实现流程

网友投稿 222 2022-11-22

Java 实战项目之CRM客户管理系统的实现流程

一、项目简述

功能包括: 用户管理,系统管理,客户管理,客户服务,客户关怀, 销售机会,统计管理等等。

二、项目运行

环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: 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);

}

/**

* 根据id获取员工具体信息

* @param id

* @return

*/

@GetMapping("/getUserById")

public EmployeeDTO getUserAllInfoById(@RequestParam(name = "id") Integer id) {

return employeeService.getUserById(id);

}

/**

* 根据员工获取信息

* @param id

* @return

http:// */

@GetMapping("/getEmployeeById")

public Employee getUserById(@RequestParam(name = "id") Integer id) {

return employeeMapper.selectById(id);

}

/**

* 增加员工接口

*

* @param employee

* @return

*/

@PostMapping("/add")

public Map addUser(@RequestBody Employee employee) {

log.info(employee.toString());

return employeeService.add(employee);

}

/**

* 更新用户

* @param employee

* @return

*/

@PostMapping("/update")

public Map 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 dismissEmployeeById(@RequestParam(name = "id") Integer id) {

return employeeService.dismissEmployeeById(id);

}

/**

* 得到所以工作,部门,学历信息

*

* @return

*/

@GetMapping("/otherInfo")

public Result getAllOtherInfo() {

Map 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();

}

}

人事管理相关接口:

/**

* 人事管理相关接口

*/

@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);

}

}

服务端:

/**

* websocket 服务端

* 注意: websocket 不能被代理,还有下面几个注解修饰的方法必须是public的

*/

@Component

@ServerEndpoint("/websocket/login")

@Slf4j

public class WebSocketServer {

// static Log log = LogFactory.get(WebSocketServer.class);

/**

* 记录连接数量

*/

private static int onlineCount = 0;

/**

* juc中的线程安全容器

*/

private static CopyOnWriteArraySet webSocketSet = new CopyOnWriteArraySet<>();

/**

* 存放websocket 中的会话

*/

private Session session;

/**

* 连接建立成功调用的方法

*/

@OnOpen

public void onOpen(Session session) {

this.session = session;

webSocketSet.add(this);

addOnlineCount();

log.info("新增一个websocket连接,现在连接数" + getOnlineCount());

}

/**

* websocket 连接断开调用的方法

*/

@OnClose

public void onClose() {

webSocketSet.remove(this);

subOnlineCount();

log.info("断开websocket一个连接,现在连接数:" + getOnlineCount());

}

/**

* 收到消息调用此方法

*

* @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();

}

}

/**

* 发生错误调用的方法

*

* @param session

* @param throwable

*/

@OnError

public void onError(Session session, Throwable throwable) {

log.error("发送错误, ");

throwable.printStackTrace();

}

/**

* 实现主动推送消息到客户端

*/

public void sendMessage(String message) throws IOException {

if (session != null) {

this.session.getBasicRemote().sendText(message);

} elsehttp:// {

log.info("session为空");

}

}

public static void sendInfo(Object message, String type) throws IOException {

log.info("推送消息到窗口,推送内容:" + message);

Map resultMap = new HashMap<>();

resultMap.put("type", type);

resultMap.put("message", message);

JSONObject jsonObject = JSONUtil.parseObj(resultMap);

for (WebSocketServer item : webSocketSet) {

try {

//这里可以设定只推送给这个sid的,为null则全部推送

item.sendMessage(jsonObject.toString());

} catch (IOException e) {

continue;

}

}

}

public static synchronized int getOnlineCount() {

return onlineCount;

}

public static synchronized voidXaJOWa addOnlineCount() {

WebSocketServer.onlineCount++;

}

pubXaJOWalic static synchronized void subOnlineCount() {

WebSocketServer.onlineCount--;

}

}

以上就是java 实战项目之CRM客户管理系统的实现流程的详细内容,更多关于Java CRM客户管理系统的资料请关注我们其它相关文章!

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:在科技发展的路上创基Type-C分线器伴你前行
下一篇:hive hwi配置
相关文章

 发表评论

暂时没有评论,来抢沙发吧~