1550076451 11 月之前
父節點
當前提交
7c7dba842d

+ 8 - 5
hjzx-api/pom.xml

67
             <artifactId>druid</artifactId>
67
             <artifactId>druid</artifactId>
68
             <version>1.1.22</version>
68
             <version>1.1.22</version>
69
         </dependency>
69
         </dependency>
70
-<!--        <dependency>-->
71
-<!--            <groupId>org.apache.shardingsphere</groupId>-->
72
-<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
73
-<!--            <version>5.1.1</version>-->
74
-<!--        </dependency>-->
70
+        <!-- 如果需要解码播放mp3文件则引入这个jar包 -->
71
+        <dependency>
72
+            <groupId>com.googlecode.soundlibs</groupId>
73
+            <artifactId>mp3spi</artifactId>
74
+            <version>1.9.5.4</version>
75
+        </dependency>
76
+
77
+
75
 
78
 
76
     </dependencies>
79
     </dependencies>
77
 
80
 

+ 57 - 2
hjzx-api/src/main/java/api/controller/HomeController.java

19
 import io.swagger.annotations.Api;
19
 import io.swagger.annotations.Api;
20
 import io.swagger.annotations.ApiOperation;
20
 import io.swagger.annotations.ApiOperation;
21
 import lombok.extern.slf4j.Slf4j;
21
 import lombok.extern.slf4j.Slf4j;
22
+
23
+
22
 import org.springframework.beans.factory.annotation.Autowired;
24
 import org.springframework.beans.factory.annotation.Autowired;
23
 import org.springframework.web.bind.annotation.*;
25
 import org.springframework.web.bind.annotation.*;
24
 import org.springframework.web.multipart.MultipartFile;
26
 import org.springframework.web.multipart.MultipartFile;
25
 
27
 
26
 import javax.servlet.http.HttpServletRequest;
28
 import javax.servlet.http.HttpServletRequest;
27
 import javax.servlet.http.HttpServletResponse;
29
 import javax.servlet.http.HttpServletResponse;
28
-import java.io.IOException;
29
-import java.io.PrintWriter;
30
+import javax.sound.sampled.*;
31
+import java.io.*;
30
 import java.util.*;
32
 import java.util.*;
31
 import java.util.stream.Collectors;
33
 import java.util.stream.Collectors;
32
 
34
 
33
 
35
 
36
+
34
 @Api(value = "默认", tags = "默认")
37
 @Api(value = "默认", tags = "默认")
35
 @Slf4j
38
 @Slf4j
36
 @Anonymous
39
 @Anonymous
51
 
54
 
52
     @Autowired
55
     @Autowired
53
     private WebSocket webSocket;
56
     private WebSocket webSocket;
57
+    @ApiOperation("GetViev")
58
+    @GetMapping("/GetViev")
59
+    public AjaxResult GetViev() {
60
+            Map<String,Object> map=new HashMap<>();
61
+               // 音频文件路径
62
+           String audioFilePath ="D:/6047871_2034_150732.mp3";
63
+  try
64
+  {
65
+      // FFmpeg命令:获取音频平均音量和音速
66
+     // String[] command = new String[]{"ffmpeg", "-i", audioFilePath, "-filter_complex", "volumedetect", "-f", "null", "NUL"};
67
+      String[] command = new String[]{"ffmpeg", "-i", audioFilePath, "-ss", "00:01:00", "-t", "00:02:00", "D:/6047871_2034_150732output.mp3"};
68
+      // 执行FFmpeg命令
69
+      ProcessBuilder builder = new ProcessBuilder(command);
70
+      builder.redirectErrorStream(true);
71
+      Process process = builder.start();
72
+      process.waitFor();
73
+      String[] command1 = new String[]{"ffmpeg", "-i", "D:/6047871_2034_150732output.mp3", "-filter_complex", "volumedetect", "-f", "null", "NUL"};
74
+      ProcessBuilder builder1 = new ProcessBuilder(command1);
75
+      builder1.redirectErrorStream(true);
76
+      Process process1 = builder1.start();
77
+      final InputStream inputStream = process1.getInputStream();
78
+      BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream,"GBK"));
79
+      String line;
80
+      while ((line = reader.readLine()) != null) {
81
+          if (line.contains("mean_volume")) {
82
+              map.put("平均音量",line.split(":")[1]);
83
+          } else  if (line.contains("max_volume")) {
84
+              map.put("最大音量",line.split(":")[1]);
85
+          }
86
+          else  if (line.contains("Stream #0:0")) {
87
+              String[] parts = line.split(",");
88
+              for (String part : parts) {
89
+                  if (part.contains("kb/s")) {
90
+                      // 这里假设音速是以kb/s为单位的
91
+                      String audioSpeed = part.trim();
92
+                      map.put("音速",audioSpeed);
93
+                  }
94
+              }
95
+          }
96
+      }
97
+      process1.waitFor();
98
+      reader.close();
99
+              } catch (Exception e) {
100
+      e.printStackTrace();
101
+               }
102
+
103
+
104
+        return Success("获取成功", map);
105
+    }
106
+
107
+
108
+
54
 
