Commit 1cb0089d by Joneq

增加删除订单

parent ed640eee
Showing with 27 additions and 0 deletions
......@@ -57,6 +57,9 @@ func main() {
currentDatetime = getSysLogLastTIme(scm_data_dao.GetScmDataDb())
fmt.Println(currentDatetime)
//删除订单
deleteOrder(currentDate)
for _,v := range syncTable {
wg.Add(1)
go handleCurrentTable(v,currentDate)
......@@ -65,6 +68,30 @@ func main() {
}
func deleteOrder(currentDate string) {
table := "Purchase_delete_Order"
jsonStr := requestTableInfo(table,currentDate)
//[{"number": "CG210577669-B79595", "data_update_time": "2021-05-19 11:25:45"}]
sqlDb := scm_data_dao.GetScmDataDb()
for _, res := range gjson.Parse(jsonStr).Array() {
deleteKeyErp := make(map[string]string)
res.ForEach(func(key, value gjson.Result) bool {
deleteKeyErp[key.String()] = value.String()
return true
})
//删除采购订单中当前单号的,like单号的
_,err :=sqlDb.Exec("delete from Purchase_Order where number = ? and data_update_time < ?",deleteKeyErp["number"],deleteKeyErp["data_update_time"]);
_,err = sqlDb.Exec("delete from Purchase_Order where number like ? and data_update_time < ?",deleteKeyErp["number"]+"-%",deleteKeyErp["data_update_time"]);
if err != nil{
fmt.Println(err)
}
}
}
//处理当前的这个表任务
......
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