京东刷新结算价

This commit is contained in:
苏尹岚
2020-09-29 09:27:59 +08:00
parent 2540aa7b5c
commit 5474654012
3 changed files with 58 additions and 11 deletions

View File

@@ -1299,15 +1299,18 @@ func RefreshJdShopOrdersEarningPrice(ctx *jxcontext.Context, orderStartTime, ord
}
for _, v := range results.BillList.Result {
if v.DueAmount != 0 {
order := &model.GoodsOrder{}
order.VendorOrderID = utils.Int64ToStr(v.OrderID)
dao.GetEntity(db, order, "VendorOrderID")
storeDeatil, _ := dao.GetStoreDetail(db, jxutils.GetSaleStoreIDFromOrder(order), order.VendorID)
order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100)
if order.NewEarningPrice == 0 {
jxutils.RefreshOrderEarningPrice2(order, storeDeatil.PayPercentage)
order, _ := partner.CurOrderManager.LoadOrder(utils.Int64ToStr(v.OrderID), model.VendorIDJD)
stores, _ := dao.GetStoreList(db, []int{jxutils.GetSaleStoreIDFromOrder(order)}, nil, nil, nil, "")
if len(stores) > 0 {
store := stores[0]
if order.NewEarningPrice == 0 {
jxutils.RefreshOrderEarningPrice2(order, store.PayPercentage)
}
if order.TotalShopMoney == 0 {
order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100)
}
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
}
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
}
}
return err

View File

@@ -3694,18 +3694,51 @@ func GetDiffJxStoreAndMTWMStoreInfo(ctx *jxcontext.Context, storeIDs []int) (err
"对比情况",
}
sheetList []*excel.Obj2ExcelSheetConfig
tmpDiffStore []*TmpDiffStore
tmpDiffStoreList []*TmpDiffStore
downloadURL, fileName string
db = dao.GetDB()
)
courierStoreList, _ := dao.GetStoreCourierList(db, storeIDs, []int{model.VendorIDMTPS}, model.StoreStatusAll, model.StoreAuditStatusAll)
for _, v := range courierStoreList {
fmt.Println(v)
tmpDiffStore := &TmpDiffStore{
StoreID: v.StoreID,
}
shopInfo, _ := api.MtpsAPI.ShopQuery(utils.Int2Str(v.StoreID))
if shopInfo == nil {
continue
}
stores, _ := dao.GetStoreList(db, []int{v.StoreID}, nil, nil, nil, "")
if len(stores) == 0 {
continue
}
store := stores[0]
place, _ := dao.GetPlaceByCode(db, store.CityCode)
tmpDiffStore.City = place.Name
tmpDiffStore.StoreName = store.Name
tmpDiffStore.Coordinate = utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lng)) + "," + utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lat))
tmpDiffStore.Address = store.Address
tmpDiffStore.Phone = store.Tel1
tmpDiffStore.CoordinateMT = utils.Float64ToStr(jxutils.IntCoordinate2Standard(shopInfo.ShopLng)) + "," + utils.Float64ToStr(jxutils.IntCoordinate2Standard(shopInfo.ShopLat))
tmpDiffStore.AddressMT = shopInfo.ShopAddress
tmpDiffStore.PhoneMT = shopInfo.ContactPhone
comment := ""
if tmpDiffStore.Coordinate != tmpDiffStore.CoordinateMT {
comment += "坐标不同;"
}
if tmpDiffStore.Address != tmpDiffStore.AddressMT {
comment += "地址不同;"
}
if tmpDiffStore.Phone != tmpDiffStore.PhoneMT {
comment += "电话不同;"
}
if comment != "" {
tmpDiffStoreList = append(tmpDiffStoreList, tmpDiffStore)
}
}
excelConf := &excel.Obj2ExcelSheetConfig{
Title: "sheet1",
Data: tmpDiffStore,
Data: tmpDiffStoreList,
CaptionList: excelTitle,
}
sheetList = append(sheetList, excelConf)

View File

@@ -903,3 +903,14 @@ func (c *StoreController) StoreAudit() {
return retVal, "", err
})
}
// @Title 比较美团配送门店信息
// @Description 比较美团配送门店信息
// @Param token header string true "认证token"
// @Param storeIDs formData string true "门店ids"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetDiffJxStoreAndMTWMStoreInfo [post]
func (c *StoreController) GetDiffJxStoreAndMTWMStoreInfo() {
}