This commit is contained in:
苏尹岚
2020-11-11 18:08:55 +08:00
parent 8749f1d4be
commit 19c58e4b4a
3 changed files with 64 additions and 359 deletions

View File

@@ -705,8 +705,9 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID
} }
saleInfoMap[index] = saleInfo saleInfoMap[index] = saleInfo
} }
//成都菜市
if beego.BConfig.RunMode == "prod" { if beego.BConfig.RunMode == "prod" {
if v.EarningType == model.EarningTypeQuote { if v.EarningType == model.EarningTypeQuote && v.VendorID != model.VendorIDJD && v.CityCode != 510100 {
saleInfo.RealEarningPrice += v.ShopPrice * int64(v.Count) saleInfo.RealEarningPrice += v.ShopPrice * int64(v.Count)
} }
} else { } else {
@@ -722,7 +723,7 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID
if k == 0 { if k == 0 {
saleInfo.EarningPrice = v.NewEarningPrice saleInfo.EarningPrice = v.NewEarningPrice
if beego.BConfig.RunMode == "prod" { if beego.BConfig.RunMode == "prod" {
if v.EarningType == model.EarningTypePoints { if v.EarningType == model.EarningTypePoints && v.VendorID != model.VendorIDJD && v.CityCode != 510100 {
saleInfo.RealEarningPrice += v.NewEarningPrice saleInfo.RealEarningPrice += v.NewEarningPrice
} }
} else { } else {
@@ -735,7 +736,7 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID
flagVendorOrderID = v.VendorOrderID flagVendorOrderID = v.VendorOrderID
saleInfo.EarningPrice += v.NewEarningPrice saleInfo.EarningPrice += v.NewEarningPrice
if beego.BConfig.RunMode == "prod" { if beego.BConfig.RunMode == "prod" {
if v.EarningType == model.EarningTypePoints { if v.EarningType == model.EarningTypePoints && v.VendorID != model.VendorIDJD && v.CityCode != 510100 {
saleInfo.RealEarningPrice += v.NewEarningPrice saleInfo.RealEarningPrice += v.NewEarningPrice
} }
} else { } else {

View File

@@ -1710,362 +1710,65 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
// cms.UpdateStoreSkus(ctx, 0, storeDetail.ID, skuBindInfos, true, true) // cms.UpdateStoreSkus(ctx, 0, storeDetail.ID, skuBindInfos, true, true)
// } // }
var ( var (
db = dao.GetDB() // jdStoreIDs = []string{
storeIDs = []int{ // "11734848",
667510, // "11734850",
667501, // "11734854",
667493, // "11734862",
667490, // "11734868",
667485, // "11734873",
667480, // "11734874",
667479, // "11734886",
667463, // "11748353",
667459, // "11890095",
667446, // "11800399",
667445, // "11738114",
667441, // "11857499",
667439, // "11873440",
667431, // "11883071",
667429, // "11734852",
667423, // "11886763",
667421, // "11874614",
667414, // "11734884",
667413, // "11926674",
667412, // "11929173",
667410, // "11894144",
667407, // "11734861",
667401, // "11951611",
667399, // "11800403",
667398, // "11913597",
667394, // "11980746",
667385, // "11981675",
667383, // "12011812",
667377, // "12007545",
667375, // "11734846",
667365, // "12005417",
667363, // "12005640",
667357, // "12005682",
667351, // "12006134",
667349, // "11982352",
667341, // "12007250",
667331, // "12007560",
667329, // "11982427",
667317, // "12008087",
667312, // "12035806",
667308, // "12008160",
667304, // "12008395",
667302, // "12009345",
667296, // "11940019",
667293, // "12010237",
667292, // "12010654",
667284, // "12011111",
667283, // "12006857",
667266, // "11734851",
667234, // "12030632",
667231, // "12050456",
667229, // }
667214, jdStoreIDxipu = "11890095"
667208,
667198,
667182,
667179,
667176,
667158,
667152,
667133,
667128,
667125,
667122,
667116,
667110,
667101,
667094,
667093,
667091,
667067,
667066,
667057,
667047,
667044,
667011,
666987,
666972,
666963,
666942,
666932,
666919,
666918,
666915,
666891,
666888,
666879,
666864,
666839,
666820,
666800,
666793,
666790,
666786,
666767,
666755,
666751,
666746,
666678,
666677,
103459,
103435,
103433,
103408,
103205,
103197,
103194,
103193,
103191,
103189,
103182,
103151,
103119,
103111,
103090,
103089,
103088,
103085,
103084,
103074,
103069,
103062,
103055,
103050,
103037,
103036,
103035,
103033,
103031,
103029,
103027,
103022,
103015,
103009,
103006,
103004,
103002,
102999,
102997,
102996,
102995,
102994,
102992,
102987,
102981,
102980,
102978,
102973,
102969,
102966,
102963,
102962,
102960,
102958,
102956,
102955,
102952,
102945,
102935,
102934,
102933,
102929,
102926,
102924,
102923,
102921,
102920,
102911,
102908,
102907,
102902,
102898,
102896,
102895,
102894,
102893,
102891,
102890,
102888,
102877,
102876,
102875,
102865,
102859,
102858,
102857,
102851,
102844,
102836,
102826,
102824,
102823,
102819,
102818,
102812,
102807,
102795,
102794,
102790,
102789,
102788,
102785,
102784,
102778,
102776,
102767,
102756,
102752,
102751,
102744,
102742,
102736,
102731,
102718,
102713,
102705,
102691,
102686,
102676,
102671,
102630,
102624,
102596,
102594,
102561,
102533,
102530,
102498,
102490,
102488,
102482,
102481,
102479,
102475,
102433,
102426,
102425,
102383,
102379,
102374,
102373,
102371,
102364,
102358,
102357,
102353,
102304,
102303,
102300,
102293,
102280,
102206,
102167,
102147,
102126,
102101,
102075,
102074,
102068,
102063,
102046,
102016,
102014,
101997,
101983,
101979,
101956,
101948,
101909,
101897,
101763,
101750,
101736,
101666,
101176,
101134,
101111,
101110,
101099,
101078,
101062,
101039,
101036,
101013,
101012,
101000,
100988,
100987,
100946,
100937,
100920,
100905,
100887,
100867,
100849,
100829,
100802,
100766,
100720,
100712,
100699,
100681,
100670,
100664,
100658,
100600,
100548,
100477,
100471,
100470,
100463,
100455,
100454,
100449,
100444,
100409,
100396,
100366,
100361,
100324,
100309,
100299,
100292,
100274,
100236,
100215,
100206,
100190,
100175,
100167,
100157,
100135,
100123,
100121,
100115,
100068,
100065,
100056,
100032,
100022,
100002,
}
payload = make(map[string]interface{})
) )
payload["pricePercentagePack"] = "美团菜市双1169-25" handler := partner.GetPurchasePlatformFromVendorID(model.VendorIDJD).(partner.IPurchasePlatformStoreSkuHandler)
task := tasksch.NewParallelTask("美团双11刷新", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, outStoreSkuList, err := handler.GetStoreSkusBareInfo(ctx, "320406", nil, 0, jdStoreIDxipu, nil)
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { fmt.Println(utils.Format4Output(outStoreSkuList, false))
v := batchItemList[0].(int)
cms.UpdateStoreVendorMap(ctx, db, v, model.VendorIDMTWM, payload, ctx.GetUserName())
cms.CurVendorSync.SyncStoresSkus(ctx, nil, 0, db, []int{model.VendorIDMTWM}, []int{v}, nil, false, true, true)
return retVal, err
}, storeIDs)
tasksch.HandleTask(task, nil, true).Run()
task.GetID()
return err return err
} }

View File

@@ -49,6 +49,7 @@ type OrderSkuWithActualPayPrice struct {
OrderPayPercentage int `json:"orderPayPercentage"` OrderPayPercentage int `json:"orderPayPercentage"`
NewEarningPrice int64 `json:"newEarningPrice"` NewEarningPrice int64 `json:"newEarningPrice"`
EarningType int `json:"earningType"` EarningType int `json:"earningType"`
CityCode int `json:"cityCode"`
} }
type tGoodsAndOrder struct { type tGoodsAndOrder struct {
@@ -377,7 +378,7 @@ func GetStoreOrderSkuList(db *DaoDB, storeIDs []int, finishedAtBegin, finishedAt
sql := ` sql := `
SELECT t1.*, SELECT t1.*,
IF(t2.jx_store_id > 0, t2.jx_store_id, t2.store_id) store_id, t2.status, t2.actual_pay_price, t2.distance_freight_money, t2.waybill_tip_money, t2.new_earning_price, IF(t2.jx_store_id > 0, t2.jx_store_id, t2.store_id) store_id, t2.status, t2.actual_pay_price, t2.distance_freight_money, t2.waybill_tip_money, t2.new_earning_price,
t3.pay_percentage, t2.earning_type, t2.order_pay_percentage t3.pay_percentage, t2.earning_type, t2.order_pay_percentage, t3.city_code
FROM order_sku t1 FROM order_sku t1
JOIN goods_order t2 ON t2.vendor_order_id = t1.vendor_order_id AND t2.vendor_id = t1.vendor_id JOIN goods_order t2 ON t2.vendor_order_id = t1.vendor_order_id AND t2.vendor_id = t1.vendor_id
LEFT JOIN store t3 ON t3.id = IF(t2.jx_store_id > 0, t2.jx_store_id, t2.store_id) LEFT JOIN store t3 ON t3.id = IF(t2.jx_store_id > 0, t2.jx_store_id, t2.store_id)