zhuwei 2 лет назад
Родитель
Сommit
01c7fb9cb0

+ 5 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java

@@ -164,4 +164,9 @@ public class User extends TenantEntity {
     @ApiModelProperty(value = "日单价")
     private Double oneMoney;
 
+    /**
+     * 职位
+     */
+    @ApiModelProperty(value = "机构信息")
+    private String deptInfo;
 }

+ 8 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java

@@ -26,6 +26,8 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.system.user.entity.User;
 
+import java.util.List;
+
 /**
  * 视图实体类
  *
@@ -96,4 +98,10 @@ public class UserVO extends User {
      */
     @ApiModelProperty(value = "拓展信息")
     private String userExt;
+
+    /**
+     * 组织机构
+     */
+    @ApiModelProperty(value = "组织机构对象(内控)")
+    private List<DeptUserVO> deptList;
 }

+ 4 - 6
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchivesAutoController.java

@@ -37,6 +37,7 @@ import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.entity.ArchiveTreeContract;
@@ -603,11 +604,8 @@ public class ArchivesAutoController extends BladeController {
 	@ApiImplicitParams(value = {
 			@ApiImplicitParam(name = "file", value = "文件源", required = true)
 	})
-	public R putFileAttach(@RequestParam("file") MultipartFile file) {
-		String file_path = FileUtils.getSysLocalFileUrl();
-
-
-
-		return R.success("上传成功");
+	public R searchInfo(@RequestParam("file") MultipartFile file, BladeUser user) {
+		return archivesAutoService.searchInfo(file);
 	}
+
 }

+ 10 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchivesAutoService.java

@@ -25,7 +25,9 @@ import org.springblade.core.tool.api.R;
 import org.springblade.manager.entity.ArchiveTreeContract;
 import org.springblade.system.entity.DictBiz;
 import org.springblade.system.user.entity.User;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -86,13 +88,18 @@ public interface IArchivesAutoService extends BaseService<ArchivesAuto> {
 
 	List<User> getArchiveDestroyUser();
 
-	List<Map<String,List<Map<String,String>>>> getArchivesCabinet(ArchivesAutoVO archivesAuto);
+	List<Map<String, List<Map<String, String>>>> getArchivesCabinet(ArchivesAutoVO archivesAuto);
 
 	R pageByArchivesAuto2(ArchivesAutoVO archivesAuto);
 
-    void getArchivesAuthByUser(Long projectId,Long contractId,Integer archiveType);
+	void getArchivesAuthByUser(Long projectId, Long contractId, Integer archiveType);
 
-    Long allArchiveFileSize(Long projectId);
+	Long allArchiveFileSize(Long projectId);
 
 	ArchivesAutoVO getArchiveFileList(Long id);
+
+
+	// 语音搜索
+	R searchInfo(MultipartFile file) throws IOException;
+
 }

+ 75 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -16,14 +16,16 @@
  */
 package org.springblade.archive.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+
+import com.aliyun.oss.OSSClient;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.google.common.collect.Lists;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
@@ -32,6 +34,7 @@ import org.springblade.archive.entity.ArchivesAuto;
 import org.springblade.archive.service.IArchiveAutoPdfService;
 import org.springblade.archive.service.IArchiveProjectConfigService;
 import org.springblade.archive.utils.ArchiveTreeUtil;
+import org.springblade.archive.utils.FileTransJavaDemo;
 import org.springblade.archive.utils.FileUtils;
 import org.springblade.archive.vo.ArchivesAutoVO;
 import org.springblade.archive.mapper.ArchivesAutoMapper;
@@ -70,7 +73,11 @@ import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.ExecutorService;
@@ -315,6 +322,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		return vo;
 	}
 
