CX hai 1 ano
pai
achega
bd1ce8a723

+ 5 - 0
src/main/java/com/dashitech/businessdata/entity/CallLogEntity.java

@@ -162,4 +162,9 @@ public class CallLogEntity implements Serializable {
162 162
     public void setVersion(Integer version) {
163 163
         this.version = version;
164 164
     }
165
+
166
+    @Override
167
+    public String toString() {
168
+        return "CallLogEntity{" + "id=" + id + ", version=" + version + ", callDept='" + callDept + '\'' + ", phyIDA='" + phyIDA + '\'' + ", dTMFA='" + dTMFA + '\'' + ", dTMFB='" + dTMFB + '\'' + ", responseTime=" + responseTime + ", longTime='" + longTime + '\'' + ", path='" + path + '\'' + ", callType=" + callType + ", callState=" + callState + ", hosId=" + hosId + '}';
169
+    }
165 170
 }

+ 24 - 15
src/main/java/com/dashitech/callcenter/socket/HandlerThread.java

@@ -449,7 +449,13 @@ public class HandlerThread  {
449 449
                     return "暂无";
450 450
                 }
451 451
                 //给来电科室赋值
452
-                String deptName = departmentDAO.getDeptNameByPhone(phone);
452
+                String deptName = "";
453
+                if("HSMS".equals(projectMain)) {
454
+                    deptName = hsmsCallLogDAO.getDeptNameByPhone(phone);
455
+                } else {    //其它,以运维项目为主
456
+                    deptName = departmentDAO.getDeptNameByPhone(phone);
457
+                }
458
+
453 459
                 if (deptName!=null&&!deptName.equals("")){
454 460
                     return deptName;
455 461
                 }else {
@@ -572,7 +578,8 @@ public class HandlerThread  {
572 578
     }
573 579
 
574 580
     private void saveHsmsCallLog(CallLogEntity callLog,String uuid) {
575
-        log.info("开始保存HSMS通话记录2");
581
+        log.info("开始保存HSMS通话记录");
582
+        log.info(callLog);
576 583
         HsmsCallLogEntity hsmsCallLog = null;
577 584
 
578 585
         try {
@@ -580,10 +587,11 @@ public class HandlerThread  {
580 587
                 String hosId = hsmsCallLogDAO.selectSernelNo("sernelNo",serialNo);
581 588
 
582 589
                 if(StringUtils.isNotEmpty(uuid)) {
583
-                    Long id = callRecordDAO.selectIdByUuid(uuid);
590
+                    Long id = hsmsCallLogDAO.selectIdByUuid(uuid);
584 591
                     if(id == null) {
585 592
                         hsmsCallLog = new HsmsCallLogEntity();
586 593
                         copyCallLog(callLog,hsmsCallLog);
594
+                        hsmsCallLog.setVersion(0);
587 595
                         hsmsCallLog.setCallAccept(uuid);
588 596
                         hsmsCallLog.setHosId(StringUtils.isEmpty(hosId)? null : Integer.valueOf(hosId));
589 597
                         hsmsCallLogDAO.save(hsmsCallLog);
@@ -595,25 +603,28 @@ public class HandlerThread  {
595 603
                     log.info("开始匹配HSMS临时通话记录");
596 604
                     hsmsCallLog = hsmsCallLogDAO.selectByParams(callLog.getdTMFA(), callLog.getdTMFB(), callLog.getResponseTime());
597 605
                     if(hsmsCallLog == null) {   //新增
606
+                        log.info("HSMS未匹配到,开始新增");
598 607
                         hsmsCallLog = new HsmsCallLogEntity();
599
-                        copyCallLog(callLog,hsmsCallLog);
600
-                        hsmsCallLog.setVersion(0);
608
+                        callLog.setVersion(0);
601 609
                         hsmsCallLog.setCallAccept(UUID.randomUUID().toString());
602
-                        hsmsCallLog.setHosId(StringUtils.isEmpty(hosId)? null : Integer.valueOf(hosId));
603 610
                     }
611
+
612
+                    copyCallLog(callLog,hsmsCallLog);
613
+                    hsmsCallLog.setHosId(StringUtils.isEmpty(hosId)? null : Integer.valueOf(hosId));
614
+
604 615
                     if(callLog.getPath() != null && StringUtils.isNotEmpty(callLog.getPath())) {
605
-                        String newPath = callLog.getPath();
606
-                        String[] arr = callLog.getPath().split(recordRegex);
607
-                        if (arr.length > 1) {
608
-                            newPath = recordNginxPath + arr[1];
609
-                        }
610
-                        hsmsCallLog.setPath(newPath);
616
+//                        String newPath = callLog.getPath();
617
+//                        String[] arr = callLog.getPath().split(recordRegex);
618
+//                        if (arr.length > 1) {
619
+//                            newPath = recordNginxPath + arr[1];
620
+//                        }
621
+//                        hsmsCallLog.setPath(newPath);
611 622
                     }else {
612 623
                         log.info("HSMS callLog 保存没有路径path");
613 624
                         return;
614 625
                     }
615 626
                     hsmsCallLogDAO.save(hsmsCallLog);
616
-                    log.info("保存HSMS通话记录2完成!");
627
+                    log.info("保存HSMS通话记录完成!");
617 628
                 }
618 629
 
619 630
                 log.info("保存HSMS通话记录完成:"+hsmsCallLog.getCallAccept());
@@ -625,10 +636,8 @@ public class HandlerThread  {
625 636
     }
626 637
 
627 638
     private HsmsCallLogEntity copyCallLog(CallLogEntity callLog,HsmsCallLogEntity hsmsCallLog) {
628
-        hsmsCallLog.setId(callLog.getId());
629 639
         hsmsCallLog.setVersion(callLog.getVersion());
630 640
         hsmsCallLog.setHosId(callLog.getHosId());
631
-        hsmsCallLog.setCallAccept(callLog.getCallDept());
632 641
         hsmsCallLog.setCallDept(callLog.getCallDept());
633 642
         hsmsCallLog.setPhyIDA(callLog.getPhyIDA());
634 643
         hsmsCallLog.setdTMFA(callLog.getdTMFA());

+ 5 - 0
src/main/java/com/dashitech/hsms/dao/IHsmsCallLogDAO.java

@@ -18,4 +18,9 @@ public interface IHsmsCallLogDAO extends JpaRepository<HsmsCallLogEntity, String
18 18
     @Query(value = "select hos_id from itsm_system_hospital_config where _key = ?1 and _value =?2 limit 1 ",nativeQuery = true)
19 19
     String selectSernelNo(String key,String value);
20 20
 
21
+    @Query(value = " select a.id from HsmsCallLogEntity a where a.callAccept=:uuid ")
22
+    Long selectIdByUuid(@Param("uuid") String uuid);
23
+
24
+    @Query(value = "SELECT dept FROM itsm_uc_dept g WHERE g.many_phone like CONCAT('%',:phone,'%') AND g.delete_flag = 0 limit 1", nativeQuery = true)
25
+    String getDeptNameByPhone(@Param("phone")String phone);
21 26
 }

+ 14 - 9
src/main/resources/application.properties

@@ -4,11 +4,12 @@
4 4
 # //TODO 转运配置
5 5
 mysql1.spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
6 6
 mysql1.spring.datasource.driver-class-name=com.mysql.jdbc.Driver
7
-#mysql1.spring.datasource.url=jdbc:mysql://localhost:3306/hsms2_0622?autoReconnect=true&useUnicode=true&characterEncoding=utf8
7
+# 南京
8
+mysql1.spring.datasource.url=jdbc:mysql://192.144.201.19:3306/hsms2_0622?autoReconnect=true&useUnicode=true&characterEncoding=utf8
8 9
 #mysql1.spring.datasource.url=jdbc:mysql://192.168.3.108:3306/hsms2_0622?autoReconnect=true&useUnicode=true&characterEncoding=utf8
9
-mysql1.spring.datasource.url=jdbc:mysql://192.168.3.111:3306/md2?autoReconnect=true&useUnicode=true&characterEncoding=utf8
10 10
 mysql1.spring.datasource.username=root
11 11
 #mysql1.spring.datasource.password=DStech@123
12
+# 南京
12 13
 mysql1.spring.datasource.password=100100
13 14
 
14 15
 # 下面为连接池的补充设置,应用到上面所有数据源中
@@ -32,10 +33,12 @@ mysql1.spring.datasource.testOnReturn=true
32 33
 # //TODO ITSM配置
33 34
 mysql2.spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
34 35
 mysql2.spring.datasource.driver-class-name=com.mysql.jdbc.Driver
35
-#mysql2.spring.datasource.url=jdbc:mysql://localhost:3306/hsms2_1129?autoReconnect=true&useUnicode=true&characterEncoding=utf8
36
-mysql2.spring.datasource.url=jdbc:mysql://192.168.3.111:3306/md2?autoReconnect=true&useUnicode=true&characterEncoding=utf8
36
+# 南京
37
+mysql2.spring.datasource.url=jdbc:mysql://192.144.201.19:3306/md2?autoReconnect=true&useUnicode=true&characterEncoding=utf8
38
+#mysql2.spring.datasource.url=jdbc:mysql://192.168.3.111:3306/md2?autoReconnect=true&useUnicode=true&characterEncoding=utf8
37 39
 mysql2.spring.datasource.username=root
38 40
 #mysql2.spring.datasource.password=DStech@123
41
+# 南京
39 42
 mysql2.spring.datasource.password=100100
40 43
 
41 44
 mysql2.spring.datasource.initialSize=3
@@ -50,11 +53,13 @@ mysql2.spring.datasource.testOnBorrow=true
50 53
 mysql2.spring.datasource.testOnReturn=true
51 54
 
52 55
 #project=HSMS
53
-project=ITSM
54
-#project=ALL
55
-#配置呼叫中心以哪个项目为主,单个与project一致即可
56
-project.main=ITSM
57
-db.hjzx.record.nginx=/hjzxRecord
56
+#project=ITSM
57
+project=ALL
58
+#配置呼叫中心以哪个项目为主,ITSM或者HSMS。单项目与project一致即可
59
+project.main=HSMS
60
+#db.hjzx.record.nginx=/hjzxRecord
61
+# 南京
62
+db.hjzx.record.nginx=/record/192.144.41.171
58 63
 db.hjzx.record.path.regex=voice
59 64
 
60 65