This commit is contained in:
suyl
2021-06-07 14:31:43 +08:00
parent a5e63f1484
commit c4eecaffef
3 changed files with 14 additions and 45 deletions

View File

@@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
"regexp"
"strings"
"time"
@@ -1924,36 +1923,6 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
// dao.UpdateEntity(db, v, "ConsigneeMobile2")
// }
//}
var (
db = dao.GetDB()
)
courierStoreList, _ := dao.GetStoreCourierList(db, nil, []int{model.VendorIDMTPS}, model.StoreStatusAll, model.StoreAuditStatusAll)
task := tasksch.NewParallelTask("uuuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
courierStore := batchItemList[0].(*model.StoreCourierMap)
storeDetail, _ := dao.GetStoreDetail(db, courierStore.StoreID, model.VendorIDJX, "")
result, _ := api.MtpsAPI.GetStoreInfoByID(utils.Str2Int(courierStore.VendorStoreID))
name := fmt.Sprintf("%s-%s-%s", globals.StoreName, storeDetail.CityName, storeDetail.Name)
if result != nil {
if result.PoiName != name {
shopInfo := &mtpsapi.ShopInfo{
ShopID: utils.Int2Str(storeDetail.ID),
ShopName: name,
}
api.MtpsAPI.ShopUpdate(shopInfo)
}
if result.OpenType != courierStore.VendorStatus {
courierStore.VendorStatus = result.OpenType
dao.UpdateEntity(db, courierStore, "VendorStatus")
}
} else {
courierStore.VendorStatus = 0
dao.UpdateEntity(db, courierStore, "VendorStatus")
}
return retVal, err
}, courierStoreList)
tasksch.HandleTask(task, nil, true).Run()
task.GetID()
return err
}