+
 	/**
 	 * 根据搜索获取档案柜
 	 * @param archivesAuto
@@ -2029,14 +2037,78 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 				e.printStackTrace();
 				log.error("自动组卷报错。"+e.getMessage()+"--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
 				//设置自动组卷结束
-				contractClient.updateIsArchivesAutoById(contractId,0);
+				contractClient.updateIsArchivesAutoById(contractId, 0);
 			}
 		});
 	}
+
 	@Override
 	public List<User> getArchiveDestroyUser() {
 		return autoMapper.getArchiveDestroyUser();
 	}
 
 
+	/**
+	 * 语音搜索
+	 *
+	 * @param file
+	 * @return
+	 */
+	@Override
+	public R searchInfo(MultipartFile file) throws IOException {
+		JSONObject json = new JSONObject();
+		String fileUrl = FileUtils.getSysLocalFileUrl();
+
+		File fileInfo = org.springblade.common.utils.FileUtils.convert(file);
+		BladeFile data = iossClient.updateFile(file.getBytes(), "testInfo.wav");
+		String token = "cc96fcdce38f49f1af2298a949d39800";
+		String appkey = "7T7TkowOxND01n1y";
+		//	SpeechRecognizerRESTfulDemo demo = new SpeechRecognizerRESTfulDemo(appkey, token);
+
+/*		String fileName = "/Users/hongchuangyanfa/Downloads/nls-sample-16k.wav" ;//SpeechRecognizerRESTfulDemo.class.getClassLoader().getResource("/Users/hongchuangyanfa/Downloads/nls-sample-16k.wav").getPath();
+		String format = "pcm";
+		int sampleRate = 16000;
+		boolean enablePunctuationPrediction = true;
+		boolean enableInverseTextNormalization = true;
+		boolean enableVoiceDetection = false;
+		String dataInfo = demo.process(fileInfo, format, sampleRate, enablePunctuationPrediction, enableInverseTextNormalization, enableVoiceDetection);
+	*/
+
+		//System.out.println("123");
+		//System.out.println(dataInfo);
+		//JSONObject json = new JSONObject();
+		//json.put("year","2023");
+
+		final String accessKeyId = "LTAI5tMwtPCL85iXbUtjLTxD";
+		final String accessKeySecret = "WiUW5ag7HhQZPNoMAoQSC5LuxD2kLw";
+		final String appKey = "IxV21DxuzHuc8Oe4";
+		//  String fileUrl = FileUtils.getSysLocalFileUrl()+"/voiceInfo/123456.wav";
+
+
+		///String fileLink = "http://fileinfo.hczcxx.cn/voiceInfo/c574b9f3-f4fe-43db-abeb-5c5f24a15eb4.wav";
+		String fileLink = data.getLink();
+		FileTransJavaDemo demo = new FileTransJavaDemo(accessKeyId, accessKeySecret);
+		// 第一步:提交录音文件识别请求,获取任务ID用于后续的识别结果轮询。
+		String taskId = demo.submitFileTransRequest(appKey, fileLink);
+		if (taskId != null) {
+			System.out.println("录音文件识别请求成功,task_id: " + taskId);
+		} else {
+			System.out.println("录音文件识别请求失败!");
+		}
+		// 第二步:根据任务ID轮询识别结果。
+		String result = demo.getFileTransResult(taskId);
+		if (result != null) {
+			System.out.println("录音文件识别结果查询成功:" + result);
+			JSONObject dataInfo = JSONObject.parseObject(result);
+			JSONArray word = dataInfo.getJSONArray("Words");
+			JSONArray sentences = dataInfo.getJSONArray("Sentences");
+
+		} else {
+			System.out.println("录音文件识别结果查询失败!");
+		}
+
+		return R.data(json);
+	}
+
+
 }

+ 184 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/FileTransJavaDemo.java

