Browse Source

Merge remote-tracking branch 'origin/master'

zxy 2 năm trước cách đây
mục cha
commit
b5ad963d42
25 tập tin đã thay đổi với 82 bổ sung64 xóa
  1. 8 9
      spring-cloud/server-basic/pom.xml
  2. 5 2
      spring-cloud/server-basic/src/main/java/com/jd/controller/OtherBusinessSystemController.java
  3. 1 1
      spring-cloud/server-basic/src/main/java/com/jd/mapper/OtherBusinessSystemMapper.java
  4. 1 1
      spring-cloud/server-basic/src/main/java/com/jd/service/OtherBusinessSystemService.java
  5. 2 2
      spring-cloud/server-basic/src/main/java/com/jd/service/impl/OtherBusinessSystemServiceImpl.java
  6. 3 4
      spring-cloud/server-basic/src/main/java/com/jd/service/impl/SafetyInfoServiceImpl.java
  7. 26 27
      spring-cloud/server-basic/src/main/java/com/jd/service/impl/SystemRiskServiceImpl.java
  8. 5 0
      spring-cloud/server-basic/src/main/resources/mapper/OtherBusinessSystemMapper.xml
  9. 2 2
      spring-cloud/server-basic/src/main/resources/mapper/SystemRiskMapper.xml
  10. 1 1
      spring-cloud/server-page/src/main/resources/static/page/js/basic/systemRisk.js
  11. 10 6
      spring-cloud/server-threeapi/src/main/java/com/jd/util/ApiUrlUtil.java
  12. BIN
      voice/magic-api/res/msc.dll
  13. 0 1
      voice/magic-api/res/msc/ivw_local.logcache
  14. BIN
      voice/magic-api/res/msc/res/asr/common.jet
  15. BIN
      voice/magic-api/res/msc/res/ivw/wakeupresource.jet
  16. BIN
      voice/magic-api/res/msc/res/tts/common.jet
  17. BIN
      voice/magic-api/res/msc/res/tts/xiaofeng.jet
  18. BIN
      voice/magic-api/res/msc/res/tts/xiaoyan.jet
  19. BIN
      voice/magic-api/res/msc_x64.dll
  20. 7 3
      voice/magic-api/src/main/java/com/magicapi/MagicApiApplication.java
  21. 1 1
      voice/magic-api/src/main/java/com/magicapi/util/ConfigUtil.java
  22. 3 0
      voice/magic-api/src/main/java/com/magicapi/util/Constant.java
  23. 6 3
      voice/magic-api/src/main/java/com/magicapi/util/FrameUtil.java
  24. 1 1
      xfyun-api/msc/08074aa6887ab9652c80933dc2b843ff/u.data
  25. BIN
      xfyun-api/msc/08074aa6887ab9652c80933dc2b843ff/urec.data

+ 8 - 9
spring-cloud/server-basic/pom.xml

@@ -104,13 +104,12 @@
 			<groupId>org.seleniumhq.selenium</groupId>
 			<artifactId>selenium-java</artifactId>
 		</dependency>
-		
-        <dependency>
-            <groupId>it.sauronsoftware</groupId>
-            <artifactId>jave</artifactId>
-            <version>1.0.2</version>
-        </dependency>
-		
+
+		<dependency>
+			<groupId>it.sauronsoftware</groupId>
+			<artifactId>jave</artifactId>
+			<version>1.0.2</version>
+		</dependency>
 
 	</dependencies>
 
@@ -120,10 +119,10 @@
 				<groupId>org.springframework.boot</groupId>
 				<artifactId>spring-boot-maven-plugin</artifactId>
 			</plugin>
-			<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> 
+			<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId>
 				<configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> 
 				<mainClass>com.jd.ServerBasicApplication</mainClass> </manifest> </archive> 
-				</configuration> </plugin> -->
+				</configuration> </plugin>-->
 			<!-- 添加配置跳过测试 -->
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>

+ 5 - 2
spring-cloud/server-basic/src/main/java/com/jd/controller/OtherBusinessSystemController.java

@@ -60,9 +60,12 @@ public class OtherBusinessSystemController {
 
     @GetMapping("getAllOtherSystem")
     @ApiOperation(value = "分页查询单位")
-    public Map<String, Object> getAllOtherSystem() {
-        return otherBusinessSystemService.getAllOtherSystem();
+    public Map<String, Object> getAllOtherSystem(String orgType) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("orgType", orgType);
+        return otherBusinessSystemService.getAllOtherSystem(map);
     }
+
     /**
      * 插入攻击类型
      * @param request

+ 1 - 1
spring-cloud/server-basic/src/main/java/com/jd/mapper/OtherBusinessSystemMapper.java

@@ -33,7 +33,7 @@ public interface OtherBusinessSystemMapper {
      * 查询所有单位方法
      * @return
      */
-    List<Map<String, Object>> getAllOtherSystem();
+    List<Map<String, Object>> getAllOtherSystem(Map<String, Object> param);
 
     /**
      * 通过NMAE查询单位数量

+ 1 - 1
spring-cloud/server-basic/src/main/java/com/jd/service/OtherBusinessSystemService.java

@@ -31,7 +31,7 @@ public interface OtherBusinessSystemService {
      * 获取所有单位
      * @return
      */
-    Map<String, Object> getAllOtherSystem();
+    Map<String, Object> getAllOtherSystem(Map<String, Object> param);
 
     /**
      * 新增单位

+ 2 - 2
spring-cloud/server-basic/src/main/java/com/jd/service/impl/OtherBusinessSystemServiceImpl.java

@@ -45,8 +45,8 @@ public class OtherBusinessSystemServiceImpl implements OtherBusinessSystemServic
     }
 
     @Override
-    public Map<String, Object> getAllOtherSystem() {
-        return SendUtil.send(otherBusinessSystemMapper.getAllOtherSystem());
+    public Map<String, Object> getAllOtherSystem(Map<String, Object> param) {
+        return SendUtil.send(true, null, otherBusinessSystemMapper.getAllOtherSystem(param));
     }
 
     @Override

+ 3 - 4
spring-cloud/server-basic/src/main/java/com/jd/service/impl/SafetyInfoServiceImpl.java

@@ -146,7 +146,7 @@ public class SafetyInfoServiceImpl implements SafetyInfoService {
         String month = "";
         //获取数据库中的数据显示时间
         List<Map<String, Object>> basicTimeList = basicDataMapper.getAllBasicDataByType("SAFETY_TIME");
-        if(Blank.isNotEmpty(basicTimeList)){
+       if(Blank.isNotEmpty(basicTimeList)){
             Map<String, Object> basicTime = basicTimeList.get(0);
             String showTime = basicTime.get("data_value").toString();
             String[] timeList = showTime.split("-");
@@ -342,9 +342,8 @@ public class SafetyInfoServiceImpl implements SafetyInfoService {
         apiUrl.setUrlPrefix("https://23.37.0.200");
         apiUrl.setUrlApi("/api/security/incident/overview");
         apiUrl.setUrlMethod("GET");
-        apiUrl.setUrlParamType(1);
-        String params = "{\"keyword\":\"\",\"startTime\":\"2022-05-01 00:00:00\"," +
-                "\"endTime\":\"2022-05-30 17:05:00\"}";
+        apiUrl.setUrlParamType(2);
+        String params = "{\"keyword\":\"\",\"startTime\":\"2022-05-25+00:00:00\",\"endTime\":\"2022-05-30+17:05:00\",\"threatSeverity\":\"\"}";
         //通过threeAPI调用第三方接口
         //Map<String, Object> apiMap = threeApiClient.sendApiUrlAndParam(urlCode, params);
         String apiString = sendHttpRequest(apiUrl, params);

+ 26 - 27
spring-cloud/server-basic/src/main/java/com/jd/service/impl/SystemRiskServiceImpl.java

@@ -80,10 +80,10 @@ public class SystemRiskServiceImpl implements SystemRiskService {
         Map<String, Object> safetyInfo = safetyInfoMapper.getSafetyInfoByMonth(timeMap);
         //准备返回参数
         if(Blank.isEmpty(safetyInfo)){
-            return SendUtil.send(false);
+            return SendUtil.send(false, "无安全数据信息");
         }
         if(Blank.isEmpty(safetyInfo.get("high_risk_number")) || Blank.isEmpty(safetyInfo.get("middle_risk_number"))){
-            return SendUtil.send(false);
+            return SendUtil.send(false, "无高中危漏洞信息");
         }
         //高危漏洞数
         Integer countHighRisk = Convert.toInt(safetyInfo.get("high_risk_number").toString());
@@ -107,36 +107,36 @@ public class SystemRiskServiceImpl implements SystemRiskService {
                 infoId = Integer.parseInt(safetyMap.get("id").toString());
             }catch (Exception e){
                 e.printStackTrace();
-                return SendUtil.send(false);
+                return SendUtil.send(false, "安全信息id格式错误");
             }
             //通过信息ID获取漏洞数据
             List<Map<String, Object>> riskList = systemRiskMapper.getSystemRiskByInfoId(infoId);
             //遍历每条安全信息中的系统漏洞统计系统漏洞数
             for (Map<String, Object> map : riskList) {
-                if(Blank.isEmpty(map.get("high_risk_number")) || Blank.isEmpty(map.get("middle_risk_number")) || Blank.isEmpty(map.get("system_name"))){
-                    return SendUtil.send(false);
-                }
-                Integer highRisk = Integer.parseInt(map.get("high_risk_number").toString());
-                Integer middleRisk = Integer.parseInt(map.get("middle_risk_number").toString());
-                String systemName = map.get("system_name").toString();
-                Map<String, Object> businessSystem = businessSystemMapper.getOfficeBySysName(systemName);
-                Integer officeType = 0;
-                if(Blank.isEmpty(businessSystem)){
-                    return SendUtil.send(false);
-                }
-                if(Blank.isEmpty(businessSystem.get("office_type"))){
-                    return SendUtil.send(false);
-                }
-                officeType =  Integer.parseInt(businessSystem.get("office_type").toString());
-                //局本部
-                if(officeType == 1){
-                    countOfficeHighRisk += highRisk;
-                    countOfficeMiddleRisk += middleRisk;
-                //二级单位
-                }else{
-                    countCompanyHighRisk += highRisk;
-                    countCompanyMiddleRisk += middleRisk;
+                if(Blank.isNotEmpty(map.get("high_risk_number")) && Blank.isNotEmpty(map.get("middle_risk_number")) && Blank.isNotEmpty(map.get("system_name"))){
+                    Integer highRisk = Integer.parseInt(map.get("high_risk_number").toString());
+                    Integer middleRisk = Integer.parseInt(map.get("middle_risk_number").toString());
+                    String systemName = map.get("system_name").toString();
+                    Map<String, Object> businessSystem = businessSystemMapper.getOfficeBySysName(systemName);
+                    Integer officeType = 0;
+                    if(Blank.isNotEmpty(businessSystem)){
+                        if(Blank.isEmpty(businessSystem.get("office_type"))){
+                            return SendUtil.send(false, "系统未匹配单位");
+                        }
+                        officeType =  Integer.parseInt(businessSystem.get("office_type").toString());
+                        //局本部
+                        if(officeType == 1){
+                            countOfficeHighRisk += highRisk;
+                            countOfficeMiddleRisk += middleRisk;
+                            //二级单位
+                        }else{
+                            countCompanyHighRisk += highRisk;
+                            countCompanyMiddleRisk += middleRisk;
+                        }
+                    }
+
                 }
+
             }
         }
 
@@ -233,7 +233,6 @@ public class SystemRiskServiceImpl implements SystemRiskService {
                 timeMap.put("orgType", orgType);
             }
             //查询单月安全信息数据
-
             Map<String, Object> safetyInfo = safetyInfoMapper.getSafetyInfoByMonth(timeMap);
             Integer countHighRisk = 0;
             Integer countMiddleRisk = 0;

+ 5 - 0
spring-cloud/server-basic/src/main/resources/mapper/OtherBusinessSystemMapper.xml

@@ -41,6 +41,11 @@
             update_time
         FROM
         t_other_business_system
+        <where>
+            <if test="orgType != null and orgType != ''">
+                AND org_type = #{orgType}
+            </if>
+        </where>
     </select>
 
     <!-- 查询其他业务系统 -->

+ 2 - 2
spring-cloud/server-basic/src/main/resources/mapper/SystemRiskMapper.xml

@@ -122,7 +122,7 @@
         FROM
             system_risk sr
         LEFT JOIN
-            t_business_system bs ON sr.system_name = bs.system_name
+            t_other_business_system bs ON sr.system_name = bs.system_name
         LEFT JOIN t_office o ON bs.office_id = o.id
         <where>
             <if test="infoId != null and infoId != ''">
@@ -146,7 +146,7 @@
                bs.grade_eval,
                bs.eval_time
         from t_office o
-        LEFT JOIN t_business_system bs ON o.id = bs.office_id
+        LEFT JOIN t_other_business_system bs ON o.id = bs.office_id
         LEFT JOIN system_risk sr ON bs.system_name = sr.system_name
         <where>
             <if test="infoId != null and infoId != ''">

+ 1 - 1
spring-cloud/server-page/src/main/resources/static/page/js/basic/systemRisk.js

@@ -330,7 +330,7 @@ function initBusinessSystemType(orgType) {
 	//初始化下拉框
 	ly.ajax({
 	    type: 'get',
-	    url: PAGE_BASIC + '/businessSystem/getAllSystem',
+	    url: PAGE_BASIC + '/otherBusinessSystem/getAllOtherSystem',
 	    dataType: 'json',
 	    data: {
 			orgType: orgType

+ 10 - 6
spring-cloud/server-threeapi/src/main/java/com/jd/util/ApiUrlUtil.java

@@ -56,9 +56,11 @@ public class ApiUrlUtil {
 		}else if(urlParamType == 1){
 			//参数为json字符串
 			String urlParam = apiUrl.getUrlParam();
-			if(StrUtil.isNotEmpty(urlParam)) {
-				JSONObject urlParamObj = JSONUtil.parseObj(urlParam);
-				paramsObj.putAll(urlParamObj);
+			if(StrUtil.isEmpty(params)){
+				if(StrUtil.isNotEmpty(urlParam)) {
+					JSONObject urlParamObj = JSONUtil.parseObj(urlParam);
+					paramsObj.putAll(urlParamObj);
+				}
 			}
 			String jsonStr = paramsObj.toJSONString(0);
 			httpRequest = httpRequest.body(jsonStr);
@@ -66,9 +68,11 @@ public class ApiUrlUtil {
 		}else if(urlParamType == 2){
 			//参数为form表单
 			String urlParam = apiUrl.getUrlParam();
-			if(StrUtil.isNotEmpty(urlParam)) {
-				JSONObject urlParamObj = JSONUtil.parseObj(urlParam);
-				paramsObj.putAll(urlParamObj);
+			if(StrUtil.isEmpty(params)) {
+				if (StrUtil.isNotEmpty(urlParam)) {
+					JSONObject urlParamObj = JSONUtil.parseObj(urlParam);
+					paramsObj.putAll(urlParamObj);
+				}
 			}
 			httpRequest = httpRequest.form(paramsObj);
 			log.info("请求参数(form表单): " + paramsObj.toJSONString(0));

BIN
voice/magic-api/res/msc.dll


+ 0 - 1
voice/magic-api/res/msc/ivw_local.logcache

@@ -1 +0,0 @@
-civw1P1HHBH44QITJOIm6aauLXkGLBr91VZ.log

BIN
voice/magic-api/res/msc/res/asr/common.jet


BIN
voice/magic-api/res/msc/res/ivw/wakeupresource.jet


BIN
voice/magic-api/res/msc/res/tts/common.jet


BIN
voice/magic-api/res/msc/res/tts/xiaofeng.jet


BIN
voice/magic-api/res/msc/res/tts/xiaoyan.jet


BIN
voice/magic-api/res/msc_x64.dll


+ 7 - 3
voice/magic-api/src/main/java/com/magicapi/MagicApiApplication.java

@@ -2,6 +2,7 @@ package com.magicapi;
 
 import javax.sound.sampled.DataLine;
 import javax.sound.sampled.LineUnavailableException;
+import javax.sound.sampled.SourceDataLine;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.TargetDataLine;
 
@@ -17,15 +18,18 @@ public class MagicApiApplication {
 
 	public static void main(String[] args) throws LineUnavailableException {
 		SpringApplicationBuilder builder = new SpringApplicationBuilder(MagicApiApplication.class);
-        builder.headless(false).run(args);
-        
+		builder.headless(false).run(args);
+
 		Constant.audioFormat = Step4_audioFormat.getAudioFormat(Constant.audioFormat);
 		DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, Constant.audioFormat);
 		Constant.targetDataLine = (TargetDataLine) AudioSystem.getLine(dataLineInfo);
 		Constant.myThread = new Step3_ivw_thread();
 		Constant.myThread.start();
 		Constant.voiceStatus = true;
-		
+
+		DataLine.Info line = new DataLine.Info(SourceDataLine.class, Constant.audioFormat, AudioSystem.NOT_SPECIFIED);
+		Constant.sourceDataLine = (SourceDataLine) AudioSystem.getLine(line);
+
 	}
 
 }

+ 1 - 1
voice/magic-api/src/main/java/com/magicapi/util/ConfigUtil.java

@@ -3,7 +3,7 @@ package com.magicapi.util;
 public class ConfigUtil {
 	
 	// 语音appid
-	public static final String XF_APPID = "5c20ae83";
+	public static final String XF_APPID = "e5bb677f";
 	// 静态资源目录
 	public static final String STATIC_FILE_PATH = "D:/cgj/";
 	

+ 3 - 0
voice/magic-api/src/main/java/com/magicapi/util/Constant.java

@@ -4,6 +4,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.SourceDataLine;
 import javax.sound.sampled.TargetDataLine;
 
 import org.openqa.selenium.WebDriver;
@@ -25,6 +26,8 @@ public class Constant {
 	public static AudioFormat audioFormat;
 	public static TargetDataLine targetDataLine;
 	
+	public static SourceDataLine sourceDataLine;
+	
 	public static Step3_ivw_thread myThread;
 	
 	public static String sessionId;

+ 6 - 3
voice/magic-api/src/main/java/com/magicapi/util/FrameUtil.java

@@ -10,6 +10,7 @@ import com.magicapi.frame.VoiceFrame2;
 import com.magicapi.frame.WebFrame;
 import com.magicapi.frame.WebFrame2;
 import com.magicapi.voice.Step3_ivw_thread;
+import com.magicapi.voice.Step3_tts_thread;
 import com.magicapi.voice.synthesis.MSTTSSpeech;
 
 import cn.hutool.core.lang.UUID;
@@ -53,9 +54,11 @@ public class FrameUtil {
 			voiceFrame2.setLabelTxt(txt);
 			voiceFrame2.setVisible(true);
 		}
-		MSTTSSpeech speech = new MSTTSSpeech();
-		speech.setFormatType(6);
-		speech.speak(txt);
+		Step3_tts_thread speech = new Step3_tts_thread(txt);
+		speech.start();
+//		MSTTSSpeech speech = new MSTTSSpeech();
+//		speech.setFormatType(6);
+//		speech.speak(txt);
 	}
 	
 	public static void closeVoiceFrame2() {

+ 1 - 1
xfyun-api/msc/08074aa6887ab9652c80933dc2b843ff/u.data

@@ -1 +1 @@
-d17438455018
+d17541304895

BIN
xfyun-api/msc/08074aa6887ab9652c80933dc2b843ff/urec.data