Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
2d61cd89
提交
2d61cd89
authored
5月 26, 2023
作者:
zjm
浏览文件
操作
浏览文件
下载
差异文件
合并dev
上级
a8ea4361
e7954a0b
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
220 行增加
和
25 行删除
+220
-25
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+9
-10
DocumentDevice.java
.../java/com/tykj/dev/device/file/entity/DocumentDevice.java
+49
-0
JavaToPdfHtmlFreeMarker.java
...om/tykj/dev/device/file/util/JavaToPdfHtmlFreeMarker.java
+5
-3
RepairBackBillServiceImpl.java
...device/repair/service/impl/RepairBackBillServiceImpl.java
+2
-1
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+4
-2
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+2
-0
HandoverController.java
.../tykj/dev/device/train/controller/HandoverController.java
+11
-0
WorkHandover.java
...n/java/com/tykj/dev/device/train/entity/WorkHandover.java
+8
-1
TerminateVo.java
...java/com/tykj/dev/device/train/entity/vo/TerminateVo.java
+31
-0
WorkHandoverService.java
...om/tykj/dev/device/train/service/WorkHandoverService.java
+7
-1
WorkHandoverServiceImpl.java
...ev/device/train/service/impl/WorkHandoverServiceImpl.java
+21
-0
application-dev.properties
dev-union/src/main/resources/application-dev.properties
+6
-3
application-prodM.properties
dev-union/src/main/resources/application-prodM.properties
+2
-0
application-prodT.properties
dev-union/src/main/resources/application-prodT.properties
+4
-0
application-test.properties
dev-union/src/main/resources/application-test.properties
+3
-1
VenitalisService.java
...ykj/dev/device/user/subject/service/VenitalisService.java
+11
-0
VenitalisServiceImpl.java
...evice/user/subject/service/impl/VenitalisServiceImpl.java
+45
-3
没有找到文件。
dev-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
2d61cd89
...
...
@@ -76,7 +76,7 @@ public class FileController {
*/
@ApiOperation
(
value
=
"生成维修单据"
)
@PostMapping
(
"/printRepair"
)
public
ResponseEntity
printRepair
(
@RequestBody
Documents
documents
)
throws
IOException
,
DocumentException
{
public
ResponseEntity
printRepair
(
@RequestBody
Documents
documents
)
{
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRenderRepair
(
documents
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成出入单据对接口 出入库单据"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"documents/"
));
...
...
@@ -213,7 +213,7 @@ public class FileController {
*/
@ApiOperation
(
value
=
"生成单据1"
)
@GetMapping
(
"/printDocuments1"
)
public
ResponseEntity
printDocuments
(
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
IOException
,
DocumentException
{
public
ResponseEntity
printDocuments
(
HttpServletResponse
response
,
HttpServletRequest
request
){
int
interval
=
request
.
getSession
().
getMaxInactiveInterval
();
System
.
out
.
println
(
"-------"
+
interval
);
Documents
documents
=
new
Documents
();
...
...
@@ -222,13 +222,13 @@ public class FileController {
documents
.
setReplyNum
(
"123123123131"
);
documents
.
setSenderUnit
(
"浙江省"
);
documents
.
setTitle
(
"密码装备清退单"
);
documents
.
setId
(
1
);
documents
.
setId
(
null
);
List
<
DocumentDevice
>
documentDevices
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
20
;
i
++){
for
(
int
i
=
0
;
i
<
1
;
i
++){
DocumentDevice
documentDevice
=
new
DocumentDevice
();
documentDevice
.
setCount
(
i
);
documentDevice
.
setModel
(
"
MM001
"
);
documentDevice
.
setRemark
(
"
备注
"
);
documentDevice
.
setModel
(
"
ZJM-123123
"
);
documentDevice
.
setRemark
(
"
<1231231231>312312312321312
"
);
documentDevice
.
setApplicationField
(
"省一级"
);
documentDevice
.
setDeviceSerialNumber
(
"asdq1231232"
);
// documentDevice.setProductionSerialNumber("12312312312");
...
...
@@ -238,10 +238,9 @@ public class FileController {
documentDevices
.
add
(
documentDevice
);
}
documents
.
setDocumentDevices
(
documentDevices
);
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRender
(
documents
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成出入单据对接口 documents"
);
// String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRender(documents,url+"htmlModel/");
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRenderRepair
(
documents
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成出入单据对接口 出入库单据"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"documents/"
));
}
...
...
dev-file/src/main/java/com/tykj/dev/device/file/entity/DocumentDevice.java
浏览文件 @
2d61cd89
...
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
/**
* @author zjm
...
...
@@ -84,4 +85,52 @@ public class DocumentDevice {
this
.
setOneCount
((
remainder
>
0
)
?
deviceSerialNumber
.
length
()/
56
+
1
:
deviceSerialNumber
.
length
()/
56
);
return
this
;
}
public
DocumentDevice
toChangeWord
(){
remark
=
changeWord
(
remark
);
return
this
;
}
public
String
changeWord
(
String
keyword
)
{
System
.
out
.
println
(
keyword
);
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
if
(
keyword
.
contains
(
"<br/>"
)){
keyword
=
keyword
.
replace
(
"<br/>"
,
"Ǵ"
);
}
if
(
keyword
.
contains
(
"<"
))
{
keyword
=
keyword
.
replace
(
"<"
,
"<"
);
}
if
(
keyword
.
contains
(
">"
))
{
keyword
=
keyword
.
replace
(
">"
,
">"
);
}
}
keyword
=
keyword
.
replace
(
"Ǵ"
,
"<br/>"
);
return
keyword
;
}
public
static
void
main
(
String
[]
args
)
{
String
keyword
=
"<11111>ashdsa<br />asdsad<2222>"
;
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
if
(
keyword
.
contains
(
"<br />"
)){
keyword
=
keyword
.
replace
(
"<br />"
,
"Ǵ"
);
}
if
(
keyword
.
contains
(
"&"
))
{
keyword
=
keyword
.
replace
(
"&"
,
"&"
);
}
if
(
keyword
.
contains
(
"<"
))
{
keyword
=
keyword
.
replace
(
"<"
,
"<"
);
}
if
(
keyword
.
contains
(
">"
))
{
keyword
=
keyword
.
replace
(
">"
,
">"
);
}
}
keyword
=
keyword
.
replace
(
"Ǵ"
,
"<br />"
);
System
.
out
.
println
(
keyword
);
}
}
dev-file/src/main/java/com/tykj/dev/device/file/util/JavaToPdfHtmlFreeMarker.java
浏览文件 @
2d61cd89
...
...
@@ -115,7 +115,7 @@ public class JavaToPdfHtmlFreeMarker {
String
url
=
new
File
(
htmlFile
).
toURI
().
toURL
().
toString
();
ByteArrayOutputStream
os
=
new
ByteArrayOutputStream
();
ITextRenderer
renderer
=
new
ITextRenderer
();
renderer
.
setDocument
(
htmlFile
);
renderer
.
setDocument
(
url
);
// 解决中文不显示问题
ITextFontResolver
fontResolver
=
renderer
.
getFontResolver
();
fontResolver
.
addFont
(
ResourceUtils
.
getURL
(
"classpath:"
).
getPath
()+
"font/simhei.ttf"
,
BaseFont
.
IDENTITY_H
,
BaseFont
.
NOT_EMBEDDED
);
...
...
@@ -253,6 +253,7 @@ public class JavaToPdfHtmlFreeMarker {
for
(
int
i
=
1
;
i
<=
3
;
i
++){
Integer
page
=
1
;
for
(
List
<
DocumentDevice
>
list1:
listList
)
{
String
htmlname
=
htmlPath
+
UUID
.
randomUUID
().
toString
()+
".html"
;
// 合并数据模型与模板
FileWriter
fileWriter
=
new
FileWriter
(
new
File
(
htmlname
));
...
...
@@ -266,6 +267,7 @@ public class JavaToPdfHtmlFreeMarker {
return
strings
;
}
catch
(
Exception
e
)
{
log
.
error
(
"[freeMarkerRender] 方法找不到地址:{}"
,
htmlPath
);
log
.
error
(
"{}"
,
e
);
}
finally
{
try
{
out
.
close
();
...
...
@@ -347,7 +349,7 @@ public class JavaToPdfHtmlFreeMarker {
documentDevice
.
setModel
(
String
.
join
(
""
,
modelList
.
subList
(
0
,
differ
)));
documentDevice1
.
setModel
(
String
.
join
(
""
,
modelList
.
subList
(
differ
,
modelList
.
size
())));
}
else
{
documentDevice
.
setModel
(
String
.
join
(
""
,
modelList
.
subList
(
0
,
differ
)));
documentDevice
.
setModel
(
String
.
join
(
""
,
modelList
.
subList
(
0
,
modelList
.
size
()
)));
}
if
(
seqList
.
size
()>
differ
){
...
...
@@ -632,7 +634,7 @@ public class JavaToPdfHtmlFreeMarker {
// list1.add(documentDevice);
// }
// );
data
.
put
(
"documentDevices"
,
list
);
data
.
put
(
"documentDevices"
,
list
.
stream
().
map
(
DocumentDevice:
:
toChangeWord
).
collect
(
Collectors
.
toList
())
);
return
data
;
}
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/service/impl/RepairBackBillServiceImpl.java
浏览文件 @
2d61cd89
...
...
@@ -108,7 +108,8 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
@Override
public
boolean
delete
(
Integer
id
)
{
return
false
;
deviceRepairBackBillDao
.
deleteById
(
id
);
return
true
;
}
@Override
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
2d61cd89
...
...
@@ -1000,7 +1000,7 @@ public class SelfCheckController {
Integer
storageLocationId
=
selfCheckVo
.
getStorageLocationId
();
String
unit
=
userUtils
.
getCurrentUserUnitName
();
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
Specifications
.
and
();
predicateBuilder
.
eq
(
"
locatio
nUnit"
,
unit
);
predicateBuilder
.
eq
(
"
ow
nUnit"
,
unit
);
if
(
selfCheckVo
.
getFilterStatusList
()
!=
null
){
predicateBuilder
.
notIn
(
"lifeStatus"
,
selfCheckVo
.
getFilterStatusList
().
toArray
());
...
...
@@ -1011,7 +1011,7 @@ public class SelfCheckController {
if
(
storageLocationId1
!=
null
){
if
(
storageLocationId1
!=
0
){
predicateBuilder
.
eq
(
"storageLocationId"
,
storageLocationId1
);
// predicateBuilder.eq("ownUnit", unit);
}
}
}
else
{
...
...
@@ -1038,6 +1038,8 @@ public class SelfCheckController {
List
<
Integer
>
status
=
new
ArrayList
<>(
Arrays
.
asList
(
5
,
10
,
12
));
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryDao
.
findAll
(
predicateBuilder
.
build
())
.
stream
().
filter
(
deviceLibrary
->
!
status
.
contains
(
deviceLibrary
.
getLifeStatus
())).
collect
(
Collectors
.
toList
());
// List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll()
// .stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus())).collect(Collectors.toList());
deviceLibraries
.
forEach
(
DeviceLibrary:
:
setConfigName
);
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraries
.
stream
()
.
filter
(
deviceLibrary
->
deviceLibrary
.
getLocationUnit
().
equals
(
unit
)&&(
deviceLibrary
.
getLifeStatus
()==
2
||
deviceLibrary
.
getLifeStatus
()==
14
))
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
2d61cd89
...
...
@@ -1508,8 +1508,10 @@ public class TaskServiceImpl implements TaskService {
predicateBuilder
.
eq
(
"billStatus"
,
StatusEnum
.
ARCHIVE
.
id
);
}
if
(
taskSelectVo
.
getSelectNum
()
==
0
)
{
if
(!
taskSelectVo
.
getBusinessType
().
contains
(
BusinessEnum
.
WORK_HANDOVER
.
id
))
{
predicateBuilder
.
notIn
(
"billStatus"
,
StatusEnum
.
ARCHIVE
.
id
);
}
}
if
(
taskSelectVo
.
getSelectNum
()
==
1
)
{
predicateBuilder
.
eq
(
"createUserId"
,
userUtils
.
getCurrentUserId
());
predicateBuilder
.
notIn
(
"billStatus"
,
StatusEnum
.
ARCHIVE
.
id
);
...
...
dev-train/src/main/java/com/tykj/dev/device/train/controller/HandoverController.java
浏览文件 @
2d61cd89
package
com
.
tykj
.
dev
.
device
.
train
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.train.entity.vo.TerminateVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo
;
import
com.tykj.dev.device.train.service.WorkHandoverService
;
...
...
@@ -14,6 +15,7 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -83,6 +85,7 @@ public class HandoverController {
}
/**
<<<<<<< HEAD
* 区块验证
*/
@GetMapping
(
value
=
"/checkTrueData/{billId}"
)
...
...
@@ -100,4 +103,12 @@ public class HandoverController {
return
ResponseEntity
.
ok
(
workHandoverService
.
traceabilityParsing
(
billId
));
}
@PostMapping
(
value
=
"/terminateWorkHandover"
)
@ApiOperation
(
value
=
"工作交接-终止工作交接"
)
public
ResponseEntity
userList
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
TerminateVo
terminateVo
)
{
workHandoverService
.
terminateWorkHandover
(
terminateVo
);
return
ResponseEntity
.
ok
(
"终止成功"
);
}
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/WorkHandover.java
浏览文件 @
2d61cd89
...
...
@@ -62,13 +62,20 @@ public class WorkHandover {
private
String
file
;
/**
* 状态 1.新建 2.完成
* 状态 1.新建 2.完成
3.终止
*/
private
Integer
status
=
1
;
@ApiModelProperty
(
value
=
"区块链RID"
,
name
=
"recordId"
)
private
String
recordId
;
/**
* 终止说明
*/
@Column
(
name
=
"terminate"
,
columnDefinition
=
"TEXT"
)
private
String
terminate
;
/**
* 工作交接单据集合
*/
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/TerminateVo.java
0 → 100644
浏览文件 @
2d61cd89
package
com
.
tykj
.
dev
.
device
.
train
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Column
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"终止说明vo"
,
description
=
"终止说明vo"
)
public
class
TerminateVo
{
/**
* 终止说明
*/
@ApiModelProperty
(
value
=
"终止说明"
,
example
=
"bmxx"
,
name
=
"terminate"
)
@Column
(
name
=
"terminate"
,
columnDefinition
=
"TEXT"
)
private
String
terminate
;
/**
* 工作交接id
*/
@ApiModelProperty
(
value
=
"工作交接id"
,
example
=
"bmxx"
,
name
=
"billId"
)
private
Integer
billId
;
}
dev-train/src/main/java/com/tykj/dev/device/train/service/WorkHandoverService.java
浏览文件 @
2d61cd89
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.train.service;
import
com.tykj.dev.device.block.entity.vo.BlockTraceabilityParsing
;
import
com.tykj.dev.device.train.entity.WorkHandover
;
import
com.tykj.dev.device.train.entity.vo.TerminateVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
...
...
@@ -43,7 +44,6 @@ public interface WorkHandoverService {
*/
List
<
User
>
handover
(
List
<
Integer
>
userIds
);
boolean
checkTrueData
(
Integer
billId
);
BlockTraceabilityParsing
traceabilityParsing
(
Integer
billId
);
...
...
@@ -52,4 +52,10 @@ public interface WorkHandoverService {
* 历史数据上链
*/
void
historyUpperChain
();
/**
* 终止工作交接
*/
void
terminateWorkHandover
(
TerminateVo
terminateVo
);
}
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/WorkHandoverServiceImpl.java
浏览文件 @
2d61cd89
...
...
@@ -17,6 +17,7 @@ import com.tykj.dev.device.train.dao.WorkHandoverDao;
import
com.tykj.dev.device.train.dao.WorkHandoverDevDao
;
import
com.tykj.dev.device.train.entity.WorkHandover
;
import
com.tykj.dev.device.train.entity.WorkHandoverDev
;
import
com.tykj.dev.device.train.entity.vo.TerminateVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverUserVo
;
...
...
@@ -244,6 +245,8 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
);
}
private
String
operatorName
(
WorkHandover
workHandover
)
{
StringBuffer
buf
=
new
StringBuffer
();
...
...
@@ -268,6 +271,23 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
return
contrast
;
}
@Override
public
void
terminateWorkHandover
(
TerminateVo
terminateVo
)
{
Optional
<
WorkHandover
>
byId
=
workHandoverDao
.
findById
(
terminateVo
.
getBillId
());
if
(
byId
.
isPresent
()){
WorkHandover
workHandover
=
byId
.
get
();
workHandover
.
setStatus
(
3
);
workHandover
.
setTerminate
(
terminateVo
.
getTerminate
());
workHandoverDao
.
save
(
workHandover
);
TaskBto
taskBto
=
trainTaskService
.
selectFatherIsNullAndBillidAndBillType
(
workHandover
.
getWorkHandoverId
(),
BusinessEnum
.
WORK_HANDOVER
.
id
);
taskService
.
moveToArchive
(
taskBto
);
}
else
{
throw
new
ApiException
(
"[工作交接] 终止工作交接任务"
);
}
}
private
void
addMessage
(
MessageBto
messageBto
){
messageService
.
add
(
messageBto
);
}
...
...
@@ -320,3 +340,4 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
blockService
.
sendText
(
BlockBusinessEnum
.
WORK_HANDOVER
.
subCode
,
JacksonUtil
.
toJSon
(
workHandover
),
BusinessEnum
.
WORK_HANDOVER
.
id
,
id
,
workHandover
.
getLeadershipName
());
}
}
dev-union/src/main/resources/application-dev.properties
浏览文件 @
2d61cd89
...
...
@@ -13,9 +13,10 @@ spring.jpa.hibernate.ddl-auto=update
#spring.jpa.hibernate.ddl-auto=update
#file.path=C:/Users/dengdiyi/Documents/file/
# spring boot admin
#file.path=/Users/zjm/code/test-tu/
file.path
=
C:/file/
preview.path
=
http://192.168.0.14:8090/file/
#file.path=/Users/ozoz/data/
file.path
=
C:/ZB/
preview.path
=
http://192.168.102.169:8087/file/
spring.boot.admin.client.url
=
http://localhost:8769
spring.boot.admin.client.instance.serviceBaseUrl
=
http://localhost:8087
block.flag
=
true
...
...
@@ -27,3 +28,5 @@ carrier.url = http://192.168.0.101:8087/configuration/saveConfiguration
file.matching.excel
=
/Users/zhoushaopan/excel/
check.time.last
=
C:/file/CHECKTIME2.txt
ven.http
=
dev-union/src/main/resources/application-prodM.properties
浏览文件 @
2d61cd89
...
...
@@ -11,3 +11,4 @@ block.flag=true
carrier.url
=
http://10.153.4.11:8088/carrier/configuration/saveConfiguration
file.matching.excel
=
/data/equip/matching/excel/
ven.http
=
http://10.153.4.10:8081
\ No newline at end of file
dev-union/src/main/resources/application-prodT.properties
浏览文件 @
2d61cd89
...
...
@@ -12,5 +12,9 @@ qrcode.path = /opt/qrcode/
qrcode.preview.path
=
http://10.153.4.11:8088/equipTest/code/
carrier.url
=
http://10.153.4.11:8088/carrierTest/configuration/saveConfiguration
file.matching.excel
=
/data/equipTest/matching/excel/
block.carrier.ip
=
http://10.153.4.11:8088/blockTest
check.time.last
=
/opt/zb/check
ven.http
=
http://10.153.4.10:8081
dev-union/src/main/resources/application-test.properties
浏览文件 @
2d61cd89
...
...
@@ -14,7 +14,8 @@ block.flag=true
readMachine.ip
=
10.153.4.80
qrcode.path
=
/opt/qrcode/
qrcode.preview.path
=
http://localhost:8088/equip/code/
qrcode.preview.path
=
http://10.153.4.80/equip/code/
carrier.url
=
http://10.153.4.80:8088/carrier/configuration/saveConfiguration
...
...
@@ -23,3 +24,4 @@ file.matching.excel=/data/equip/excel/
block.carrier.ip
=
http://10.153.4.80:8088/block
check.time.last
=
/opt/zb/check
ven.http
=
http://10.153.4.80:8081
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/VenitalisService.java
浏览文件 @
2d61cd89
...
...
@@ -22,4 +22,15 @@ public interface VenitalisService {
* 特征对比
*/
Integer
contrastRet
(
String
deviceType
,
String
value
);
/**
* 删除特征
*/
RegistereRetVo
delFeature
(
Integer
userId
,
String
featureItem
);
/**
* 查询特征
*/
String
featureQuery
(
Integer
userId
);
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/VenitalisServiceImpl.java
浏览文件 @
2d61cd89
...
...
@@ -14,12 +14,14 @@ import com.tykj.dev.misc.utils.JacksonUtil;
import
com.tykj.dev.misc.utils.httpclientutil.HttpClientUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
/**
* @author zjm
...
...
@@ -36,10 +38,16 @@ public class VenitalisServiceImpl implements VenitalisService {
@Autowired
private
UserLogDao
userLogDao
;
// private final static String http="http://10.153.4.11:8081";
private
final
static
String
http
=
"http://192.168.0.80:8081"
;
@Value
(
"${ven.http}"
)
private
String
http
;
// private final static String http="http://10.153.4.80:8081";
private
final
static
String
REGISTERE
=
"/api/v2/auth/register"
;
private
final
static
String
CONTRAST
=
"/api/v2/auth/identify"
;
private
final
static
String
Feature
=
"/api/v2/auth/delFeature"
;
private
final
static
String
FEATUREQUERY
=
"/api/v2/auth/featureQuery"
;
@Override
public
RegistereRetVo
registeredRet
(
VenitalisVo
venitalisVo
)
{
User
user
=
userDao
.
findById
(
venitalisVo
.
getUserId
()).
get
();
...
...
@@ -65,7 +73,7 @@ public class VenitalisServiceImpl implements VenitalisService {
registereRetVo
.
setRet
(
true
);
userLogDao
.
save
(
new
UserLog
(
venitalisVo
.
getUserId
(),
new
Date
(),
user
.
getName
()+
"注册了指静脉"
));
return
registereRetVo
;
}
else
{
}
else
{
registereRetVo
.
setRet
(
false
);
return
registereRetVo
;
}
...
...
@@ -89,4 +97,38 @@ public class VenitalisServiceImpl implements VenitalisService {
}
}
@Override
public
RegistereRetVo
delFeature
(
Integer
userId
,
String
featureItem
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"username"
,
"lingo"
);
params
.
put
(
"password"
,
"511B0D5F341BDDBD9A5348923B48D14C"
);
params
.
put
(
"id_type"
,
"06"
);
params
.
put
(
"device_type"
,
"tg.VM661J.img"
);
params
.
put
(
"uid"
,
userId
);
params
.
put
(
"feature_item"
,
featureItem
);
String
ret
=
HttpClientUtil
.
httpPostRequest
(
http
+
Feature
,
params
);
RegisteredRet
registeredRet
=
JacksonUtil
.
readValue
(
ret
,
RegisteredRet
.
class
);
RegistereRetVo
registereRetVo
=
new
RegistereRetVo
();
if
(
Objects
.
requireNonNull
(
registeredRet
).
getResult_code
().
equals
(
"200"
)){
registereRetVo
.
setRet
(
true
);
}
else
{
registereRetVo
.
setRet
(
false
);
}
return
registereRetVo
;
}
@Override
public
String
featureQuery
(
Integer
userId
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"username"
,
"lingo"
);
params
.
put
(
"password"
,
"511B0D5F341BDDBD9A5348923B48D14C"
);
params
.
put
(
"id_type"
,
"06"
);
params
.
put
(
"device_type"
,
"tg.VM661J.img"
);
params
.
put
(
"uid"
,
userId
);
String
ret
=
HttpClientUtil
.
httpPostRequest
(
http
+
FEATUREQUERY
,
params
);
return
ret
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论