Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
55eeda21
提交
55eeda21
authored
12月 12, 2022
作者:
zjm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(区块模块): 添加了区块链模块
添加了区块链模块
上级
a63357bc
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
156 行增加
和
26 行删除
+156
-26
BlockData.java
...main/java/com/tykj/dev/device/block/entity/BlockData.java
+4
-1
BlockService.java
.../java/com/tykj/dev/device/block/service/BlockService.java
+1
-1
BlockServiceImpl.java
.../tykj/dev/device/block/service/impl/BlockServiceImpl.java
+29
-6
BlockBusinessEnum.java
...c/main/java/com/tykj/dev/misc/base/BlockBusinessEnum.java
+104
-0
pom.xml
dev-union/pom.xml
+18
-18
没有找到文件。
dev-block/src/main/java/com/tykj/dev/device/block/entity/BlockData.java
浏览文件 @
55eeda21
...
...
@@ -29,16 +29,19 @@ import javax.persistence.Table;
@EntityListeners
(
AuditingEntityListener
.
class
)
@SQLDelete
(
sql
=
"update zt_block_data set delete_tag = 1 where id = ?"
)
@Where
(
clause
=
"delete_tag = 0"
)
@Table
(
name
=
"z
t
_block_bill_data"
)
@Table
(
name
=
"z
b
_block_bill_data"
)
@Builder
public
class
BlockData
extends
BaseEntity
{
@ApiModelProperty
(
value
=
"业务类型"
)
private
Integer
billType
;
@ApiModelProperty
(
value
=
"业务id"
)
private
Integer
billId
;
@ApiModelProperty
(
value
=
"记录id"
)
private
String
recordID
;
@ApiModelProperty
(
value
=
"发起单位名称"
)
private
String
unitName
;
...
...
dev-block/src/main/java/com/tykj/dev/device/block/service/BlockService.java
浏览文件 @
55eeda21
...
...
@@ -23,7 +23,7 @@ public interface BlockService {
* @param subCode 业务代码编号
* @param content 文本 200k以内
*/
BcText
sendText
(
Integer
systemId
,
Integer
subCode
,
String
content
);
void
sendText
(
Integer
systemId
,
Integer
subCode
,
String
content
,
Integer
billType
,
Integer
billId
,
String
unitName
);
/**
* hash 上链
...
...
dev-block/src/main/java/com/tykj/dev/device/block/service/impl/BlockServiceImpl.java
浏览文件 @
55eeda21
package
com
.
tykj
.
dev
.
device
.
block
.
service
.
impl
;
import
com.tykj.dev.device.block.conf.ApI
;
import
com.tykj.dev.device.block.entity.BlockData
;
import
com.tykj.dev.device.block.entity.bc.*
;
import
com.tykj.dev.device.block.service.BlockDataService
;
import
com.tykj.dev.device.block.service.BlockService
;
import
com.tykj.dev.misc.exception.ApiException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -17,11 +22,15 @@ import java.util.TreeMap;
* @create: 2022-11-02 11:25
**/
@Service
@Slf4j
public
class
BlockServiceImpl
implements
BlockService
{
@Value
(
"${block.carrier.ip}"
)
private
String
IP
;
@Autowired
BlockDataService
blockDataService
;
@Override
public
BcRegister
subRegister
(
Integer
systemId
,
String
subName
)
{
...
...
@@ -38,16 +47,30 @@ public class BlockServiceImpl implements BlockService {
}
@Override
public
BcText
sendText
(
Integer
systemId
,
Integer
subCode
,
String
content
)
{
public
void
sendText
(
Integer
systemId
,
Integer
subCode
,
String
content
,
Integer
billType
,
Integer
billId
,
String
unitName
)
{
SortedMap
<
Object
,
Object
>
request
=
getRequest
();
request
.
put
(
"systemId"
,
systemId
);
request
.
put
(
"subCode"
,
subCode
);
request
.
put
(
"content"
,
content
);
return
new
RestTemplate
().
postForObject
(
IP
+
ApI
.
CO_SEND_TEXT
,
request
,
BcText
.
class
);
try
{
BcText
bcText
=
new
RestTemplate
().
postForObject
(
IP
+
ApI
.
CO_SEND_TEXT
,
request
,
BcText
.
class
);
if
(
bcText
.
getCode
()
==
0
)
{
blockDataService
.
saveBlockData
(
BlockData
.
builder
()
.
billId
(
billId
)
.
unitName
(
unitName
)
.
billType
(
billType
)
.
recordID
(
bcText
.
getData
().
getRecordID
()).
build
());
}
else
{
throw
new
ApiException
(
bcText
.
getInfo
());
}
}
catch
(
Exception
e
){
log
.
info
(
"上链失败"
);
}
}
@Override
...
...
dev-misc/src/main/java/com/tykj/dev/misc/base/BlockBusinessEnum.java
0 → 100644
浏览文件 @
55eeda21
package
com
.
tykj
.
dev
.
misc
.
base
;
import
lombok.AllArgsConstructor
;
/**
* @author dengdiyi
* 业务枚举
*/
@AllArgsConstructor
public
enum
BlockBusinessEnum
{
/**
* 入库业务
*/
STORAGE
(
2
,
"入库业务"
),
/**
* 配发业务
*/
ALLOT
(
3
,
"配发业务"
),
/**
* 自查业务
*/
SELF_CHECK
(
4
,
"自查业务"
),
/**
* 维修业务
*/
REPAIR
(
5
,
"维修业务"
),
/**
* 核查业务
*/
CONFIRM_CHECK
(
6
,
"核查业务"
),
/**
* 核查统计业务
*/
CONFIRM_CHECK_STAT
(
7
,
"核查统计"
),
/**
* 核查详情业务
*/
CONFIRM_CHECK_DETAIL
(
8
,
"核查详情"
),
/**
* 申请业务
*/
APPLY
(
9
,
"申请业务"
),
/**
* 维修退回
*/
REPAIR_BACK
(
10
,
"维修退回"
),
/**
* 维修继续送修
*/
REPAIR_SEND
(
11
,
"维修业务"
),
/**
* 销毁业务
*/
DESTROY
(
14
,
"销毁业务"
),
/**
* 清退业务
*/
SEND_BACK
(
16
,
"清退业务"
),
/**
* 清退异常处理
*/
DECOMMISSIONING
(
17
,
"退役业务"
),
/**
* 新增配套设备
*/
ADD_MATCHING_DEVICE
(
19
,
"新增配套设备"
),
/**
* 工作交接
*/
WORK_HANDOVER
(
21
,
"工作交接"
),
/**
* 退回
*/
ALLOT_BACK
(
22
,
"退回业务"
),
/**
* 报废
*/
SCRAP
(
23
,
"报废业务"
),
/**
* 丢失
*/
LOSS
(
24
,
"丢失业务"
),
/**
* 找回
*/
RETRIEVE
(
25
,
"找回业务"
),
/**
* 重新入库
*/
AGAINSTORAGE
(
26
,
"装备状态转换业务"
);
public
Integer
subCode
;
public
String
name
;
}
dev-union/pom.xml
浏览文件 @
55eeda21
...
...
@@ -541,24 +541,24 @@
</plugin>
<!--打包插件-->
<!--
<plugin>-->
<!--
<groupId>org.springframework.boot</groupId>-->
<!--
<artifactId>spring-boot-maven-plugin</artifactId>-->
<!--
<configuration>-->
<!--
<executable>true</executable>-->
<!--
<includeSystemScope>true</includeSystemScope>-->
<!--
<mainClass>com.tykj.dev.union.UnionApplication</mainClass>-->
<!--
</configuration>-->
<!--
</plugin>-->
<!--
<!–跳过测试插件–>-->
<!--
<plugin>-->
<!--
<groupId>org.apache.maven.plugins</groupId>-->
<!--
<artifactId>maven-surefire-plugin</artifactId>-->
<!--
<version>2.20</version>-->
<!--
<configuration>-->
<!--
<skipTests>true</skipTests> <!–默认关掉单元测试 –>-->
<!--
</configuration>-->
<!--
</plugin>-->
<!--
<plugin>-->
<!--
<groupId>org.springframework.boot</groupId>-->
<!--
<artifactId>spring-boot-maven-plugin</artifactId>-->
<!--
<configuration>-->
<!--
<executable>true</executable>-->
<!--
<includeSystemScope>true</includeSystemScope>-->
<!--
<mainClass>com.tykj.dev.union.UnionApplication</mainClass>-->
<!--
</configuration>-->
<!--
</plugin>-->
<!--
<!–跳过测试插件–>-->
<!--
<plugin>-->
<!--
<groupId>org.apache.maven.plugins</groupId>-->
<!--
<artifactId>maven-surefire-plugin</artifactId>-->
<!--
<version>2.20</version>-->
<!--
<configuration>-->
<!--
<skipTests>true</skipTests> <!–默认关掉单元测试 –>-->
<!--
</configuration>-->
<!--
</plugin>-->
</plugins>
</build>
</project>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论