Skip to content

Commit

Permalink
Merge pull request WeBankBlockchain#466 from chengliang8056/dev
Browse files Browse the repository at this point in the history
完成task4 在保存链上交易到tb trans数据表时,加入app id字段
  • Loading branch information
CodingCattwo authored Nov 16, 2022
2 parents 1fb3889 + 97bfb84 commit 75418da
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# 节点管理服务
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE/CONTRIBUTING.html)
[![CodeFactor](https://www.codefactor.io/repository/github/webankfintech/webase-node-manager/badge)](https://www.codefactor.io/repository/github/webankfintech/webase-node-manager)
[![Code Lines](https://tokei.rs/b1/github/WeBankFinTech/WeBASE-Node-Manager?category=code)](https://github.com/WeBankFinTech/WeBASE-Node-Manager)
[![CodeFactor](https://www.codefactor.io/repository/github/webankblockchain/webase-node-manager/badge)](https://www.codefactor.io/repository/github/webankblockchain/webase-node-manager)
[![Code Lines](https://tokei.rs/b1/github/WeBankBlockchain/WeBASE-Node-Manager?category=code)](https://github.com/WeBankBlockchain/WeBASE-Node-Manager)
[![license](http://img.shields.io/badge/license-Apache%20v2-blue.svg)](http://www.apache.org/licenses/)
[![GitHub (pre-)release](https://img.shields.io/github/release/WeBankFinTech/WeBASE-Node-Manager/all.svg)](https://github.com/WeBankFinTech/WeBASE-Node-Manager/releases)
[![GitHub (pre-)release](https://img.shields.io/github/release/WeBankBlockchain/WeBASE-Node-Manager/all.svg)](https://github.com/WeBankBlockchain/WeBASE-Node-Manager/releases)

## 简介
WeBASE-Node-Manager处理前端页面所有web请求,管理各个节点的状态,管理链上所有智能合约,对区块链的数据进行统计、分析,对异常交易的审计,私钥管理等。 详细介绍请查看[WeBASE-Node-Manager在线文档](https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE-Node-Manager/index.html)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ List test = [
"org.springframework.boot:spring-boot-starter-test:$springboot_version"
]

def log4j_version="2.13.3"
def log4j_version="2.15.0"
List log4j = [
"org.apache.logging.log4j:log4j-api:$log4j_version",
"org.apache.logging.log4j:log4j-core:$log4j_version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public String listJoin(UserParam param) {

public String count(UserParam param) {
SQL sql = new SQL();
sql.SELECT("count(1),ext.group_id,ext.address,b.userId,b.account,b.userName from tb_external_account ext "
sql.SELECT("count(1) from tb_external_account ext "
+ "left join "
+ "(select user_id userId,group_id,address,account,user_name userName from tb_user) b "
+ "on ext.address=b.address and ext.group_id=b.group_id ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public String listJoin(ContractParam param) {

public String count(ContractParam param) {
SQL sql = new SQL();
sql.SELECT("count(1),ext.group_id,ext.contract_address,b.abiId,b.account,b.contract_name"
sql.SELECT("count(1)"
+ " from tb_external_contract ext "
+ "left join "
+ "(select abi_id abiId,contract_address,group_id,account,contract_name from tb_abi) b "
+ "on ext.contract_address=b.contract_address and ext.group_id=b.group_id ");
+ "on ext.contract_address=b.contract_address and ext.group_id=b.group_id");
if (param.getGroupId() != null) {
sql.WHERE("ext.group_id = #{groupId}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class TbTransHash {
private Integer statisticsFlag;
private LocalDateTime createTime;
private LocalDateTime modifyTime;
private String appId;

/**
* init by transaction、blockNumber、blockTimestamp.
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/mapper/TableMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
statistics_flag int(1) DEFAULT '1' COMMENT '是否已统计(1-未统计,2-已统计)',
create_time datetime DEFAULT NULL COMMENT '创建时间',
modify_time datetime DEFAULT NULL COMMENT '修改时间',
app_id varchar(64) DEFAULT NULL COMMENT 'app_id',
PRIMARY KEY (trans_hash),
KEY index_flag (statistics_flag),
KEY index_number (block_number),
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/mapper/TransHashMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
property="createTime"/>
<result column="modify_time" javaType="java.time.LocalDateTime" jdbcType="TIMESTAMP"
property="modifyTime"/>
<result column="app_id" javaType="java.lang.String" jdbcType="VARCHAR" property="appId"/>
</resultMap>


<insert id="add">
insert ignore into ${tableName}(trans_hash,trans_from,trans_to,block_number,block_timestamp,create_time,modify_time)
values(#{trans.transHash},#{trans.transFrom},#{trans.transTo},#{trans.blockNumber},#{trans.blockTimestamp},NOW(),NOW())
insert ignore into ${tableName}(trans_hash,trans_from,trans_to,block_number,block_timestamp,create_time,modify_time,app_id)
values(#{trans.transHash},#{trans.transFrom},#{trans.transTo},#{trans.blockNumber},#{trans.blockTimestamp},NOW(),NOW(),#{trans.appId})
</insert>


Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/mapper/UserMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
and user_name like CONCAT(#{userName},'%')
</if>
<if test="commParam != null and commParam != ''">
and user_name like CONCAT(#{commParam},'%')
or address like CONCAT(#{commParam},'%')
and (user_name like CONCAT(#{commParam},'%')
or address like CONCAT(#{commParam},'%'))
</if>
<if test="hasPk != null and hasPk != ''">
and has_pk = #{hasPk}
Expand Down

0 comments on commit 75418da

Please sign in to comment.