Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hnxtbaboot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨亮
hnxtbaboot
Commits
aee5a60c
Commit
aee5a60c
authored
Nov 09, 2022
by
wuchengwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
讯飞声纹下载
parent
2b0617f0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
112 additions
and
6 deletions
+112
-6
hnxtba-core/src/main/java/com/founder/config/DataSourceConfig.java
+8
-0
hnxtba-core/src/main/java/com/founder/config/MybatisXfswDbConfig.java
+39
-0
hnxtba-core/src/main/java/com/founder/controller/SwCjController.java
+12
-6
hnxtba-core/src/main/java/com/founder/service/ISwCjService.java
+7
-0
hnxtba-core/src/main/java/com/founder/service/impl/SwCjServiceImpl.java
+14
-0
hnxtba-core/src/main/java/com/founder/xfswDao/XfswDao.java
+15
-0
hnxtba-core/src/main/resources/application-dev.properties
+8
-0
hnxtba-core/src/main/resources/mapper/XfswSqlMapper.xml
+9
-0
No files found.
hnxtba-core/src/main/java/com/founder/config/DataSourceConfig.java
View file @
aee5a60c
...
...
@@ -170,4 +170,12 @@ public class DataSourceConfig {
public
DataSource
tenthDataSource
(){
return
tenthDbProperties
().
initializeDataSourceBuilder
().
build
();
}
@Bean
(
name
=
"xfswdb"
)
@Qualifier
(
"xfswdb"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.xfswdb"
)
public
DataSource
xfswdbDataSource
(){
return
tenthDbProperties
().
initializeDataSourceBuilder
().
build
();
}
}
hnxtba-core/src/main/java/com/founder/config/MybatisXfswDbConfig.java
0 → 100644
View file @
aee5a60c
package
com
.
founder
.
config
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
javax.sql.DataSource
;
/**
* @author www
* @DateTime: 2020/6/9 3:14 下午
*/
@Configuration
@MapperScan
(
basePackages
=
{
"com.founder.xfswDao"
},
sqlSessionFactoryRef
=
"xfswdbSqlSessionFactory"
)
public
class
MybatisXfswDbConfig
{
static
final
String
MAPPER_LOCATION
=
"classpath:mapper/*.xml"
;
@Autowired
@Qualifier
(
"xfswdb"
)
private
DataSource
xfswdb
;
@Bean
(
name
=
"xfswdbSqlSessionFactory"
)
public
SqlSessionFactory
xzxtcxSqlSessionFactory
()
throws
Exception
{
SqlSessionFactoryBean
factoryBean
=
new
SqlSessionFactoryBean
();
factoryBean
.
setDataSource
(
xfswdb
);
factoryBean
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
().
getResources
(
MAPPER_LOCATION
));
return
factoryBean
.
getObject
();
}
@Bean
(
name
=
"xfswdbSqlSessionTemplate"
)
public
SqlSessionTemplate
xzxtcxSqlSessionTemplate
()
throws
Exception
{
return
new
SqlSessionTemplate
(
xzxtcxSqlSessionFactory
());
}
}
hnxtba-core/src/main/java/com/founder/controller/SwCjController.java
View file @
aee5a60c
...
...
@@ -3,7 +3,6 @@ package com.founder.controller;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONObject
;
import
com.founder.model.*
;
import
com.founder.module.redis.service.IDicItemService
;
import
com.founder.ryswtz.controller.CommonController
;
import
com.founder.service.AutoTbXwRycjService
;
import
com.founder.service.IParamService
;
...
...
@@ -11,8 +10,7 @@ import com.founder.service.ISwCjService;
import
com.founder.service.XzxtcxService
;
import
com.founder.utils.EasyuiPage
;
import
com.founder.utils.FileUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -44,8 +42,8 @@ import static com.founder.model.Constant.USER_LEVEL_CX;
* @date 2019-3-19
*/
@Controller
@Slf4j
public
class
SwCjController
{
private
static
Log
log
=
LogFactory
.
getLog
(
SwCjController
.
class
);
@Autowired
private
ISwCjService
swCjService
;
/**
...
...
@@ -694,7 +692,7 @@ private static Log log = LogFactory.getLog(SwCjController.class);
}
/**
* 保存声纹采集数据
* 保存声纹采集数据
---讯飞
* @param tbStSw
* @return
*/
...
...
@@ -805,7 +803,15 @@ private static Log log = LogFactory.getLog(SwCjController.class);
@RequestMapping
(
value
=
"/downloadfile"
)
@ResponseBody
public
String
findfile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestParam
(
"filename"
)
String
filename
,
@RequestParam
(
"rybh"
)
String
rybh
)
throws
IOException
{
public
String
findfile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestParam
(
"filename"
)
String
filename
,
@RequestParam
(
"rybh"
)
String
rybh
,
String
sbcs
)
{
if
(
"1"
.
equals
(
sbcs
)){
String
xfFile
=
swCjService
.
querySwByRybh
(
rybh
);
if
(
StringUtils
.
isEmpty
(
xfFile
)){
return
null
;
}
log
.
info
(
"该人员编号:{},查询讯飞下载路径为:{}"
,
rybh
,
xfFile
);
return
xfFile
;
}
ServletOutputStream
out
=
null
;
FileInputStream
ips
=
null
;
...
...
hnxtba-core/src/main/java/com/founder/service/ISwCjService.java
View file @
aee5a60c
...
...
@@ -38,4 +38,11 @@ public interface ISwCjService {
* @return
*/
boolean
deleteSwxx
(
String
xxzjbh
);
/**
* 根据人员编号获取讯飞下载链接
* @param rybh
* @return
*/
String
querySwByRybh
(
String
rybh
);
}
hnxtba-core/src/main/java/com/founder/service/impl/SwCjServiceImpl.java
View file @
aee5a60c
...
...
@@ -3,6 +3,7 @@ package com.founder.service.impl;
import
com.founder.dao.SwCjDao
;
import
com.founder.model.TbStSw
;
import
com.founder.service.ISwCjService
;
import
com.founder.xfswDao.XfswDao
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -19,6 +20,8 @@ public class SwCjServiceImpl implements ISwCjService {
private
static
Log
log
=
LogFactory
.
getLog
(
SwCjServiceImpl
.
class
);
@Autowired
private
SwCjDao
swCjDao
;
@Autowired
private
XfswDao
xfswDao
;
@Override
public
Boolean
saveSwSjXx
(
TbStSw
tbStSw
,
String
ssdw
)
{
Boolean
b
=
false
;
...
...
@@ -60,4 +63,15 @@ private static Log log = LogFactory.getLog(SwCjServiceImpl.class);
}
return
b
;
}
/**
* 根据人员编号获取讯飞下载链接
*
* @param rybh
* @return
*/
@Override
public
String
querySwByRybh
(
String
rybh
)
{
return
xfswDao
.
querySwByRybh
(
rybh
);
}
}
hnxtba-core/src/main/java/com/founder/xfswDao/XfswDao.java
0 → 100644
View file @
aee5a60c
package
com
.
founder
.
xfswDao
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
/**
* @Author: wcw
* @Date: 2022/11/4 14:48
*/
@Component
@Mapper
public
interface
XfswDao
{
String
querySwByRybh
(
@Param
(
"rybh"
)
String
rybh
);
}
hnxtba-core/src/main/resources/application-dev.properties
View file @
aee5a60c
...
...
@@ -89,6 +89,14 @@ spring.datasource.hnxzxtdb.password=ENC(h9d/u+bhR4tkrWih6C/7cQ==)
spring.datasource.hnxzxtdb.driver-class-name
=
oracle.jdbc.driver.OracleDriver
spring.datasource.hnxzxtdb.type
:
com.alibaba.druid.pool.DruidDataSource
#声纹数据库下载
spring.datasource.xfswdb.url
:
jdbc:mysql://65.26.13.247:3365/vlib3?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
spring.datasource.xfswdb.username
:
xtsend
spring.datasource.xfswdb.password
:
xtsend
spring.datasource.xfswdb.driver-class-name
:
com.mysql.cj.jdbc.Driver
spring.datasource.xfswdb.type
:
com.alibaba.druid.pool.DruidDataSource
mapper.mappers
=
com.founder.util.MyMapper
mapper.not-empty
=
false
mapper.identity
=
oracle
...
...
hnxtba-core/src/main/resources/mapper/XfswSqlMapper.xml
0 → 100644
View file @
aee5a60c
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.founder.xfswDao.XfswDao"
>
<!-- 根据人员编号查询讯飞声纹下载信息 -->
<select
id=
"querySwByRybh"
parameterType=
"java.lang.String"
resultType=
"java.lang.String"
>
select 下载地址 from xt_send where 人员编号 = #{rybh,jdbcType=VARCHAR} rownum = 1
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment