Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chaincode
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘星星@五瓣科技
chaincode
Commits
e7d540c7
Commit
e7d540c7
authored
Dec 07, 2020
by
刘星星@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add supply_chain chaincode
parent
8c84d3e5
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
417 additions
and
216 deletions
+417
-216
workspace.xml
.idea/workspace.xml
+390
-203
bean
src/bean
+1
-0
restropect_test.go
src/retrospect_chain/restropect_test.go
+7
-0
retrospect.go
src/retrospect_chain/retrospect.go
+19
-13
No files found.
.idea/workspace.xml
View file @
e7d540c7
This diff is collapsed.
Click to expand it.
bean
@
0de10c54
Subproject commit 0de10c54a09fe9f5a0e8b43b2936e5c96ac2a4db
src/retrospect_chain/restropect_test.go
View file @
e7d540c7
...
...
@@ -200,4 +200,11 @@ func TestAddActivityInfo(t *testing.T) {
}
else
if
print
{
fmt
.
Println
(
string
(
resSearch
.
Payload
))
}
resSearch1
:=
stub
.
MockInvoke
(
"invoke1"
,[][]
byte
{[]
byte
(
"searchRespectInfo"
),[]
byte
(
"1102"
),[]
byte
(
"89"
)})
if
resSearch1
.
Status
!=
200
{
//testResult = false
t
.
Error
(
resSearch1
.
Message
)
}
else
if
print
{
fmt
.
Println
(
string
(
resSearch1
.
Payload
))
}
}
\ No newline at end of file
src/retrospect_chain/retrospect.go
View file @
e7d540c7
...
...
@@ -78,7 +78,6 @@ type DetectionInfo struct {
Contacts
string
`json:"contacts"`
//联系人
ContactPhone
string
`json:"contactPhone"`
//联系电话
Status
int
`json:"status"`
//状态
}
/*
...
...
@@ -347,7 +346,6 @@ type SalesInfo struct {
PrincipalId
string
`json:"principalId"`
//负责人ID
Principal
string
`json:"principal"`
//负责人
CommissionRatio
float32
`json:"commissionRatio"`
//返佣比例
}
/*
...
...
@@ -561,7 +559,7 @@ func AddCompanyInfo(args []string, stub shim.ChaincodeStubInterface) pb.Response
comInfo
:=
&
CompanyInfo
{}
err
:=
json
.
Unmarshal
([]
byte
(
args
[
0
]),
comInfo
)
if
err
!=
nil
{
return
shim
.
Error
(
fmt
.
Sprintf
(
"Unmarshal CompanyInfo fail,err %s
"
,
err
))
return
shim
.
Error
(
fmt
.
Sprintf
(
"Unmarshal CompanyInfo fail,err %s
,info is %s"
,
err
,
args
[
0
]
))
}
if
comInfo
.
Cid
==
" "
||
len
(
comInfo
.
Cid
)
==
0
{
return
shim
.
Error
(
"company info cid can not is null"
)
...
...
@@ -1057,18 +1055,26 @@ func SearchRespectInfo(args []string, stub shim.ChaincodeStubInterface) pb.Respo
return
shim
.
Error
(
"create respect show composite key err: "
+
err
.
Error
())
}
showByte
,
err
:=
getStateByte
(
showKey
,
stub
)
qr
:=
&
SearchQrCode
{}
if
showByte
!=
nil
{
return
shim
.
Success
(
showByte
)
}
qrcode
,
err
:=
getQrcode
(
args
,
stub
)
if
err
!=
nil
{
return
shim
.
Error
(
err
.
Error
())
}
searchShow
,
err
:=
extractRespectShowInfo
(
qrcode
,
stub
)
if
err
!=
nil
{
return
shim
.
Error
(
"extract RespectShow info err: "
+
err
.
Error
())
err
=
json
.
Unmarshal
(
showByte
,
qr
)
if
err
!=
nil
{
return
shim
.
Error
(
err
.
Error
())
}
qr
.
Count
+=
1
}
else
{
qrcode
,
err
:=
getQrcode
(
args
,
stub
)
if
err
!=
nil
{
return
shim
.
Error
(
err
.
Error
())
}
qr
,
err
=
extractRespectShowInfo
(
qrcode
,
stub
)
if
err
!=
nil
{
return
shim
.
Error
(
"extract RespectShow info err: "
+
err
.
Error
())
}
}
valueByte
,
err
:=
json
.
Marshal
(
searchShow
)
valueByte
,
err
:=
json
.
Marshal
(
qr
)
if
err
!=
nil
{
return
shim
.
Error
(
fmt
.
Sprintf
(
"json marshal data fail,err: %s"
,
err
))
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment