|
|
@@ -16,6 +16,7 @@ import me.chanjar.weixin.mp.api.WxMpService;
|
|
16
|
16
|
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
|
|
17
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
18
|
18
|
import org.springframework.stereotype.Component;
|
|
|
19
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
19
|
20
|
|
|
20
|
21
|
import javax.annotation.PostConstruct;
|
|
21
|
22
|
import javax.websocket.*;
|
|
|
@@ -71,11 +72,14 @@ public class WebSocket {
|
|
71
|
72
|
servicerQueue.add(userCode);
|
|
72
|
73
|
}
|
|
73
|
74
|
} else {
|
|
74
|
|
- reply=customers.containsKey(userCode);
|
|
75
|
|
- if(!reply) {
|
|
|
75
|
+ reply = customers.containsKey(userCode);
|
|
|
76
|
+ if (!reply) {
|
|
76
|
77
|
customers.put(userCode, source);
|
|
77
|
78
|
khsessionPool.put(userCode, session);
|
|
78
|
|
- addCustomer(userCode,source);
|
|
|
79
|
+ Long pid = null;
|
|
|
80
|
+ List<String> ps = session.getRequestParameterMap().get("project");
|
|
|
81
|
+ if (!ps.isEmpty()) pid = Long.valueOf(ps.get(0));
|
|
|
82
|
+ addCustomer(userCode, source, pid);
|
|
79
|
83
|
}
|
|
80
|
84
|
}
|
|
81
|
85
|
if(reply) {
|
|
|
@@ -464,7 +468,7 @@ public class WebSocket {
|
|
464
|
468
|
|
|
465
|
469
|
if (!customers.containsKey(sendUser)) {
|
|
466
|
470
|
customers.put(sendUser, 2);
|
|
467
|
|
- addCustomer(sendUser,2);
|
|
|
471
|
+ addCustomer(sendUser,2,null);
|
|
468
|
472
|
};
|
|
469
|
473
|
|
|
470
|
474
|
String kf = khkfs.get(sendUser);
|
|
|
@@ -491,13 +495,14 @@ public class WebSocket {
|
|
491
|
495
|
webSocket.messageService.insert(message);
|
|
492
|
496
|
}
|
|
493
|
497
|
|
|
494
|
|
- public void addCustomer(String userCode,Integer source) {
|
|
|
498
|
+ public void addCustomer(String userCode,Integer source,Long project) {
|
|
495
|
499
|
LambdaQueryWrapper<Customer> qw = new LambdaQueryWrapper();
|
|
496
|
500
|
qw.eq(Customer::getCustomerNo, userCode);
|
|
497
|
501
|
if (!webSocket.customerService.exists(qw)) {
|
|
498
|
502
|
Customer customer = new Customer();
|
|
499
|
503
|
customer.setCustomerNo(userCode);
|
|
500
|
504
|
customer.setType(Long.valueOf(source));
|
|
|
505
|
+ customer.setProject(project);
|
|
501
|
506
|
customer.setFCreatetime(new Date());
|
|
502
|
507
|
customer.setFIsdelete(0L);
|
|
503
|
508
|
webSocket.customerService.insert(customer);
|