Commit 54d2e710 by Joneq

修改旧商品

parent 399ffab5
Showing with 29 additions and 0 deletions
......@@ -50,6 +50,8 @@ var currentDatetime int64
//同步海关信息至中间库
func main() {
UpdateOldGoodsId()
panic(1)
runtime.GOMAXPROCS(5)
//获取当天时间
var currentDate = time.Now().Format("2006-01-02")
......@@ -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+"'")
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment