1
This commit is contained in:
@@ -2219,14 +2219,13 @@ func UpdateStoreName() error {
|
|||||||
var db = dao.GetDB()
|
var db = dao.GetDB()
|
||||||
sql := ` SELECT * FROM store_courier_map WHERE vendor_id IN (?,?,?,?) AND deleted_at = ?`
|
sql := ` SELECT * FROM store_courier_map WHERE vendor_id IN (?,?,?,?) AND deleted_at = ?`
|
||||||
courierList := make([]*model.StoreCourierMap, 0, 0)
|
courierList := make([]*model.StoreCourierMap, 0, 0)
|
||||||
globals.SugarLogger.Debugf("====================len : %d", len(courierList))
|
|
||||||
if err := dao.GetRows(db, &courierList, sql, []interface{}{model.VendorIDMTPS, model.VendorIDFengNiao, model.VendorIDDada, model.VendorIDUUPT, utils.DefaultTimeValue}...); err != nil {
|
if err := dao.GetRows(db, &courierList, sql, []interface{}{model.VendorIDMTPS, model.VendorIDFengNiao, model.VendorIDDada, model.VendorIDUUPT, utils.DefaultTimeValue}...); err != nil {
|
||||||
globals.SugarLogger.Debugf("query Order err := %v", err)
|
globals.SugarLogger.Debugf("query Order err := %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("====================len : %d", len(courierList))
|
||||||
|
|
||||||
work := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
work := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
var resultList []interface{}
|
|
||||||
storeCourier := batchItemList[0].(*model.StoreCourierMap)
|
storeCourier := batchItemList[0].(*model.StoreCourierMap)
|
||||||
globals.SugarLogger.Debugf("====================storeId : %d", storeCourier.StoreID)
|
globals.SugarLogger.Debugf("====================storeId : %d", storeCourier.StoreID)
|
||||||
errList := errlist.New()
|
errList := errlist.New()
|
||||||
@@ -2242,7 +2241,7 @@ func UpdateStoreName() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resultList, errList.GetErrListAsOne()
|
return nil, errList.GetErrListAsOne()
|
||||||
}
|
}
|
||||||
// 定时任务更新或者创建时修改东西
|
// 定时任务更新或者创建时修改东西
|
||||||
task := tasksch.NewParallelTask("UpdateStoreName", tasksch.NewParallelConfig().SetIsContinueWhenError(false), jxcontext.AdminCtx, work, courierList)
|
task := tasksch.NewParallelTask("UpdateStoreName", tasksch.NewParallelConfig().SetIsContinueWhenError(false), jxcontext.AdminCtx, work, courierList)
|
||||||
|
|||||||
@@ -626,5 +626,8 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *DeliveryHandler) UpdateStoreName(storeId, name string) (err error) {
|
func (c *DeliveryHandler) UpdateStoreName(storeId, name string) (err error) {
|
||||||
return err
|
return api.DadaAPI.ShopUpdate(&dadaapi.ShopInfo{
|
||||||
|
StationName: name,
|
||||||
|
OriginShopID: storeId,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -475,5 +475,36 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *DeliveryHandler) UpdateStoreName(storeId, name string) (err error) {
|
func (c *DeliveryHandler) UpdateStoreName(storeId, name string) (err error) {
|
||||||
return err
|
// 获取蜂鸟门店id
|
||||||
|
fnStore, err := api.FnAPI.GetStore(storeId)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
updateStore := &fnpsapi.UpdateStoreParam{
|
||||||
|
ChainStoreID: fnStore.ChainStoreID,
|
||||||
|
ContactPhone: fnStore.ContactPhone,
|
||||||
|
Address: fnStore.Address,
|
||||||
|
Longitude: fnStore.Longitude,
|
||||||
|
Latitude: fnStore.Latitude,
|
||||||
|
PositionSource: 3,
|
||||||
|
OutShopCode: fnStore.OutShopCode,
|
||||||
|
CategoryID: utils.Int2Str(fnStore.CategoryID),
|
||||||
|
OwnerName: fnStore.OwnerName,
|
||||||
|
OwnerIDNum: fnStore.OwnerIDNum,
|
||||||
|
HandheldLicencePicHash: "暂不需要(手持身份证、营业执照图片)",
|
||||||
|
OwnerIDPicFrontHash: "暂不需要(省份证正)",
|
||||||
|
OwnerIDPicBackHash: "暂不需要(身份证反)",
|
||||||
|
CreditCode: fnStore.CreditCode,
|
||||||
|
}
|
||||||
|
updateStore.HeadShopName = name
|
||||||
|
updateStore.BranchShopName = name
|
||||||
|
if updateStore.OwnerName == "" {
|
||||||
|
updateStore.OwnerName = "石锋"
|
||||||
|
}
|
||||||
|
if updateStore.OwnerIDNum == "" {
|
||||||
|
updateStore.OwnerIDNum = "610126198012230014"
|
||||||
|
}
|
||||||
|
|
||||||
|
return api.FnAPI.UpdateStore(updateStore)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user