@@ -0,0 +1,184 @@
+package org.springblade.archive.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.aliyuncs.CommonRequest;
+import com.aliyuncs.CommonResponse;
+import com.aliyuncs.DefaultAcsClient;
+import com.aliyuncs.IAcsClient;
+import com.aliyuncs.exceptions.ClientException;
+import com.aliyuncs.http.MethodType;
+import com.aliyuncs.profile.DefaultProfile;
+import org.springblade.common.utils.CommonUtil;
+
+public class FileTransJavaDemo {
+    // 地域ID,常量,固定值。
+    public static final String REGIONID = "cn-shanghai";
+    public static final String ENDPOINTNAME = "cn-shanghai";
+    public static final String PRODUCT = "nls-filetrans";
+    public static final String DOMAIN = "filetrans.cn-shanghai.aliyuncs.com";
+    public static final String API_VERSION = "2018-08-17";  // 中国站版本
+    // public static final String API_VERSION = "2019-08-23";  // 国际站版本
+    public static final String POST_REQUEST_ACTION = "SubmitTask";
+    public static final String GET_REQUEST_ACTION = "GetTaskResult";
+    // 请求参数
+    public static final String KEY_APP_KEY = "appkey";
+    public static final String KEY_FILE_LINK = "file_link";
+    public static final String KEY_VERSION = "version";
+    public static final String KEY_ENABLE_WORDS = "enable_words";
+    // 响应参数
+    public static final String KEY_TASK = "Task";
+    public static final String KEY_TASK_ID = "TaskId";
+    public static final String KEY_STATUS_TEXT = "StatusText";
+    public static final String KEY_RESULT = "Result";
+    // 状态值
+    public static final String STATUS_SUCCESS = "SUCCESS";
+    private static final String STATUS_RUNNING = "RUNNING";
+    private static final String STATUS_QUEUEING = "QUEUEING";
+    // 阿里云鉴权client
+    IAcsClient client;
+
+    public FileTransJavaDemo(String accessKeyId, String accessKeySecret) {
+        // 设置endpoint
+        try {
+            DefaultProfile.addEndpoint(ENDPOINTNAME, REGIONID, PRODUCT, DOMAIN);
+        } catch (ClientException e) {
+            e.printStackTrace();
+        }
+        // 创建DefaultAcsClient实例并初始化
+        DefaultProfile profile = DefaultProfile.getProfile(REGIONID, accessKeyId, accessKeySecret);
+        this.client = new DefaultAcsClient(profile);
+    }
+
+    public String submitFileTransRequest(String appKey, String fileLink) {
+        /**
+         * 1. 创建CommonRequest,设置请求参数。
+         */
+        CommonRequest postRequest = new CommonRequest();
+        // 设置域名
+        postRequest.setDomain(DOMAIN);
+        // 设置API的版本号,格式为YYYY-MM-DD。
+        postRequest.setVersion(API_VERSION);
+        // 设置action
+        postRequest.setAction(POST_REQUEST_ACTION);
+        // 设置产品名称
+        postRequest.setProduct(PRODUCT);
+        /**
+         * 2. 设置录音文件识别请求参数,以JSON字符串的格式设置到请求Body中。
+         */
+        JSONObject taskObject = new JSONObject();
+        // 设置appkey
+        taskObject.put(KEY_APP_KEY, appKey);
+        // 设置音频文件访问链接
+        taskObject.put(KEY_FILE_LINK, fileLink);
+        // 新接入请使用4.0版本,已接入(默认2.0)如需维持现状,请注释掉该参数设置。
+        taskObject.put(KEY_VERSION, "4.0");
+        // 设置是否输出词信息,默认为false,开启时需要设置version为4.0及以上。
+        taskObject.put(KEY_ENABLE_WORDS, true);
+
+        taskObject.put("enable_sample_rate_adaptive", true);
+
+        String task = taskObject.toJSONString();
+        System.out.println(task);
+        // 设置以上JSON字符串为Body参数。
+        postRequest.putBodyParameter(KEY_TASK, task);
+        // 设置为POST方式的请求。
+        postRequest.setMethod(MethodType.POST);
+        /**
+         * 3. 提交录音文件识别请求,获取录音文件识别请求任务的ID,以供识别结果查询使用。
+         */
+        String taskId = null;
+        try {
+            CommonResponse postResponse = client.getCommonResponse(postRequest);
+            System.err.println("提交录音文件识别请求的响应:" + postResponse.getData());
+            if (postResponse.getHttpStatus() == 200) {
+                JSONObject result = JSONObject.parseObject(postResponse.getData());
+                String statusText = result.getString(KEY_STATUS_TEXT);
+                if (STATUS_SUCCESS.equals(statusText)) {
+                    taskId = result.getString(KEY_TASK_ID);
+                }
+            }
+        } catch (ClientException e) {
+            e.printStackTrace();
+        }
+        return taskId;
+    }
+
+    public String getFileTransResult(String taskId) {
+        /**
+         * 1. 创建CommonRequest,设置任务ID。
+         */
+        CommonRequest getRequest = new CommonRequest();
+        // 设置域名
+        getRequest.setDomain(DOMAIN);
+        // 设置API版本
+        getRequest.setVersion(API_VERSION);
+        // 设置action
+        getRequest.setAction(GET_REQUEST_ACTION);
+        // 设置产品名称
+        getRequest.setProduct(PRODUCT);
+        // 设置任务ID为查询参数
+        getRequest.putQueryParameter(KEY_TASK_ID, taskId);
+        // 设置为GET方式的请求
+        getRequest.setMethod(MethodType.GET);
+        /**
+         * 2. 提交录音文件识别结果查询请求
+         * 以轮询的方式进行识别结果的查询,直到服务端返回的状态描述为“SUCCESS”或错误描述,则结束轮询。
+         */
+        String result = null;
+        while (true) {
+            try {
+                CommonResponse getResponse = client.getCommonResponse(getRequest);
+                System.err.println("识别查询结果:" + getResponse.getData());
+                if (getResponse.getHttpStatus() != 200) {
+                    break;
+                }
+                JSONObject rootObj = JSONObject.parseObject(getResponse.getData());
+                String statusText = rootObj.getString(KEY_STATUS_TEXT);
+                if (STATUS_RUNNING.equals(statusText) || STATUS_QUEUEING.equals(statusText)) {
+                    // 继续轮询,注意设置轮询时间间隔。
+                    Thread.sleep(10000);
+                } else {
+                    // 状态信息为成功,返回识别结果;状态信息为异常,返回空。
+                    if (STATUS_SUCCESS.equals(statusText)) {
+                        result = rootObj.getString(KEY_RESULT);
+                        // 状态信息为成功,但没有识别结果,则可能是由于文件里全是静音、噪音等导致识别为空。
+                        if (result == null) {
+                            result = "";
+                        }
+                    }
+                    break;
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    public static void main(String args[]) throws Exception {
+
+        final String accessKeyId = "LTAI5tMwtPCL85iXbUtjLTxD";
+        final String accessKeySecret = "WiUW5ag7HhQZPNoMAoQSC5LuxD2kLw";
+        final String appKey = "IxV21DxuzHuc8Oe4";
+        //  String fileUrl = FileUtils.getSysLocalFileUrl()+"/voiceInfo/123456.wav";
+
+
+        String fileLink = "http://fileinfo.hczcxx.cn/voiceInfo/录音 (1).wav";
+        FileTransJavaDemo demo = new FileTransJavaDemo(accessKeyId, accessKeySecret);
+        // 第一步:提交录音文件识别请求,获取任务ID用于后续的识别结果轮询。
+        String taskId = demo.submitFileTransRequest(appKey, fileLink);
+        if (taskId != null) {
+            System.out.println("录音文件识别请求成功,task_id: " + taskId);
+        } else {
+            System.out.println("录音文件识别请求失败!");
+            return;
+        }
+        // 第二步:根据任务ID轮询识别结果。
+        String result = demo.getFileTransResult(taskId);
+        if (result != null) {
+            System.out.println("录音文件识别结果查询成功:" + result);
+        } else {
+            System.out.println("录音文件识别结果查询失败!");
+        }
+    }
+}

+ 2 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/FileUtils.java

@@ -1,14 +1,13 @@
 package org.springblade.archive.utils;
 
 import com.aspose.cells.SaveFormat;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.itextpdf.text.Document;
 import com.itextpdf.text.Element;
 import com.itextpdf.text.pdf.*;
 import com.sun.image.codec.jpeg.JPEGCodec;
 import com.sun.image.codec.jpeg.JPEGImageEncoder;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections4.ListUtils;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFPrintSetup;
 import org.apache.poi.ss.usermodel.ClientAnchor;
@@ -727,4 +726,5 @@ public class FileUtils {
         demo.process("./nls-sample-16k.wav", 16000);
         demo.shutdown();*/
     }
+
 }

+ 83 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/HttpUtil.java

@@ -0,0 +1,83 @@
+package org.springblade.archive.utils;
+
+import okhttp3.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.SocketTimeoutException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+public class HttpUtil {
+
+    private static String getResponseWithTimeout(Request q) {
+        String ret = null;
+
+        OkHttpClient.Builder httpBuilder = new OkHttpClient.Builder();
+        OkHttpClient client = httpBuilder.connectTimeout(10, TimeUnit.SECONDS)
+                .readTimeout(60, TimeUnit.SECONDS)
+                .writeTimeout(60, TimeUnit.SECONDS)
+                .build();
+
+        try {
+            Response s = client.newCall(q).execute();
+            ret = s.body().string();
+            s.close();
+        } catch (SocketTimeoutException e) {
+            ret = null;
+            System.err.println("get result timeout");
+        } catch (IOException e) {
+            System.err.println("get result error " + e.getMessage());
+        }
+
+        return ret;
+    }
+
+    public static String sendPostFile(String url, HashMap<String, String> headers, File file) {
+        RequestBody body;
+
+        body = RequestBody.create(MediaType.parse("application/octet-stream"), file);
+
+        Headers.Builder hb = new Headers.Builder();
+        if (headers != null && !headers.isEmpty()) {
+            for (Map.Entry<String, String> entry : headers.entrySet()) {
+                hb.add(entry.getKey(), entry.getValue());
+            }
+        }
+
+        Request request = new Request.Builder()
+                .url(url)
+                .headers(hb.build())
+                .post(body)
+                .build();
+
+        return getResponseWithTimeout(request);
+    }
+
+    public static String sendPostData(String url, HashMap<String, String> headers, byte[] data) {
+        RequestBody body;
+
+        if (data.length == 0) {
+            System.err.println("The send data is empty.");
+            return null;
+        } else {
+            body = RequestBody.create(MediaType.parse("application/octet-stream"), data);
+        }
+
+        Headers.Builder hb = new Headers.Builder();
+        if (headers != null && !headers.isEmpty()) {
+            for (Map.Entry<String, String> entry : headers.entrySet()) {
+                hb.add(entry.getKey(), entry.getValue());
+            }
+        }
+
+        Request request = new Request.Builder()
+                .url(url)
+                .headers(hb.build())
+                .post(body)
+                .build();
+
+        return getResponseWithTimeout(request);
+    }
+}

+ 104 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/SpeechRecognizerRESTfulDemo.java

@@ -0,0 +1,104 @@
+/*
+package org.springblade.archive.utils;
+
+import com.alibaba.fastjson.JSONPath;
+
+import java.io.File;
+import java.util.HashMap;
+public class SpeechRecognizerRESTfulDemo {
+    private String accessToken;
+    private String appkey;
+
+    public SpeechRecognizerRESTfulDemo(String appkey, String token) {
+        this.appkey = appkey;
+        this.accessToken = token;
+    }
+
+    public String process(File fileName, String format, int sampleRate,
+                          boolean enablePunctuationPrediction,
+                          boolean enableInverseTextNormalization,
+                          boolean enableVoiceDetection) {
+
+        */
+/**
+ * 设置HTTPS RESTful POST请求:
+ * 1.使用HTTPS协议。
+ * 2.语音识别服务域名:nls-gateway-cn-shanghai.aliyuncs.com。
+ * 3.语音识别接口请求路径:/stream/v1/asr。
+ * 4.设置必选请求参数:appkey、format、sample_rate。
+ * 5.设置可选请求参数:enable_punctuation_prediction、enable_inverse_text_normalization、enable_voice_detection。
+ * <p>
+ * 设置HTTPS头部字段:
+ * 1.鉴权参数。
+ * 2.Content-Type:application/octet-stream。
+ * <p>
+ * 发送HTTPS POST请求,返回服务端的响应。
+ *//*
+
+        String url = "https://nls-gateway-cn-shanghai.aliyuncs.com/stream/v1/asr";
+        String request = url;
+        request = request + "?appkey=" + appkey;
+        request = request + "&format=" + format;
+        request = request + "&sample_rate=" + sampleRate;
+        if (enablePunctuationPrediction) {
+            request = request + "&enable_punctuation_prediction=" + true;
+        }
+        if (enableInverseTextNormalization) {
+            request = request + "&enable_inverse_text_normalization=" + true;
+        }
+        if (enableVoiceDetection) {
+            request = request + "&enable_voice_detection=" + true;
+        }
+
+        System.out.println("Request: " + request);
+
+        */
+/**
+ * 设置HTTPS头部字段:
+ * 1.鉴权参数。
+ * 2.Content-Type:application/octet-stream。
+ *//*
+
+        HashMap<String, String> headers = new HashMap<String, String>();
+        headers.put("X-NLS-Token", this.accessToken);
+        headers.put("Content-Type", "application/octet-stream");
+
+        */
+/**
+ * 发送HTTPS POST请求,返回服务端的响应。
+ *//*
+
+        String response = HttpUtil.sendPostFile(request, headers, fileName);
+
+        if (response != null) {
+            System.out.println("Response: " + response);
+            String result = JSONPath.read(response, "result").toString();
+            System.out.println("识别结果:" + result);
+            return result;
+        }
+        else {
+            System.err.println("识别失败!");
+        }
+
+        return "1";
+    }
+
+    public static void main(String[] args) {
+
+
+        String token = "cc96fcdce38f49f1af2298a949d39800";
+        String appkey = "7T7TkowOxND01n1y";
+
+        SpeechRecognizerRESTfulDemo demo = new SpeechRecognizerRESTfulDemo(appkey, token);
+
+        String fileName = "/Users/hongchuangyanfa/Downloads/nls-sample-16k.wav" ;//SpeechRecognizerRESTfulDemo.class.getClassLoader().getResource("/Users/hongchuangyanfa/Downloads/nls-sample-16k.wav").getPath();
+        String format = "pcm";
+        int sampleRate = 16000;
+        boolean enablePunctuationPrediction = true;
+        boolean enableInverseTextNormalization = true;
+        boolean enableVoiceDetection = false;
+   //     String dataInfo = demo.process(fileName, format, sampleRate, enablePunctuationPrediction, enableInverseTextNormalization, enableVoiceDetection);
+        System.out.println("123");
+        //System.out.println(dataInfo);
+    }
+}*/

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/mapper/PostMapper.xml

@@ -28,7 +28,7 @@
         SELECT
         post_name
         FROM
-        blade_post
+        blade_view_post
         WHERE
         id IN
         <foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">

+ 3 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

@@ -168,6 +168,7 @@ public class UserController {
         // 内控系统拆分
         List<DeptUserVO> deptList = user.getDeptList();
         if (deptList != null && deptList.size() >= 1) {
+            user.setRoleId(JSON.toJSONString(deptList));
             String deptId = "";
             String postId = "";
             String isLaderpostId = "";
@@ -189,6 +190,7 @@ public class UserController {
             }
             user.setPostId(postId);
             user.setDeptId(deptId);
+            user.setIsLeader(isLaderpostId);
         }
 
 
@@ -240,6 +242,7 @@ public class UserController {
             user.setIsLeader(isLaderpostId);
             user.setPostId(postId);
             user.setDeptId(deptId);
+            user.setDeptInfo(JSONArray.toJSONString(deptList));
         }
         return R.status(userService.updateUser(user));
     }

+ 1 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml

@@ -34,6 +34,7 @@
         <result column="sys_type" property="sysType"/>
         <result column="is_lader" property="isLeader"/>
         <result column="one_money" property="oneMoney"/>
+        <result column="dept_info" property="deptInfo"/>
     </resultMap>
     <update id="updateRoleIdById">
         UPDATE blade_user

+ 7 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/wrapper/UserWrapper.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.system.user.wrapper;
 
+import com.alibaba.fastjson.JSON;
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
@@ -25,6 +26,7 @@ import org.springblade.system.cache.SysCache;
 import org.springblade.system.entity.Tenant;
 import org.springblade.system.enums.DictEnum;
 import org.springblade.system.user.entity.User;
+import org.springblade.system.user.vo.DeptUserVO;
 import org.springblade.system.user.vo.UserVO;
 
 import java.util.List;
@@ -53,6 +55,11 @@ public class UserWrapper extends BaseEntityWrapper<User, UserVO> {
         userVO.setDeptName(Func.join(deptName));
         userVO.setPostName(Func.join(postName));
         userVO.setSexName(DictCache.getValue(DictEnum.SEX, user.getSex()));
+
+        // 用户机构集合
+        userVO.setDeptList(JSON.parseArray(user.getDeptInfo(), DeptUserVO.class));
+
+        // 用户所属 项目
         if (ObjectUtil.isNotEmpty(user.getUserType())) {
             String value = DictCache.getValue(DictEnum.USER_TYPE, user.getUserType()).replace("[", "").replace("]", "");
             userVO.setUserTypeName(value);