109
 
55
     @ApiOperation("Hello World")
110
     @ApiOperation("Hello World")
56
     @GetMapping("/")
111
     @GetMapping("/")

+ 3 - 3
hjzx-api/src/main/java/api/controller/order/WorkOrderBaseController.java

249
     @ApiOperation("新增")
249
     @ApiOperation("新增")
250
     @Log(title = "新增wo_workorderbase", businessType = BusinessType.INSERT)
250
     @Log(title = "新增wo_workorderbase", businessType = BusinessType.INSERT)
251
     @PostMapping
251
     @PostMapping
252
-    public AjaxResult add(@RequestBody WorkOrderBase input, String callid) {
252
+    public AjaxResult add(@RequestBody WorkOrderBase input) {
253
 
253
 
254
         Date currentDate = new Date(System.currentTimeMillis());
254
         Date currentDate = new Date(System.currentTimeMillis());
255
         Random random = new Random();
255
         Random random = new Random();
282
         }
282
         }
283
 
283
 
284
         boolean result = workorderbaseService.insert(input);
284
         boolean result = workorderbaseService.insert(input);
285
-        if (!StringHelper.isEmpty(callid)) {
285
+        if ( input.getCallId() !=null && input.getCallId()>0) {
286
 
286
 
287
             LambdaUpdateWrapper<CallLog> qw = new LambdaUpdateWrapper<>();
287
             LambdaUpdateWrapper<CallLog> qw = new LambdaUpdateWrapper<>();
288
-            qw.eq(CallLog::getUuid, callid);
288
+            qw.eq(CallLog::getId, input.getCallId());
289
             qw.set(CallLog::getWorkordercode, ordercode);
289
             qw.set(CallLog::getWorkordercode, ordercode);
290
             calllogService.updateBatch(qw);
290
             calllogService.updateBatch(qw);
291
         }
291
         }

+ 1 - 0
hjzx-api/src/main/java/api/controller/patient/PatientController.java

69
          qw.like(!StringHelper.isEmpty(input.getPatientStatus()), Patient::getPatientStatus, input.getPatientStatus());
69
          qw.like(!StringHelper.isEmpty(input.getPatientStatus()), Patient::getPatientStatus, input.getPatientStatus());
70
         qw.eq( input.getPhoneStatus()!=null , Patient::getPhoneStatus, input.getPhoneStatus());
70
         qw.eq( input.getPhoneStatus()!=null , Patient::getPhoneStatus, input.getPhoneStatus());
71
         qw.eq( input.getJzks()!=null&&input.getJzks()>0 , Patient::getJzks, input.getJzks());
71
         qw.eq( input.getJzks()!=null&&input.getJzks()>0 , Patient::getJzks, input.getJzks());
72
+        qw.eq( input.getSex()!=null&&input.getSex()>0 , Patient::getSex, input.getSex());
72
         qw.eq( Patient::getIsDelete,0);
73
         qw.eq( Patient::getIsDelete,0);
73
         qw.orderByDesc(Patient::getCreateTime);
74
         qw.orderByDesc(Patient::getCreateTime);
74
         Page<Patient> page = GetPage(pageInput);
75
         Page<Patient> page = GetPage(pageInput);

