aa
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/delivery"
|
"git.rosy.net.cn/jx-callback/business/partner/delivery"
|
||||||
"github.com/360EntSecGroup-Skylar/excelize"
|
"github.com/360EntSecGroup-Skylar/excelize"
|
||||||
@@ -1745,59 +1747,67 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//门店建商品
|
|
||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
|
||||||
storeMaps []*model.StoreMap
|
storeMaps []*model.StoreMap
|
||||||
|
db = dao.GetDB()
|
||||||
)
|
)
|
||||||
sql := `
|
sql := `
|
||||||
SELECT *
|
SELECT * from store_map where vendor_id = 5 and deleted_at = '1970-01-01 00:00:00' and vendor_org_code = 2
|
||||||
FROM store_map
|
and store_id = 102808
|
||||||
WHERE vendor_id = 5
|
`
|
||||||
AND deleted_at = '1970-01-01 00:00:00'
|
dao.GetRows(db, &storeMaps, sql, nil)
|
||||||
AND vendor_org_code = 2
|
for _, v := range storeMaps {
|
||||||
AND store_id <> 667281
|
detail, _ := api.JdShop2API.ShopDetail(utils.Str2Int(v.VendorStoreID))
|
||||||
AND store_id <> 100000
|
storeDetail, _ := dao.GetStoreDetail(db, v.StoreID, model.VendorIDJDShop, "2")
|
||||||
AND store_id <> 102919
|
ex := storeDetail.IDExpire
|
||||||
AND store_id <> 103075
|
if ex == "" {
|
||||||
`
|
ex = utils.Time2Str(utils.Str2Time(storeDetail.IDValid).AddDate(10, 0, 0))
|
||||||
err = dao.GetRows(db, &storeMaps, sql, nil)
|
}
|
||||||
storeSkus, _ := dao.GetStoresSkusInfo(db, []int{model.JdShopMainStoreID2}, nil)
|
if !strings.Contains(ex, "00:00:00") {
|
||||||
task := tasksch.NewParallelTask("京东商城门店建商品1", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(true), ctx,
|
ex += " 00:00:00"
|
||||||
func(task2 *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
}
|
||||||
v := batchItemList[0].(*model.StoreSkuBind)
|
var url2 string
|
||||||
if v.JdsID != 0 && v.SubStoreID == 0 {
|
if storeDetail.IDCardFront != "" {
|
||||||
if err = api.JdShop2API.StoreSkuBindStore(true, []string{utils.Int64ToStr(v.JdsID)}, nil); err == nil {
|
data2, _, _ := jxutils.DownloadFileByURL(storeDetail.IDCardFront)
|
||||||
// task := tasksch.NewParallelTask("京东商城门店建商品2", tasksch.NewParallelConfig().SetParallelCount(2).SetIsContinueWhenError(true), ctx,
|
fileName := storeDetail.IDCardFront[strings.LastIndex(storeDetail.IDCardFront, "/")+1 : len(storeDetail.IDCardFront)]
|
||||||
// func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
url2, _ = api.JdShop2API.UploadImageNew(data2, fileName)
|
||||||
// storeMap := batchItemList[0].(*model.StoreMap)
|
}
|
||||||
// storeSkus2, _ := dao.GetStoresSkusInfo(db, []int{storeMap.StoreID}, []int{v.SkuID})
|
api.JdShop2API.UpdateBasic(&jdshopapi.UpdateBasicParam{
|
||||||
// if len(storeSkus2) > 0 {
|
StoreID: detail.StoreID,
|
||||||
// status := storeSkus2[0].Status
|
StoreName: detail.StoreName,
|
||||||
// stock := storeSkus2[0].Stock
|
CategoryID2: detail.CategoryID2,
|
||||||
// price := storeSkus2[0].Price
|
Coordinate: detail.Coordinate,
|
||||||
// if status == model.StoreSkuBindStatusNormal {
|
BussinessBeginTime: detail.BussinessBeginTime,
|
||||||
// api.JdShop2API.StoreWareDoUpdate(status, v.JdsID, storeMap.VendorStoreID)
|
BussinessEndTime: detail.BussinessEndTime,
|
||||||
// }
|
ImgURL: detail.ImgURL,
|
||||||
// if stock != 0 {
|
StorePhone: detail.StorePhone,
|
||||||
// api.JdShop2API.StoreUpdateStock(stock, v.JdsID, storeMap.VendorStoreID)
|
AddName: utils.LimitUTF8StringLen(detail.AddName, 100),
|
||||||
// }
|
AddCode1: detail.AddCode1,
|
||||||
// api.JdShop2API.StoreUpdatePrice(utils.Float64ToStr(jxutils.IntPrice2Standard(int64(price))), v.JdsID, storeMap.VendorStoreID)
|
AddCode2: detail.AddCode2,
|
||||||
// } else {
|
AddCode3: detail.AddCode3,
|
||||||
// return retVal, err
|
CategoryID1: detail.CategoryID1,
|
||||||
// }
|
QualificationRequests: []*jdshopapi.QualificationRequests{
|
||||||
// return retVal, err
|
&jdshopapi.QualificationRequests{
|
||||||
// }, storeMaps)
|
QualificationID: 41,
|
||||||
// tasksch.HandleTask(task, task2, true).Run()
|
QualificationName: "营业执照",
|
||||||
// _, err = task.GetResult(0)
|
QualificationNo: detail.QualificationInfoTOList[0].QualificationNo,
|
||||||
}
|
QualificationURL: detail.QualificationInfoTOList[0].QualificationURL,
|
||||||
}
|
StartTime: detail.QualificationInfoTOList[0].StartTime,
|
||||||
v.SubStoreID = 1
|
EndingTime: detail.QualificationInfoTOList[0].EndingTime,
|
||||||
dao.UpdateEntity(db, v, "SubStoreID")
|
Time: []string{detail.QualificationInfoTOList[0].StartTime, detail.QualificationInfoTOList[0].EndingTime},
|
||||||
return retVal, err
|
},
|
||||||
}, storeSkus)
|
&jdshopapi.QualificationRequests{
|
||||||
tasksch.HandleTask(task, nil, true).Run()
|
QualificationID: 42,
|
||||||
_, err = task.GetResult(0)
|
QualificationName: "身份证件",
|
||||||
|
QualificationNo: storeDetail.IDCode,
|
||||||
|
QualificationURL: url2,
|
||||||
|
StartTime: utils.Time2Str(utils.Str2Time(storeDetail.IDValid)),
|
||||||
|
EndingTime: ex,
|
||||||
|
Time: []string{utils.Time2Str(utils.Str2Time(storeDetail.IDValid)), ex},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user