aa
This commit is contained in:
@@ -84,7 +84,7 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int, isAsyn
|
|||||||
case 0:
|
case 0:
|
||||||
priceReferSnapshot, err := dao.GetStatisticsReportForStoreSkusPrice(db, cityCodes, skuIDs)
|
priceReferSnapshot, err := dao.GetStatisticsReportForStoreSkusPrice(db, cityCodes, skuIDs)
|
||||||
if len(priceReferSnapshot) > 0 {
|
if len(priceReferSnapshot) > 0 {
|
||||||
txDB , _ := dao.Begin(db)
|
txDB, _ := dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil || err != nil {
|
if r := recover(); r != nil || err != nil {
|
||||||
dao.Rollback(db, txDB)
|
dao.Rollback(db, txDB)
|
||||||
@@ -214,7 +214,7 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int, isAsyn
|
|||||||
}
|
}
|
||||||
resultMap[k1] = skuNameMap
|
resultMap[k1] = skuNameMap
|
||||||
}
|
}
|
||||||
txDB , _ := dao.Begin(db)
|
txDB, _ := dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil || err != nil {
|
if r := recover(); r != nil || err != nil {
|
||||||
dao.Rollback(db, txDB)
|
dao.Rollback(db, txDB)
|
||||||
@@ -246,7 +246,7 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int, isAsyn
|
|||||||
}
|
}
|
||||||
dao.Commit(db, txDB)
|
dao.Commit(db, txDB)
|
||||||
case 2:
|
case 2:
|
||||||
txDB , _ := dao.Begin(db)
|
txDB, _ := dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil || err != nil {
|
if r := recover(); r != nil || err != nil {
|
||||||
dao.Rollback(db, txDB)
|
dao.Rollback(db, txDB)
|
||||||
@@ -461,6 +461,9 @@ func RefreshStoreManageState(ctx *jxcontext.Context) {
|
|||||||
}
|
}
|
||||||
storeDetail, _ := dao.GetStoreDetail(db, storeMap.StoreID, vendorID, storeMap.VendorOrgCode)
|
storeDetail, _ := dao.GetStoreDetail(db, storeMap.StoreID, vendorID, storeMap.VendorOrgCode)
|
||||||
storeManage := buildStoreManageState(ctx, db, storeMap, storeDetail, messageFlag)
|
storeManage := buildStoreManageState(ctx, db, storeMap, storeDetail, messageFlag)
|
||||||
|
if storeManage == nil {
|
||||||
|
return retVal, err
|
||||||
|
}
|
||||||
if storeManageStates, err := dao.GetStoreManageStateSimple(db, []int{storeDetail.ID}, nil, vendorID); err == nil && len(storeManageStates) > 0 {
|
if storeManageStates, err := dao.GetStoreManageStateSimple(db, []int{storeDetail.ID}, nil, vendorID); err == nil && len(storeManageStates) > 0 {
|
||||||
storeManage.ID = storeManageStates[0].ID
|
storeManage.ID = storeManageStates[0].ID
|
||||||
dao.UpdateEntity(db, storeManage)
|
dao.UpdateEntity(db, storeManage)
|
||||||
@@ -485,7 +488,10 @@ func buildStoreManageState(ctx *jxcontext.Context, db *dao.DaoDB, storeMap *mode
|
|||||||
}
|
}
|
||||||
dao.WrapAddIDCULEntity(storeManage, ctx.GetUserName())
|
dao.WrapAddIDCULEntity(storeManage, ctx.GetUserName())
|
||||||
handler := partner.GetPurchasePlatformFromVendorID(storeMap.VendorID)
|
handler := partner.GetPurchasePlatformFromVendorID(storeMap.VendorID)
|
||||||
store, _ := handler.ReadStore(ctx, storeDetail.VendorOrgCode, storeDetail.VendorStoreID)
|
store, err := handler.ReadStore(ctx, storeDetail.VendorOrgCode, storeDetail.VendorStoreID)
|
||||||
|
if err != nil || store == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
// if coverAreaFlag {
|
// if coverAreaFlag {
|
||||||
if storeMap.VendorID == model.VendorIDJD && store.DeliveryRangeType != model.DeliveryRangeTypePolygon {
|
if storeMap.VendorID == model.VendorIDJD && store.DeliveryRangeType != model.DeliveryRangeTypePolygon {
|
||||||
storeManage.CoverArea = utils.Str2Float64(fmt.Sprintf("%.2f", math.Pi*utils.Str2Float64WithDefault(store.DeliveryRange, 0)/float64(1000)*utils.Str2Float64WithDefault(store.DeliveryRange, 0)/float64(1000)))
|
storeManage.CoverArea = utils.Str2Float64(fmt.Sprintf("%.2f", math.Pi*utils.Str2Float64WithDefault(store.DeliveryRange, 0)/float64(1000)*utils.Str2Float64WithDefault(store.DeliveryRange, 0)/float64(1000)))
|
||||||
|
|||||||
Reference in New Issue
Block a user