+ 33 - 10
hjzx-api/src/main/java/api/controller/system/UserExtensionController.java

25
 import api.util.helper.*;
25
 import api.util.helper.*;
26
 import io.swagger.annotations.Api;
26
 import io.swagger.annotations.Api;
27
 import io.swagger.annotations.ApiOperation;
27
 import io.swagger.annotations.ApiOperation;
28
+import lombok.var;
28
 import org.springframework.beans.factory.annotation.Autowired;
29
 import org.springframework.beans.factory.annotation.Autowired;
29
 
30
 
30
 import org.springframework.web.bind.annotation.*;
31
 import org.springframework.web.bind.annotation.*;
149
         {
150
         {
150
             return Error("该用户不存在");
151
             return Error("该用户不存在");
151
         }
152
         }
153
+        LambdaQueryWrapper<UserExtension> queryWrapper = new LambdaQueryWrapper<>();
154
+        queryWrapper.eq(UserExtension::getUsercode, input.getUsercode());
155
+        var Extension = userextensionService.getList(queryWrapper);
156
+
157
+
158
+        LambdaUpdateWrapper<UserExtension> update = new LambdaUpdateWrapper<>();
159
+        update.eq(UserExtension::getExtension, input.getExtension());
160
+        update.set(UserExtension::getExtension,"");//将之前该分机号下的用户置空
161
+        boolean result1 = userextensionService.updateBatch(update);
162
+
163
+        if(Extension!=null&&Extension.size()>0)
164
+        {  LambdaUpdateWrapper<UserExtension> updateqw = new LambdaUpdateWrapper<>();
165
+            updateqw.eq(UserExtension::getUsercode, input.getUsercode());
166
+            updateqw.set(UserExtension::getExtension, input.getExtension());
167
+            boolean result = userextensionService.updateBatch(updateqw);
168
+            //  boolean result = userextensionService.update(input);
169
+            if (result) {
170
+                return Success("成功");
171
+            } else {
172
+                return Error("修改失败");
173
+            }
174
+        }
175
+        else
176
+        {
177
+
178
+            boolean result = userextensionService.insert(input);
179
+            if (result) {
180
+                return Success("成功");
181
+            } else {
182
+                return Error("失败");
183
+            }
184
+        }
152
 
185
 
153
-        LambdaUpdateWrapper<UserExtension> updateqw = new LambdaUpdateWrapper<>();
154
-        updateqw.eq(UserExtension::getExtension, input.getExtension());
155
 
186
 
156
 
187
 
157
-        updateqw.set(UserExtension::getUsercode, input.getUsercode());
158
 
188
 
159
-        boolean result = userextensionService.updateBatch(updateqw);
160
 
189
 
161
-      //  boolean result = userextensionService.update(input);
162
-        if (result) {
163
-            return Success("成功");
164
-        } else {
165
-            return Error("修改失败");
166
-        }
167
     }
190
     }
168
 
191
 
169
     @ApiOperation("删除")
192
     @ApiOperation("删除")

+ 64 - 39
hjzx-api/src/main/resources/application-production.yml

1
 server:
1
 server:
2
-  port: 8000
2
+  port: 8120
3
 swagger: false
3
 swagger: false
4
+
4
 spring:
5
 spring:
