Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
83feb330
提交
83feb330
authored
2月 25, 2021
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
90d3db5a
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
272 行增加
和
36 行删除
+272
-36
BlockChainUtilImpl.java
...dev/blockcha/subject/service/impl/BlockChainUtilImpl.java
+24
-26
DeviceInvisibleRange.java
...n/java/com/tykj/dev/config/base/DeviceInvisibleRange.java
+38
-0
DeviceLifeStatus.java
.../main/java/com/tykj/dev/config/base/DeviceLifeStatus.java
+92
-0
DeviceManageStatus.java
...ain/java/com/tykj/dev/config/base/DeviceManageStatus.java
+24
-0
DeviceSecretLevel.java
...main/java/com/tykj/dev/config/base/DeviceSecretLevel.java
+42
-0
ConfigVo.java
...config/src/main/java/com/tykj/dev/config/vo/ConfigVo.java
+37
-0
application-dev.properties
dev-union/src/main/resources/application-dev.properties
+3
-2
application-local.properties
dev-union/src/main/resources/application-local.properties
+5
-3
application-test.properties
dev-union/src/main/resources/application-test.properties
+2
-1
VenitalisServiceImpl.java
...evice/user/subject/service/impl/VenitalisServiceImpl.java
+2
-4
userRun.java
.../src/main/java/com/tykj/dev/device/user/task/userRun.java
+3
-0
没有找到文件。
dev-blockcha/src/main/java/com/tykj/dev/blockcha/subject/service/impl/BlockChainUtilImpl.java
浏览文件 @
83feb330
...
...
@@ -4,7 +4,6 @@ import com.tykj.dev.blockcha.conf.BcUrl;
import
com.tykj.dev.blockcha.subject.entity.*
;
import
com.tykj.dev.blockcha.subject.service.BlockChainUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -25,24 +24,24 @@ import java.util.UUID;
@Component
public
class
BlockChainUtilImpl
implements
BlockChainUtil
{
//
private String SECRET_KEY = "3mdeM1dw2FfHrd5h6WAuhB3WYdDG6ZAgz96CcM1nzxbiYA8QaaZHW75Je9xKixTTD2rwujyb1gVUNPYm5W6FPZQ8";
//
private String SECRET_ID = "3yXRRiL9xsLfbt2kv7qRH2so6ChJX3rFkay7Njcsxfbp";
private
String
SECRET_KEY
=
"3mdeM1dw2FfHrd5h6WAuhB3WYdDG6ZAgz96CcM1nzxbiYA8QaaZHW75Je9xKixTTD2rwujyb1gVUNPYm5W6FPZQ8"
;
private
String
SECRET_ID
=
"3yXRRiL9xsLfbt2kv7qRH2so6ChJX3rFkay7Njcsxfbp"
;
//测试环境
// public String SECRET_KEY;
// public String SECRET_ID;
//测试环境
public
String
SECRET_KEY
=
"3RJWStDCXN7mqJyZAB8rF59f87arGShdk9aKyDN3wKbzq9JnaXom1Hpe6mHT1k2yx9zfE7VFWidqwuxyT7DtPjCs"
;
public
String
SECRET_ID
=
"JAjQyTZdR8bmbHaU6iiFGvrCuUik4cG4U4ostk8KKrbS"
;
//
public String SECRET_KEY = "3RJWStDCXN7mqJyZAB8rF59f87arGShdk9aKyDN3wKbzq9JnaXom1Hpe6mHT1k2yx9zfE7VFWidqwuxyT7DtPjCs";
//
public String SECRET_ID = "JAjQyTZdR8bmbHaU6iiFGvrCuUik4cG4U4ostk8KKrbS";
private
final
static
String
BLOCK_CHAIN_URL
=
"http://1
92.168.0.80
:8076"
;
private
final
static
String
BLOCK_CHAIN_URL
=
"http://1
0.153.4.12
:8076"
;
private
final
static
String
BLOCK_CHAIN_URL2
=
"http://10.153.8.10:8076"
;
private
final
static
String
BLOCK_CHAIN_URL3
=
"http://10.153.8.11:8076"
;
private
final
static
String
BLOCK_CHAIN_URL4
=
"http://10.153.110.10:8076"
;
private
final
static
String
BLOCK_CHAIN_URL5
=
"http://10.153.6.11:8076"
;
@Value
(
"${useBlockcha:fasle"
)
private
String
useBlockcha
;
//
@Value("${useBlockcha:fasle")
//
private String useBlockcha;
@Override
public
BcStatus
getStatus
()
{
...
...
@@ -186,24 +185,23 @@ public class BlockChainUtilImpl implements BlockChainUtil {
@Override
public
BcHash
sendHash
(
Integer
subCode
,
String
content
)
{
if
(
"true"
.
equals
(
this
.
useBlockcha
))
{
// SortedMap<Object, Object> request = getRequest();
// request.put("content", HexUtil.hex64(content));
// request.put("subCode", subCode);
// String s = ApiSignatureUtil.getApiSignature(request, SECRET_KEY);
// log.info("apiSignature:{}",s);
// request.put("apiSignature", s);
//
// return new RestTemplate().postForObject(
// BLOCK_CHAIN_URL + BcUrl.SEND_HASH,
// request,
// BcHash.class
// );
return
new
BcHash
();
}
else
{
return
new
BcHash
(
0
,
""
,
new
BcHashData
(
"000"
));
}
// if ("true".equals(this.useBlockcha)) {
SortedMap
<
Object
,
Object
>
request
=
getRequest
();
request
.
put
(
"content"
,
HexUtil
.
hex64
(
content
));
request
.
put
(
"subCode"
,
subCode
);
String
s
=
ApiSignatureUtil
.
getApiSignature
(
request
,
SECRET_KEY
);
log
.
info
(
"apiSignature:{}"
,
s
);
request
.
put
(
"apiSignature"
,
s
);
return
new
RestTemplate
().
postForObject
(
BLOCK_CHAIN_URL
+
BcUrl
.
SEND_HASH
,
request
,
BcHash
.
class
);
// }
// else {
// return new BcHash(0, "", new BcHashData("000"));
// }
}
@Override
...
...
dev-config/src/main/java/com/tykj/dev/config/base/DeviceInvisibleRange.java
0 → 100644
浏览文件 @
83feb330
package
com
.
tykj
.
dev
.
config
.
base
;
import
com.tykj.dev.config.domin.SystemConfig
;
import
lombok.AllArgsConstructor
;
/**
* @author dengdiyi
* 装备可见范围枚举
*/
@AllArgsConstructor
public
enum
DeviceInvisibleRange
{
/**
* 省一级
*/
SHEN
(
1
,
"省一级"
),
/**
* 县一级
*/
XIAN
(
3
,
"县一级"
),
/**
* 市一级
*/
SHI
(
2
,
"市一级"
);
public
Integer
id
;
public
String
name
;
public
SystemConfig
toDo
(){
SystemConfig
systemConfig
=
new
SystemConfig
();
systemConfig
.
setValue
(
id
);
systemConfig
.
setLabel
(
name
);
systemConfig
.
setChineseName
(
"可见范围"
);
systemConfig
.
setEnglishName
(
"invisibleRange"
);
return
systemConfig
;
}
}
dev-config/src/main/java/com/tykj/dev/config/base/DeviceLifeStatus.java
0 → 100644
浏览文件 @
83feb330
package
com
.
tykj
.
dev
.
config
.
base
;
import
com.tykj.dev.config.domin.SystemConfig
;
import
lombok.AllArgsConstructor
;
/**
* @author dengdiyi
* 装备生命状态枚举
*/
@AllArgsConstructor
public
enum
DeviceLifeStatus
{
// /**
// * 入库待审核
// */
// STORAGE_WAIT_CONFIRM(0, "入库待审核"),
// /**
// * 入库审核失败
// */
// STORAGE_CONFIRM_FAILED(1, "入库审核失败"),
/**
* 在库
*/
IN_LIBRARY
(
2
,
"在库"
),
/**
* 配发中
*/
IN_TRANSIT
(
3
,
"配发"
),
/**
* 维修中
*/
REPAIRING
(
4
,
"维修中"
),
/**
* 报废在省库
*/
SCRAP_I
(
5
,
"已报废"
),
/**
* 清退
*/
SEND_BACK
(
6
,
"清退"
),
// /**
// * 待退装
// */
// WAIT_RETIRED(7, "待退装"),
// /**
// * 退装
// */
// RETIRED(8, "退装"),
// /**
// * 待销毁
// */
// WAIT_DESTROY(9, "待销毁"),
/**
* 已销毁
*/
DESTROYED
(
10
,
"已销毁"
),
/**
* 丢失
*/
LOSS
(
11
,
"丢失"
),
/**
* 退役
*/
RETIRE
(
12
,
"退役"
),
// /**
// * 报废不在省库
// */
// SCRAP_II(13, "已报废"),
/**
* 使用
*/
USE
(
14
,
"使用"
),
/**
* 待退役
*/
REPEL
(
15
,
"待退役"
);
public
Integer
id
;
public
String
name
;
public
SystemConfig
toDo
(){
SystemConfig
systemConfig
=
new
SystemConfig
();
systemConfig
.
setValue
(
id
);
systemConfig
.
setLabel
(
name
);
systemConfig
.
setChineseName
(
"生命状态"
);
systemConfig
.
setEnglishName
(
"lifeStatus"
);
return
systemConfig
;
}
}
dev-config/src/main/java/com/tykj/dev/config/base/DeviceManageStatus.java
0 → 100644
浏览文件 @
83feb330
package
com
.
tykj
.
dev
.
config
.
base
;
import
lombok.AllArgsConstructor
;
/**
* @author dengdiyi
* 装备管理状态枚举
*/
@AllArgsConstructor
public
enum
DeviceManageStatus
{
/**
* 不在所属单位
*/
PACKING
(
0
,
"不在所属单位"
),
/**
* 在所属单位
*/
STORAGE
(
1
,
"在所属单位"
);
public
Integer
id
;
public
String
name
;
}
dev-config/src/main/java/com/tykj/dev/config/base/DeviceSecretLevel.java
0 → 100644
浏览文件 @
83feb330
package
com
.
tykj
.
dev
.
config
.
base
;
import
com.tykj.dev.config.domin.SystemConfig
;
import
lombok.AllArgsConstructor
;
/**
* @author dengdiyi
* 装备可见范围枚举
*/
@AllArgsConstructor
public
enum
DeviceSecretLevel
{
/**
* 省一级
*/
SECRETLEVEL_1
(
1
,
"绝密"
),
/**
* 县一级
*/
SECRETLEVEL_2
(
2
,
"秘密"
),
/**
* 市一级
*/
SECRETLEVEL_3
(
3
,
"机密"
),
/**
* 县一级
*/
SECRETLEVEL_4
(
4
,
"无"
);
public
Integer
id
;
public
String
name
;
public
SystemConfig
toDo
(){
SystemConfig
systemConfig
=
new
SystemConfig
();
systemConfig
.
setValue
(
id
);
systemConfig
.
setLabel
(
name
);
systemConfig
.
setChineseName
(
"密级"
);
systemConfig
.
setEnglishName
(
"secretLevel"
);
return
systemConfig
;
}
}
dev-config/src/main/java/com/tykj/dev/config/vo/ConfigVo.java
0 → 100644
浏览文件 @
83feb330
package
com
.
tykj
.
dev
.
config
.
vo
;
import
com.tykj.dev.config.domin.SystemConfig
;
import
com.tykj.dev.config.service.SystemConfigService
;
import
com.tykj.dev.misc.utils.SpringUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author dengdiyi
*/
@Data
@ApiModel
(
"配置变量存储类"
)
public
class
ConfigVo
{
@ApiModelProperty
(
value
=
"英文变量名"
)
private
String
englishName
;
@ApiModelProperty
(
value
=
"中文变量名"
)
private
String
chineseName
;
@ApiModelProperty
(
value
=
"变量值显示名"
)
private
String
label
;
public
SystemConfig
toDo
(){
SystemConfigService
systemConfigService
=
SpringUtils
.
getBean
(
"systemConfigServiceImpl"
);
SystemConfig
systemConfig
=
new
SystemConfig
();
systemConfig
.
setEnglishName
(
englishName
);
systemConfig
.
setChineseName
(
chineseName
);
systemConfig
.
setLabel
(
label
);
if
(
systemConfigService
!=
null
)
{
systemConfig
.
setValue
(
systemConfigService
.
getMaxValue
(
englishName
)==
null
?
1
:
systemConfigService
.
getMaxValue
(
englishName
)+
1
);
}
return
systemConfig
;
}
}
dev-union/src/main/resources/application-dev.properties
浏览文件 @
83feb330
...
...
@@ -2,4 +2,5 @@ spring.datasource.url=jdbc:mysql://192.168.100.249:3306/device?serverTimezone=As
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.username
=
root
spring.datasource.password
=
root
spring.jpa.hibernate.ddl-auto
=
update
\ No newline at end of file
spring.jpa.hibernate.ddl-auto
=
update
file.path
=
C:/Users/dengdiyi/Documents/file/
\ No newline at end of file
dev-union/src/main/resources/application-local.properties
浏览文件 @
83feb330
spring.datasource.url
=
jdbc:mysql://localhost:3306/
equipment
?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.url
=
jdbc:mysql://localhost:3306/
device
?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.username
=
root
spring.datasource.password
=
root
\ No newline at end of file
spring.datasource.password
=
root
file.path
=
C:/Users/dengdiyi/Documents/file/
preview.path
=
http://124.70.145.101:8087/equip/file/
\ No newline at end of file
dev-union/src/main/resources/application-test.properties
浏览文件 @
83feb330
...
...
@@ -3,5 +3,5 @@ spring.datasource.url=jdbc:mysql://124.70.145.101:3306/device?serverTimezone=Asi
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.username
=
device
spring.datasource.password
=
Qwer1234
file.path
=
/home/files/zb
file.path
=
C:/Users/dengdiyi/Documents/file/
preview.path
=
http://124.70.145.101:8087/equip/file/
\ No newline at end of file
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/VenitalisServiceImpl.java
浏览文件 @
83feb330
...
...
@@ -13,8 +13,6 @@ 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.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
...
...
@@ -39,8 +37,8 @@ public class VenitalisServiceImpl implements VenitalisService {
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"
;
private
final
static
String
http
=
"http://10.153.4.11:8081"
;
//
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
...
...
dev-user/src/main/java/com/tykj/dev/device/user/task/userRun.java
浏览文件 @
83feb330
...
...
@@ -43,6 +43,7 @@ public class userRun implements CommandLineRunner {
if
(
userService
.
findAll
().
size
()
==
0
)
{
Units
units
=
Units
.
toDb
();
units
.
setAreaId
(
1
);
units
=
unitsService
.
save
(
units
);
User
user
=
User
.
toDb
();
user
.
setUserId
(
1
);
...
...
@@ -60,6 +61,7 @@ public class userRun implements CommandLineRunner {
units
=
Units
.
toDb
();
units
.
setName
(
"市机要局"
);
units
.
setUnitDesc
(
"市机要局"
);
units
.
setAreaId
(
2
);
units
=
unitsService
.
save
(
units
);
user
=
User
.
toDb
();
user
.
setUserId
(
3
);
...
...
@@ -76,6 +78,7 @@ public class userRun implements CommandLineRunner {
units
=
Units
.
toDb
();
units
.
setName
(
"区机要局"
);
units
.
setUnitDesc
(
"区机要局"
);
units
.
setAreaId
(
3
);
units
=
unitsService
.
save
(
units
);
user
=
User
.
toDb
();
user
.
setUserId
(
5
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论