Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
edbfac00
提交
edbfac00
authored
11月 24, 2020
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[用户] [清退] [专管员统计] 代码提交
上级
a592ac80
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
47 个修改的文件
包含
1163 行增加
和
59 行删除
+1163
-59
pom.xml
dev-config/pom.xml
+4
-0
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+1
-0
UseReportFIleServiceImpl.java
...ev/device/file/service/Impl/UseReportFIleServiceImpl.java
+18
-6
pom.xml
dev-misc/pom.xml
+12
-0
GlobalExceptionHandler.java
...a/com/tykj/dev/misc/exception/GlobalExceptionHandler.java
+2
-2
HttpClientUtil.java
...om/tykj/dev/misc/utils/httpclientutil/HttpClientUtil.java
+311
-0
HttpConnectionManager.java
.../dev/misc/utils/httpclientutil/HttpConnectionManager.java
+56
-0
SslSelfSigned.java
...com/tykj/dev/misc/utils/httpclientutil/SslSelfSigned.java
+37
-0
SendBackController.java
...kj/dev/device/sendback/controller/SendBackController.java
+11
-0
SendBackBill.java
.../tykj/dev/device/sendback/entity/domain/SendBackBill.java
+1
-0
BusinessSendBackVo.java
...ykj/dev/device/sendback/entity/vo/BusinessSendBackVo.java
+29
-0
TrackingVo.java
...va/com/tykj/dev/device/sendback/entity/vo/TrackingVo.java
+38
-0
SendBackService.java
...com/tykj/dev/device/sendback/service/SendBackService.java
+10
-1
SendBackServiceImpl.java
...dev/device/sendback/service/impl/SendBackServiceImpl.java
+0
-0
SendBackServiceImpls.java
...ev/device/sendback/service/impl/SendBackServiceImpls.java
+0
-0
TrainJobController.java
.../tykj/dev/device/train/controller/TrainJobController.java
+9
-4
TrainTheme.java
...ain/java/com/tykj/dev/device/train/entity/TrainTheme.java
+7
-2
ByTrainingPeople.java
...com/tykj/dev/device/train/entity/vo/ByTrainingPeople.java
+2
-2
ConditionsTrainVo.java
...om/tykj/dev/device/train/entity/vo/ConditionsTrainVo.java
+2
-2
GradeEntry.java
.../java/com/tykj/dev/device/train/entity/vo/GradeEntry.java
+8
-5
InTrainVo.java
...n/java/com/tykj/dev/device/train/entity/vo/InTrainVo.java
+2
-2
TrainAuditVo.java
...ava/com/tykj/dev/device/train/entity/vo/TrainAuditVo.java
+3
-3
TrainDetailsVo.java
...a/com/tykj/dev/device/train/entity/vo/TrainDetailsVo.java
+136
-0
TrainRegistrationVo.java
.../tykj/dev/device/train/entity/vo/TrainRegistrationVo.java
+2
-2
TrainThemeAddVo.java
.../com/tykj/dev/device/train/entity/vo/TrainThemeAddVo.java
+3
-2
TrainThemeVo.java
...ava/com/tykj/dev/device/train/entity/vo/TrainThemeVo.java
+1
-1
TrainTrainingVo.java
.../com/tykj/dev/device/train/entity/vo/TrainTrainingVo.java
+2
-2
TrainUpdateVo.java
...va/com/tykj/dev/device/train/entity/vo/TrainUpdateVo.java
+2
-2
TrainThemeService.java
.../com/tykj/dev/device/train/service/TrainThemeService.java
+1
-0
TrainThemeServiceImpl.java
.../dev/device/train/service/impl/TrainThemeServiceImpl.java
+34
-2
WorkHandoverServiceImpl.java
...ev/device/train/service/impl/WorkHandoverServiceImpl.java
+12
-6
TrainTask.java
...c/main/java/com/tykj/dev/device/train/task/TrainTask.java
+2
-2
VenitalisVo.java
...n/java/com/tykj/dev/device/user/base/req/VenitalisVo.java
+40
-0
RegistereRetVo.java
...ava/com/tykj/dev/device/user/base/ret/RegistereRetVo.java
+23
-0
MyFilter.java
...c/main/java/com/tykj/dev/device/user/config/MyFilter.java
+21
-0
SecurityConfig.java
.../java/com/tykj/dev/device/user/config/SecurityConfig.java
+5
-1
UserController.java
...kj/dev/device/user/subject/controller/UserController.java
+39
-5
Area.java
...in/java/com/tykj/dev/device/user/subject/entity/Area.java
+2
-0
User.java
...in/java/com/tykj/dev/device/user/subject/entity/User.java
+9
-1
ContrastRet.java
...device/user/subject/entity/venaDigitalis/ContrastRet.java
+26
-0
Person.java
.../dev/device/user/subject/entity/venaDigitalis/Person.java
+22
-0
RegisteredRet.java
...vice/user/subject/entity/venaDigitalis/RegisteredRet.java
+24
-0
VenitalisService.java
...ykj/dev/device/user/subject/service/VenitalisService.java
+28
-0
AreaServiceImpl.java
...dev/device/user/subject/service/impl/AreaServiceImpl.java
+3
-2
UserServiceImpl.java
...dev/device/user/subject/service/impl/UserServiceImpl.java
+3
-2
VenitalisServiceImpl.java
...evice/user/subject/service/impl/VenitalisServiceImpl.java
+87
-0
DecryptMD5.java
...c/main/java/com/tykj/dev/device/user/util/DecryptMD5.java
+73
-0
没有找到文件。
dev-config/pom.xml
浏览文件 @
edbfac00
...
...
@@ -89,5 +89,8 @@
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
2.0.5
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
dev-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
edbfac00
...
...
@@ -100,6 +100,7 @@ public class FileController {
public
ResponseEntity
fileUpload
(
HttpServletRequest
request
)
throws
IOException
,
DocumentException
{
log
.
info
(
"触发图片转pdf的接口"
);
List
<
MultipartFile
>
multipartFiles
=
((
MultipartHttpServletRequest
)
request
).
getFiles
(
"file"
);
log
.
info
(
"数量{}"
,
multipartFiles
.
size
());
File
file1
=
new
File
(
url
+
"print/"
);
if
(!
file1
.
exists
())
{
file1
.
mkdirs
();
...
...
dev-file/src/main/java/com/tykj/dev/device/file/service/Impl/UseReportFIleServiceImpl.java
浏览文件 @
edbfac00
...
...
@@ -131,9 +131,15 @@ public class UseReportFIleServiceImpl implements UseReportFIleService {
e
.
printStackTrace
();
}
finally
{
try
{
bs
.
close
();
is
.
close
();
os
.
close
();
if
(
bs
!=
null
)
{
bs
.
close
();
}
if
(
is
!=
null
)
{
is
.
close
();
}
if
(
os
!=
null
)
{
os
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -174,9 +180,15 @@ public class UseReportFIleServiceImpl implements UseReportFIleService {
e
.
printStackTrace
();
}
finally
{
try
{
bs
.
close
();
is
.
close
();
os
.
close
();
if
(
bs
!=
null
)
{
bs
.
close
();
}
if
(
is
!=
null
)
{
is
.
close
();
}
if
(
os
!=
null
)
{
os
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
dev-misc/pom.xml
浏览文件 @
edbfac00
...
...
@@ -36,6 +36,18 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.5.4
</version>
</dependency>
<dependency>
<groupId>
commons-net
</groupId>
<artifactId>
commons-net
</artifactId>
<version>
3.1
</version>
</dependency>
</dependencies>
</project>
dev-misc/src/main/java/com/tykj/dev/misc/exception/GlobalExceptionHandler.java
浏览文件 @
edbfac00
...
...
@@ -38,7 +38,7 @@ public class GlobalExceptionHandler {
@ResponseBody
@ExceptionHandler
(
Exception
.
class
)
public
ResponseEntity
errorMessage
(
Exception
e
)
{
log
.
error
(
"[其他异常] {}"
,
e
.
toString
()
);
log
.
error
(
"[其他异常] {}"
,
e
);
e
.
printStackTrace
();
return
ResultUtil
.
failed
(
e
.
getMessage
());
}
...
...
@@ -69,7 +69,7 @@ public class GlobalExceptionHandler {
@ResponseBody
@ExceptionHandler
(
ApiException
.
class
)
public
ResponseEntity
errorMessage
(
ApiException
e
)
{
log
.
warn
(
"[自定义异常] {}"
,
e
.
toString
()
);
log
.
warn
(
"[自定义异常] {}"
,
e
);
if
(
e
.
getResponseEntity
()
!=
null
)
{
return
e
.
getResponseEntity
();
}
...
...
dev-misc/src/main/java/com/tykj/dev/misc/utils/httpclientutil/HttpClientUtil.java
0 → 100755
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
misc
.
utils
.
httpclientutil
;
import
org.apache.http.*
;
import
org.apache.http.client.ClientProtocolException
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.client.methods.HttpRequestBase
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.message.BasicNameValuePair
;
import
org.apache.http.util.EntityUtils
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.nio.charset.UnsupportedCharsetException
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.Map
;
/**
* @author LJJ
* on 18-12-27
*/
public
class
HttpClientUtil
{
/**
* 缺省超时时间 单位:ms
*/
private
static
final
int
TIMEOUT
=
60000
;
/**
* 是否重定向标识
*/
private
static
final
boolean
IS_REDIRECTS
=
false
;
private
static
String
EMPTY_STR
=
""
;
/**
* 字符集编码格式
*/
private
static
String
UTF_8
=
"UTF-8"
;
private
HttpClientUtil
()
{
}
/**
* 发送 get 请求
*
* @param url 请求地址
* @return String
*/
public
static
String
httpGetRequest
(
String
url
)
{
HttpGet
httpGet
=
new
HttpGet
(
url
);
return
execute
(
httpGet
);
}
/**
* 发送 get 请求
*
* @param url 请求地址
* @param headers 头信息
* @return String
*/
public
static
String
httpGetRequestWithHeaders
(
String
url
,
Map
<
String
,
Object
>
headers
)
{
HttpGet
httpGet
=
new
HttpGet
(
url
);
for
(
Map
.
Entry
<
String
,
Object
>
param
:
headers
.
entrySet
())
{
httpGet
.
addHeader
(
param
.
getKey
(),
String
.
valueOf
(
param
.
getValue
()));
}
return
execute
(
httpGet
);
}
/**
* 发送 get 请求
*
* @param url 请求地址
* @param headers 头信息
* @param params 参数
* @return String
*/
public
static
String
httpGetRequest
(
String
url
,
Map
<
String
,
Object
>
headers
,
Map
<
String
,
Object
>
params
)
{
HttpGet
httpGet
=
new
HttpGet
(
createParamUrl
(
url
,
params
));
for
(
Map
.
Entry
<
String
,
Object
>
param
:
headers
.
entrySet
())
{
httpGet
.
addHeader
(
param
.
getKey
(),
String
.
valueOf
(
param
.
getValue
()));
}
return
execute
(
httpGet
);
}
/**
* 发送 get 请求
*
* @param url 请求地址
* @return String
*/
public
static
String
httpGetRequestWithParams
(
String
url
,
Map
<
String
,
Object
>
params
)
{
HttpGet
httpGet
=
new
HttpGet
(
createParamUrl
(
url
,
params
));
return
execute
(
httpGet
);
}
/**
* 创建带参数的 URL
*
* @param url 无参URL
* @param params 参数
* @return String 带参数URL
*/
private
static
String
createParamUrl
(
String
url
,
Map
<
String
,
Object
>
params
)
{
Iterator
<
String
>
it
=
params
.
keySet
().
iterator
();
StringBuilder
sb
=
new
StringBuilder
();
boolean
isIncludeQuestionMark
=
url
.
contains
(
"?"
);
if
(!
isIncludeQuestionMark
)
{
sb
.
append
(
"?"
);
}
while
(
it
.
hasNext
())
{
String
key
=
it
.
next
();
String
value
=
(
String
)
params
.
get
(
key
);
sb
.
append
(
"&"
);
sb
.
append
(
key
);
sb
.
append
(
"="
);
sb
.
append
(
value
);
}
url
+=
sb
.
toString
();
return
url
;
}
/**
* 发送 post 请求
*
* @param url 请求地址
* @return String
*/
public
static
String
httpPostRequest
(
String
url
)
{
HttpPost
httpPost
=
new
HttpPost
(
url
);
return
execute
(
httpPost
);
}
/**
* 发送 post 请求
*
* @param url 地址
* @param params 参数
* @return String
*/
public
static
String
httpPostRequest
(
String
url
,
Map
<
String
,
Object
>
params
)
{
HttpPost
httpPost
=
new
HttpPost
(
url
);
ArrayList
<
NameValuePair
>
pairs
=
covertParams2NVPS
(
params
);
try
{
httpPost
.
setEntity
(
new
UrlEncodedFormEntity
(
pairs
,
UTF_8
));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
return
execute
(
httpPost
);
}
/**
* 发送 post 请求
*
* @param url 地址
* @param headers 头信息
* @param params 参数
* @return String
*/
public
static
String
httpPostRequest
(
String
url
,
Map
<
String
,
Object
>
headers
,
Map
<
String
,
Object
>
params
)
{
HttpPost
httpPost
=
new
HttpPost
(
url
);
for
(
Map
.
Entry
<
String
,
Object
>
headerParam
:
headers
.
entrySet
())
{
httpPost
.
addHeader
(
headerParam
.
getKey
(),
String
.
valueOf
(
headerParam
.
getValue
()));
}
ArrayList
<
NameValuePair
>
pairs
=
covertParams2NVPS
(
params
);
try
{
httpPost
.
setEntity
(
new
UrlEncodedFormEntity
(
pairs
,
UTF_8
));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
return
execute
(
httpPost
);
}
/**
* 发送 post 请求
*
* @param url 地址
* @param headers 头信息
* @param json json 格式参数
* @return String
*/
public
static
String
httpPostRequestByJson
(
String
url
,
Map
<
String
,
Object
>
headers
,
String
json
)
{
HttpPost
httpPost
=
new
HttpPost
(
url
);
for
(
Map
.
Entry
<
String
,
Object
>
headerParam
:
headers
.
entrySet
())
{
httpPost
.
addHeader
(
headerParam
.
getKey
(),
String
.
valueOf
(
headerParam
.
getValue
()));
}
try
{
httpPost
.
setEntity
(
new
StringEntity
(
json
,
UTF_8
));
}
catch
(
UnsupportedCharsetException
e
)
{
e
.
printStackTrace
();
}
return
execute
(
httpPost
);
}
/**
* 把参数转换为名值对数组
*
* @param params 参数
* @return ArrayList<NameValuePair>
*/
private
static
ArrayList
<
NameValuePair
>
covertParams2NVPS
(
Map
<
String
,
Object
>
params
)
{
ArrayList
<
NameValuePair
>
pairs
=
new
ArrayList
<
NameValuePair
>();
for
(
Map
.
Entry
<
String
,
Object
>
param
:
params
.
entrySet
())
{
pairs
.
add
(
new
BasicNameValuePair
(
param
.
getKey
(),
String
.
valueOf
(
param
.
getValue
())));
}
return
pairs
;
}
/**
* 执行 HTTP 请求 若重定向返回重定向地址
*
* @return String
*/
private
static
String
execute
(
HttpRequestBase
request
)
{
String
result
=
EMPTY_STR
;
request
.
setConfig
(
createConfig
(
TIMEOUT
,
IS_REDIRECTS
));
CloseableHttpClient
httpClient
=
getHttpClient
();
try
{
CloseableHttpResponse
response
=
httpClient
.
execute
(
request
);
if
(
isRedirected
(
response
))
{
result
=
getRedirectedUrl
(
response
);
}
else
{
result
=
getEntityData
(
response
);
}
}
catch
(
ClientProtocolException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
result
;
}
/**
* 创建HTTP请求配置
*
* @param timeout 超时时间
* @param redirectsEnabled 是否开启重定向
* @return RequestConfig
*/
private
static
RequestConfig
createConfig
(
int
timeout
,
boolean
redirectsEnabled
)
{
return
RequestConfig
.
custom
()
// 读取数据超时时间(毫秒)
.
setSocketTimeout
(
timeout
)
// 建立连接超时时间(毫秒)
.
setConnectTimeout
(
timeout
)
// 从连接池获取连接的等待时间(毫秒)
.
setConnectionRequestTimeout
(
timeout
)
// 当响应状态码为302时,是否进行重定向
.
setRedirectsEnabled
(
redirectsEnabled
)
.
build
();
}
/**
* 通过连接池获取 httpclient
*/
private
static
CloseableHttpClient
getHttpClient
()
{
return
HttpClients
.
custom
().
setConnectionManager
(
HttpConnectionManager
.
POOLING_CONNECTION_MANAGER
).
build
();
}
/**
* 判断发送请求是否重定向跳转过
*
* @param response 请求响应
* @return boolean
*/
private
static
boolean
isRedirected
(
CloseableHttpResponse
response
)
{
int
statusCode
=
response
.
getStatusLine
().
getStatusCode
();
return
statusCode
==
HttpStatus
.
SC_MOVED_PERMANENTLY
||
statusCode
==
HttpStatus
.
SC_MOVED_TEMPORARILY
;
}
/**
* 获得重定向跳转地址
*
* @param response 请求响应
* @return String 重定向地址
*/
private
static
String
getRedirectedUrl
(
CloseableHttpResponse
response
)
{
String
result
=
EMPTY_STR
;
Header
[]
hs
=
response
.
getHeaders
(
"Location"
);
if
(
hs
.
length
>
0
)
{
result
=
hs
[
0
].
getValue
();
}
return
result
;
}
/**
* 获得响应实体信息
*
* @param response 请求响应
* @return String 消息实体信息
*/
private
static
String
getEntityData
(
CloseableHttpResponse
response
)
throws
ParseException
,
IOException
{
String
result
=
EMPTY_STR
;
HttpEntity
entity
=
response
.
getEntity
();
if
(
entity
!=
null
)
{
result
=
EntityUtils
.
toString
(
entity
);
response
.
close
();
}
return
result
;
}
}
dev-misc/src/main/java/com/tykj/dev/misc/utils/httpclientutil/HttpConnectionManager.java
0 → 100755
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
misc
.
utils
.
httpclientutil
;
import
org.apache.http.config.Registry
;
import
org.apache.http.config.RegistryBuilder
;
import
org.apache.http.conn.HttpClientConnectionManager
;
import
org.apache.http.conn.socket.ConnectionSocketFactory
;
import
org.apache.http.conn.socket.PlainConnectionSocketFactory
;
import
org.apache.http.impl.conn.BasicHttpClientConnectionManager
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
/**
* @author LJJ
* on 18-12-27
*/
public
class
HttpConnectionManager
{
/**
* 普通连接管理器
*/
public
static
final
HttpClientConnectionManager
BASIC_CONNECTION_MANAGER
;
/**
* 连接池管理器
*/
public
static
final
HttpClientConnectionManager
POOLING_CONNECTION_MANAGER
;
static
{
Registry
<
ConnectionSocketFactory
>
r
=
RegistryBuilder
.<
ConnectionSocketFactory
>
create
()
.
register
(
"http"
,
PlainConnectionSocketFactory
.
getSocketFactory
())
.
register
(
"https"
,
SslSelfSigned
.
SSL_CONNECTION_SOCKET_FACTORY
).
build
();
// 普通连接管理器
BASIC_CONNECTION_MANAGER
=
new
BasicHttpClientConnectionManager
(
r
);
// 连接池管理器
PoolingHttpClientConnectionManager
pooling
=
new
PoolingHttpClientConnectionManager
(
r
);
// 设置最大连接数
pooling
.
setMaxTotal
(
1000
);
// 设置每个路由基础上的最大连接数
pooling
.
setDefaultMaxPerRoute
(
300
);
POOLING_CONNECTION_MANAGER
=
pooling
;
}
private
HttpConnectionManager
()
{
}
/**
* @param max httpClient 最大连接数
*/
public
static
void
setMaxTotal
(
int
max
)
{
((
PoolingHttpClientConnectionManager
)
POOLING_CONNECTION_MANAGER
).
setMaxTotal
(
max
);
}
/**
* @param max 每个路由基础上的最大连接数
*/
public
static
void
setDefaultMaxPerRoute
(
int
max
)
{
((
PoolingHttpClientConnectionManager
)
POOLING_CONNECTION_MANAGER
).
setDefaultMaxPerRoute
(
max
);
}
}
dev-misc/src/main/java/com/tykj/dev/misc/utils/httpclientutil/SslSelfSigned.java
0 → 100755
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
misc
.
utils
.
httpclientutil
;
import
org.apache.http.conn.ssl.NoopHostnameVerifier
;
import
org.apache.http.conn.ssl.SSLConnectionSocketFactory
;
import
org.apache.http.conn.ssl.TrustSelfSignedStrategy
;
import
org.apache.http.ssl.SSLContexts
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.net.ssl.SSLContext
;
import
java.security.KeyManagementException
;
import
java.security.KeyStoreException
;
import
java.security.NoSuchAlgorithmException
;
/**
* @author LJJ
* on 18-12-27
*/
public
class
SslSelfSigned
{
public
static
final
SSLConnectionSocketFactory
SSL_CONNECTION_SOCKET_FACTORY
;
protected
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SslSelfSigned
.
class
);
static
{
SSLContext
sslContext
=
null
;
try
{
sslContext
=
SSLContexts
.
custom
().
loadTrustMaterial
(
TrustSelfSignedStrategy
.
INSTANCE
).
build
();
}
catch
(
KeyManagementException
|
NoSuchAlgorithmException
|
KeyStoreException
e
)
{
logger
.
error
(
"{}"
,
e
);
}
SSL_CONNECTION_SOCKET_FACTORY
=
new
SSLConnectionSocketFactory
(
sslContext
,
NoopHostnameVerifier
.
INSTANCE
);
}
private
SslSelfSigned
()
{
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/controller/SendBackController.java
浏览文件 @
edbfac00
...
...
@@ -157,5 +157,16 @@ public class SendBackController {
return
sendBackService
.
exceptionSelect
(
taskId
);
}
@ApiOperation
(
value
=
"跟踪业务查询详情接口"
)
@GetMapping
(
"/select/tracking/{taskId}"
)
public
ResponseEntity
trackingSelect
(
@PathVariable
(
"taskId"
)
Integer
taskId
)
{
return
sendBackService
.
trackingSelect
(
taskId
);
}
@ApiOperation
(
value
=
"清退账单查询接口"
)
@GetMapping
(
"/select/repelBack/{taskId}"
)
public
ResponseEntity
repelBack
(
@PathVariable
(
"taskId"
)
Integer
taskId
)
{
return
sendBackService
.
repelBack
(
taskId
);
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/domain/SendBackBill.java
浏览文件 @
edbfac00
...
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.checkerframework.checker.units.qual.A
;
import
org.hibernate.annotations.SQLDelete
;
import
org.hibernate.annotations.Where
;
import
org.springframework.data.annotation.CreatedBy
;
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/vo/BusinessSendBackVo.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
sendback
.
entity
.
vo
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.checkerframework.checker.units.qual.A
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName BusinessSendBackVo.java
* @Description TODO
* @createTime 2020年11月11日 12:20:00
*/
@Data
@ApiModel
(
"跟踪详"
)
public
class
BusinessSendBackVo
{
@ApiModelProperty
(
value
=
"异常装备描述"
)
private
UnDeviceDesVo
unDeviceDes
;
@ApiModelProperty
(
value
=
"异常装备"
)
private
List
<
DeviceLibrary
>
unDevice
;
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/vo/TrackingVo.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
sendback
.
entity
.
vo
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName TrackingVo.java
* @Description TODO
* @createTime 2020年11月09日 10:03:00
*/
@Data
@ApiModel
(
"跟踪详细页面"
)
public
class
TrackingVo
{
/**
* 审核状态 1.审核通过 2.不通过 3.待审核
*/
@ApiModelProperty
(
value
=
"审核状态"
)
private
Integer
status
;
/**
* 相关装备集合
*/
@ApiModelProperty
(
value
=
"相关装备集合"
)
private
List
<
DeviceLibrary
>
deviceLibraries
;
@ApiModelProperty
(
value
=
"异常装备描述"
)
private
UnDeviceDesVo
unDeviceDes
;
@ApiModelProperty
(
value
=
"异常装备"
)
private
List
<
DeviceLibrary
>
unDevice
;
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/SendBackService.java
浏览文件 @
edbfac00
...
...
@@ -83,7 +83,6 @@ public interface SendBackService {
*/
ResponseEntity
sendBackOutExamine
(
Integer
taskId
,
Integer
startUserId
,
Integer
type
);
/**
* 入库-专管员B
* 1、通过,完结task
...
...
@@ -139,4 +138,14 @@ public interface SendBackService {
*/
ResponseEntity
exceptionSelect
(
Integer
task
);
/**
* 跟踪业务 查询页面
*/
ResponseEntity
trackingSelect
(
Integer
taskId
);
/**
* 清退单查询
*/
ResponseEntity
repelBack
(
Integer
taskId
);
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/SendBackServiceImpl.java
浏览文件 @
edbfac00
差异被折叠。
点击展开。
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/SendBackServiceImpls.java
0 → 100644
浏览文件 @
edbfac00
差异被折叠。
点击展开。
dev-train/src/main/java/com/tykj/dev/device/train/controller/TrainJobController.java
浏览文件 @
edbfac00
...
...
@@ -99,7 +99,7 @@ public class TrainJobController {
//2. 报名中
// JobEntity jobEntity=new JobEntity(taskEntity.getId(),0,trainTheme.getTrainStatus(),securityUser.getCurrentUserInfo().getUserId(),"x"+securityUser.getCurrentUserInfo().getUserId()+"x",0);
// jobService.addEntity(jobEntity);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1000
.
id
);
needTrain
.
forEach
(
id
->
{
//4 报名确认
...
...
@@ -128,7 +128,7 @@ public class TrainJobController {
// TaskLogBto taskLogBto = new TaskLogBto(task.getId(),"发起培训",null);
// taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
trainTheme
);
return
ResponseEntity
.
ok
(
trainTheme
Service
.
save
(
trainTheme
)
);
}
//报名
...
...
@@ -459,7 +459,7 @@ public class TrainJobController {
//7 市培训申请发证审核
trainTheme
.
setIsCertificate
(
gradeEntryVo
.
getIsCertificate
());
trainTheme
.
setTrainingResults
(
JacksonUtil
.
toJSon
(
gradeEntryVo
.
getGradeEntryList
()));
trainTheme
.
setTrainStatus
(
33
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1006
.
id
);
trainTheme
.
setGood
(
gradeEntryVo
.
getGood
());
trainTheme
.
setPass
(
gradeEntryVo
.
getPass
());
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"发证审核"
,
null
);
...
...
@@ -476,7 +476,6 @@ public class TrainJobController {
TaskBto
taskBto
=
trainTaskService
.
selectFatherIsNullAndBillidAndBillType
(
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
TRAIN1007
,
gradeEntryVo
.
getAuditId
());
//
// TaskEntity taskEntity= taskService.findByParentAndBillIdAndBussType(0,trainTheme.getTrainId(),BusinessEnum.TRAIN.id);
// taskEntity.setBillStatus(34);
// taskService.update(taskEntity);
...
...
@@ -722,4 +721,10 @@ public class TrainJobController {
return
ResponseEntity
.
ok
(
trainThemeService
.
updateTrain
(
trainUpdateVo
));
}
@ApiOperation
(
value
=
"培训详情接口查询"
)
@GetMapping
(
"/details/{trainId}"
)
public
ResponseEntity
details
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
trainId
)
{
return
ResponseEntity
.
ok
(
trainThemeService
.
findSelectDetailsVo
(
trainId
));
}
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/TrainTheme.java
浏览文件 @
edbfac00
...
...
@@ -46,7 +46,7 @@ public class TrainTheme {
/**
* 报名截止时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"报名截止时间"
)
private
Date
trainTime
;
...
...
@@ -83,7 +83,7 @@ public class TrainTheme {
* 培训结束时间
*/
@ApiModelProperty
(
value
=
"培训结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
...
...
@@ -202,5 +202,10 @@ public class TrainTheme {
return
mapper
.
map
(
this
,
TrainAuditVo
.
class
);
}
public
TrainDetailsVo
toTrainDetailsVo
()
{
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
return
mapper
.
map
(
this
,
TrainDetailsVo
.
class
);
}
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/ByTrainingPeople.java
浏览文件 @
edbfac00
...
...
@@ -73,13 +73,13 @@ public class ByTrainingPeople {
* 培训开始时间
*/
@ApiModelProperty
(
value
=
"培训开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 培训结束时间
*/
@ApiModelProperty
(
value
=
"培训结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/ConditionsTrainVo.java
浏览文件 @
edbfac00
...
...
@@ -30,11 +30,11 @@ public class ConditionsTrainVo {
@ApiModelProperty
(
value
=
"开始时间"
,
example
=
"bmxx"
,
name
=
"statusTime"
)
private
String
dimName
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"开始时间"
,
example
=
"bmxx"
,
name
=
"statusTime"
)
private
Date
statusTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"bmxx"
,
name
=
"endTime"
)
private
Date
endTime
;
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/GradeEntry.java
浏览文件 @
edbfac00
...
...
@@ -7,6 +7,7 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Transient
;
import
java.util.Date
;
/**
...
...
@@ -31,7 +32,6 @@ public class GradeEntry {
* 用户名称
*/
@ApiModelProperty
(
value
=
"用户名称"
,
name
=
"name"
)
private
String
name
;
/**
...
...
@@ -50,30 +50,33 @@ public class GradeEntry {
* 考勤
*/
@ApiModelProperty
(
value
=
"考勤"
,
name
=
"attendance"
)
private
String
attendance
;
/**
* 分数
*/
@ApiModelProperty
(
value
=
"分数"
,
name
=
"score"
)
private
String
score
;
/**
* 评价
*/
@ApiModelProperty
(
value
=
"评价"
,
name
=
"evaluation"
)
private
String
evaluation
;
/**
* 是否发证
*/
@ApiModelProperty
(
value
=
"是否发证"
,
name
=
"certificate"
)
private
Integer
certificate
;
/**
* 证书
*/
@Transient
private
Mgrcert
mgrcert
;
public
Mgrcert
toDo
()
{
// LocalDateTime now = LocalDateTime.now().plusYears(2).atZone(ZoneOffset.ofHours(8)).toLocalDateTime();
// DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(formatStr);
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/InTrainVo.java
浏览文件 @
edbfac00
...
...
@@ -63,13 +63,13 @@ public class InTrainVo {
* 培训开始时间
*/
@ApiModelProperty
(
value
=
"培训开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 培训结束时间
*/
@ApiModelProperty
(
value
=
"培训结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/TrainAuditVo.java
浏览文件 @
edbfac00
...
...
@@ -43,7 +43,7 @@ public class TrainAuditVo {
* 报名截止时间
*/
@ApiModelProperty
(
value
=
"报名截止时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
trainTime
;
/**
...
...
@@ -74,13 +74,13 @@ public class TrainAuditVo {
* 培训开始时间
*/
@ApiModelProperty
(
value
=
"培训开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 培训结束时间
*/
@ApiModelProperty
(
value
=
"培训结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/TrainDetailsVo.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
train
.
entity
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName InTrainVo.java
* @Description 报名中
* @createTime 2020年08月17日 23:45:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"培训中返回的对象"
,
description
=
"培训中返回的对象"
)
public
class
TrainDetailsVo
{
/**
* 培训id
*/
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@ApiModelProperty
(
value
=
"培训id"
)
private
Integer
trainId
;
/**
* 培训主题
*/
@ApiModelProperty
(
value
=
"培训主题"
)
private
String
name
;
/**
* 报名截止时间
*/
@ApiModelProperty
(
value
=
"报名截止时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
trainTime
;
/**
* 发起人 originator
*/
@ApiModelProperty
(
value
=
"发起人"
)
private
String
originatorName
;
/**
* 发起人 originator
*/
@ApiModelProperty
(
value
=
"发起人id"
)
private
Integer
originatorId
;
/**
* 主办单位
*/
@ApiModelProperty
(
value
=
"主办单位名称"
)
private
String
unitsName
;
/**
* 主办单位
*/
@ApiModelProperty
(
value
=
"主办单位"
)
private
Integer
unitsId
;
/**
* 培训开始时间
*/
@ApiModelProperty
(
value
=
"培训开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 培训结束时间
*/
@ApiModelProperty
(
value
=
"培训结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
* 培训地点
*/
@ApiModelProperty
(
value
=
"培训地点"
)
private
String
trainLocation
;
/**
* 主讲人
*/
@ApiModelProperty
(
value
=
"主讲人"
)
private
String
speakerUserId
;
/**
* 培训资料名称
*/
@ApiModelProperty
(
value
=
"培训资料"
)
private
String
trainDataName
;
/**
* 培训url
*/
@ApiModelProperty
(
value
=
"培训资料"
)
private
String
trainDataUrl
;
/**
* 培训简介
*/
@ApiModelProperty
(
value
=
"trainSynopsis"
)
private
String
trainSynopsis
;
/**
* 及格
*/
@ApiModelProperty
(
value
=
"发证状态"
)
private
Integer
pass
;
/**
* 优秀
*/
@ApiModelProperty
(
value
=
"发证状态"
)
private
Integer
good
;
/**
* 成绩
*/
@ApiModelProperty
(
value
=
"gradeEntry"
)
private
List
<
GradeEntry
>
gradeEntry
;
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/TrainRegistrationVo.java
浏览文件 @
edbfac00
...
...
@@ -74,13 +74,13 @@ public class TrainRegistrationVo {
* 培训开始时间
*/
@ApiModelProperty
(
value
=
"培训开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 培训结束时间
*/
@ApiModelProperty
(
value
=
"培训结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/TrainThemeAddVo.java
浏览文件 @
edbfac00
...
...
@@ -9,6 +9,7 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
org.modelmapper.ModelMapper
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -105,13 +106,13 @@ public class TrainThemeAddVo {
* 必须参加
*/
@ApiModelProperty
(
value
=
"参会人员id 集合"
)
private
List
<
Integer
>
joinUserIds
;
private
List
<
Integer
>
joinUserIds
=
new
ArrayList
<>()
;
/**
* 不必须参会人员
*/
@ApiModelProperty
(
value
=
"参会人员id 集合"
)
private
List
<
Integer
>
noJoinUserIds
;
private
List
<
Integer
>
noJoinUserIds
=
new
ArrayList
<>()
;
/**
* 培训状态 1报名中 2待培训 3培训中
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/TrainThemeVo.java
浏览文件 @
edbfac00
...
...
@@ -32,7 +32,7 @@ public class TrainThemeVo {
private
String
name
;
@ApiModelProperty
(
value
=
"时间"
,
example
=
"10"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
trainTime
;
/**
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/TrainTrainingVo.java
浏览文件 @
edbfac00
...
...
@@ -75,13 +75,13 @@ public class TrainTrainingVo {
* 培训开始时间
*/
@ApiModelProperty
(
value
=
"培训开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 培训结束时间
*/
@ApiModelProperty
(
value
=
"培训结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/TrainUpdateVo.java
浏览文件 @
edbfac00
...
...
@@ -30,13 +30,13 @@ public class TrainUpdateVo {
* 培训开始时间
*/
@ApiModelProperty
(
value
=
"培训开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 培训结束时间
*/
@ApiModelProperty
(
value
=
"培训结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/TrainThemeService.java
浏览文件 @
edbfac00
...
...
@@ -32,4 +32,5 @@ public interface TrainThemeService {
TrainThemePage
findTrainPageVo
(
ConditionsTrainVo
conditionsTrainVo
);
TrainDetailsVo
findSelectDetailsVo
(
Integer
trainId
);
}
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/TrainThemeServiceImpl.java
浏览文件 @
edbfac00
...
...
@@ -12,6 +12,7 @@ import com.tykj.dev.device.train.service.TrainThemeService;
import
com.tykj.dev.device.user.subject.service.MgrcertService
;
import
com.tykj.dev.device.user.subject.service.UserService
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
org.checkerframework.checker.units.qual.A
;
...
...
@@ -20,11 +21,14 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
/**
* @author zjm
...
...
@@ -94,8 +98,12 @@ public class TrainThemeServiceImpl implements TrainThemeService {
});
List
<
Integer
>
integerList2
=
JacksonUtil
.
readValue
(
trainTheme
.
getJoinUserId
(),
new
TypeReference
<
List
<
Integer
>>()
{
});
integerList1
.
addAll
(
integerList2
);
integerList1
.
removeAll
(
signUp
);
if
(
integerList2
!=
null
)
{
integerList1
.
addAll
(
integerList2
);
}
if
(
integerList1
!=
null
)
{
integerList1
.
removeAll
(
signUp
);
}
trainRegistrationVo
.
setNoSignUpUser
(
userService
.
findByIdListUserTarinVo
(
integerList1
));
return
trainRegistrationVo
;
...
...
@@ -169,6 +177,30 @@ public class TrainThemeServiceImpl implements TrainThemeService {
.
total
((
int
)
all
.
getTotalElements
()).
build
();
}
@Override
public
TrainDetailsVo
findSelectDetailsVo
(
Integer
trainId
)
{
Optional
<
TrainTheme
>
trainThemeOptional
=
trainThemeDao
.
findById
(
trainId
);
if
(
trainThemeOptional
.
isPresent
()){
TrainTheme
trainTheme
=
trainThemeOptional
.
get
();
TrainDetailsVo
trainDetailsVo
=
trainTheme
.
toTrainDetailsVo
();
String
gradeEntity
=
trainTheme
.
getTrainingResults
();
if
(
gradeEntity
!=
null
)
{
List
<
GradeEntry
>
list
=
JacksonUtil
.
readValue
(
gradeEntity
,
new
TypeReference
<
List
<
GradeEntry
>>()
{
});
list
.
forEach
(
gradeEntry
->
gradeEntry
.
setMgrcert
(
mgrcertService
.
findByUserId
(
gradeEntry
.
getUserId
()))
);
trainDetailsVo
.
setGradeEntry
(
list
);
}
return
trainDetailsVo
;
}
else
{
throw
new
ApiException
(
ResponseEntity
.
ok
(
"培训id没有查询到,请检查"
));
}
}
private
Page
<
TrainTheme
>
getContacts
(
ConditionsTrainVo
conditionsTrainVo
,
Pageable
pageable
)
{
PredicateBuilder
<
TrainTheme
>
predicateBuilder
=
Specifications
.
and
();
if
(
conditionsTrainVo
.
getEndTime
()
!=
null
&&
conditionsTrainVo
.
getStatusTime
()
!=
null
)
{
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/WorkHandoverServiceImpl.java
浏览文件 @
edbfac00
...
...
@@ -92,12 +92,18 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
if
(
optionalWorkHandover
.
isPresent
())
{
WorkHandover
workHandover
=
optionalWorkHandover
.
get
();
WorkHandoverVo
workHandoverVo
=
workHandover
.
toWorkHandover
();
workHandoverVo
.
setFileLists
(
JacksonUtil
.
readValue
(
workHandover
.
getFileLists
(),
new
TypeReference
<
List
<
FileRet
>>()
{
}));
workHandoverVo
.
setCommissionWord
(
JacksonUtil
.
readValue
(
workHandover
.
getCommissionWord
(),
new
TypeReference
<
List
<
TaskUserVo
>>()
{
}));
workHandoverVo
.
setTrackingWord
(
JacksonUtil
.
readValue
(
workHandover
.
getTrackingWord
(),
new
TypeReference
<
List
<
TaskUserVo
>>()
{
}));
if
(
workHandover
.
getFileLists
()!=
null
)
{
workHandoverVo
.
setFileLists
(
JacksonUtil
.
readValue
(
workHandover
.
getFileLists
(),
new
TypeReference
<
List
<
FileRet
>>()
{
}));
}
if
(
workHandover
.
getCommissionWord
()!=
null
)
{
workHandoverVo
.
setCommissionWord
(
JacksonUtil
.
readValue
(
workHandover
.
getCommissionWord
(),
new
TypeReference
<
List
<
TaskUserVo
>>()
{
}));
}
if
(
workHandover
.
getTrackingWord
()!=
null
)
{
workHandoverVo
.
setTrackingWord
(
JacksonUtil
.
readValue
(
workHandover
.
getTrackingWord
(),
new
TypeReference
<
List
<
TaskUserVo
>>()
{
}));
}
return
workHandoverVo
;
}
else
{
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
"没有这个id:"
+
workHandoverId
));
...
...
dev-train/src/main/java/com/tykj/dev/device/train/task/TrainTask.java
浏览文件 @
edbfac00
...
...
@@ -75,7 +75,7 @@ public class TrainTask {
trainTaskService
.
selectBillidAndBillType
(
trainTheme
.
getTrainId
(),
13
,
StatusEnum
.
TRAIN1010
.
id
).
forEach
(
taskBto
->
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
TRAIN1004
)
);
trainTheme
.
setTrainStatus
(
8
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1004
.
id
);
trainThemeService
.
save
(
trainTheme
);
});
...
...
@@ -89,7 +89,7 @@ public class TrainTask {
taskBto
->
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
TRAIN1008
)
);
//5 录入成绩
trainTheme
.
setTrainStatus
(
30
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1008
.
id
);
trainThemeService
.
save
(
trainTheme
);
});
}
...
...
dev-user/src/main/java/com/tykj/dev/device/user/base/req/VenitalisVo.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
base
.
req
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName VenitalisVo.java
* @Description TODO
* @createTime 2020年11月17日 13:21:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel
(
value
=
"注册指静脉接口"
,
description
=
"注册指静脉接口参数信息"
)
public
class
VenitalisVo
{
/**
* 注册指静脉的用户id
*/
@ApiModelProperty
(
value
=
"注册指静脉的用户id"
,
name
=
"userId"
,
example
=
"12321L"
)
private
Integer
userId
;
/**
* 指静脉仪器的序列号
*/
@ApiModelProperty
(
value
=
"指静脉仪器的序列号"
,
name
=
"deviceType"
,
example
=
"12321L"
)
private
String
deviceType
;
/**
* 采集到的特征值
*/
@ApiModelProperty
(
value
=
"采集到的特征值"
,
name
=
"value"
,
example
=
"12321L"
)
private
List
<
String
>
value
;
}
dev-user/src/main/java/com/tykj/dev/device/user/base/ret/RegistereRetVo.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
base
.
ret
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author zjm
* @version 1.0.0
* @ClassName RegistereRetVo.java
* @Description TODO
* @createTime 2020年11月18日 11:01:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"指静脉注册返回对象"
,
description
=
"用户查询条件信息"
)
public
class
RegistereRetVo
{
@ApiModelProperty
(
value
=
"ret"
,
example
=
"true"
)
private
Boolean
ret
;
}
dev-user/src/main/java/com/tykj/dev/device/user/config/MyFilter.java
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
config
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.tykj.dev.device.user.subject.dao.UserDao
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.VenitalisService
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
...
...
@@ -22,6 +26,11 @@ import java.util.Map;
public
class
MyFilter
extends
UsernamePasswordAuthenticationFilter
{
@Autowired
SessionRegistry
sessionRegistry
;
@Autowired
private
UserDao
userDao
;
@Autowired
VenitalisService
venitalisService
;
@Override
public
Authentication
attemptAuthentication
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
AuthenticationException
{
...
...
@@ -39,13 +48,25 @@ public class MyFilter extends UsernamePasswordAuthenticationFilter {
}
String
username
=
loginData
.
get
(
getUsernameParameter
());
String
password
=
loginData
.
get
(
getPasswordParameter
());
String
deviceType
=
loginData
.
get
(
"deviceType"
);
String
vaule
=
loginData
.
get
(
"value"
);
boolean
flag
=
false
;
if
(
username
==
null
)
{
username
=
""
;
flag
=
true
;
}
if
(
password
==
null
)
{
password
=
""
;
}
if
(
flag
){
Integer
uid
=
venitalisService
.
contrastRet
(
deviceType
,
vaule
);
User
user
=
userDao
.
findById
(
uid
).
get
();
username
=
user
.
getUsername
();
password
=
user
.
getNoPassword
();
}
username
=
username
.
trim
();
// User user= userDao.findByUsername(username);
UsernamePasswordAuthenticationToken
authRequest
=
new
UsernamePasswordAuthenticationToken
(
username
,
password
);
setDetails
(
request
,
authRequest
);
...
...
dev-user/src/main/java/com/tykj/dev/device/user/config/SecurityConfig.java
浏览文件 @
edbfac00
...
...
@@ -21,6 +21,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.security.core.session.SessionRegistryImpl
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.password.NoOpPasswordEncoder
;
import
org.springframework.security.web.access.intercept.FilterSecurityInterceptor
;
import
org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
;
import
org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy
;
...
...
@@ -149,7 +150,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public
void
configure
(
WebSecurity
web
)
{
//swagger静态资源访问
web
.
ignoring
().
antMatchers
(
"/v2/api-docs"
,
"/v2/api-docs-ext"
,
"/configuration/ui"
,
"/swagger-resources/**"
,
"/configuration/security"
,
"/swagger-ui/"
,
"/swagger-ui/**"
,
"/swagger-ui.html"
,
"/doc.html"
,
"/webjars/**"
,
"/swagger-resources/configuration/ui"
,
"**/swagger-ui.html"
,
"/static/**"
,
"/**/index.html"
,
"index.html"
,
"/js/**"
,
"/css/**"
,
"/fonds/**"
,
"/img/**"
,
"/access/send"
);
web
.
ignoring
().
antMatchers
(
"/v2/api-docs"
,
"/v2/api-docs-ext"
,
"/configuration/ui"
,
"/swagger-resources/**"
,
"/configuration/security"
,
"/swagger-ui/"
,
"/swagger-ui/**"
,
"/swagger-ui.html"
,
"/doc.html"
,
"/webjars/**"
,
"/swagger-resources/configuration/ui"
,
"**/swagger-ui.html"
,
"/static/**"
,
"/**/index.html"
,
"index.html"
,
"/js/**"
,
"/css/**"
,
"/fonds/**"
,
"/img/**"
,
"/access/send"
,
"/user/s"
);
}
@Bean
...
...
@@ -168,6 +169,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected
void
configure
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
auth
.
userDetailsService
(
myUserDetailsServiceImpl
);
// auth.authenticationProvider()
// auth.inMemoryAuthentication();
}
@Bean
...
...
@@ -184,4 +187,5 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
public
BCryptPasswordEncoder
bCryptPasswordEncoder
()
{
return
new
BCryptPasswordEncoder
();
}
//
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/controller/UserController.java
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.user.base.req.LoginUser
;
import
com.tykj.dev.device.user.base.req.VenitalisVo
;
import
com.tykj.dev.device.user.base.ret.UserUpdatePw
;
import
com.tykj.dev.device.user.config.MyFilter
;
import
com.tykj.dev.device.user.config.MyUserDetailsServiceImpl
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.RoleService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UserRoleService
;
import
com.tykj.dev.device.user.subject.service.UserService
;
import
com.tykj.dev.device.user.subject.service.*
;
import
com.tykj.dev.device.user.util.LogoutUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.annotation.AuthenticationPrincipal
;
import
org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
;
import
org.springframework.security.core.authority.mapping.NullAuthoritiesMapper
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.UUID
;
/**
...
...
@@ -45,6 +55,11 @@ public class UserController {
@Autowired
UnitsService
unitsService
;
@Autowired
VenitalisService
venitalisService
;
@Autowired
MyUserDetailsServiceImpl
myUserDetailsService
;
@Autowired
LogoutUtil
logout
;
// @PostMapping(value = "/login")
...
...
@@ -70,6 +85,18 @@ public class UserController {
logout
.
logout
();
}
@Autowired
MyFilter
myFilter
;
private
GrantedAuthoritiesMapper
authoritiesMapper
=
new
NullAuthoritiesMapper
();
@ApiOperation
(
value
=
"用户登出"
)
@PostMapping
(
"/s"
)
private
ResponseEntity
login
(
@RequestBody
LoginUser
loginUser
,
HttpServletRequest
request
,
HttpServletResponse
response
){
UserDetails
userDetails
=
myUserDetailsService
.
loadUserByUsername
(
loginUser
.
getUsername
());
myFilter
.
attemptAuthentication
(
request
,
response
);
return
ResponseEntity
.
ok
(
userDetails
);
}
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
value
=
"用户新增接口"
,
notes
=
"添加成功返回用户对象"
)
public
ResponseEntity
saveUser
(
@RequestBody
User
user
)
{
...
...
@@ -124,7 +151,7 @@ public class UserController {
}
@
Ge
tMapping
(
value
=
"/archives/update/password"
)
@
Pos
tMapping
(
value
=
"/archives/update/password"
)
@ApiOperation
(
value
=
"修改用户密码"
,
notes
=
"返回修改结果"
)
public
ResponseEntity
updatePassword
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
UserUpdatePw
userUpdatePw
)
{
...
...
@@ -180,4 +207,11 @@ public class UserController {
return
ResponseEntity
.
ok
(
UUID
.
randomUUID
().
toString
());
}
@PostMapping
(
"/save/ven"
)
@ApiOperation
(
value
=
"指静脉注册接口"
,
notes
=
"List<UserSuperiorVo>"
)
public
ResponseEntity
saveVen
(
@RequestBody
VenitalisVo
venitalisVo
)
{
return
ResponseEntity
.
ok
(
venitalisService
.
registeredRet
(
venitalisVo
));
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/entity/Area.java
浏览文件 @
edbfac00
...
...
@@ -69,4 +69,6 @@ public class Area {
return
mapper
.
map
(
this
,
AreaVo
.
class
);
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/entity/User.java
浏览文件 @
edbfac00
...
...
@@ -32,6 +32,7 @@ public class User {
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
columnDefinition
=
"INT4 AUTO_INCREMENT"
)
@ApiModelProperty
(
value
=
"用户数据ID"
,
name
=
"userId"
,
example
=
"12321L"
)
// @GeneratedValue(generator="UserIdentityGenerator",strategy = GenerationType.AUTO)
// @GenericGenerator(name = "UserIdentityGenerator", strategy = "UserIdentityGenerator")
...
...
@@ -44,11 +45,17 @@ public class User {
private
String
name
;
/**
* 密码
*
加密后
密码
*/
@ApiModelProperty
(
value
=
"密码"
,
name
=
"mPassWord"
,
example
=
"12321L"
)
private
String
password
;
/**
* 未加密密码
*/
@ApiModelProperty
(
value
=
"密码"
,
name
=
"mPassWord"
,
example
=
"12321L"
)
private
String
noPassword
;
/**
* 用户名
*/
...
...
@@ -131,6 +138,7 @@ public class User {
" "
,
"1234"
,
"sa"
,
""
,
1
,
"1234"
,
"1234"
,
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/entity/venaDigitalis/ContrastRet.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
entity
.
venaDigitalis
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName contrast.java
* @Description 指静脉1对n 返回值对象
* @createTime 2020年11月12日 16:24:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
ContrastRet
{
private
String
auth_message
;
private
String
result_message
;
private
Boolean
auth_result
;
private
List
<
Person
>
personVoList
;
private
String
result_code
;
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/entity/venaDigitalis/Person.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
entity
.
venaDigitalis
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author zjm
* @version 1.0.0
* @ClassName Person.java
* @Description contrastRet 字段
* @createTime 2020年11月12日 16:27:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
Person
{
private
String
uid
;
private
String
sex
;
private
String
name
;
private
String
id_type
;
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/entity/venaDigitalis/RegisteredRet.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
entity
.
venaDigitalis
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName RegisteredRet.java
* @Description 注册对象返回值
* @createTime 2020年11月12日 16:32:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
RegisteredRet
{
private
String
reg_result
;
private
String
result_message
;
private
String
reg_message
;
private
String
result_code
;
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/VenitalisService.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
service
;
import
com.sun.org.apache.regexp.internal.RE
;
import
com.tykj.dev.device.user.base.req.VenitalisVo
;
import
com.tykj.dev.device.user.base.ret.RegistereRetVo
;
import
com.tykj.dev.device.user.subject.entity.venaDigitalis.ContrastRet
;
import
com.tykj.dev.device.user.subject.entity.venaDigitalis.RegisteredRet
;
/**
* @author zjm
* @version 1.0.0
* @ClassName VenaDigitalis.java
* @Description TODO
* @createTime 2020年11月12日 16:36:00
*/
public
interface
VenitalisService
{
/**
* 注册特征
*/
RegistereRetVo
registeredRet
(
VenitalisVo
venitalisVo
);
/**
* 特征对比
*/
Integer
contrastRet
(
String
deviceType
,
String
value
);
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/AreaServiceImpl.java
浏览文件 @
edbfac00
...
...
@@ -3,7 +3,6 @@ package com.tykj.dev.device.user.subject.service.impl;
import
com.tykj.dev.device.user.base.ret.*
;
import
com.tykj.dev.device.user.subject.dao.AreaDao
;
import
com.tykj.dev.device.user.subject.entity.Area
;
import
com.tykj.dev.device.user.subject.entity.Role
;
import
com.tykj.dev.device.user.subject.service.AreaService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.misc.exception.ApiException
;
...
...
@@ -159,7 +158,9 @@ public class AreaServiceImpl implements AreaService {
}
else
{
throw
new
ApiException
(
ResponseEntity
.
ok
(
"[区域] 没有找到对应的所属区域id"
));
}
return
areaDao
.
save
(
area
);
Area
area1
=
areaDao
.
save
(
area
);
return
area1
;
}
@Override
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UserServiceImpl.java
浏览文件 @
edbfac00
...
...
@@ -199,10 +199,11 @@ public class UserServiceImpl implements UserService {
@Override
public
Integer
updatePw
(
UserUpdatePw
userUpdatePw
)
{
Optional
<
User
>
userOpt
=
userDao
.
findById
(
userUpdatePw
.
getUserId
());
log
.
info
(
"参数:{}"
,
userUpdatePw
);
if
(
userOpt
.
isPresent
())
{
User
user
=
userOpt
.
get
();
if
(
userOpt
.
get
().
getPassword
().
equals
(
bCryptPasswordEncoder
.
encode
(
userUpdatePw
.
getPassword
())))
{
if
(
bCryptPasswordEncoder
.
matches
(
userUpdatePw
.
getPassword
(),
user
.
getPassword
()))
{
user
.
setPassword
(
bCryptPasswordEncoder
.
encode
(
userUpdatePw
.
getNewPassWord
()));
User
user1
=
userDao
.
save
(
user
);
return
user1
.
getUserId
();
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/VenitalisServiceImpl.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
service
.
impl
;
import
com.tykj.dev.device.user.base.req.VenitalisVo
;
import
com.tykj.dev.device.user.base.ret.RegistereRetVo
;
import
com.tykj.dev.device.user.subject.dao.UserDao
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.entity.venaDigitalis.ContrastRet
;
import
com.tykj.dev.device.user.subject.entity.venaDigitalis.RegisteredRet
;
import
com.tykj.dev.device.user.subject.service.VenitalisService
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.httpclientutil.HttpClientUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.checkerframework.checker.i18nformatter.qual.I18nFormat
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author zjm
* @version 1.0.0
* @ClassName VenitalisServiceImpl.java
* @Description TODO
* @createTime 2020年11月12日 16:43:00
*/
@Service
@Slf4j
public
class
VenitalisServiceImpl
implements
VenitalisService
{
@Autowired
private
UserDao
userDao
;
private
final
static
String
http
=
"http://192.168.0.80:8081"
;
private
final
static
String
REGISTERE
=
"/api/v2/auth/register"
;
private
final
static
String
CONTRAST
=
"/api/v2/auth/identify"
;
@Override
public
RegistereRetVo
registeredRet
(
VenitalisVo
venitalisVo
)
{
User
user
=
userDao
.
findById
(
venitalisVo
.
getUserId
()).
get
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"username"
,
"lingo"
);
params
.
put
(
"password"
,
"511B0D5F341BDDBD9A5348923B48D14C"
);
params
.
put
(
"id_type"
,
"06"
);
params
.
put
(
"uid"
,
venitalisVo
.
getUserId
());
params
.
put
(
"name"
,
user
.
getName
());
if
(
user
.
getSex
()==
0
){
params
.
put
(
"sex"
,
"1"
);
}
else
{
params
.
put
(
"sex"
,
"2"
);
}
params
.
put
(
"feature_item"
,
"ls"
);
params
.
put
(
"device_type"
,
"tg.VM661J.img"
);
params
.
put
(
"value"
,
String
.
join
(
","
,
venitalisVo
.
getValue
()));
String
ret
=
HttpClientUtil
.
httpPostRequest
(
http
+
REGISTERE
,
params
);
log
.
info
(
"[指静脉] 注册请求返回:{}"
,
ret
);
RegisteredRet
registeredRet
=
JacksonUtil
.
readValue
(
ret
,
RegisteredRet
.
class
);
RegistereRetVo
registereRetVo
=
new
RegistereRetVo
();
if
(
registeredRet
.
getReg_result
().
equals
(
"ok"
)
&&
registeredRet
.
getResult_code
().
equals
(
"ok"
)){
registereRetVo
.
setRet
(
true
);
return
registereRetVo
;
}
else
{
registereRetVo
.
setRet
(
false
);
return
registereRetVo
;
}
}
@Override
public
Integer
contrastRet
(
String
deviceType
,
String
value
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"username"
,
"lingo"
);
params
.
put
(
"password"
,
"511B0D5F341BDDBD9A5348923B48D14C"
);
params
.
put
(
"device_type"
,
"tg.VM661J.img"
);
params
.
put
(
"value"
,
value
);
String
ret
=
HttpClientUtil
.
httpPostRequest
(
http
+
CONTRAST
,
params
);
log
.
info
(
"[指静脉] 认证请求返回:{}"
,
ret
);
ContrastRet
contrastRet
=
JacksonUtil
.
readValue
(
ret
,
ContrastRet
.
class
);
if
(
contrastRet
.
getResult_code
().
equals
(
"ok"
)
&&
contrastRet
.
getAuth_result
()){
return
Integer
.
valueOf
(
contrastRet
.
getPersonVoList
().
get
(
0
).
getUid
());
}
else
{
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
contrastRet
));
}
}
}
dev-user/src/main/java/com/tykj/dev/device/user/util/DecryptMD5.java
0 → 100644
浏览文件 @
edbfac00
package
com
.
tykj
.
dev
.
device
.
user
.
util
;
import
java.security.MessageDigest
;
/**
* @author zjm
* @version 1.0.0
* @ClassName DecryptMD5.java
* @Description TODO
* @createTime 2020年11月12日 15:25:00
*/
public
class
DecryptMD5
{
// MD5加码。32位
public
static
String
MD5
(
String
inStr
)
{
MessageDigest
md5
=
null
;
try
{
md5
=
MessageDigest
.
getInstance
(
"MD5"
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
toString
());
e
.
printStackTrace
();
return
""
;
}
char
[]
charArray
=
inStr
.
toCharArray
();
byte
[]
byteArray
=
new
byte
[
charArray
.
length
];
for
(
int
i
=
0
;
i
<
charArray
.
length
;
i
++)
byteArray
[
i
]
=
(
byte
)
charArray
[
i
];
byte
[]
md5Bytes
=
md5
.
digest
(
byteArray
);
StringBuffer
hexValue
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
md5Bytes
.
length
;
i
++)
{
int
val
=
((
int
)
md5Bytes
[
i
])
&
0xff
;
if
(
val
<
16
)
hexValue
.
append
(
"0"
);
hexValue
.
append
(
Integer
.
toHexString
(
val
));
}
return
hexValue
.
toString
();
}
// 可逆的加密算法
public
static
String
KL
(
String
inStr
)
{
// String s = new String(inStr);
char
[]
a
=
inStr
.
toCharArray
();
for
(
int
i
=
0
;
i
<
a
.
length
;
i
++)
{
a
[
i
]
=
(
char
)
(
a
[
i
]
^
't'
);
}
String
s
=
new
String
(
a
);
return
s
;
}
// 加密后解密
public
static
String
JM
(
String
inStr
)
{
char
[]
a
=
inStr
.
toCharArray
();
for
(
int
i
=
0
;
i
<
a
.
length
;
i
++)
{
a
[
i
]
=
(
char
)
(
a
[
i
]
^
't'
);
}
String
k
=
new
String
(
a
);
return
k
;
}
// 测试主函数
public
static
void
main
(
String
args
[])
{
String
s
=
new
String
(
"sa"
);
System
.
out
.
println
(
"原始:"
+
s
);
System
.
out
.
println
(
"MD5后:"
+
MD5
(
s
));
System
.
out
.
println
(
"MD5后再加密:"
+
KL
(
MD5
(
s
)));
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论