Bladeren bron

新增 会议签到,会议纪要

tjf 7 maanden geleden
bovenliggende
commit
699539bb5b

+ 162 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/meeting/AbstractSignature.java

@@ -0,0 +1,162 @@
+package com.ruoyi.web.controller.meeting;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.SignatureException;
+
+/**
+ * 加签加密抽象类
+ *
+ * @author : jun
+ * @date : 2021年04月08日
+ */
+public abstract class AbstractSignature {
+    /**
+     * 签名ID
+     */
+    private String id;
+
+    /**
+     * 加密key
+     */
+    private String key;
+
+    /**
+     * 服务url
+     */
+    private String url;
+
+    /**
+     * 加密算法
+     */
+    private String encryptType;
+
+    /**
+     * 待加密原始字符
+     */
+    private String originSign;
+
+    /**
+     * 最终生成的签名
+     */
+    protected String signa;
+
+    /**
+     * 时间戳timestamp
+     */
+    private String ts;
+
+    /**
+     * 请求类型,默认get
+     */
+    protected String requestMethod = "GET";
+
+    /**
+     * @param id
+     * @param key
+     * @param url
+     */
+    public AbstractSignature(String id, String key, String url) {
+        this.id = id;
+        this.key = key;
+        this.url = url;
+        this.ts = generateTs();
+    }
+
+    /**
+     * 可设置请求类型
+     * @param id
+     * @param key
+     * @param url
+     * @param isPost 是否为POST
+     */
+    public AbstractSignature(String id, String key, String url, boolean isPost) {
+        this.id = id;
+        this.key = key;
+        this.url = url;
+        if (isPost) {
+            this.requestMethod = "POST";
+        }else{
+            this.requestMethod = "GET";
+        }
+
+        this.ts = generateTs();
+    }
+
+    /**
+     * 生成ts时间
+     */
+    public String generateTs() {
+        return String.valueOf(System.currentTimeMillis() / 1000L);
+    }
+
+
+    /**
+     * 完成签名,返回完整签名
+     *
+     * @return
+     * @throws SignatureException
+     */
+    public abstract String getSigna() throws SignatureException;
+
+    public String generateOriginSign() throws SignatureException {
+        try {
+            URL url = new URL(this.getUrl());
+
+            return "host: " + url.getHost() + "\n" +
+                    "date: " + this.getTs() + "\n" +
+                    "GET " + url.getPath() + " HTTP/1.1";
+        } catch (MalformedURLException e) {
+            throw new SignatureException("MalformedURLException:" + e.getMessage());
+        }
+    }
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getOriginSign() {
+        return originSign;
+    }
+
+    public void setOriginSign(String originSign) {
+        this.originSign = originSign;
+    }
+
+    public String getTs() {
+        return ts;
+    }
+
+    public void setTs(String ts) {
+        this.ts = ts;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getEncryptType() {
+        return encryptType;
+    }
+
+    public void setEncryptType(String encryptType) {
+        this.encryptType = encryptType;
+    }
+}

+ 53 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/meeting/LfasrSignature.java

@@ -0,0 +1,53 @@
+package com.ruoyi.web.controller.meeting;
+
+
+import com.ruoyi.common.utils.xunfei.CryptTools;
+import cn.hutool.core.util.ObjectUtil;
+import java.security.NoSuchAlgorithmException;
+import java.security.SignatureException;
+
+/**
+ * Lfasr能力签名实体
+ *
+ * @author : jun
+ * @date : 2021年03月29日
+ */
+public class LfasrSignature extends AbstractSignature {
+
+    /**
+     *
+     * @param appId
+     * @param keySecret
+     */
+    public LfasrSignature(String appId, String keySecret) {
+        super(appId, keySecret, null);
+    }
+
+    @Override
+    public String getSigna() throws SignatureException {
+        if (ObjectUtil.isEmpty(this.signa)) {
+            this.setOriginSign(generateOriginSign());
+            this.signa = generateSignature();
+        }
+        return this.signa;
+    }
+
+    /**
+     * 生成最终的签名,需要先生成原始sign
+     *
+     * @throws SignatureException
+     */
+    public String generateSignature() throws SignatureException {
+        return CryptTools.hmacEncrypt(CryptTools.HMAC_SHA1, this.getOriginSign(), this.getKey());
+    }
+
+    /**
+     * 生成待加密原始字符
+     *
+     * @throws NoSuchAlgorithmException
+     */
+    @Override
+    public String generateOriginSign() throws SignatureException {
+        return CryptTools.md5Encrypt(this.getId() + this.getTs());
+    }
+}

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/meeting/MeetingRecordsController.java

@@ -54,7 +54,7 @@ public class MeetingRecordsController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:records:query')")
     @GetMapping(value = "/{recordId}")
-    public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
+    public AjaxResult getInfo(@PathVariable("recordId") Long recordId) {
         return success(meetingRecordsService.selectMeetingRecordsByRecordId(recordId));
     }
 
@@ -84,7 +84,7 @@ public class MeetingRecordsController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:records:remove')")
     @Log(title = "会议记录", businessType = BusinessType.DELETE)
     @GetMapping("/delete/{recordIds}")
-    public AjaxResult remove(@PathVariable String[] recordIds) {
+    public AjaxResult remove(@PathVariable Long[] recordIds) {
         return toAjax(meetingRecordsService.deleteMeetingRecordsByRecordIds(recordIds));
     }
 }

File diff suppressed because it is too large
+ 139 - 14
ruoyi-admin/src/main/java/com/ruoyi/web/controller/meeting/RealTimeController.java


+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -20,7 +20,7 @@ spring:
     basename: i18n/messages
   profiles:
     active: druid
-    #active: prod
+#    active: prod
   # 文件上传
   servlet:
     multipart:

+ 18 - 8
ruoyi-common/pom.xml

@@ -16,7 +16,17 @@
     </description>
 
     <dependencies>
-
+        <!--讯飞语音识别需要的-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.21</version>
+        </dependency>
+        <dependency>
+        <groupId>com.google.code.gson</groupId>
+        <artifactId>gson</artifactId>
+        <version>2.9.0</version>
+    </dependency>
         <!-- Spring框架基本的核心工具 -->
         <dependency>
             <groupId>org.springframework</groupId>
@@ -52,19 +62,19 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
-  
+
         <!-- JSON工具类 -->
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
         </dependency>
-        
+
         <!-- 动态数据源 -->
-		<dependency>
-			<groupId>com.baomidou</groupId>
-			<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-			<version>3.5.2</version>
-		</dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.5.2</version>
+        </dependency>
 
         <!-- 阿里JSON解析器 -->
         <dependency>

+ 1 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java

@@ -31,6 +31,7 @@ public class MimeTypeUtils
             "bmp", "gif", "jpg", "jpeg", "png",
             // word excel powerpoint
             "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
+            "wav","mp4","mp3",
             // 压缩文件
             "rar", "zip", "gz", "bz2",
             // 视频格式

+ 91 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/xunfei/CryptTools.java

@@ -0,0 +1,91 @@
+package com.ruoyi.common.utils.xunfei;
+
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.security.InvalidKeyException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SignatureException;
+import java.util.Base64;
+
+/**
+ * @author <ydwang16@iflytek.com>
+ * @description 加解密工具
+ * @date 2021/3/24
+ */
+public class CryptTools {
+
+    public static final String HMAC_SHA1 = "HmacSHA1";
+
+    public static final String HMAC_SHA256 = "HmacSHA256";
+
+    private static final char[] md5String = {
+            '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+            'a', 'b', 'c', 'd', 'e', 'f'};
+
+
+    /**
+     * HMAC加解密
+     *
+     * @param encryptType 加密方式
+     * @param plainText   明文
+     * @param encryptKey  加密密钥
+     * @return
+     * @throws SignatureException
+     */
+    public static String hmacEncrypt(String encryptType, String plainText, String encryptKey) throws SignatureException {
+
+        try {
+            byte[] data = encryptKey.getBytes(StandardCharsets.UTF_8);
+            SecretKeySpec secretKey = new SecretKeySpec(data, encryptType);
+            Mac mac = Mac.getInstance(encryptType);
+            mac.init(secretKey);
+            byte[] text = plainText.getBytes(StandardCharsets.UTF_8);
+            byte[] rawHmac = mac.doFinal(text);
+            return Base64.getEncoder().encodeToString(rawHmac);
+        } catch (InvalidKeyException e) {
+            throw new SignatureException("InvalidKeyException:" + e.getMessage());
+        } catch (NoSuchAlgorithmException e) {
+            throw new SignatureException("NoSuchAlgorithmException:" + e.getMessage());
+        }
+    }
+
+    /**
+     * Md5加密
+     *
+     * @param pstr 加密字符串
+     * @return
+     * @throws NoSuchAlgorithmException
+     */
+    public static String md5Encrypt(String pstr) throws SignatureException {
+
+        try {
+            byte[] btInput = pstr.getBytes();
+            MessageDigest mdInst = MessageDigest.getInstance("MD5");
+            mdInst.update(btInput);
+            byte[] md = mdInst.digest();
+            int j = md.length;
+            char[] str = new char[j * 2];
+            int k = 0;
+            for (byte byte0 : md) {
+                str[k++] = md5String[byte0 >>> 4 & 0xF];
+                str[k++] = md5String[byte0 & 0xF];
+            }
+            return new String(str);
+        } catch (NoSuchAlgorithmException e) {
+            throw new SignatureException("NoSuchAlgorithmException:" + e.getMessage());
+        }
+    }
+
+    /**
+     * BASE64加密
+     *
+     * @param plainText
+     * @return
+     */
+    public static String base64Encode(String plainText) {
+        return Base64.getEncoder().encodeToString(plainText.getBytes(StandardCharsets.UTF_8));
+    }
+}

+ 163 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/xunfei/HttpConnector.java

@@ -0,0 +1,163 @@
+package com.ruoyi.common.utils.xunfei;
+
+import org.apache.http.Consts;
+import org.apache.http.HttpStatus;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpRequestRetryHandler;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.entity.ByteArrayEntity;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.SSLException;
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.net.UnknownHostException;
+import java.util.*;
+
+/**
+ * http client
+ *
+ * @author : iflytek
+ * @date : 2022年03月15日
+ */
+public class HttpConnector {
+    private static final Logger log = LoggerFactory.getLogger(HttpConnector.class);
+    private final PoolingHttpClientConnectionManager pool = new PoolingHttpClientConnectionManager();
+    private CloseableHttpClient httpClient;
+
+    private HttpConnector() {
+    }
+
+    public static HttpConnector build(int maxConnections, int connTimeout, int soTimeout, int retryCount) {
+        HttpConnector connector = ConnectorBuilder.CONNECTOR;
+        connector.pool.setMaxTotal(maxConnections);
+        connector.pool.setDefaultMaxPerRoute(5);
+
+        RequestConfig.Builder builder = RequestConfig.custom().setConnectionRequestTimeout(5000)
+                .setConnectTimeout(connTimeout).setSocketTimeout(soTimeout);
+
+        HttpClientBuilder httpClientBuilder = HttpClients.custom().setDefaultRequestConfig(builder.build())
+                .setConnectionManager(connector.pool);
+        if (retryCount > 0) {
+            HttpRequestRetryHandler retryHandler = (exception, executionCount, context) -> {
+                if (executionCount > retryCount) {
+                    return false;
+                }
+                if (exception instanceof InterruptedIOException) {
+                    return false;
+                }
+                if (exception instanceof UnknownHostException) {
+                    return false;
+                }
+                if (exception instanceof SSLException) {
+                    return false;
+                }
+                log.info("HttpConnector 第" + executionCount + "次重试");
+                return true;
+            };
+            httpClientBuilder.setRetryHandler(retryHandler);
+        }
+        connector.httpClient = httpClientBuilder.build();
+        return connector;
+    }
+
+    private static List<NameValuePair> convertMapToPair(Map<String, String> params) {
+        List<NameValuePair> pairs = new ArrayList<>();
+        for (Map.Entry<String, String> entry : params.entrySet()) {
+            pairs.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
+        }
+        return pairs;
+    }
+
+    public String post(String url, Map<String, String> param) throws IOException {
+        HttpPost httpPost = new HttpPost(url);
+        httpPost.setEntity(new UrlEncodedFormEntity(convertMapToPair(param), Consts.UTF_8));
+        return doExecute(httpPost, Consts.UTF_8.toString());
+    }
+
+    public String postByJson(String url, String jsonStr) throws IOException {
+        HttpPost httpPost = new HttpPost(url);
+        httpPost.setHeader("Content-Type", "application/json;charset=UTF-8");
+        httpPost.setEntity(new StringEntity(jsonStr, Consts.UTF_8));
+        return doExecute(httpPost, Consts.UTF_8.toString());
+    }
+
+    public String postByBytes(String url, Map<String, String> param, byte[] bytes) throws IOException {
+        HttpPost httpPost = new HttpPost(url);
+        // 设置 header
+        for (String key : param.keySet()) {
+            httpPost.setHeader(key, param.get(key));
+        }
+        if (Objects.nonNull(bytes)) {
+            httpPost.setEntity(new ByteArrayEntity(bytes));
+        }
+        return doExecute(httpPost, Consts.UTF_8.toString());
+    }
+
+    public String post(String url, Map<String, String> header, Map<String, String> param) throws IOException {
+        HttpPost httpPost = new HttpPost(url);
+        //setHeader,添加头文件
+        Set<String> keys = header.keySet();
+        for (String key : keys) {
+            httpPost.setHeader(key, header.get(key));
+        }
+        httpPost.setEntity(new UrlEncodedFormEntity(convertMapToPair(param), Consts.UTF_8));
+        return doExecute(httpPost, Consts.UTF_8.toString());
+    }
+
+    public String post(String url, String param) throws IOException {
+        HttpPost httpPost = new HttpPost(url);
+        httpPost.addHeader("Content-Type", "application/json;charset=utf-8");
+        StringEntity httpEntity = new StringEntity(param, ContentType.APPLICATION_JSON);
+        httpPost.setEntity(httpEntity);
+        return doExecute(httpPost, Consts.UTF_8.toString());
+    }
+
+
+    private String doExecute(HttpRequestBase requestBase, String charset) throws IOException {
+        String result;
+        CloseableHttpResponse response = null;
+        try {
+            response = this.httpClient.execute(requestBase);
+            int statusCode = response.getStatusLine().getStatusCode();
+            result = (charset == null) ? EntityUtils.toString(response.getEntity()) : EntityUtils.toString(response.getEntity(), charset);
+            if (statusCode != HttpStatus.SC_OK) {
+                log.warn("request:{} , status:{} , result:{}", requestBase.getURI(), statusCode, result);
+            }
+
+        } finally {
+            if (null != response) {
+                EntityUtils.consumeQuietly(response.getEntity());
+            }
+            if (null != requestBase) {
+                requestBase.releaseConnection();
+            }
+        }
+        return result;
+    }
+
+    public void release() {
+        try {
+            this.httpClient.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static class ConnectorBuilder {
+        private static final HttpConnector CONNECTOR = new HttpConnector();
+    }
+}

+ 281 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/xunfei/HttpUtil.java

@@ -0,0 +1,281 @@
+package com.ruoyi.common.utils.xunfei;
+
+import org.apache.http.Consts;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.entity.ByteArrayEntity;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.InputStreamEntity;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.*;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * HTTP请求工具类
+ */
+public class HttpUtil {
+    private HttpUtil() {
+    }
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HttpUtil.class);
+
+    private static final String UTF8 = "UTF-8";
+    /**
+     * 组件的httpClient
+     */
+    private static CloseableHttpClient httpClient;
+
+    static {
+        // 听见服务、流控组件连接池
+        PoolingHttpClientConnectionManager pool = new PoolingHttpClientConnectionManager();
+        pool.setMaxTotal(600);//客户端总并行链接最大数
+        pool.setDefaultMaxPerRoute(200);//每个主机的最大并行链接数
+        httpClient = HttpClients.createMinimal(pool);
+    }
+
+    /**
+     * 请求的upload接口, 发送音频创建转写订单
+     *
+     * @param url       请求地址
+     * @param in        需要转写的音频流
+     * @return 返回结果
+     */
+    public static String iflyrecUpload(String url,  InputStream in) {
+        // 1、准备参数
+        HttpPost httpPost = new HttpPost(url);
+        // 设置超时时间, 防止504的时候会耗时30分钟
+        RequestConfig requestConfig = RequestConfig.custom()
+                //从连接池中获取连接的超时时间
+                .setConnectionRequestTimeout(5000)
+                //与服务器连接超时时间, 指的是连接一个url的连接等待时间
+                .setConnectTimeout(600000)
+                // 读取超时, 指的是连接上一个url,获取response的返回等待时间
+                .setSocketTimeout(600000).build();
+        httpPost.setConfig(requestConfig);
+        HttpEntity requestEntity = new InputStreamEntity(in, ContentType.APPLICATION_JSON);
+        //System.out.println("---"+requestEntity);
+        httpPost.setEntity(requestEntity);
+
+        // 2、执行请求
+        return doExecute(httpPost, null);
+    }
+
+    /**
+     * 请求听见的获取结果接口
+     *
+     * @param url       请求路径
+     * @return 返回结果
+     */
+    public static String iflyrecGet(String url) {
+        // 1、准备参数
+        HttpGet httpget = new HttpGet(url);
+        // 2、执行请求
+        return doExecute(httpget, UTF8);
+    }
+
+    /**
+     * 流控组件调用
+     *
+     * @param url 请求路径
+     * @return 返回结果
+     */
+    public static String flowCtrlGet(String url) {
+        // 1、准备参数
+        HttpGet httpget = new HttpGet(url);
+        RequestConfig requestConfig = RequestConfig.custom()
+                //从连接池中获取连接的超时时间
+                .setConnectionRequestTimeout(500)
+                //与服务器连接超时时间
+                .setConnectTimeout(500)
+                // 读取超时
+                .setSocketTimeout(500).build();
+        httpget.setConfig(requestConfig);
+        // 2、执行请求
+        return doExecute(httpget, null);
+    }
+
+    /**
+     * 流传输的post
+     *
+     * @param url  请求路径
+     * @param body 字节流数据
+     * @return 返回结果
+     */
+    public static String post(String url, byte[] body) {
+        // 1、准备参数
+        HttpPost httpPost = new HttpPost(url);
+        httpPost.setEntity(new ByteArrayEntity(body, ContentType.create("application/octet-stream", Consts.UTF_8)));
+        // 2、执行请求
+        return doExecute(httpPost, UTF8);
+    }
+
+    /**
+     * 带字符串参数的post请求
+     *
+     * @param url   请求路径
+     * @param param 字符串参数
+     * @return 返回结果
+     */
+    public static String post(String url, String param) {
+        // 1、准备参数
+        HttpPost httpPost = new HttpPost(url);
+        // 设置超时时间
+        RequestConfig requestConfig = RequestConfig.custom()
+                //从连接池中获取连接的超时时间
+                .setConnectionRequestTimeout(1000)
+                //与服务器连接超时时间, 指的是连接一个url的连接等待时间
+                .setConnectTimeout(10000)
+                // 读取超时, 指的是连接上一个url,获取response的返回等待时间
+                .setSocketTimeout(10000).build();
+        httpPost.setConfig(requestConfig);
+        httpPost.setEntity(new StringEntity(param, ContentType.APPLICATION_JSON));
+        // 2、执行请求
+        return doExecute(httpPost, null);
+    }
+
+    /**
+     * 发送HttpGet请求
+     *
+     * @param url 请求路径
+     * @return 返回结果
+     */
+    public static String sendGet(String url) {
+        // 1、准备参数
+        HttpGet httpget = new HttpGet(url);
+        // 2、执行请求
+        return doExecute(httpget, null);
+    }
+
+    /**
+     * 执行网络请求
+     *
+     * @param requestBase http请求对象
+     * @param charset     字符集
+     * @return 返回结果
+     */
+    private static String doExecute(HttpRequestBase requestBase, String charset) {
+        String result = null;
+        try (CloseableHttpResponse response = httpClient.execute(requestBase)) {
+            // 3、检查结果状态
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode != HttpStatus.SC_OK) {
+                LOGGER.error("网络异常");
+                return null;
+            }
+            // 4、获取结果
+            result = charset == null
+                    ? EntityUtils.toString(response.getEntity())
+                    : EntityUtils.toString(response.getEntity(), charset);
+        } catch (Exception e) {
+            LOGGER.error("网络异常", e);
+        }
+        return result;
+    }
+
+    /**
+     * 发送post请求
+     *
+     * @param url    请求路径
+     * @param header 请求头
+     * @param body   请求数据
+     * @return 返回结果
+     */
+    public static String postWithHeader(String url, Map<String, String> header, String body) {
+        StringBuilder result = new StringBuilder();
+        BufferedReader in = null;
+        PrintWriter out = null;
+        InputStreamReader is = null;
+        try {
+            // 设置 url
+            URL realUrl = new URL(url);
+            URLConnection connection = realUrl.openConnection();
+            // 设置 header
+            for (Entry<String, String> entry : header.entrySet()) {
+                connection.setRequestProperty(entry.getKey(), entry.getValue());
+            }
+            // 设置请求 body
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            out = new PrintWriter(connection.getOutputStream());
+            // 保存body
+            out.print(body);
+            // 发送body
+            out.flush();
+            // 获取响应body
+            is = new InputStreamReader(connection.getInputStream());
+            in = new BufferedReader(is);
+            String line;
+            while ((line = in.readLine()) != null) {
+                result.append(line);
+            }
+        } catch (Exception e) {
+            LOGGER.error("HttpUtil postWithHeader Exception!", e);
+            return null;
+        } finally {
+            if (is != null) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    LOGGER.error("close IO resource Exception!", e);
+                }
+            }
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException e) {
+                    LOGGER.error("close IO resource Exception!", e);
+                }
+            }
+            if (out != null) {
+                out.close();
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * 将集合转换为路径参数
+     *
+     * @param param 集合参数
+     * @return 路径参数
+     * @author white
+     */
+    public static String parseMapToPathParam(Map<String, Object> param) {
+        StringBuilder sb = new StringBuilder();
+        try {
+            Set<Entry<String, Object>> entryset = param.entrySet();
+            boolean isFirst = true;
+            for (Entry<String, Object> entry : entryset) {
+                if (!isFirst) {
+                    sb.append("&");
+                } else {
+                    isFirst = false;
+                }
+                sb.append(URLEncoder.encode(entry.getKey(), UTF8));
+                sb.append("=");
+                sb.append(URLEncoder.encode(entry.getValue().toString(), UTF8));
+            }
+        } catch (UnsupportedEncodingException e) {
+            LOGGER.error("HttpUtil parseMapToPathParam Exception!", e);
+        }
+
+        return sb.toString();
+    }
+}

+ 29 - 5
ruoyi-system/src/main/java/com/ruoyi/system/domain/MeetingRecords.java

@@ -1,9 +1,10 @@
 package com.ruoyi.system.domain;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 会议记录对象 meeting_records
@@ -16,7 +17,7 @@ public class MeetingRecords extends BaseEntity
     private static final long serialVersionUID = 1L;
 
     /** 记录id */
-    private String recordId;
+    private Long recordId;
 
     /** 会议id(关联会议预约表) */
     @Excel(name = "会议id(关联会议预约表)")
@@ -25,6 +26,10 @@ public class MeetingRecords extends BaseEntity
     /** 记录内容 */
     @Excel(name = "记录内容")
     private String recordContent;
+    /**
+     * 音频文件地址
+     */
+    private String audioUrl;
 
     /** 说话人ID */
     @Excel(name = "说话人ID")
@@ -37,13 +42,32 @@ public class MeetingRecords extends BaseEntity
     /** 说话人昵称 */
     @Excel(name = "说话人昵称")
     private String nickName;
+    /**
+     * 会议音频文件
+     */
+    private MultipartFile file;
+
+    public String getAudioUrl() {
+        return audioUrl;
+    }
 
+    public void setAudioUrl(String audioUrl) {
+        this.audioUrl = audioUrl;
+    }
+
+    public MultipartFile getFile() {
+        return file;
+    }
+
+    public void setFile(MultipartFile file) {
+        this.file = file;
+    }
 
-    public String getRecordId() {
+    public Long getRecordId() {
         return recordId;
     }
 
-    public void setRecordId(String recordId) {
+    public void setRecordId(Long recordId) {
         this.recordId = recordId;
     }
 

+ 5 - 4
ruoyi-system/src/main/java/com/ruoyi/system/mapper/MeetingRecordsMapper.java

@@ -15,10 +15,11 @@ public interface MeetingRecordsMapper
     /**
      * 查询会议记录
      * 
-     * @param recordId 会议记录主键
+     * @param conferenceRoomOrderId 会议id
      * @return 会议记录
      */
-    public MeetingRecords selectMeetingRecordsByRecordId(String recordId);
+    public MeetingRecords selectMeetingRecordsByConferenceRoomOrderId(Long conferenceRoomOrderId);
+    public MeetingRecords selectMeetingRecordsByRecordId(Long recordId);
 
     /**
      * 查询会议记录列表
@@ -50,7 +51,7 @@ public interface MeetingRecordsMapper
      * @param recordId 会议记录主键
      * @return 结果
      */
-    public int deleteMeetingRecordsByRecordId(String recordId);
+    public int deleteMeetingRecordsByRecordId(Long recordId);
 
     /**
      * 批量删除会议记录
@@ -58,5 +59,5 @@ public interface MeetingRecordsMapper
      * @param recordIds 需要删除的数据主键集合
      * @return 结果
      */
-    public int deleteMeetingRecordsByRecordIds(String[] recordIds);
+    public int deleteMeetingRecordsByRecordIds(Long[] recordIds);
 }

+ 3 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/IMeetingRecordsService.java

@@ -18,7 +18,7 @@ public interface IMeetingRecordsService
      * @param recordId 会议记录主键
      * @return 会议记录
      */
-    public MeetingRecords selectMeetingRecordsByRecordId(String recordId);
+    public MeetingRecords selectMeetingRecordsByRecordId(Long recordId);
 
     /**
      * 查询会议记录列表
@@ -50,7 +50,7 @@ public interface IMeetingRecordsService
      * @param recordIds 需要删除的会议记录主键集合
      * @return 结果
      */
-    public int deleteMeetingRecordsByRecordIds(String[] recordIds);
+    public int deleteMeetingRecordsByRecordIds(Long[] recordIds);
 
     /**
      * 删除会议记录信息
@@ -58,5 +58,5 @@ public interface IMeetingRecordsService
      * @param recordId 会议记录主键
      * @return 结果
      */
-    public int deleteMeetingRecordsByRecordId(String recordId);
+    public int deleteMeetingRecordsByRecordId(Long recordId);
 }

+ 10 - 12
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MeetingRecordsServiceImpl.java

@@ -32,7 +32,7 @@ public class MeetingRecordsServiceImpl implements IMeetingRecordsService {
      * @return 会议记录
      */
     @Override
-    public MeetingRecords selectMeetingRecordsByRecordId(String recordId) {
+    public MeetingRecords selectMeetingRecordsByRecordId(Long recordId) {
         return meetingRecordsMapper.selectMeetingRecordsByRecordId(recordId);
     }
 
@@ -57,7 +57,7 @@ public class MeetingRecordsServiceImpl implements IMeetingRecordsService {
     public int insertMeetingRecords(MeetingRecords meetingRecords) {
 
         int row = 0;
-        String recordId = meetingRecords.getRecordId();
+        Long conferenceRoomOrderId = meetingRecords.getConferenceRoomOrderId();
         Long userId = meetingRecords.getUserId();
         SysUser sysUser = sysUserMapper.selectUserById(userId);
         if (sysUser != null) {
@@ -69,14 +69,12 @@ public class MeetingRecordsServiceImpl implements IMeetingRecordsService {
             if (StringUtils.isNotBlank(nickName)) {
                 meetingRecords.setNickName(nickName);
             }
-            if (StringUtils.isNotBlank(recordId)){
-                //先去查询是否存在
-                MeetingRecords meetingRecordsOld = meetingRecordsMapper.selectMeetingRecordsByRecordId(recordId);
-                if (meetingRecordsOld != null) {
-                    row = meetingRecordsMapper.updateMeetingRecords(meetingRecords);
-                } else {
-                    row = meetingRecordsMapper.insertMeetingRecords(meetingRecords);
-                }
+            //先去查询是否存在
+            MeetingRecords meetingRecordsOld = meetingRecordsMapper.selectMeetingRecordsByConferenceRoomOrderId(conferenceRoomOrderId);
+            if (meetingRecordsOld != null) {
+                row = meetingRecordsMapper.updateMeetingRecords(meetingRecords);
+            } else {
+                row = meetingRecordsMapper.insertMeetingRecords(meetingRecords);
             }
         }
         return row;
@@ -101,7 +99,7 @@ public class MeetingRecordsServiceImpl implements IMeetingRecordsService {
      * @return 结果
      */
     @Override
-    public int deleteMeetingRecordsByRecordIds(String[] recordIds) {
+    public int deleteMeetingRecordsByRecordIds(Long[] recordIds) {
         return meetingRecordsMapper.deleteMeetingRecordsByRecordIds(recordIds);
     }
 
@@ -112,7 +110,7 @@ public class MeetingRecordsServiceImpl implements IMeetingRecordsService {
      * @return 结果
      */
     @Override
-    public int deleteMeetingRecordsByRecordId(String recordId) {
+    public int deleteMeetingRecordsByRecordId(Long recordId) {
         return meetingRecordsMapper.deleteMeetingRecordsByRecordId(recordId);
     }
 }

+ 11 - 3
ruoyi-system/src/main/resources/mapper/system/MeetingRecordsMapper.xml

@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="recordId"    column="record_id"    />
         <result property="conferenceRoomOrderId"    column="conference_room_order_id"    />
         <result property="recordContent"    column="record_content"    />
+        <result property="audioUrl"    column="audio_url"    />
         <result property="userId"    column="user_id"    />
         <result property="avatar"    column="avatar"    />
         <result property="nickName"    column="nick_name"    />
@@ -18,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectMeetingRecordsVo">
-        select record_id, conference_room_order_id, record_content, user_id, avatar, nick_name, create_time, update_by, update_time, remark from meeting_records
+        select record_id, conference_room_order_id,audio_url, record_content, user_id, avatar, nick_name, create_time, update_by, update_time, remark from meeting_records
     </sql>
 
     <select id="selectMeetingRecordsList" parameterType="MeetingRecords" resultMap="MeetingRecordsResult">
@@ -33,17 +34,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by create_time DESC
     </select>
     
-    <select id="selectMeetingRecordsByRecordId" parameterType="string" resultMap="MeetingRecordsResult">
+    <select id="selectMeetingRecordsByConferenceRoomOrderId" parameterType="Long" resultMap="MeetingRecordsResult">
+        <include refid="selectMeetingRecordsVo"/>
+        where conference_room_order_id = #{conferenceRoomOrderId}
+    </select>
+    <select id="selectMeetingRecordsByRecordId" parameterType="Long" resultMap="MeetingRecordsResult">
         <include refid="selectMeetingRecordsVo"/>
         where record_id = #{recordId}
     </select>
-        
+
     <insert id="insertMeetingRecords" parameterType="MeetingRecords" useGeneratedKeys="true" keyProperty="recordId">
         insert into meeting_records
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="recordId != null and recordId != ''">record_id,</if>
             <if test="conferenceRoomOrderId != null ">conference_room_order_id,</if>
             <if test="recordContent != null">record_content,</if>
+            <if test="audioUrl != null and audioUrl != ''">audio_url,</if>
             <if test="userId != null">user_id,</if>
             <if test="avatar != null">avatar,</if>
             <if test="nickName != null and nickName != ''">nick_name,</if>
@@ -56,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="recordId != null and recordId != ''">#{recordId},</if>
             <if test="conferenceRoomOrderId != null">#{conferenceRoomOrderId},</if>
             <if test="recordContent != null">#{recordContent},</if>
+            <if test="audioUrl != null and audioUrl != ''">audioUrl,</if>
             <if test="userId != null">#{userId},</if>
             <if test="avatar != null">#{avatar},</if>
             <if test="nickName != null and nickName != ''">#{nickName},</if>
@@ -71,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="conferenceRoomOrderId != null">conference_room_order_id = #{conferenceRoomOrderId},</if>
             <if test="recordContent != null">record_content = #{recordContent},</if>
+            <if test="audioUrl != null and audioUrl != ''">audio_url =#{audioUrl},</if>
             <if test="userId != null">user_id = #{userId},</if>
             <if test="avatar != null">avatar = #{avatar},</if>
             <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>

Some files were not shown because too many files changed in this diff