5
-  shardingsphere:
6
-    datasource:
7
-      names: master,slave0,slave1
8
-      master:
9
-        type: com.alibaba.druid.pool.DruidDataSource
10
-        driver-class-name: com.mysql.cj.jdbc.Driver
11
-        url: jdbc:mysql://10.160.153.119:3306/jiayi?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
12
-        username: root
13
-        password: 123456
14
-      slave0:
15
-        type: com.alibaba.druid.pool.DruidDataSource
16
-        driver-class-name: com.mysql.cj.jdbc.Driver
17
-        url: jdbc:mysql://10.160.153.119:3306/jiayi?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
18
-        username: root
19
-        password: 123456
20
-      slave1:
21
-        type: com.alibaba.druid.pool.DruidDataSource
22
-        driver-class-name: com.mysql.cj.jdbc.Driver
23
-        url: jdbc:mysql://10.160.153.119:3306/jiayi?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
24
-        username: root
25
-        password: 123456
26
-    rules:
27
-      readwrite-splitting:
28
-        data-sources:
29
-          mds:
30
-            type: static
31
-            props:
32
-              write-data-source-name: master
33
-              read-data-source-names: slave0,slave1
34
-            load-balancer-name: read-random
35
-        load-balancers:
36
-          read-random:
37
-            type: round_robin
38
-    enabled: true
6
+  datasource:
7
+    type: com.alibaba.druid.pool.DruidDataSource
8
+    driver-class-name: com.mysql.cj.jdbc.Driver
9
+    url: jdbc:mysql://127.0.0.1:3306/kf12356?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
10
+    username: kf12356
11
+    password: 30oBbf5rVhAc1xdk
12
+
13
+  #  shardingsphere:
14
+  #    datasource:
15
+  #      names: master,slave0,slave1
16
+  #      master:
17
+  #        type: com.alibaba.druid.pool.DruidDataSource
18
+  #        driver-class-name: com.mysql.cj.jdbc.Driver
19
+  #        url: jdbc:mysql://192.168.1.200:3306/kfyy?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
20
+  #        username: root
21
+  #        password: 800100
22
+  #      slave0:
23
+  #        type: com.alibaba.druid.pool.DruidDataSource
24
+  #        driver-class-name: com.mysql.cj.jdbc.Driver
25
+  #        url: jdbc:mysql://192.168.1.200:3306/kfyy?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
26
+  #        username: root
27
+  #        password: 800100
28
+  #      slave1:
29
+  #        type: com.alibaba.druid.pool.DruidDataSource
30
+  #        driver-class-name: com.mysql.cj.jdbc.Driver
31
+  #        url: jdbc:mysql://192.168.1.200:3306/kfyy?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
32
+  #        username: root
33
+  #        password: 800100
34
+  #    rules:
35
+  #      readwrite-splitting:
36
+  #        data-sources:
37
+  #          mds:
38
+  #            type: static
39
+  #            props:
40
+  #              write-data-source-name: master
41
+  #              read-data-source-names: slave0,slave1
42
+  #            load-balancer-name: read-random
43
+  #        load-balancers:
44
+  #          read-random:
45
+  #            type: round_robin
46
+  #    enabled: true
47
+
39
   redis:
48
   redis:
40
     # 地址
49
     # 地址
41
-    host: 10.160.153.119
50
+    host: 127.0.0.1
42
     # 端口,默认为6379
51
     # 端口,默认为6379
43
     port: 6379
52
     port: 6379
44
     # 数据库索引
53
     # 数据库索引
45
-    database: 1
54
+    database: 5
46
     # 密码
55
     # 密码
47
-    password:
56
+    password: d55s6fa8fe6fr
48
     # 连接超时时间
57
     # 连接超时时间
49
-    timeout: 10s
58
+    timeout: 10s
59
+
60
+  wechat:
61
+    # AppId: wx0d67bbb5666ec226
62
+    # AppSecret: abe7ea3ac71e42fa27ec564045b1387a
63
+    AppId: wxe8b06998505853d2
64
+    AppSecret: e3f24289c16dafcb26596e43ef21ccc2
65
+
66
+    Token: a3ac71e42f
67
+    EncodingAESKey: SnHmIXFhkuagAXcoAAEsgVnNiqFdn2TXkwT7Tm2MqkC
68
+
69
+  esclient:
70
+    host: 192.168.1.8
71
+    port: 9200
72
+    auth: false
73
+    username:
74
+    password:

+ 2 - 2
hjzx-api/src/main/resources/application.yml

3
     date-format: yyyy-MM-dd HH:mm:ss
3
     date-format: yyyy-MM-dd HH:mm:ss
4
     time-zone: GMT+8
4
     time-zone: GMT+8
5
   profiles:
5
   profiles:
6
-    #active: production
7
-    active: dev
6
+    active: production
7
+    #active: dev
8
   servlet:
8
   servlet:
9
     multipart:
9
     multipart:
10
       max-file-size: 20MB #单个文件最大为20M
10
       max-file-size: 20MB #单个文件最大为20M