Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang_asynctask
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
54d2e710
authored
Aug 12, 2021
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改旧商品
parent
399ffab5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
cmd/scm/sync_customs/main.go
cmd/scm/sync_customs/main.go
View file @
54d2e710
...
@@ -50,6 +50,8 @@ var currentDatetime int64
...
@@ -50,6 +50,8 @@ var currentDatetime int64
//同步海关信息至中间库
//同步海关信息至中间库
func
main
()
{
func
main
()
{
UpdateOldGoodsId
()
panic
(
1
)
runtime
.
GOMAXPROCS
(
5
)
runtime
.
GOMAXPROCS
(
5
)
//获取当天时间
//获取当天时间
var
currentDate
=
time
.
Now
()
.
Format
(
"2006-01-02"
)
var
currentDate
=
time
.
Now
()
.
Format
(
"2006-01-02"
)
...
@@ -227,6 +229,33 @@ func getRowExsist(db *xorm.Engine,table,num,datetime string)bool {
...
@@ -227,6 +229,33 @@ func getRowExsist(db *xorm.Engine,table,num,datetime string)bool {
}
}
//20210812 修改旧的商品ID
func
UpdateOldGoodsId
()
{
type
Sub
struct
{
GetCustomsDockingData
func
(
string
)
(
string
,
error
)
}
var
(
sub
*
Sub
numArr
[]
string
)
client
:=
rpc
.
NewHTTPClient
(
"http://119.23.228.186:50005/"
)
client
.
UseService
(
&
sub
)
sqlDb
:=
scm_data_dao
.
GetScmDataDb
()
sqlDb
.
Table
(
"Purchase_Order"
)
.
Cols
(
"number"
)
.
Find
(
&
numArr
)
for
_
,
v
:=
range
numArr
{
result
,
_
:=
sub
.
GetCustomsDockingData
(
`{"tableName":"Purchase_Order2","bizDate":"`
+
v
+
`"}`
)
if
gjson
.
Get
(
result
,
"0.goods_id"
)
.
String
()
!=
""
{
sqlDb
.
Exec
(
"update Purchase_Order set goods_id = '"
+
gjson
.
Get
(
result
,
"0.goods_id"
)
.
String
()
+
"' where number ='"
+
v
+
"'"
)
}
}
}
...
...
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