mtps门店对比

This commit is contained in:
苏尹岚
2020-09-29 08:40:45 +08:00
parent a5a236bf24
commit a6c4bb3009

View File

@@ -3668,83 +3668,58 @@ func StoreAudit(ctx *jxcontext.Context, storeAudits []*model.StoreAudit, status
} }
func GetDiffJxStoreAndMTWMStoreInfo(ctx *jxcontext.Context, storeIDs []int) (err error) { func GetDiffJxStoreAndMTWMStoreInfo(ctx *jxcontext.Context, storeIDs []int) (err error) {
// type tmp struct { type TmpDiffStore struct {
// JdID string `json:"jdID"` StoreID int `json:"门店ID"`
// S int `json:"s"` StoreName string `json:"门店名"`
// } City string `json:"城市"`
// type SpecialtyStoreSkus struct { Coordinate string `json:"坐标"`
// StoreID int `json:"门店ID"` Address string `json:"地址"`
// StoreName string `json:"门店名"` Phone string `json:"电话"`
// City string `json:"城市"` CoordinateMT string `json:"坐标(美团)"`
// Coordinate string `json:"坐标"` AddressMT string `json:"地址(美团)"`
// Address string `json:"地址"` PhoneMT string `json:"电话(美团)"`
// Phone string `json:"电话"` Comment string `json:"对比情况"`
// CoordinateMT string `json:"坐标(美团)"` }
// AddressMT string `json:"地址(美团)"` var (
// PhoneMT string `json:"电话(美团)"` excelTitle = []string{
// Comment string `json:"对比情况"` "门店ID",
// } "门店名",
// var ( "城市",
// ss []*tmp "坐标",
// excelTitle = []string{ "地址",
// "门店ID", "电话",
// "门店名", "坐标(美团)",
// "城市", "地址(美团)",
// "坐标", "电话(美团)",
// "地址", "对比情况",
// "电话", }
// "坐标(美团)", sheetList []*excel.Obj2ExcelSheetConfig
// "地址(美团)", tmpDiffStore []*TmpDiffStore
// "电话(美团)", downloadURL, fileName string
// "对比情况", db = dao.GetDB()
// } )
// sheetList []*excel.Obj2ExcelSheetConfig courierStoreList, _ := dao.GetStoreCourierList(db, storeIDs, []int{model.VendorIDMTPS}, model.StoreStatusAll, model.StoreAuditStatusAll)
// specialtyStoreSkus []*SpecialtyStoreSkus for _, v := range courierStoreList {
// downloadURL, fileName string fmt.Println(v)
// ) }
// storeMaps, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDJD}, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
// for _, v := range storeMaps { excelConf := &excel.Obj2ExcelSheetConfig{
// time.Sleep(time.Second / 3) Title: "sheet1",
// station, err := jd.GetAPI("320406").GetDeliveryRangeByStationNo2(v.VendorStoreID) Data: tmpDiffStore,
// if err != nil { CaptionList: excelTitle,
// continue }
// } sheetList = append(sheetList, excelConf)
// if station.DeliveryRangeType == 2 { if excelConf != nil {
// strs := strings.Split(station.DeliveryRange, ";") downloadURL, fileName, err = jxutils.UploadExeclAndPushMsg(sheetList, "美团配送信息对比")
// ss = append(ss, &tmp{ } else {
// JdID: v.VendorStoreID, baseapi.SugarLogger.Debug("WriteToExcel: dataSuccess is nil!")
// S: utils.Float64TwoInt(math.Ceil((jxutils.ComputeSignedArea(strs[:len(strs)-1])))), }
// }) if err != nil {
// } baseapi.SugarLogger.Errorf("WriteToExcel:upload %s , %s failed error:%v", fileName, err)
// } } else {
// for _, v := range ss { noticeMsg := fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL)
// storeDetail, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), v.JdID, model.VendorIDJD) ddmsg.SendUserMessage(dingdingapi.MsgTyeText, ctx.GetUserID(), "异步任务完成", noticeMsg)
// place, _ := dao.GetPlaceByCode(dao.GetDB(), storeDetail.CityCode) baseapi.SugarLogger.Debug("WriteToExcel: dataSuccess downloadURL: [%v]", downloadURL)
// specialtyStoreSku := &SpecialtyStoreSkus{ }
// StoreID: storeDetail.ID,
// StoreName: storeDetail.Name,
// City: place.Name,
// Area: v.S,
// }
// specialtyStoreSkus = append(specialtyStoreSkus, specialtyStoreSku)
// }
// excelConf := &excel.Obj2ExcelSheetConfig{
// Title: "sheet1",
// Data: specialtyStoreSkus,
// CaptionList: excelTitle,
// }
// sheetList = append(sheetList, excelConf)
// if excelConf != nil {
// downloadURL, fileName, err = jxutils.UploadExeclAndPushMsg(sheetList, "面积")
// } else {
// baseapi.SugarLogger.Debug("WriteToExcel: dataSuccess is nil!")
// }
// if err != nil {
// baseapi.SugarLogger.Errorf("WriteToExcel:upload %s , %s failed error:%v", fileName, err)
// } else {
// noticeMsg := fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL)
// ddmsg.SendUserMessage(dingdingapi.MsgTyeText, ctx.GetUserID(), "异步任务完成", noticeMsg)
// baseapi.SugarLogger.Debug("WriteToExcel: dataSuccess downloadURL: [%v]", downloadURL)
// }
return err return err
} }