Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
57c22074
提交
57c22074
authored
1月 17, 2023
作者:
zjm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
上链信息接口提交
上级
93d722e6
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
69 行增加
和
37 行删除
+69
-37
AllotBackBillServiceImpl.java
...v/device/allot/service/impl/AllotBackBillServiceImpl.java
+0
-2
AllotBillServiceImpl.java
...j/dev/device/allot/service/impl/AllotBillServiceImpl.java
+13
-6
BlockController.java
...com/tykj/dev/device/block/controller/BlockController.java
+23
-7
BlockDataDao.java
...main/java/com/tykj/dev/device/block/dao/BlockDataDao.java
+1
-1
BlockRun.java
...src/main/java/com/tykj/dev/device/block/run/BlockRun.java
+5
-5
BlockServiceImpl.java
.../tykj/dev/device/block/service/impl/BlockServiceImpl.java
+2
-0
DeviceDestroyBillServiceImpl.java
...ce/destroy/service/Impl/DeviceDestroyBillServiceImpl.java
+4
-1
ScrapServiceImpl.java
.../tykj/dev/device/scrap/service/impl/ScrapServiceImpl.java
+6
-3
DeviceRepelDetailServiceImpl.java
...e/sendback/service/impl/DeviceRepelDetailServiceImpl.java
+5
-5
pom.xml
dev-union/pom.xml
+0
-1
application-dev.properties
dev-union/src/main/resources/application-dev.properties
+2
-0
application-prodT.properties
dev-union/src/main/resources/application-prodT.properties
+3
-2
application-test.properties
dev-union/src/main/resources/application-test.properties
+4
-3
SecurityConfig.java
.../java/com/tykj/dev/device/user/config/SecurityConfig.java
+1
-1
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/service/impl/AllotBackBillServiceImpl.java
浏览文件 @
57c22074
...
...
@@ -80,10 +80,8 @@ public class AllotBackBillServiceImpl implements AllotBackBillService {
public
AllotBackBill
addEntity
(
AllotBackBill
allotBackBill
)
{
AllotBackBill
allotBackBill1
=
allotBackBillDao
.
save
(
allotBackBill
);
//异步上链
CompletableFuture
.
runAsync
(()->{
//延迟2s防止同时写入
sendText
(
allotBackBill1
.
getId
());
},
TaskBeanConfig
.
getThreadPoolTaskScheduler
());
return
allotBackBill1
;
}
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/service/impl/AllotBillServiceImpl.java
浏览文件 @
57c22074
...
...
@@ -85,10 +85,9 @@ public class AllotBillServiceImpl implements AllotBillService {
public
AllotBill
addEntity
(
AllotBill
allotBillEntity
)
{
AllotBill
allotBill
=
allotBillDao
.
save
(
allotBillEntity
);
//异步上链
CompletableFuture
.
runAsync
(()
->{
//延迟2s防止同时写入
sendText
(
allotBill
.
getId
());
},
TaskBeanConfig
.
getThreadPoolTaskScheduler
());
return
allotBill
;
}
...
...
@@ -321,10 +320,18 @@ public class AllotBillServiceImpl implements AllotBillService {
allotBill
.
setApplyFileList
(
FilesUtil
.
stringFileToList
(
allotBill
.
getApplyFiles
()));
allotBill
.
setSendFileList
(
FilesUtil
.
stringFileToList
(
allotBill
.
getSendFiles
()));
allotBill
.
setReceiveFileList
(
FilesUtil
.
stringFileToList
(
allotBill
.
getReceiveFiles
()));
allotBill
.
setSenderUserA
(
userPublicService
.
getOne
(
allotBill
.
getSendUseraId
()).
getName
());
allotBill
.
setSenderUserB
(
userPublicService
.
getOne
(
allotBill
.
getSendUserbId
()).
getName
());
allotBill
.
setReceiveUserA
(
userPublicService
.
getOne
(
allotBill
.
getReceiveUseraId
()).
getName
());
allotBill
.
setReceiveUserB
(
userPublicService
.
getOne
(
allotBill
.
getReceiveUserbId
()).
getName
());
if
(
allotBill
.
getSendUseraId
()
!=
null
){
allotBill
.
setSenderUserA
(
userPublicService
.
getOne
(
allotBill
.
getSendUseraId
()).
getName
());
}
if
(
allotBill
.
getSendUserbId
()
!=
null
){
allotBill
.
setSenderUserB
(
userPublicService
.
getOne
(
allotBill
.
getSendUserbId
()).
getName
());
}
if
(
allotBill
.
getReceiveUseraId
()
!=
null
)
{
allotBill
.
setReceiveUserA
(
userPublicService
.
getOne
(
allotBill
.
getReceiveUseraId
()).
getName
());
}
if
(
allotBill
.
getReceiveUserbId
()
!=
null
)
{
allotBill
.
setReceiveUserB
(
userPublicService
.
getOne
(
allotBill
.
getReceiveUserbId
()).
getName
());
}
allotBill
.
setScripts
(
JacksonUtil
.
readValue
(
allotBill
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{
}));
return
allotBill
;
...
...
dev-block/src/main/java/com/tykj/dev/device/block/controller/BlockController.java
浏览文件 @
57c22074
package
com
.
tykj
.
dev
.
device
.
block
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.block.entity.bc.BcRegister
;
import
com.tykj.dev.device.block.service.BlockDataService
;
import
com.tykj.dev.device.block.service.BlockService
;
import
com.tykj.dev.misc.base.BlockBusinessEnum
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @program: carrier
* @description: todo
* @author: zjm
* @create: 2022-10-20 19:38
**/
...
...
@@ -32,12 +37,13 @@ public class BlockController {
BlockDataService
blockDataService
;
// @ApiOperation(value = "test", notes = "区块链")
// @GetMapping("/test")
// public ResponseEntity test(){
// //AffQaQ55FCuQNqF3bj6nsMytMqbGUDrHe8VDXqb1cPgd7K1yB8X
// return ResponseEntity.ok(blockService.sendText(1,1004,"{text}"));
// }
@ApiOperation
(
value
=
""
,
notes
=
"区块链"
)
@GetMapping
(
"/test/{code}/{content}"
)
public
ResponseEntity
test
(
@PathVariable
Integer
code
,
@PathVariable
String
content
){
//AffQaQ55FCuQNqF3bj6nsMytMqbGUDrHe8VDXqb1cPgd7K1yB8X
blockService
.
sendText
(
code
,
content
,
9999
,
0
,
"1"
);
return
ResponseEntity
.
ok
(
"成功"
);
}
@ApiOperation
(
value
=
"查询最新的20条数据"
,
notes
=
"区块大屏"
)
...
...
@@ -48,5 +54,15 @@ public class BlockController {
@ApiOperation
(
value
=
"装备业务类型创建接口"
,
notes
=
"区块大屏"
)
@GetMapping
(
"/subRegister"
)
public
ResponseEntity
subRegister
(){
List
<
BcRegister
>
bcRegisters
=
new
ArrayList
<>();
for
(
BlockBusinessEnum
value
:
BlockBusinessEnum
.
values
())
{
BcRegister
bcRegister
=
blockService
.
subRegister
(
value
.
name
);
bcRegisters
.
add
(
bcRegister
);
}
return
ResponseEntity
.
ok
(
bcRegisters
);
}
}
dev-block/src/main/java/com/tykj/dev/device/block/dao/BlockDataDao.java
浏览文件 @
57c22074
...
...
@@ -18,6 +18,6 @@ public interface BlockDataDao extends JpaRepository<BlockData,Integer>, JpaSpeci
List
<
BlockData
>
findAllByBillTypeAndBillId
(
Integer
billType
,
Integer
billId
);
@Query
(
value
=
"select b from BlockData as b order by b.
createTime
desc"
)
@Query
(
value
=
"select b from BlockData as b order by b.
id
desc"
)
List
<
BlockData
>
queryCreateTimeLimit20
(
PageRequest
pageRequest
);
}
dev-block/src/main/java/com/tykj/dev/device/block/run/BlockRun.java
浏览文件 @
57c22074
...
...
@@ -21,10 +21,10 @@ public class BlockRun implements CommandLineRunner {
BlockService
blockService
;
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
log
.
info
(
"添加区块业务类型开始"
);
for
(
BlockBusinessEnum
value
:
BlockBusinessEnum
.
values
())
{
blockService
.
subRegister
(
value
.
name
);
}
log
.
info
(
"添加区块业务类型结束"
);
//
log.info("添加区块业务类型开始");
//
for (BlockBusinessEnum value : BlockBusinessEnum.values()) {
//
blockService.subRegister(value.name);
//
}
//
log.info("添加区块业务类型结束");
}
}
dev-block/src/main/java/com/tykj/dev/device/block/service/impl/BlockServiceImpl.java
浏览文件 @
57c22074
...
...
@@ -66,9 +66,11 @@ public class BlockServiceImpl implements BlockService {
.
billType
(
billType
)
.
recordID
(
bcText
.
getData
().
getRecordID
()).
build
());
}
else
{
throw
new
ApiException
(
bcText
.
getInfo
());
}
}
catch
(
Exception
e
){
log
.
error
(
"错误:{}"
,
e
.
getLocalizedMessage
());
log
.
info
(
"上链失败"
);
}
}
...
...
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/Impl/DeviceDestroyBillServiceImpl.java
浏览文件 @
57c22074
...
...
@@ -94,7 +94,10 @@ public class DeviceDestroyBillServiceImpl implements DeviceDestroyBillService {
Optional
<
DeviceDestroyBill
>
byId
=
deviceDestroyBillDao
.
findById
(
scrapId
);
if
(
byId
.
isPresent
()){
DeviceDestroyBill
deviceDestroyBill
=
byId
.
get
();
deviceDestroyBill
.
setScripts
(
JacksonUtil
.
readValue
(
deviceDestroyBill
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{}));
if
(
deviceDestroyBill
.
getScriptJson
()!=
null
)
{
deviceDestroyBill
.
setScripts
(
JacksonUtil
.
readValue
(
deviceDestroyBill
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{
}));
}
deviceDestroyBill
.
setApplyFileList
(
FilesUtil
.
stringFileToList
(
deviceDestroyBill
.
getApplyFiles
()));
deviceDestroyBill
.
setDestructionFileList
(
FilesUtil
.
stringFileToList
(
deviceDestroyBill
.
getDestructionFiles
()));
deviceDestroyBill
.
setReplayFileList
(
FilesUtil
.
stringFileToList
(
deviceDestroyBill
.
getReplayFiles
()));
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/impl/ScrapServiceImpl.java
浏览文件 @
57c22074
...
...
@@ -250,13 +250,16 @@ public class ScrapServiceImpl implements ScrapService {
Optional
<
Scrap
>
optional
=
scrapDao
.
findById
(
scrapId
);
if
(
optional
.
isPresent
()){
Scrap
scrap
=
optional
.
get
();
List
<
ScriptSaveVo
>
scriptSaveVos
=
JacksonUtil
.
readValue
(
scrap
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{
});
if
(
scrap
.
getScriptJson
()!=
null
)
{
List
<
ScriptSaveVo
>
scriptSaveVos
=
JacksonUtil
.
readValue
(
scrap
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{
});
}
scrap
.
setBillFiles
(
FilesUtil
.
stringFileToList
(
scrap
.
getBillFile
()));
scrap
.
setOutboundFiles
(
FilesUtil
.
stringFileToList
(
scrap
.
getOutboundFile
()));
scrap
.
setReplyFileList
(
FilesUtil
.
stringFileToList
(
scrap
.
getReplyFiles
()));
scrap
.
setApplyFileList
(
FilesUtil
.
stringFileToList
(
scrap
.
getApplyFiles
()));
scrap
.
setScripts
(
scr
iptSaveVos
);
scrap
.
setScripts
(
scr
ap
.
getScripts
()
);
scrap
.
setFileMd5
(
FileMD5Util
.
fileRetToMd5
(
scrap
.
getOutboundFiles
()));
return
scrap
;
}
else
{
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/DeviceRepelDetailServiceImpl.java
浏览文件 @
57c22074
...
...
@@ -282,7 +282,7 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
*/
public
void
sendText
(
Integer
id
){
DeviceRepelDetail
deviceRepelDetail
=
queryDeviceRepelDetail
(
id
);
blockService
.
sendText
(
BlockBusinessEnum
.
SEND_BACK
.
subCode
,
JSON
.
toJSONStringWithDateFormat
(
deviceRepelDetail
,
"yyyy-MM-dd HH:mm:ss"
,
SerializerFeature
.
WriteDateUseDateFormat
),
BusinessEnum
.
DESTROY
.
id
,
id
,
deviceRepelDetail
.
getSendUnit
());
blockService
.
sendText
(
BlockBusinessEnum
.
SEND_BACK
.
subCode
,
JSON
.
toJSONStringWithDateFormat
(
deviceRepelDetail
,
"yyyy-MM-dd HH:mm:ss"
,
SerializerFeature
.
WriteDateUseDateFormat
),
BusinessEnum
.
SEND_BACK
.
id
,
id
,
deviceRepelDetail
.
getSendUnit
());
}
...
...
@@ -290,16 +290,16 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
Optional
<
DeviceRepelDetail
>
optional
=
deviceRepelDetailDao
.
findById
(
repelDetailId
);
if
(
optional
.
isPresent
()){
DeviceRepelDetail
deviceRepelDetail
=
optional
.
get
();
deviceRepelDetail
.
setScripts
(
JacksonUtil
.
readValue
(
deviceRepelDetail
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{
}));
if
(
deviceRepelDetail
.
getScriptJson
()!=
null
)
{
deviceRepelDetail
.
setScripts
(
JacksonUtil
.
readValue
(
deviceRepelDetail
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{
}));
}
deviceRepelDetail
.
setBillFiles
(
FilesUtil
.
stringFileToList
(
deviceRepelDetail
.
getBillFile
()));
deviceRepelDetail
.
setOutboundFiles
(
FilesUtil
.
stringFileToList
(
deviceRepelDetail
.
getOutboundFile
()));
deviceRepelDetail
.
setInFiles
(
FilesUtil
.
stringFileToList
(
deviceRepelDetail
.
getInFile
()));
deviceRepelDetail
.
setApplyFileList
(
FilesUtil
.
stringFileToList
(
deviceRepelDetail
.
getApplyFiles
()));
deviceRepelDetail
.
setReplyFileList
(
FilesUtil
.
stringFileToList
(
deviceRepelDetail
.
getReplyFiles
()));
deviceRepelDetail
.
setFileMd5
(
FileMD5Util
.
fileRetToMd5
(
deviceRepelDetail
.
getOutboundFiles
()));
deviceRepelDetail
.
setDeviceIds
(
null
);
deviceRepelDetail
.
setScriptJson
(
null
);
return
deviceRepelDetail
;
}
else
{
log
.
info
(
"[清退] 详情查看错误,id没有找到{}"
,
repelDetailId
);
...
...
dev-union/pom.xml
浏览文件 @
57c22074
...
...
@@ -188,7 +188,6 @@
<dependency>
<groupId>
com.tykj
</groupId>
<artifactId>
dev-block
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<exclusions>
<exclusion>
<groupId>
com.tykj.dev
</groupId>
...
...
dev-union/src/main/resources/application-dev.properties
浏览文件 @
57c22074
...
...
@@ -25,3 +25,4 @@ block.carrier.ip=http://localhost:8088
carrier.url
=
http://192.168.0.101:8087/configuration/saveConfiguration
file.matching.excel
=
/Users/zhoushaopan/excel/
check.time.last
=
/Users/zjm/code/test-tu/check
\ No newline at end of file
dev-union/src/main/resources/application-prodT.properties
浏览文件 @
57c22074
...
...
@@ -12,4 +12,5 @@ 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
\ No newline at end of file
block.carrier.ip
=
http://10.153.4.11:8088/blockTest
check.time.last
=
/opt/zb/check
\ No newline at end of file
dev-union/src/main/resources/application-test.properties
浏览文件 @
57c22074
spring.datasource.driver-class-name
=
com.oscar.Driver
#spring.datasource.url=jdbc:oscar://10.153.4.10:2003/OSRDB
spring.datasource.url
=
jdbc:oscar://
localhost
:2003/OSRDB
spring.datasource.url
=
jdbc:oscar://
192.168.0.80
:2003/OSRDB
spring.datasource.username
=
SYSDBA
spring.datasource.password
=
szoscar55
spring.jpa.database-platform
=
org.hibernate.dialect.OscarDialect
...
...
@@ -20,4 +20,5 @@ carrier.url = http://192.168.0.80:8088/carrier/configuration/saveConfiguration
file.matching.excel
=
/data/equip/excel/
block.carrier.ip
=
http://192.168.0.80:8088/block
\ No newline at end of file
block.carrier.ip
=
http://192.168.0.80:8088/block
check.time.last
=
/opt/zb/check
\ No newline at end of file
dev-user/src/main/java/com/tykj/dev/device/user/config/SecurityConfig.java
浏览文件 @
57c22074
...
...
@@ -107,7 +107,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.
cors
()
.
and
()
.
authorizeRequests
()
.
antMatchers
(
"/file/**"
,
"/actuator/**"
,
"/admin/**"
,
"/excel/**"
).
permitAll
()
.
antMatchers
(
"/file/**"
,
"/actuator/**"
,
"/admin/**"
,
"/excel/**"
,
"/chainOffer/**"
).
permitAll
()
.
antMatchers
(
"/file/llq/**"
).
permitAll
()
.
antMatchers
(
"/login/impersonate*"
).
permitAll
()
.
antMatchers
(
"/logout/impersonate*"
).
permitAll
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论