Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dizhen
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyun
dizhen
Commits
31576700
Commit
31576700
authored
Sep 17, 2025
by
wangqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
语音转文字
parent
dc1bc2d1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
349 additions
and
71 deletions
+349
-71
src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
+2
-2
src/main/java/com/ruoyi/framework/config/RuoYiConfig.java
+32
-0
src/main/java/com/ruoyi/project/ys/controller/HyjyxxController.java
+26
-6
src/main/java/com/ruoyi/project/ys/controller/HyjyxxMbController.java
+7
-6
src/main/java/com/ruoyi/project/ys/domain/Hyjyxx.java
+118
-46
src/main/java/com/ruoyi/project/ys/service/IHyjyxxService.java
+2
-0
src/main/java/com/ruoyi/project/ys/service/impl/HyjyxxMbServiceImpl.java
+5
-0
src/main/java/com/ruoyi/project/ys/service/impl/HyjyxxServiceImpl.java
+114
-0
src/main/resources/application.yml
+8
-2
src/main/resources/mybatis/hyjyxx/HyjyxxMapper.xml
+34
-9
src/main/resources/mybatis/hyjyxxMb/HyjyxxMbMapper.xml
+1
-0
No files found.
src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
View file @
31576700
...
...
@@ -22,7 +22,7 @@ public class MimeTypeUtils
public
static
final
String
[]
FLASH_EXTENSION
=
{
"swf"
,
"flv"
};
public
static
final
String
[]
MEDIA_EXTENSION
=
{
"swf"
,
"flv"
,
"mp3"
,
"wav"
,
"wma"
,
"wmv"
,
"mid"
,
"avi"
,
"mpg"
,
"asf"
,
"rm"
,
"rmvb"
};
"asf"
,
"rm"
,
"rmvb"
,
"aac"
,
"3gp"
,
"m4a"
};
public
static
final
String
[]
VIDEO_EXTENSION
=
{
"mp4"
,
"avi"
,
"rmvb"
};
...
...
@@ -37,7 +37,7 @@ public class MimeTypeUtils
"mp4"
,
"avi"
,
"rmvb"
,
// pdf
"pdf"
,
"sgy"
,
"segy"
};
"sgy"
,
"segy"
,
"mp3"
,
"wav"
,
"wma"
,
"aac"
,
"3gp"
,
"m4a"
};
public
static
String
getExtension
(
String
prefix
)
{
...
...
src/main/java/com/ruoyi/framework/config/RuoYiConfig.java
View file @
31576700
...
...
@@ -27,6 +27,38 @@ public class RuoYiConfig
/** 获取地址开关 */
private
static
boolean
addressEnabled
;
private
static
String
dzysip
;
private
static
String
ypzlip
;
private
static
String
hyjyip
;
public
static
String
getDzysip
()
{
return
dzysip
;
}
public
void
setDzysip
(
String
dzysip
)
{
RuoYiConfig
.
dzysip
=
dzysip
;
}
public
static
String
getYpzlip
()
{
return
ypzlip
;
}
public
void
setYpzlip
(
String
ypzlip
)
{
RuoYiConfig
.
ypzlip
=
ypzlip
;
}
public
static
String
getHyjyip
()
{
return
hyjyip
;
}
public
void
setHyjyip
(
String
hyjyip
)
{
RuoYiConfig
.
hyjyip
=
hyjyip
;
}
public
String
getName
()
{
return
name
;
...
...
src/main/java/com/ruoyi/project/ys/controller/HyjyxxController.java
View file @
31576700
...
...
@@ -21,6 +21,9 @@ import com.ruoyi.framework.web.domain.AjaxResult;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
javax.annotation.Resource
;
/**
* 会议信息Controller
*
...
...
@@ -37,7 +40,6 @@ public class HyjyxxController extends BaseController
/**
* 查询会议信息列表
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxx:hyjyxx:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
Hyjyxx
hyjyxx
)
{
...
...
@@ -49,7 +51,6 @@ public class HyjyxxController extends BaseController
/**
* 导出会议信息列表
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxx:hyjyxx:export')"
)
@Log
(
title
=
"会议信息"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
Hyjyxx
hyjyxx
)
...
...
@@ -62,7 +63,6 @@ public class HyjyxxController extends BaseController
/**
* 获取会议信息详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxx:hyjyxx:query')"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -72,7 +72,6 @@ public class HyjyxxController extends BaseController
/**
* 新增会议信息
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxx:hyjyxx:add')"
)
@Log
(
title
=
"会议信息"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
Hyjyxx
hyjyxx
)
...
...
@@ -83,7 +82,6 @@ public class HyjyxxController extends BaseController
/**
* 修改会议信息
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxx:hyjyxx:edit')"
)
@Log
(
title
=
"会议信息"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
Hyjyxx
hyjyxx
)
...
...
@@ -94,11 +92,33 @@ public class HyjyxxController extends BaseController
/**
* 删除会议信息
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxx:hyjyxx:remove')"
)
@Log
(
title
=
"会议信息"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
return
toAjax
(
hyjyxxService
.
deleteHyjyxxByIds
(
ids
));
}
// 注入线程池
@Resource
private
ThreadPoolTaskExecutor
taskExecutor
;
/**
* 会议转录
*/
@Log
(
title
=
"会议转录"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
"/hyzl/{id}"
)
public
AjaxResult
hyzl
(
@PathVariable
(
"id"
)
Long
id
)
{
/* return toAjax(hyjyxxService.hyzl(id));*/
// 提交任务到线程池异步执行
taskExecutor
.
execute
(()
->
{
hyjyxxService
.
hyzl
(
id
);
});
// 立即返回,告知前端任务已启动
return
AjaxResult
.
success
(
"会议转录任务已启动,请稍后查看结果"
);
}
}
src/main/java/com/ruoyi/project/ys/controller/HyjyxxMbController.java
View file @
31576700
...
...
@@ -37,7 +37,6 @@ public class HyjyxxMbController extends BaseController
/**
* 查询会议模板列表
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxxMb:hymb:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
HyjyxxMb
hyjyxxMb
)
{
...
...
@@ -49,7 +48,6 @@ public class HyjyxxMbController extends BaseController
/**
* 导出会议模板列表
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxxMb:hymb:export')"
)
@Log
(
title
=
"会议模板"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
HyjyxxMb
hyjyxxMb
)
...
...
@@ -62,7 +60,6 @@ public class HyjyxxMbController extends BaseController
/**
* 获取会议模板详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxxMb:hymb:query')"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -72,7 +69,6 @@ public class HyjyxxMbController extends BaseController
/**
* 新增会议模板
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxxMb:hymb:add')"
)
@Log
(
title
=
"会议模板"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
HyjyxxMb
hyjyxxMb
)
...
...
@@ -83,7 +79,6 @@ public class HyjyxxMbController extends BaseController
/**
* 修改会议模板
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxxMb:hymb:edit')"
)
@Log
(
title
=
"会议模板"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
HyjyxxMb
hyjyxxMb
)
...
...
@@ -94,11 +89,17 @@ public class HyjyxxMbController extends BaseController
/**
* 删除会议模板
*/
@PreAuthorize
(
"@ss.hasPermi('hyjyxxMb:hymb:remove')"
)
@Log
(
title
=
"会议模板"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
return
toAjax
(
hyjyxxMbService
.
deleteHyjyxxMbByIds
(
ids
));
}
@GetMapping
(
"/selectHybm"
)
public
TableDataInfo
selectHybm
(
HyjyxxMb
hyjyxxMb
)
{
List
<
HyjyxxMb
>
list
=
hyjyxxMbService
.
selectHyjyxxMbList
(
hyjyxxMb
);
return
getDataTable
(
list
);
}
}
src/main/java/com/ruoyi/project/ys/domain/Hyjyxx.java
View file @
31576700
...
...
@@ -9,7 +9,7 @@ import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 会议信息对象 hyjyxx
*
*
* @author ruoyi
* @date 2025-09-17
*/
...
...
@@ -44,9 +44,9 @@ public class Hyjyxx extends BaseEntity
@Excel
(
name
=
"会议纪要"
)
private
String
hyjy
;
/**
解析完成
时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"
解析完成时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd
"
)
/**
会议开始
时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@Excel
(
name
=
"
会议开始时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss
"
)
private
Date
jxwcsj
;
/** 创建人 */
...
...
@@ -70,154 +70,226 @@ public class Hyjyxx extends BaseEntity
@Excel
(
name
=
"备用3"
)
private
String
ext3
;
public
void
setId
(
Long
id
)
/** 原文标准化 */
@Excel
(
name
=
"原文标准化"
)
private
String
ywBzh
;
/** 会议纪要标准化 */
@Excel
(
name
=
"会议纪要标准化"
)
private
String
hyjyBzh
;
/** 音频文件名称 */
@Excel
(
name
=
"音频文件名称"
)
private
String
ypwjName
;
/** 模板名称 */
@Excel
(
name
=
"模板名称"
)
private
String
mbmc
;
private
String
jysczt
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
public
Long
getId
()
{
return
id
;
}
public
void
setXmid
(
Long
xmid
)
public
void
setXmid
(
Long
xmid
)
{
this
.
xmid
=
xmid
;
}
public
Long
getXmid
()
public
Long
getXmid
()
{
return
xmid
;
}
public
void
setHymc
(
String
hymc
)
public
void
setHymc
(
String
hymc
)
{
this
.
hymc
=
hymc
;
}
public
String
getHymc
()
public
String
getHymc
()
{
return
hymc
;
}
public
void
setJxzt
(
String
jxzt
)
public
void
setJxzt
(
String
jxzt
)
{
this
.
jxzt
=
jxzt
;
}
public
String
getJxzt
()
public
String
getJxzt
()
{
return
jxzt
;
}
public
void
setYpwj
(
String
ypwj
)
public
void
setYpwj
(
String
ypwj
)
{
this
.
ypwj
=
ypwj
;
}
public
String
getYpwj
()
public
String
getYpwj
()
{
return
ypwj
;
}
public
void
setYw
(
String
yw
)
public
void
setYw
(
String
yw
)
{
this
.
yw
=
yw
;
}
public
String
getYw
()
public
String
getYw
()
{
return
yw
;
}
public
void
setHyjy
(
String
hyjy
)
public
void
setHyjy
(
String
hyjy
)
{
this
.
hyjy
=
hyjy
;
}
public
String
getHyjy
()
public
String
getHyjy
()
{
return
hyjy
;
}
public
void
setJxwcsj
(
Date
jxwcsj
)
public
void
setJxwcsj
(
Date
jxwcsj
)
{
this
.
jxwcsj
=
jxwcsj
;
}
public
Date
getJxwcsj
()
public
Date
getJxwcsj
()
{
return
jxwcsj
;
}
public
void
setCreatedBy
(
String
createdBy
)
public
void
setCreatedBy
(
String
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
public
String
getCreatedBy
()
public
String
getCreatedBy
()
{
return
createdBy
;
}
public
void
setCreatedTime
(
Date
createdTime
)
public
void
setCreatedTime
(
Date
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
public
Date
getCreatedTime
()
public
Date
getCreatedTime
()
{
return
createdTime
;
}
public
void
setExt1
(
String
ext1
)
public
void
setExt1
(
String
ext1
)
{
this
.
ext1
=
ext1
;
}
public
String
getExt1
()
public
String
getExt1
()
{
return
ext1
;
}
public
void
setExt2
(
String
ext2
)
public
void
setExt2
(
String
ext2
)
{
this
.
ext2
=
ext2
;
}
public
String
getExt2
()
public
String
getExt2
()
{
return
ext2
;
}
public
void
setExt3
(
String
ext3
)
public
void
setExt3
(
String
ext3
)
{
this
.
ext3
=
ext3
;
}
public
String
getExt3
()
public
String
getExt3
()
{
return
ext3
;
}
public
void
setYwBzh
(
String
ywBzh
)
{
this
.
ywBzh
=
ywBzh
;
}
public
String
getYwBzh
()
{
return
ywBzh
;
}
public
void
setHyjyBzh
(
String
hyjyBzh
)
{
this
.
hyjyBzh
=
hyjyBzh
;
}
public
String
getHyjyBzh
()
{
return
hyjyBzh
;
}
public
void
setYpwjName
(
String
ypwjName
)
{
this
.
ypwjName
=
ypwjName
;
}
public
String
getYpwjName
()
{
return
ypwjName
;
}
public
void
setMbmc
(
String
mbmc
)
{
this
.
mbmc
=
mbmc
;
}
public
String
getMbmc
()
{
return
mbmc
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"xmid"
,
getXmid
())
.
append
(
"hymc"
,
getHymc
())
.
append
(
"jxzt"
,
getJxzt
())
.
append
(
"ypwj"
,
getYpwj
())
.
append
(
"yw"
,
getYw
())
.
append
(
"hyjy"
,
getHyjy
())
.
append
(
"jxwcsj"
,
getJxwcsj
())
.
append
(
"createdBy"
,
getCreatedBy
())
.
append
(
"createdTime"
,
getCreatedTime
())
.
append
(
"updateBy"
,
getUpdateBy
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"ext1"
,
getExt1
())
.
append
(
"ext2"
,
getExt2
())
.
append
(
"ext3"
,
getExt3
())
.
toString
();
.
append
(
"id"
,
getId
())
.
append
(
"xmid"
,
getXmid
())
.
append
(
"hymc"
,
getHymc
())
.
append
(
"jxzt"
,
getJxzt
())
.
append
(
"ypwj"
,
getYpwj
())
.
append
(
"yw"
,
getYw
())
.
append
(
"hyjy"
,
getHyjy
())
.
append
(
"jxwcsj"
,
getJxwcsj
())
.
append
(
"createdBy"
,
getCreatedBy
())
.
append
(
"createdTime"
,
getCreatedTime
())
.
append
(
"updateBy"
,
getUpdateBy
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"ext1"
,
getExt1
())
.
append
(
"ext2"
,
getExt2
())
.
append
(
"ext3"
,
getExt3
())
.
append
(
"ywBzh"
,
getYwBzh
())
.
append
(
"hyjyBzh"
,
getHyjyBzh
())
.
append
(
"ypwjName"
,
getYpwjName
())
.
append
(
"mbmc"
,
getMbmc
())
.
toString
();
}
public
String
getJysczt
()
{
return
jysczt
;
}
public
void
setJysczt
(
String
jysczt
)
{
this
.
jysczt
=
jysczt
;
}
}
src/main/java/com/ruoyi/project/ys/service/IHyjyxxService.java
View file @
31576700
...
...
@@ -58,4 +58,6 @@ public interface IHyjyxxService
* @return 结果
*/
public
int
deleteHyjyxxById
(
Long
id
);
public
int
hyzl
(
Long
id
);
}
src/main/java/com/ruoyi/project/ys/service/impl/HyjyxxMbServiceImpl.java
View file @
31576700
...
...
@@ -8,6 +8,8 @@ import com.ruoyi.project.ys.mapper.HyjyxxMbMapper;
import
com.ruoyi.project.ys.domain.HyjyxxMb
;
import
com.ruoyi.project.ys.service.IHyjyxxMbService
;
import
static
com
.
ruoyi
.
common
.
utils
.
SecurityUtils
.
getUserId
;
/**
* 会议模板Service业务层处理
*
...
...
@@ -53,6 +55,8 @@ public class HyjyxxMbServiceImpl implements IHyjyxxMbService
@Override
public
int
insertHyjyxxMb
(
HyjyxxMb
hyjyxxMb
)
{
hyjyxxMb
.
setCreateBy
(
getUserId
()+
""
);
hyjyxxMb
.
setCreatedTime
(
DateUtils
.
getNowDate
());
return
hyjyxxMbMapper
.
insertHyjyxxMb
(
hyjyxxMb
);
}
...
...
@@ -65,6 +69,7 @@ public class HyjyxxMbServiceImpl implements IHyjyxxMbService
@Override
public
int
updateHyjyxxMb
(
HyjyxxMb
hyjyxxMb
)
{
hyjyxxMb
.
setUpdateBy
(
getUserId
()+
""
);
hyjyxxMb
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
hyjyxxMbMapper
.
updateHyjyxxMb
(
hyjyxxMb
);
}
...
...
src/main/java/com/ruoyi/project/ys/service/impl/HyjyxxServiceImpl.java
View file @
31576700
...
...
@@ -2,12 +2,25 @@ package com.ruoyi.project.ys.service.impl;
import
java.util.List
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.framework.config.RuoYiConfig
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.project.ys.mapper.HyjyxxMapper
;
import
com.ruoyi.project.ys.domain.Hyjyxx
;
import
com.ruoyi.project.ys.service.IHyjyxxService
;
import
java.io.BufferedReader
;
import
java.io.DataOutputStream
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Map
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
/**
* 会议信息Service业务层处理
*
...
...
@@ -92,4 +105,105 @@ public class HyjyxxServiceImpl implements IHyjyxxService
{
return
hyjyxxMapper
.
deleteHyjyxxById
(
id
);
}
// 1. 转录接口地址(固定)
private
static
final
String
ASR_API_URL
=
"/asr"
;
/**
* 修改会议信息
*
* @param id 会议信息
* @return 结果
*/
@Override
public
int
hyzl
(
Long
id
)
{
Hyjyxx
hyjyxx
=
hyjyxxMapper
.
selectHyjyxxById
(
id
);
String
targetMp3Url
=
RuoYiConfig
.
getDzysip
()
+
hyjyxx
.
getYpwj
();
try
{
// 1. 发送 POST 请求,获取原始 JSON 响应
String
responseJson
=
sendAsrPostRequest
(
targetMp3Url
);
System
.
out
.
println
(
"接口返回原始 JSON:"
+
responseJson
);
// 创建ObjectMapper实例
ObjectMapper
objectMapper
=
new
ObjectMapper
();
// 将String转换为JsonNode(JSON对象)
JsonNode
jsonNode
=
objectMapper
.
readTree
(
responseJson
);
// 2. 直接提取 asr_text 和 timestamp_text 的值
String
asrText
=
jsonNode
.
get
(
"asr_text"
).
asText
();
String
timestampText
=
jsonNode
.
get
(
"json_result"
).
toString
();
hyjyxx
.
setYw
(
asrText
);
hyjyxx
.
setYwBzh
(
timestampText
);
hyjyxx
.
setJxzt
(
"转录成功"
);
return
hyjyxxMapper
.
updateHyjyxx
(
hyjyxx
);
}
catch
(
IOException
e
)
{
System
.
err
.
println
(
"请求异常:"
+
e
.
getMessage
());
e
.
printStackTrace
();
hyjyxx
.
setJxzt
(
"转录失败"
);
hyjyxxMapper
.
updateHyjyxx
(
hyjyxx
);
return
0
;
}
}
/**
* 发送 POST 请求到 ASR 接口
* @param mp3Url 音频文件 URL(对应请求参数 mp3_url)
* @return 接口返回结果(Map 格式:key=asr_text/timestamp_text,value=对应文本)
* @throws IOException 网络异常/请求失败
*/
public
static
String
sendAsrPostRequest
(
String
mp3Url
)
throws
IOException
{
// 1. 构建请求 JSON 字符串(无实体类,直接拼接)
String
requestJson
=
String
.
format
(
"{\"mp3_url\":\"%s\"}"
,
mp3Url
);
// 2. 创建 URL 对象并打开连接
URL
url
=
new
URL
(
RuoYiConfig
.
getYpzlip
()+
ASR_API_URL
);
HttpURLConnection
connection
=
(
HttpURLConnection
)
url
.
openConnection
();
try
{
// 3. 配置请求参数(POST 方法、请求头、超时时间)
connection
.
setRequestMethod
(
"POST"
);
// 必须设为 POST
connection
.
setRequestProperty
(
"Content-Type"
,
"application/json; charset=UTF-8"
);
// 声明 JSON 格式
connection
.
setDoOutput
(
true
);
// 允许向服务器写数据(POST 必须开启)
connection
.
setConnectTimeout
(
5000
);
// 连接超时:5秒
connection
.
setReadTimeout
(
500000
);
// 读取响应超时:10秒
// 4. 向服务器写入请求体(JSON 字符串)
try
(
DataOutputStream
outputStream
=
new
DataOutputStream
(
connection
.
getOutputStream
()))
{
byte
[]
requestBytes
=
requestJson
.
getBytes
(
StandardCharsets
.
UTF_8
);
outputStream
.
write
(
requestBytes
);
// 写入请求数据
outputStream
.
flush
();
// 刷新缓冲区,确保数据全部发送
}
// 5. 检查请求是否成功(HTTP 状态码 200-299 为成功)
int
responseCode
=
connection
.
getResponseCode
();
if
(
responseCode
<
200
||
responseCode
>=
300
)
{
throw
new
IOException
(
"请求失败!HTTP 状态码:"
+
responseCode
+
",响应信息:"
+
connection
.
getResponseMessage
());
}
// 6. 读取接口返回的 JSON 响应
StringBuilder
responseSb
=
new
StringBuilder
();
try
(
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
connection
.
getInputStream
(),
StandardCharsets
.
UTF_8
)))
{
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
responseSb
.
append
(
line
);
// 逐行读取响应内容
}
}
String
responseJson
=
responseSb
.
toString
();
// 7. 将 JSON 转为 Map(无实体类,直接通过 key 取值)
return
responseJson
;
}
finally
{
// 8. 关闭连接(避免资源泄漏)
connection
.
disconnect
();
}
}
}
src/main/resources/application.yml
View file @
31576700
...
...
@@ -12,6 +12,12 @@ ruoyi:
addressEnabled
:
false
# 验证码类型 math 数字计算 char 字符验证
captchaType
:
math
# 本机ip+端口
dzysip
:
http://192.168.31.12:8999
# 转录ip+端口
ypzlip
:
http://192.168.31.200:17751
# 纪要ip
hyjyip
:
http://192.168.31.200:17751
# 开发环境配置
server
:
...
...
@@ -57,9 +63,9 @@ spring:
servlet
:
multipart
:
# 单个文件大小
max-file-size
:
10MB
max-file-size
:
10
0
MB
# 设置总上传的文件大小
max-request-size
:
20MB
max-request-size
:
20
000
MB
# 服务模块
devtools
:
restart
:
...
...
src/main/resources/mybatis/hyjyxx/HyjyxxMapper.xml
View file @
31576700
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.project.ys.mapper.HyjyxxMapper"
>
<resultMap
type=
"Hyjyxx"
id=
"HyjyxxResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"xmid"
column=
"xmid"
/>
...
...
@@ -20,15 +20,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"ext1"
column=
"ext1"
/>
<result
property=
"ext2"
column=
"ext2"
/>
<result
property=
"ext3"
column=
"ext3"
/>
<result
property=
"ywBzh"
column=
"yw_bzh"
/>
<result
property=
"hyjyBzh"
column=
"hyjy_bzh"
/>
<result
property=
"ypwjName"
column=
"ypwj_name"
/>
<result
property=
"mbmc"
column=
"mbmc"
/>
<result
property=
"jysczt"
column=
"jysczt"
/>
</resultMap>
<sql
id=
"selectHyjyxxVo"
>
select id, xmid, hymc, jxzt, ypwj, yw, hyjy, jxwcsj, created_by, created_time, update_by, update_time, ext1, ext2, ext3 from hyjyxx
select id, xmid, hymc, jxzt, ypwj, yw, hyjy, jxwcsj, created_by, created_time, update_by, update_time, ext1, ext2, ext3
, yw_bzh, hyjy_bzh, ypwj_name, mbmc, jysczt
from hyjyxx
</sql>
<select
id=
"selectHyjyxxList"
parameterType=
"Hyjyxx"
resultMap=
"HyjyxxResult"
>
<include
refid=
"selectHyjyxxVo"
/>
<where>
<where>
<if
test=
"id != null "
>
and id = #{id}
</if>
<if
test=
"xmid != null "
>
and xmid = #{xmid}
</if>
<if
test=
"hymc != null and hymc != ''"
>
and hymc = #{hymc}
</if>
...
...
@@ -42,9 +47,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"ext1 != null and ext1 != ''"
>
and ext1 = #{ext1}
</if>
<if
test=
"ext2 != null and ext2 != ''"
>
and ext2 = #{ext2}
</if>
<if
test=
"ext3 != null and ext3 != ''"
>
and ext3 = #{ext3}
</if>
<if
test=
"ywBzh != null and ywBzh != ''"
>
and yw_bzh = #{ywBzh}
</if>
<if
test=
"hyjyBzh != null and hyjyBzh != ''"
>
and hyjy_bzh = #{hyjyBzh}
</if>
<if
test=
"ypwjName != null and ypwjName != ''"
>
and ypwj_name like concat('%', #{ypwjName}, '%')
</if>
<if
test=
"mbmc != null and mbmc != ''"
>
and mbmc = #{mbmc}
</if>
<if
test=
"jysczt != null and jysczt != ''"
>
and jysczt = #{jysczt}
</if>
</where>
</select>
<select
id=
"selectHyjyxxById"
parameterType=
"Long"
resultMap=
"HyjyxxResult"
>
<include
refid=
"selectHyjyxxVo"
/>
where id = #{id}
...
...
@@ -67,7 +77,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"ext1 != null"
>
ext1,
</if>
<if
test=
"ext2 != null"
>
ext2,
</if>
<if
test=
"ext3 != null"
>
ext3,
</if>
</trim>
<if
test=
"ywBzh != null"
>
yw_bzh,
</if>
<if
test=
"hyjyBzh != null"
>
hyjy_bzh,
</if>
<if
test=
"ypwjName != null"
>
ypwj_name,
</if>
<if
test=
"mbmc != null"
>
mbmc,
</if>
<if
test=
"jysczt != null"
>
jysczt,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"xmid != null"
>
#{xmid},
</if>
<if
test=
"hymc != null"
>
#{hymc},
</if>
...
...
@@ -83,7 +98,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"ext1 != null"
>
#{ext1},
</if>
<if
test=
"ext2 != null"
>
#{ext2},
</if>
<if
test=
"ext3 != null"
>
#{ext3},
</if>
</trim>
<if
test=
"ywBzh != null"
>
#{ywBzh},
</if>
<if
test=
"hyjyBzh != null"
>
#{hyjyBzh},
</if>
<if
test=
"ypwjName != null"
>
#{ypwjName},
</if>
<if
test=
"mbmc != null"
>
#{mbmc},
</if>
<if
test=
"jysczt != null"
>
#{jysczt},
</if>
</trim>
</insert>
<update
id=
"updateHyjyxx"
parameterType=
"Hyjyxx"
>
...
...
@@ -103,6 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"ext1 != null"
>
ext1 = #{ext1},
</if>
<if
test=
"ext2 != null"
>
ext2 = #{ext2},
</if>
<if
test=
"ext3 != null"
>
ext3 = #{ext3},
</if>
<if
test=
"ywBzh != null"
>
yw_bzh = #{ywBzh},
</if>
<if
test=
"hyjyBzh != null"
>
hyjy_bzh = #{hyjyBzh},
</if>
<if
test=
"ypwjName != null"
>
ypwj_name = #{ypwjName},
</if>
<if
test=
"mbmc != null"
>
mbmc = #{mbmc},
</if>
<if
test=
"jysczt != null"
>
jysczt = #{jysczt},
</if>
</trim>
where id = #{id}
</update>
...
...
@@ -112,7 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete
id=
"deleteHyjyxxByIds"
parameterType=
"String"
>
delete from hyjyxx where id in
delete from hyjyxx where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
...
...
src/main/resources/mybatis/hyjyxxMb/HyjyxxMbMapper.xml
View file @
31576700
...
...
@@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"ext2 != null and ext2 != ''"
>
and ext2 = #{ext2}
</if>
<if
test=
"ext3 != null and ext3 != ''"
>
and ext3 = #{ext3}
</if>
</where>
order by px
</select>
<select
id=
"selectHyjyxxMbById"
parameterType=
"Long"
resultMap=
"HyjyxxMbResult"
>
...
...
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