Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
c5cdc232
Commit
c5cdc232
authored
Apr 17, 2020
by
邓实川
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
电子合同
parent
45b594ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
15 deletions
+57
-15
src/main/java/cn/timer/api/controller/dzht/DzhtController.java
+21
-14
src/main/java/cn/timer/api/controller/dzht/DzhtController2.java
+1
-1
src/main/java/cn/timer/api/utils/QueryUtil.java
+35
-0
No files found.
src/main/java/cn/timer/api/controller/dzht/DzhtController.java
View file @
c5cdc232
...
...
@@ -45,6 +45,7 @@ import cn.timer.api.controller.dzht.cn.tign.hz.constant.ConfigConstant;
import
cn.timer.api.controller.dzht.cn.tign.hz.enums.RequestType
;
import
cn.timer.api.controller.dzht.cn.tign.hz.exception.DefineException
;
import
cn.timer.api.dto.dzht.DzhtRzDto
;
import
cn.timer.api.utils.QueryUtil
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
...
...
@@ -233,7 +234,20 @@ public class DzhtController {
return
ResultUtil
.
data
(
list
);
}
final
static
String
savePath
=
"esignTemplate"
;
// 本地服务器文件保存路径
public
static
String
savePath
()
{
String
savePath
=
null
;
String
name
=
System
.
getProperty
(
"os.name"
);
if
(
name
.
startsWith
(
"Windows"
))
{
savePath
=
"E:\\esignTemplate"
;
// Windows本地服务器文件保存路径包
}
else
if
(
name
.
startsWith
(
"Linux"
)){
savePath
=
"esignTemplate"
;
// Linux远程服务器文件保存路径包
}
else
{
savePath
=
"esignTemplate"
;
// 其他服务器文件保存路径包
}
return
savePath
;
}
final
static
String
APP_ID
=
ConfigConstant
.
PROJECT_ID
;
// 项目id
final
static
String
APP_SECRET
=
ConfigConstant
.
PROJECT_SECRET
;
// 项目密码
// final static String RE_TOKEN = "8b58973c290cc848b67ff0017cd424ff";
...
...
@@ -595,7 +609,7 @@ public class DzhtController {
String
filePath
=
null
;
try
{
filePath
=
FileHelper
.
downLoadFromUrl
(
ossUrl
,
fileName
,
savePath
);
filePath
=
FileHelper
.
downLoadFromUrl
(
ossUrl
,
fileName
,
savePath
()
);
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
...
...
@@ -678,18 +692,11 @@ public class DzhtController {
}
@GetMapping
(
"/queryName"
)
@ApiOperation
(
value
=
"查版本名字"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
getName
(
@RequestParam
String
empNum
)
{
String
a
=
System
.
getProperty
(
"os.name"
);
String
b
=
System
.
getProperty
(
"os.arch"
);
String
c
=
System
.
getProperty
(
"os.version"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"os.name"
,
a
);
map
.
put
(
"os.arch"
,
b
);
map
.
put
(
"os.version"
,
c
);
return
ResultUtil
.
data
(
map
);
// return ResultUtil.data(YgglMainEmp.builder().build()
// .selectOne(new QueryWrapper<YgglMainEmp>().eq("emp_num", empNum)).getName());
@ApiOperation
(
value
=
"查名字"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
getName
(
@RequestParam
(
required
=
false
)
Integer
empNum
)
{
String
name
=
QueryUtil
.
queryEmpName
(
empNum
);
Map
<
String
,
String
>
map
=
QueryUtil
.
queryVersionName
();
return
ResultUtil
.
datas
(
map
,
name
,
"查询成功"
);
}
/*************************** 设置请求头 ***************************************/
...
...
src/main/java/cn/timer/api/controller/dzht/DzhtController2.java
View file @
c5cdc232
...
...
@@ -724,7 +724,7 @@ public class DzhtController2 {
String
filePath
=
null
;
try
{
filePath
=
FileHelper
.
downLoadFromUrl
(
ossUrl
,
fileName
,
DzhtController
.
savePath
);
filePath
=
FileHelper
.
downLoadFromUrl
(
ossUrl
,
fileName
,
DzhtController
.
savePath
()
);
tpyz
.
setFilePath
(
filePath
);
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
...
...
src/main/java/cn/timer/api/utils/QueryUtil.java
0 → 100644
View file @
c5cdc232
package
cn
.
timer
.
api
.
utils
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
public
class
QueryUtil
{
/**
* 查询当前系统名字与版本号
* @return
*/
public
static
Map
<
String
,
String
>
queryVersionName
()
{
String
a
=
System
.
getProperty
(
"os.name"
);
String
b
=
System
.
getProperty
(
"os.arch"
);
String
c
=
System
.
getProperty
(
"os.version"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"os.name"
,
a
);
map
.
put
(
"os.arch"
,
b
);
map
.
put
(
"os.version"
,
c
);
return
map
;
}
/**
* 查询员工姓名
* @param empNum
* @return
*/
public
static
String
queryEmpName
(
Integer
empNum
)
{
return
YgglMainEmp
.
builder
().
build
()
.
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
eq
(
"emp_num"
,
empNum
)).
getName
();
}
}
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