Compare commits
28 Commits
c1f973df21
...
jdshop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c882f8a08 | ||
|
|
6fe950cb6d | ||
|
|
1cfe8bf1b7 | ||
|
|
93178c924b | ||
|
|
b213cbea45 | ||
|
|
d76fce41ad | ||
|
|
fd5e61b249 | ||
|
|
6767779cd9 | ||
|
|
b58f356601 | ||
|
|
73f0f641fc | ||
|
|
d244d0f247 | ||
|
|
ff07b53000 | ||
|
|
0dc5510f0d | ||
|
|
958f9ce14a | ||
|
|
8951d2f420 | ||
|
|
4eb74de864 | ||
|
|
14c38b6bfa | ||
|
|
7e0cd4a82c | ||
|
|
5bbc71a47f | ||
|
|
c4717ecec7 | ||
|
|
26aa372c2d | ||
|
|
92e391733a | ||
|
|
43bae940f4 | ||
|
|
6bb017e73b | ||
|
|
b71ad6737f | ||
|
|
711da91cf4 | ||
|
|
9d96ef6426 | ||
|
|
3a69b7a3f5 |
@@ -473,6 +473,7 @@ func GetTokenInfo(token string) (authInfo *AuthInfo, err error) {
|
||||
|
||||
func SetUserInfo(token string, authInfo *AuthInfo, duration time.Duration) {
|
||||
api.Cacher.Set(token, authInfo, DefTokenDuration)
|
||||
api.Cacher.Set(authInfo.Mobile, token, DefTokenDuration)
|
||||
}
|
||||
|
||||
func ClearUserToken(userID string) {
|
||||
|
||||
@@ -3,11 +3,8 @@ package bidding
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -15,93 +12,93 @@ import (
|
||||
)
|
||||
|
||||
// GetStatisticsList 京西数据查询
|
||||
func GetStatisticsList(start, end time.Time, storeIds []int, offset, pageSize int) (*model.PagedInfo, error) {
|
||||
return dao.GetStatistics(dao.GetDB(), start, end, storeIds, offset, pageSize)
|
||||
}
|
||||
//func GetStatisticsList(start, end time.Time, storeIds []int, offset, pageSize int) (*model.PagedInfo, error) {
|
||||
// return dao.GetStatistics(dao.GetDB(), start, end, storeIds, offset, pageSize)
|
||||
//}
|
||||
|
||||
// GetMTInfo 更新美团门店信息
|
||||
func GetMTInfo() []error {
|
||||
var db = dao.GetDB()
|
||||
var errList = make([]error, 0, 0)
|
||||
// 获取当前一月有效订单的门店信息
|
||||
effectiveStores, err := dao.StoreInformationStatistics(db)
|
||||
if err != nil {
|
||||
return append(errList, err)
|
||||
}
|
||||
|
||||
var mtApi *mtwmapi.API
|
||||
for _, v := range effectiveStores {
|
||||
if v.VendorOrgCode == globals.Mtwm2Code {
|
||||
mtApi = api.Mtwm2API
|
||||
mtApi.SetToken(v.MtwmToken)
|
||||
} else {
|
||||
mtApi = api.MtwmAPI
|
||||
}
|
||||
|
||||
statistics := &model.ActivityStation{
|
||||
StoreID: v.JxStoreID,
|
||||
VendorID: model.VendorIDMTWM,
|
||||
VendorStoreID: v.VendorStoreID,
|
||||
BrandID: v.VendorOrgCode,
|
||||
//Activity1: 0,
|
||||
//Activity2: 0,
|
||||
//Activity: 0,
|
||||
//StoreSkuNum: 0,
|
||||
//StoreRating: 0,
|
||||
//DeliveryFee: "",
|
||||
//DeliveryFee2: "",
|
||||
PromotionFee: "暂无法获取",
|
||||
//BusinessHours: "",
|
||||
}
|
||||
dao.WrapAddIDCULEntity(statistics, "system")
|
||||
down, up := getActivityCount(mtApi, v.VendorStoreID)
|
||||
statistics.Activity1 = int64(down)
|
||||
statistics.Activity2 = int64(up)
|
||||
statistics.Activity = int64(down + up)
|
||||
score, err := mtApi.CommentScore(v.VendorStoreID)
|
||||
if err != nil {
|
||||
errList = append(errList, fmt.Errorf("%s获取评分错误:%s", v.VendorStoreID, err.Error()))
|
||||
}
|
||||
if score != nil {
|
||||
statistics.StoreRating = score.AvgPoiScore
|
||||
} else {
|
||||
statistics.StoreRating = 0
|
||||
}
|
||||
|
||||
// 获取门店营业时长
|
||||
detail, _ := mtApi.PoiMGet([]string{v.VendorStoreID})
|
||||
if detail != nil {
|
||||
statistics.BusinessHours, err = getStoreShippingTime(detail[0].ShippingTime)
|
||||
if err != nil {
|
||||
errList = append(errList, fmt.Errorf("%s获取营业时长错误:%s", v.VendorStoreID, err.Error()))
|
||||
statistics.BusinessHours = err.Error()
|
||||
}
|
||||
statistics.DeliveryFee2 = utils.Float64ToStr(detail[0].ShippingFee)
|
||||
}
|
||||
// 获取门店起送价
|
||||
result, err := mtApi.ShippingList(v.VendorStoreID)
|
||||
if err != nil {
|
||||
errList = append(errList, fmt.Errorf("%s获取起送价错误:%s", v.VendorStoreID, err.Error()))
|
||||
statistics.DeliveryFee = err.Error()
|
||||
}
|
||||
shippingList := make([]ShippingList, 0, 0)
|
||||
for _, v2 := range result {
|
||||
shippingList = append(shippingList, ShippingList{
|
||||
TimeRange: utils.Interface2String(v2["time_range"]),
|
||||
MinPrice: utils.MustInterface2Float64(v2["min_price"]),
|
||||
ShippingFee: utils.MustInterface2Float64(v2["shipping_fee"]),
|
||||
})
|
||||
}
|
||||
statistics.DeliveryFee = utils.Format4Output(shippingList, false)
|
||||
if len(result) == 0 {
|
||||
statistics.DeliveryFee = ""
|
||||
}
|
||||
|
||||
dao.CreateEntity(db, statistics)
|
||||
}
|
||||
|
||||
return errList
|
||||
}
|
||||
//func GetMTInfo() []error {
|
||||
// var db = dao.GetDB()
|
||||
// var errList = make([]error, 0, 0)
|
||||
// // 获取当前一月有效订单的门店信息
|
||||
// effectiveStores, err := dao.StoreInformationStatistics(db)
|
||||
// if err != nil {
|
||||
// return append(errList, err)
|
||||
// }
|
||||
//
|
||||
// var mtApi *mtwmapi.API
|
||||
// for _, v := range effectiveStores {
|
||||
// if v.VendorOrgCode == globals.Mtwm2Code {
|
||||
// mtApi = api.Mtwm2API
|
||||
// mtApi.SetToken(v.MtwmToken)
|
||||
// } else {
|
||||
// mtApi = api.MtwmAPI
|
||||
// }
|
||||
//
|
||||
// statistics := &model.ActivityStation{
|
||||
// StoreID: v.JxStoreID,
|
||||
// VendorID: model.VendorIDMTWM,
|
||||
// VendorStoreID: v.VendorStoreID,
|
||||
// BrandID: v.VendorOrgCode,
|
||||
// //Activity1: 0,
|
||||
// //Activity2: 0,
|
||||
// //Activity: 0,
|
||||
// //StoreSkuNum: 0,
|
||||
// //StoreRating: 0,
|
||||
// //DeliveryFee: "",
|
||||
// //DeliveryFee2: "",
|
||||
// PromotionFee: "暂无法获取",
|
||||
// //BusinessHours: "",
|
||||
// }
|
||||
// dao.WrapAddIDCULEntity(statistics, "system")
|
||||
// down, up := getActivityCount(mtApi, v.VendorStoreID)
|
||||
// statistics.Activity1 = int64(down)
|
||||
// statistics.Activity2 = int64(up)
|
||||
// statistics.Activity = int64(down + up)
|
||||
// score, err := mtApi.CommentScore(v.VendorStoreID)
|
||||
// if err != nil {
|
||||
// errList = append(errList, fmt.Errorf("%s获取评分错误:%s", v.VendorStoreID, err.Error()))
|
||||
// }
|
||||
// if score != nil {
|
||||
// statistics.StoreRating = score.AvgPoiScore
|
||||
// } else {
|
||||
// statistics.StoreRating = 0
|
||||
// }
|
||||
//
|
||||
// // 获取门店营业时长
|
||||
// detail, _ := mtApi.PoiMGet([]string{v.VendorStoreID})
|
||||
// if detail != nil {
|
||||
// statistics.BusinessHours, err = getStoreShippingTime(detail[0].ShippingTime)
|
||||
// if err != nil {
|
||||
// errList = append(errList, fmt.Errorf("%s获取营业时长错误:%s", v.VendorStoreID, err.Error()))
|
||||
// statistics.BusinessHours = err.Error()
|
||||
// }
|
||||
// statistics.DeliveryFee2 = utils.Float64ToStr(detail[0].ShippingFee)
|
||||
// }
|
||||
// // 获取门店起送价
|
||||
// result, err := mtApi.ShippingList(v.VendorStoreID)
|
||||
// if err != nil {
|
||||
// errList = append(errList, fmt.Errorf("%s获取起送价错误:%s", v.VendorStoreID, err.Error()))
|
||||
// statistics.DeliveryFee = err.Error()
|
||||
// }
|
||||
// shippingList := make([]ShippingList, 0, 0)
|
||||
// for _, v2 := range result {
|
||||
// shippingList = append(shippingList, ShippingList{
|
||||
// TimeRange: utils.Interface2String(v2["time_range"]),
|
||||
// MinPrice: utils.MustInterface2Float64(v2["min_price"]),
|
||||
// ShippingFee: utils.MustInterface2Float64(v2["shipping_fee"]),
|
||||
// })
|
||||
// }
|
||||
// statistics.DeliveryFee = utils.Format4Output(shippingList, false)
|
||||
// if len(result) == 0 {
|
||||
// statistics.DeliveryFee = ""
|
||||
// }
|
||||
//
|
||||
// dao.CreateEntity(db, statistics)
|
||||
// }
|
||||
//
|
||||
// return errList
|
||||
//}
|
||||
|
||||
// 获取门店折扣活动商品数量
|
||||
func getActivityCount(api *mtwmapi.API, vendorStoreId string) (int, int) {
|
||||
@@ -228,3 +225,7 @@ type ShippingList struct {
|
||||
MinPrice float64 `json:"min_price"` // 最小起送价
|
||||
ShippingFee float64 `json:"shipping_fee"` // 配送费
|
||||
}
|
||||
|
||||
func StatisticsOrderCount(startTime, endTime time.Time, storeId []int, vendorId []int, offset, pageSize int) (*model.PagedInfo, error) {
|
||||
return dao.StatisticsOrderCount(dao.GetDB(), startTime, endTime, storeId, vendorId, offset, pageSize)
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ func (c *BaseScheduler) ConfirmReceiveGoods(ctx *jxcontext.Context, order *model
|
||||
|
||||
func (c *BaseScheduler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool, reason string) (err error) {
|
||||
if c.IsReallyCallPlatformAPI {
|
||||
err = partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID).AgreeOrRefuseCancel(ctx, order, isAcceptIt, reason)
|
||||
err = partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID).AgreeOrRefuseCancel(ctx, order, isAcceptIt, reason, nil)
|
||||
}
|
||||
if err == nil {
|
||||
flag := model.OrderFlagAgreeUserApplyCancel
|
||||
@@ -234,12 +234,12 @@ func (c *BaseScheduler) CancelWaybillByID(ctx *jxcontext.Context, vendorWaybillI
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *BaseScheduler) AgreeOrRefuseRefund(ctx *jxcontext.Context, afsOrderID string, vendorID, approveType int, reason string) (err error) {
|
||||
func (c *BaseScheduler) AgreeOrRefuseRefund(ctx *jxcontext.Context, afsOrderID string, vendorID, approveType int, reason string, mtReview map[string]interface{}) (err error) {
|
||||
skus := make([]*model.OrderFinancialSkuExt, 0, 0)
|
||||
afsOrder, err := partner.CurOrderManager.LoadAfsOrder(afsOrderID, vendorID)
|
||||
if err == nil {
|
||||
if c.IsReallyCallPlatformAPI {
|
||||
err = partner.GetPurchaseOrderHandlerFromVendorID(vendorID).AgreeOrRefuseRefund(ctx, afsOrder, approveType, reason)
|
||||
err = partner.GetPurchaseOrderHandlerFromVendorID(vendorID).AgreeOrRefuseRefund(ctx, afsOrder, approveType, reason, mtReview)
|
||||
}
|
||||
if err == nil {
|
||||
flag := model.AfsOrderFlagAgreeUserRefund
|
||||
|
||||
@@ -27,7 +27,7 @@ func (s *DefScheduler) OnAfsOrderNew(order *model.AfsOrder, isPending bool) (err
|
||||
if !isPending {
|
||||
if isAutoRejectAfsOrder(order) {
|
||||
if handler := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID); handler != nil {
|
||||
if err := handler.AgreeOrRefuseRefund(jxcontext.AdminCtx, order, partner.AfsApproveTypeRefused, "抱歉,蟹券不接受退货或换货"); err != nil {
|
||||
if err := handler.AgreeOrRefuseRefund(jxcontext.AdminCtx, order, partner.AfsApproveTypeRefused, "抱歉,蟹券不接受退货或换货", nil); err != nil {
|
||||
globals.SugarLogger.Debugf("OnAfsOrderNew, orderID:%s, afsOrderID:%s failed with err:%v", order.VendorOrderID, order.AfsOrderID, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3014,7 +3014,7 @@ func UpdateSkuExinfoMap(ctx *jxcontext.Context, nameIDs []int, imgWaterMark stri
|
||||
skuIDs = append(skuIDs, v.ID)
|
||||
}
|
||||
|
||||
globals.SugarLogger.Debugf("---------test := %s", utils.Format4Output(partner.IsMultiStore(vendorID), false))
|
||||
globals.SugarLogger.Debugf("---------1test := %s", utils.Format4Output(partner.IsMultiStore(vendorID), false))
|
||||
if partner.IsMultiStore(vendorID) {
|
||||
for _, v := range skuIDs {
|
||||
OnUpdateThing(ctx, db, nil, int64(v), model.ThingTypeSku)
|
||||
@@ -3030,7 +3030,7 @@ func UpdateSkuExinfoMap(ctx *jxcontext.Context, nameIDs []int, imgWaterMark stri
|
||||
}
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("---------test storeIDs:= %s", utils.Format4Output(storeIDs, false))
|
||||
globals.SugarLogger.Debugf("---------2test storeIDs:= %s", utils.Format4Output(storeIDs, false))
|
||||
SetStoreSkuSyncStatus2(db, storeIDs, []int{vendorID}, skuIDs, model.SyncFlagModifiedMask)
|
||||
}
|
||||
}
|
||||
@@ -3087,18 +3087,18 @@ func UpdateVendorImg(ctx *jxcontext.Context, storeId int, imgWaterMark string, v
|
||||
for {
|
||||
foodList, _ := api.RetailListAll(storeDetail.VendorStoreID, i)
|
||||
for _, v := range foodList {
|
||||
skuEx := &model.SkuExinfoMap{
|
||||
NameID: storeId,
|
||||
ImgWatermark: v.PictureList[0], // 原图
|
||||
ImgWatermarkMix: v.AppFoodCode, // 商品ID
|
||||
ExPrefix: exPrefix,
|
||||
VendorID: vendorID,
|
||||
BeginAt: fromTimeP,
|
||||
EndAt: toTimeP,
|
||||
BrandID: 0,
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(skuEx, ctx.GetUserName())
|
||||
dao.CreateEntity(db, skuEx)
|
||||
//skuEx := &model.SkuExinfoMap{
|
||||
// NameID: storeId,
|
||||
// ImgWatermark: v.PictureList[0], // 原图
|
||||
// ImgWatermarkMix: v.AppFoodCode, // 商品ID
|
||||
// ExPrefix: exPrefix,
|
||||
// VendorID: vendorID,
|
||||
// BeginAt: fromTimeP,
|
||||
// EndAt: toTimeP,
|
||||
// BrandID: 0,
|
||||
//}
|
||||
//dao.WrapAddIDCULDEntity(skuEx, ctx.GetUserName())
|
||||
//dao.CreateEntity(db, skuEx)
|
||||
|
||||
param := map[string]interface{}{}
|
||||
qiNiuImg := ""
|
||||
@@ -3129,7 +3129,10 @@ func UpdateVendorImg(ctx *jxcontext.Context, storeId int, imgWaterMark string, v
|
||||
i++
|
||||
}
|
||||
for _, v := range imgList {
|
||||
jxutils.DeleteExportContent(strings.Split(v, "/")[3])
|
||||
globals.SugarLogger.Debugf("-------v := %s", v)
|
||||
aa := strings.Split(v, "/")[3]
|
||||
globals.SugarLogger.Debugf("-------aa := %s", aa)
|
||||
jxutils.DeleteExportContent(aa)
|
||||
time.Sleep(100 * time.Microsecond)
|
||||
}
|
||||
//case model.VendorIDEBAI:
|
||||
|
||||
@@ -6786,3 +6786,26 @@ func GetStoreSettlementList(storeId []int, start, end time.Time, vendorId []int,
|
||||
func GetCityCodeSettlementList(cityCode []string, start, end time.Time, vendorId []int, size, offset int, rank string) (*model.PagedInfo, error) {
|
||||
return dao.StatisticsSettlementByCity(dao.GetDB(), cityCode, start, end, vendorId, size, offset, rank)
|
||||
}
|
||||
|
||||
func DeleteOrderUploadImg() error {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
data = make([]*model.GoodsOrderImg, 0, 0)
|
||||
)
|
||||
if err := dao.GetRows(db, &data, `SELECT * FROM goods_order_img WHERE created_at <= ? `, time.Now().AddDate(0, 0, -7)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, v := range data {
|
||||
var imgList []string
|
||||
if err := jxutils.Strings2Objs(v.OriginalData, &imgList); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, il := range imgList {
|
||||
jxutils.DeleteExportContent(strings.Split(il, "/")[3])
|
||||
}
|
||||
dao.DeleteEntity(db, v, "ID")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -109,46 +109,102 @@ func CopyEBaiToEBai(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail,
|
||||
//}
|
||||
case 2:
|
||||
//同步分类
|
||||
fromCategoryList, err := api.ShopCategoryGet(utils.Int2Str(fromStore.ID))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, v := range fromCategoryList {
|
||||
parentID, categoryErr := api.ShopCategoryCreate(utils.Int2Str(toStore.ID), 0, v.Name, v.Rank)
|
||||
if categoryErr != nil {
|
||||
globals.SugarLogger.Debugf("err := RetailCatUpdate : %v", categoryErr)
|
||||
continue
|
||||
}
|
||||
VendorCategoryIDMap[v.CategoryID] = parentID
|
||||
if v.Children != nil && len(v.Children) != 0 {
|
||||
for _, c := range v.Children {
|
||||
childrenCateId, err := api.ShopCategoryCreate(utils.Int2Str(toStore.ID), parentID, c.Name, c.Rank)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("err := RetailCatUpdate Children : %v", err)
|
||||
continue
|
||||
}
|
||||
VendorCategoryIDMap[c.CategoryID] = childrenCateId
|
||||
}
|
||||
}
|
||||
//fromCategoryList, err := api.ShopCategoryGet(utils.Int2Str(fromStore.ID))
|
||||
//if err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
//for _, v := range fromCategoryList {
|
||||
// parentID, categoryErr := api.ShopCategoryCreate(utils.Int2Str(toStore.ID), 0, v.Name, v.Rank)
|
||||
// if categoryErr != nil {
|
||||
// globals.SugarLogger.Debugf("err := RetailCatUpdate : %v", categoryErr)
|
||||
// continue
|
||||
// }
|
||||
// VendorCategoryIDMap[v.CategoryID] = parentID
|
||||
// if v.Children != nil && len(v.Children) != 0 {
|
||||
// for _, c := range v.Children {
|
||||
// childrenCateId, err := api.ShopCategoryCreate(utils.Int2Str(toStore.ID), parentID, c.Name, c.Rank)
|
||||
// if err != nil {
|
||||
// globals.SugarLogger.Debugf("err := RetailCatUpdate Children : %v", err)
|
||||
// continue
|
||||
// }
|
||||
// VendorCategoryIDMap[c.CategoryID] = childrenCateId
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
VendorCategoryIDMap = map[int64]int64{
|
||||
1647792815228: 1783655621221494,
|
||||
166074216522662: 1783655616221476,
|
||||
166074277122800: 1783655619221486,
|
||||
1660817971221141: 1783655621221495,
|
||||
166087125422564: 1783655616221474,
|
||||
168123919522131: 1783655620221490,
|
||||
16831126732292: 1783655621221493,
|
||||
170532859722299: 1783655614221451,
|
||||
17053370692243: 1783655616221472,
|
||||
17110932372230: 1783655614221454,
|
||||
1712655580225326: 1783655619221487,
|
||||
172536777922315: 1783655620221492,
|
||||
17278653502220: 1783655622221498,
|
||||
174809565622151: 1783655615221470,
|
||||
1752773599225: 1783655621221496,
|
||||
1752773622226: 1783655619221485,
|
||||
175300467322516: 1783655616221475,
|
||||
175363909122230: 1783655617221479,
|
||||
1758352353221072: 1783655620221491,
|
||||
1758387942228: 1783655618221484,
|
||||
1763709422226666: 1783655622221497,
|
||||
176563009122143: 1783663337221887,
|
||||
176717046822902: 178358015522541,
|
||||
176717046822903: 1783655628221543,
|
||||
176774799222377: 1783655622221499,
|
||||
1767748733221565: 1783655623221512,
|
||||
176775575122888: 1783655623221509,
|
||||
176783623022984: 178358015622554,
|
||||
176783831622900: 1783655628221544,
|
||||
176783886722192: 178364558822191,
|
||||
177243820422532: 1783655617221480,
|
||||
177243820422533: 1783655618221481,
|
||||
177243820422534: 1783655618221483,
|
||||
17725113282251: 1783655618221482,
|
||||
177322471322207: 1783655620221489,
|
||||
177322471322208: 1783655619221488,
|
||||
177328570522328: 1783655617221477,
|
||||
177328593622153: 1783655617221478,
|
||||
177528018022662: 1783655615221469,
|
||||
17776912892222: 1783655615221468,
|
||||
177830887822245: 1783655623221511,
|
||||
177857557522194: 1783655614221453,
|
||||
17786606752211879: 1783655614221452,
|
||||
1780019613224672: 178364625622332,
|
||||
17815417862237: 1783655615221465,
|
||||
1783567962221199: 1783646592221185,
|
||||
178357784822717: 1783592931221880,
|
||||
}
|
||||
case 3:
|
||||
i := 1
|
||||
skuIdOffset := 0
|
||||
param := &ebaiapi.SkuListParams{
|
||||
Page: 1,
|
||||
SkuIdOffset: skuIdOffset,
|
||||
}
|
||||
foodListData := make([]*ebaiapi.SkuInfo, 0, 0)
|
||||
|
||||
for {
|
||||
// 同步商品
|
||||
fromFoodList, err1 := api.SkuList(utils.Int2Str(fromStore.ID), &ebaiapi.SkuListParams{
|
||||
Page: i,
|
||||
})
|
||||
if len(fromFoodList.List) == 0 || fromFoodList == nil {
|
||||
return nil, fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i)
|
||||
fromFoodList, _ := api.SkuList(utils.Int2Str(fromStore.ID), param)
|
||||
foodListData = append(foodListData, fromFoodList.List...)
|
||||
param.Page += 1
|
||||
skuIdOffset = fromFoodList.SkuIdOffset
|
||||
if len(fromFoodList.List) < 100 {
|
||||
break
|
||||
}
|
||||
errList := BatchInitSkuEBai2EBai(ctx, fromFoodList.List, api, utils.Int2Str(toStore.ID), VendorCategoryIDMap)
|
||||
if errList != nil {
|
||||
for _, verr := range errList {
|
||||
errListData = append(errListData, verr.Error())
|
||||
}
|
||||
globals.SugarLogger.Debugf("BatchInitData : %s", utils.Format4Output(errList, false))
|
||||
}
|
||||
|
||||
errList := BatchInitSkuEBai2EBai(ctx, foodListData, api, utils.Int2Str(toStore.ID), VendorCategoryIDMap)
|
||||
if errList != nil {
|
||||
for _, verr := range errList {
|
||||
errListData = append(errListData, verr.Error())
|
||||
}
|
||||
i = i + 1
|
||||
globals.SugarLogger.Debugf("BatchInitData : %s", utils.Format4Output(errList, false))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -168,7 +224,7 @@ func CopyEBaiToEBai(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail,
|
||||
// BatchInitSkuEBai2EBai 批量创建商品
|
||||
func BatchInitSkuEBai2EBai(ctx *jxcontext.Context, fromSku []*ebaiapi.SkuInfo, toApi *ebaiapi.API, storeID string, VendorCategoryIDMap map[int64]int64) []error {
|
||||
var errList = make([]error, 0, 0)
|
||||
for _, storeSku := range fromSku {
|
||||
for k, storeSku := range fromSku {
|
||||
params := map[string]interface{}{
|
||||
"left_num": model.MaxStoreSkuStockQty,
|
||||
"weight": storeSku.Weight,
|
||||
@@ -178,8 +234,8 @@ func BatchInitSkuEBai2EBai(ctx *jxcontext.Context, fromSku []*ebaiapi.SkuInfo, t
|
||||
params["upc"] = storeSku.Upc
|
||||
params["name"] = storeSku.Name
|
||||
params["cat3_id"] = storeSku.CateId
|
||||
params["category_id"] = VendorCategoryIDMap[utils.Str2Int64(storeSku.CustomCatList[0].CustomCatID)]
|
||||
params["rtf"] = storeSku.Rtf
|
||||
params["category_id"] = VendorCategoryIDMap[utils.Str2Int64(storeSku.CustomCatIDs)]
|
||||
params["desc"] = storeSku.Desc
|
||||
params["left_num"] = storeSku.LeftNum
|
||||
params["process_type"] = storeSku.ProcessType
|
||||
params["process_detail"] = storeSku.ProcessDetail
|
||||
@@ -194,10 +250,12 @@ func BatchInitSkuEBai2EBai(ctx *jxcontext.Context, fromSku []*ebaiapi.SkuInfo, t
|
||||
if customSkuID == "" {
|
||||
customSkuID = utils.Int64ToStr(storeSku.SkuId)
|
||||
}
|
||||
_, err := toApi.SkuCreate(ctx.GetTrackInfo(), storeID, utils.Str2Int64(storeSku.CustomSkuID), params)
|
||||
_, err := toApi.SkuCreate(ctx.GetTrackInfo(), storeID, storeSku.CustomSkuID, params)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("---------name := %s-err := %s", storeSku.Name, err.Error())
|
||||
errList = append(errList, err)
|
||||
}
|
||||
globals.SugarLogger.Debugf("---------k := %d,%s", k, storeSku.Name)
|
||||
}
|
||||
|
||||
return errList
|
||||
|
||||
@@ -208,11 +208,12 @@ func Init() {
|
||||
"05:00:00",
|
||||
})
|
||||
|
||||
ScheduleTimerFunc("UpdateMtActivityInfo", func() {
|
||||
bidding.GetMTInfo()
|
||||
}, []string{
|
||||
"13:00:00",
|
||||
})
|
||||
// 更新美团店铺信息
|
||||
//ScheduleTimerFunc("UpdateMtActivityInfo", func() {
|
||||
// bidding.GetMTInfo()
|
||||
//}, []string{
|
||||
// "13:00:00",
|
||||
//})
|
||||
/// 更新淘鲜达结算信息
|
||||
//ScheduleTimerFunc("UpdateTaoTotalMoney", func() {
|
||||
// orderman.UpdateTaoSettleInfo()
|
||||
@@ -503,6 +504,10 @@ func Init() {
|
||||
ScheduleTimerFunc("AutoSaleStoreSku", func() {
|
||||
cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, true)
|
||||
}, autoSaleStoreSkuTimeList)
|
||||
// 删除图片(定时任务删除门店老板上传美团订单拣货图片)
|
||||
ScheduleTimerFunc("DeleteOrderUploadImg", func() {
|
||||
cms.DeleteOrderUploadImg()
|
||||
}, createStorePriceTimeList)
|
||||
|
||||
// 菜市无聊信息同步到果园
|
||||
if beego.BConfig.RunMode == model.ServerTypeFruits {
|
||||
|
||||
@@ -383,7 +383,7 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
|
||||
}
|
||||
|
||||
func IsRoled(ctx *jxcontext.Context) bool {
|
||||
if ctx.GetUserName() != "jxadmin" {
|
||||
if ctx.GetUserName() != "jxadmin" && ctx.GetUserName() != "shifengfix" {
|
||||
userRole, _ := dao.GetUserRole(dao.GetDB(), []string{ctx.GetUserID()}, nil)
|
||||
for _, v := range userRole {
|
||||
if v.RoleID == model.YES {
|
||||
|
||||
@@ -360,7 +360,6 @@ func IntCoordinate2MarsStandard(gpsLng, gpsLat int, coordinateType int) (marsLng
|
||||
Type: coordSys,
|
||||
})
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("--TencentCoordinateChange err := %v", err)
|
||||
return marsLng, marsLat, nil
|
||||
}
|
||||
|
||||
@@ -1130,7 +1129,6 @@ func MixWatermarkImg(imgWatermark, img string, exPrefixBegin, exPrefixEnd *time.
|
||||
} else {
|
||||
imgUrl = img + "?imageView2/0/q/75|watermark/1/image/" + baseURL + "/dissolve/100/gravity/Center/dx/0/dy/0"
|
||||
}
|
||||
globals.SugarLogger.Debugf("---imgUrl := %s", imgUrl)
|
||||
if resBinary, _, err := DownloadFileByURL(imgUrl); err == nil {
|
||||
downloadURL, err := UploadExportContent(resBinary, utils.Int64ToStr(time.Now().Unix())+img[strings.LastIndex(img, "/")+1:len(img)])
|
||||
if err == nil {
|
||||
|
||||
@@ -62,3 +62,58 @@ func GetStatistics(db *DaoDB, startTime, endTime time.Time, storeId []int, offse
|
||||
|
||||
return pageInfo, err
|
||||
}
|
||||
|
||||
type StatisticsOrderObj struct {
|
||||
OrderCount int64 `json:"order_count"`
|
||||
StoreCount int64 `json:"store_count"`
|
||||
Name string `json:"name"`
|
||||
Mobile string `json:"mobile"`
|
||||
}
|
||||
|
||||
// StatisticsOrderCount 统计负责人订单量
|
||||
func StatisticsOrderCount(db *DaoDB, startTime, endTime time.Time, storeId []int, vendorId []int, offset, pageSize int) (pageInfo *model.PagedInfo, err error) {
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS
|
||||
COUNT(a.vendor_order_id) AS order_count,
|
||||
COUNT(DISTINCT b.id) AS store_count,
|
||||
c.name AS name,
|
||||
c.mobile AS mobile
|
||||
FROM goods_order a
|
||||
LEFT JOIN store b ON IF(a.store_id = 0, a.jx_store_id, a.store_id) = b.id
|
||||
LEFT JOIN user c ON c.mobile = b.market_man_phone
|
||||
WHERE 1 = 1
|
||||
`
|
||||
param := []interface{}{}
|
||||
if !utils.IsTimeZero(startTime) {
|
||||
sql += ` AND a.order_created_at >= ?`
|
||||
param = append(param, startTime)
|
||||
}
|
||||
if !utils.IsTimeZero(endTime) {
|
||||
sql += ` AND a.order_created_at <= ?`
|
||||
param = append(param, endTime)
|
||||
}
|
||||
if len(storeId) > 0 {
|
||||
sql += " AND IF(a.store_id <> '', a.store_id, a.jx_store_id) IN (" + dao.GenQuestionMarks(len(storeId)) + ")"
|
||||
param = append(param, storeId)
|
||||
}
|
||||
if len(vendorId) != 0 {
|
||||
sql += " AND a.vendor_id IN (" + dao.GenQuestionMarks(len(vendorId)) + ")"
|
||||
param = append(param, vendorId)
|
||||
}
|
||||
|
||||
sql += ` AND a.status = 110 `
|
||||
sql += ` GROUP BY c.mobile,c.name ORDER BY order_count desc LIMIT ? OFFSET ?`
|
||||
param = append(param, jxutils.FormalizePageSize(pageSize), offset)
|
||||
|
||||
txDB, _ := Begin(db)
|
||||
defer Commit(db, txDB)
|
||||
var msgList []*StatisticsOrderObj
|
||||
if err = GetRowsTx(txDB, &msgList, sql, param...); err == nil {
|
||||
pageInfo = &model.PagedInfo{
|
||||
TotalCount: GetLastTotalRowCount2(db, txDB),
|
||||
Data: msgList,
|
||||
}
|
||||
}
|
||||
return pageInfo, err
|
||||
|
||||
}
|
||||
|
||||
@@ -702,10 +702,6 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
|
||||
}
|
||||
sql = fmt.Sprintf(sql, fmtParams...)
|
||||
sql += " ORDER BY t1.price"
|
||||
if storeID == 669148 {
|
||||
globals.SugarLogger.Debugf("----------sql := %s", sql)
|
||||
globals.SugarLogger.Debugf("----------sqlParams := %s", utils.Format4Output(sqlParams, false))
|
||||
}
|
||||
if err = GetRows(db, &skus, sql, sqlParams...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -149,22 +149,23 @@ type GoodsOrder struct {
|
||||
OrderFinishedAt time.Time `orm:"type(datetime)" json:"orderFinishedAt"`
|
||||
StatusTime time.Time `orm:"type(datetime)" json:"statusTime"` // last status time
|
||||
PickDeadline time.Time `orm:"type(datetime);null" json:"pickDeadline"`
|
||||
DeliveryFeeFrom *time.Time `orm:"type(datetime);null" json:"deliveryFeeFrom,omitempty"` // 三方配置费计算的开始基准时间
|
||||
Flag int `json:"flag"` // 非运单调整相关的其它状态
|
||||
InvoiceTitle string `orm:"size(64)" json:"invoiceTitle"` // 发票抬头
|
||||
InvoiceTaxerID string `orm:"size(32);column(invoice_taxer_id)" json:"invoiceTaxerID"` // 发票纳税人识别码
|
||||
InvoiceEmail string `orm:"size(64)" json:"invoiceEmail"` // 发票邮箱
|
||||
VendorOrgCode string `orm:"size(64)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
||||
FromStoreID int `orm:"column(from_store_id)" json:"fromStoreID"` // 物料配送门店
|
||||
EclpOutID string `orm:"column(eclp_out_id)" json:"eclpOutID"` // 物料配送的出库单号
|
||||
AddressID int64 `orm:"column(address_id)" json:"addressID"` // 配送地址ID
|
||||
EarningType int `json:"earningType"` // 订单结算方式,2为扣点,1为报价
|
||||
OrderType int `json:"orderType"` // 订单类型,0为普通订单,1为物料订单,2为进货订单
|
||||
OrderPayPercentage int `json:"orderPayPercentage"` // 调价包?
|
||||
CouponIDs string `orm:"column(coupon_ids)" json:"couponIDs"` // 优惠券IDs(京西商城)
|
||||
NotifyType int `json:"notifyType"` // 0表示没有通知,1表示发的短信,2表示发的语音
|
||||
PhoneAscription string `orm:"column(phone_ascription)" json:"phoneAscription"` // 电话号码归属地,{代表抖音号码归宿地[yes-四川成都]}
|
||||
PackagePrice int `orm:"size(8);column(package_price);default(0)" json:"packagePrice"` // 门店包装袋金额
|
||||
DeliveryFeeFrom *time.Time `orm:"type(datetime);null" json:"deliveryFeeFrom,omitempty"` // 三方配置费计算的开始基准时间
|
||||
Flag int `json:"flag"` // 非运单调整相关的其它状态
|
||||
InvoiceTitle string `orm:"size(64)" json:"invoiceTitle"` // 发票抬头
|
||||
InvoiceTaxerID string `orm:"size(32);column(invoice_taxer_id)" json:"invoiceTaxerID"` // 发票纳税人识别码
|
||||
InvoiceEmail string `orm:"size(64)" json:"invoiceEmail"` // 发票邮箱
|
||||
VendorOrgCode string `orm:"size(64)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
||||
FromStoreID int `orm:"column(from_store_id)" json:"fromStoreID"` // 物料配送门店
|
||||
EclpOutID string `orm:"column(eclp_out_id)" json:"eclpOutID"` // 物料配送的出库单号
|
||||
AddressID int64 `orm:"column(address_id)" json:"addressID"` // 配送地址ID
|
||||
EarningType int `json:"earningType"` // 订单结算方式,2为扣点,1为报价
|
||||
OrderType int `json:"orderType"` // 订单类型,0为普通订单,1为物料订单,2为进货订单
|
||||
OrderPayPercentage int `json:"orderPayPercentage"` // 调价包?
|
||||
CouponIDs string `orm:"column(coupon_ids)" json:"couponIDs"` // 优惠券IDs(京西商城)
|
||||
NotifyType int `json:"notifyType"` // 0表示没有通知,1表示发的短信,2表示发的语音
|
||||
PhoneAscription string `orm:"column(phone_ascription)" json:"phoneAscription"` // 电话号码归属地,{代表抖音号码归宿地[yes-四川成都]}
|
||||
PackagePrice int `orm:"size(8);column(package_price);default(0)" json:"packagePrice"` // 门店包装袋金额
|
||||
ForceRequirePicture int `orm:"size(4);column(force_require_picture);default(0)" json:"forceRequirePicture"` // 是否强制返图1需要0不需要
|
||||
// 以下只是用于传递数据
|
||||
OriginalData string `orm:"-" json:"-"`
|
||||
Skus []*OrderSku `orm:"-" json:"-"`
|
||||
@@ -193,6 +194,21 @@ func (o *GoodsOrderOriginal) TableUnique() [][]string {
|
||||
}
|
||||
}
|
||||
|
||||
// GoodsOrderImg 订单图片上传记录
|
||||
type GoodsOrderImg struct {
|
||||
ID int64 `orm:"column(id)" json:"-"`
|
||||
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
|
||||
VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
OriginalData string `orm:"type(text)" json:"-"`
|
||||
}
|
||||
|
||||
func (o *GoodsOrderImg) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"CreatedAt"},
|
||||
}
|
||||
}
|
||||
|
||||
type OrderSku struct {
|
||||
ID int64 `orm:"column(id)" json:"id"`
|
||||
VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
|
||||
|
||||
@@ -47,6 +47,7 @@ var (
|
||||
102114997: true,
|
||||
102641826: true,
|
||||
102651220: true,
|
||||
156976863: true,
|
||||
// 果园啊
|
||||
6572945: true,
|
||||
6772759: true,
|
||||
|
||||
@@ -339,8 +339,6 @@ func ReadMsgFromVendor(vendorID int, elmAppID string, msg []byte) error {
|
||||
SendType: SendTypeJd,
|
||||
MsgContent: risMsg,
|
||||
}
|
||||
globals.SugarLogger.Debugf("-----rismsg2 := %s", utils.Format4Output(risMsg, false))
|
||||
globals.SugarLogger.Debugf("-----elmAppID := %s", elmAppID)
|
||||
systemMsg, userMsg, readMsg, err = jdapi.ImMsgChange(risMsg, elmAppID)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -351,6 +349,7 @@ func ReadMsgFromVendor(vendorID int, elmAppID string, msg []byte) error {
|
||||
}
|
||||
switch elmAppID {
|
||||
case jdapi.ImCallbackRisMsg:
|
||||
return nil
|
||||
userList.UserID = systemMsg.From.Pin
|
||||
userList.LatestTime = int(systemMsg.Timestamp)
|
||||
userList.LatestMsg = "暂无"
|
||||
@@ -359,8 +358,9 @@ func ReadMsgFromVendor(vendorID int, elmAppID string, msg []byte) error {
|
||||
userList.LatestTime = int(userMsg.Timestamp)
|
||||
userList.LatestMsg = userMsg.Body.Content
|
||||
case jdapi.ImCallbackReadMsg:
|
||||
return nil
|
||||
userList.UserID = readMsg.From.Pin
|
||||
userList.LatestTime = int(userMsg.Timestamp)
|
||||
userList.LatestTime = int(readMsg.Timestamp)
|
||||
userList.LatestMsg = "暂无"
|
||||
}
|
||||
vendorStoreID = risMsg.StoreId
|
||||
|
||||
@@ -64,7 +64,7 @@ type IPurchasePlatformOrderHandler interface {
|
||||
|
||||
GetOrderRealMobile(ctx *jxcontext.Context, order *model.GoodsOrder) (mobile string, err error)
|
||||
ReplyOrderComment(ctx *jxcontext.Context, vendorOrgCode string, orderComment *model.OrderComment, replyComment string) (err error)
|
||||
AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error)
|
||||
AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string, refundParam interface{}) (err error)
|
||||
CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string) (err error)
|
||||
// order.Skus要包含原始订单中的Sku信息,removedSkuList中是要移除的Sku信息
|
||||
AdjustOrder(ctx *jxcontext.Context, order *model.GoodsOrder, removedSkuList []*model.OrderSku, reason string) (err error)
|
||||
@@ -75,7 +75,7 @@ type IPurchasePlatformOrderHandler interface {
|
||||
// 发起部分退款
|
||||
PartRefundOrder(ctx *jxcontext.Context, order *model.GoodsOrder, refundSkuList []*model.OrderSku, reason string) (err error)
|
||||
// 审核售后单申请
|
||||
AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error)
|
||||
AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error)
|
||||
// // 确认收到退货
|
||||
ConfirmReceivedReturnGoods(ctx *jxcontext.Context, order *model.AfsOrder) (err error)
|
||||
//获取自提单取货码
|
||||
|
||||
@@ -173,6 +173,8 @@ type IPurchasePlatformStoreSkuHandler interface {
|
||||
|
||||
// UploadInvoice 发票回复
|
||||
UploadInvoice(param *model.InvoiceMsg, base64 string) ([]string, []string, error)
|
||||
// UploadPickingImg 上传订单拣货图片
|
||||
UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error
|
||||
}
|
||||
|
||||
type ISingleStoreStoreSkuHandler interface {
|
||||
|
||||
@@ -47,16 +47,18 @@ func (p *PurchaseHandler) InvoiceApply(msg *ebaiapi.CallbackMsg) (response *ebai
|
||||
if err := utils.Map2StructByJson(msg.Body, invoice, false); err != nil {
|
||||
return api.EbaiAPI.Err2CallbackResponse(msg.Cmd, err, msg.Cmd)
|
||||
}
|
||||
orderId = utils.Int64ToStr(invoice.OrderList[0].OrderId)
|
||||
invoiceData, _ := dao.GetInvoiceInfo(db, utils.Int64ToStr(invoice.OrderList[0].OrderId))
|
||||
orderId = invoice.OrderList[0].OrderId
|
||||
invoiceData, _ := dao.GetInvoiceInfo(db, orderId)
|
||||
applyNo = invoice.ApplicationNo
|
||||
storeId = invoice.ShopId
|
||||
vendorStoreId = invoice.BaiduShopId
|
||||
localOrder, _ := partner.CurOrderManager.LoadOrder(orderId, model.VendorIDEBAI)
|
||||
|
||||
if invoiceData == nil {
|
||||
invoiceObj := model.InvoiceMsg{
|
||||
invoiceObj := &model.InvoiceMsg{
|
||||
ModelIDCUL: model.ModelIDCUL{},
|
||||
OrderId: utils.Int64ToStr(invoice.OrderList[0].OrderId),
|
||||
StoreID: utils.Str2Int(invoice.ShopId),
|
||||
OrderId: orderId,
|
||||
StoreID: localOrder.JxStoreID,
|
||||
VendorID: model.VendorIDEBAI,
|
||||
InvoiceTaskId: invoice.ApplicationNo,
|
||||
Status: invoice.Status,
|
||||
@@ -74,7 +76,7 @@ func (p *PurchaseHandler) InvoiceApply(msg *ebaiapi.CallbackMsg) (response *ebai
|
||||
InvoiceId: "",
|
||||
}
|
||||
if len(invoice.OrderList) > 1 {
|
||||
orderList := make(map[int64]float64, 0)
|
||||
orderList := make(map[string]float64, 0)
|
||||
for _, v := range invoice.OrderList {
|
||||
orderList[v.OrderId] = v.InvoiceAmount
|
||||
}
|
||||
|
||||
@@ -805,7 +805,7 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
return mobile, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool, reason string, refundParam interface{}) (err error) {
|
||||
if globals.EnableEbaiStoreWrite {
|
||||
param := &ebaiapi.RefundOrderExamine{
|
||||
ReverseOrderId: "",
|
||||
@@ -1093,3 +1093,8 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
||||
}
|
||||
return result.SuccessfulApplicationNoList, result.FailedApplicationNoList, nil
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ func (c *PurchaseHandler) callbackAfsMsg2Status(msg *ebaiapi.CallbackMsg) (order
|
||||
}
|
||||
|
||||
// 审核售后单申请 退货退款
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
if globals.EnableEbaiStoreWrite {
|
||||
param := &ebaiapi.RefundOrderExamine{
|
||||
ReverseOrderId: order.AfsOrderID,
|
||||
|
||||
@@ -932,7 +932,7 @@ func BathUpdateInvoiceSetting(baiDuStoreId string, setting *ebaiapi.StoreInvoice
|
||||
}
|
||||
|
||||
// QueryUnansweredInvoice 查询门店未回复发票信息
|
||||
func QueryUnansweredInvoice(baiDuStoreId string, jxStoreId int) (*ebaiapi.QueryUnansweredInvoiceResult, error) {
|
||||
func QueryUnansweredInvoice(baiDuStoreId string, jxStoreId int) (*ebaiapi.QueryUnansweredInvoiceResult2, error) {
|
||||
var db = dao.GetDB()
|
||||
unansweredList, err := api.EbaiAPI.QueryUnansweredInvoice(baiDuStoreId)
|
||||
if err != nil {
|
||||
@@ -950,7 +950,7 @@ func QueryUnansweredInvoice(baiDuStoreId string, jxStoreId int) (*ebaiapi.QueryU
|
||||
invoiceDataMap[unansweredList.RecordList[i].ApplicationNo].Status = model.InvoiceStatusInit
|
||||
dao.UpdateEntity(db, invoiceDataMap[unansweredList.RecordList[i].ApplicationNo], "Status")
|
||||
} else {
|
||||
invoiceObj := model.InvoiceMsg{
|
||||
invoiceObj := &model.InvoiceMsg{
|
||||
ModelIDCUL: model.ModelIDCUL{},
|
||||
OrderId: utils.Int64ToStr(unansweredList.RecordList[i].OrderList[0].OrderId),
|
||||
StoreID: utils.Str2Int(unansweredList.RecordList[i].ShopId),
|
||||
|
||||
@@ -270,18 +270,18 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
||||
var (
|
||||
vendorSkuID int64
|
||||
isExd bool = false
|
||||
customSkuID int64
|
||||
customSkuID string
|
||||
)
|
||||
if strings.Contains(storeSku.StoreName, model.ExdStoreName) {
|
||||
isExd = true
|
||||
if storeSku.ExdSkuID == "" {
|
||||
customSkuID = 0
|
||||
customSkuID = ""
|
||||
} else {
|
||||
customSkuID = utils.Str2Int64(storeSku.ExdSkuID)
|
||||
customSkuID = storeSku.ExdSkuID
|
||||
}
|
||||
} else {
|
||||
isExd = false
|
||||
customSkuID = int64(storeSku.SkuID)
|
||||
customSkuID = utils.Int2Str(storeSku.SkuID)
|
||||
}
|
||||
|
||||
params := genSkuParamsFromStoreSkuInfo2(storeSku, true, true)
|
||||
|
||||
@@ -318,7 +318,7 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
return mobile, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string, refundParam interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -359,3 +359,8 @@ func (c *PurchaseHandler) ApplyCompensationOrder(order *model.GoodsOrder) (strin
|
||||
func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg) ([]string, []string, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
return mobile, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string, refundParam interface{}) (err error) {
|
||||
if globals.EnableJdStoreWrite {
|
||||
err = getAPI(order.VendorOrgCode).OrderCancelOperate(order.VendorOrderID, isAgree, ctx.GetUserName(), reason)
|
||||
}
|
||||
@@ -734,3 +734,8 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
||||
|
||||
return nil, nil, getAPI(order.VendorOrgCode).UploadBlueTicket(blue)
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ func (c *PurchaseHandler) buildAfsOrder(afsInfo *jdapi.AfsServiceResponse) (afsO
|
||||
}
|
||||
|
||||
// 审核售后单申请
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
if globals.EnableJdStoreWrite {
|
||||
err = getAPI(order.VendorOrgCode).AfsOpenApprove(order.AfsOrderID, afsApproveTypeMap[approveType], reason, ctx.GetUserName())
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ func (p *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
func (p *PurchaseHandler) ReplyOrderComment(ctx *jxcontext.Context, vendorOrgCode string, orderComment *model.OrderComment, replyComment string) (err error) {
|
||||
return err
|
||||
}
|
||||
func (p *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (p *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string,refundParam interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
func (p *PurchaseHandler) CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string) (err error) {
|
||||
@@ -348,3 +348,8 @@ func (c *PurchaseHandler) ApplyCompensationOrder(order *model.GoodsOrder) (strin
|
||||
func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string) ([]string, []string, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
)
|
||||
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, afsOrder *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, afsOrder *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
var status int
|
||||
if approveType == partner.AfsApproveTypeRefused {
|
||||
status = model.AfsOrderStatusFailed
|
||||
|
||||
@@ -1575,7 +1575,7 @@ func MarkArrears(db *dao.DaoDB, order *model.GoodsOrder, orderPay *model.OrderPa
|
||||
}
|
||||
}
|
||||
|
||||
func AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string,refundParam interface{}) (err error) {
|
||||
if isAgree {
|
||||
err = CancelOrder(ctx, order, reason)
|
||||
} else {
|
||||
|
||||
@@ -95,10 +95,10 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
return mobile, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string, refundParam interface{}) (err error) {
|
||||
if model.IsOrderJXTemp(order) {
|
||||
} else {
|
||||
err = localjx.AgreeOrRefuseCancel(ctx, order, isAgree, reason)
|
||||
err = localjx.AgreeOrRefuseCancel(ctx, order, isAgree, reason, nil)
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -176,3 +176,8 @@ func (c *PurchaseHandler) ApplyCompensationOrder(order *model.GoodsOrder) (strin
|
||||
func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg) ([]string, []string, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
// 审核售后单申请
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
var status int
|
||||
if approveType == partner.AfsApproveTypeRefused {
|
||||
status = model.AfsOrderStatusFailed
|
||||
|
||||
@@ -188,6 +188,13 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
||||
if openUID > 0 {
|
||||
order.VendorUserID = utils.Int64ToStr(openUID)
|
||||
}
|
||||
|
||||
// 当此数值为1时需要强制返图
|
||||
if utils.MustInterface2Int64(result["force_require_picture"]) == 1 {
|
||||
order.ForceRequirePicture = 1
|
||||
} else {
|
||||
order.ForceRequirePicture = 0
|
||||
}
|
||||
// 不设置最晚拣货时间,以缺省值为准
|
||||
// if utils.IsTimeZero(order.PickDeadline) && !utils.IsTimeZero(order.StatusTime) {
|
||||
// order.PickDeadline = order.StatusTime.Add(pickupOrderDelay) // 美团外卖要求在5分钟内拣货,不然订单会被取消
|
||||
@@ -328,7 +335,6 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
||||
}
|
||||
order.CouponIDs = strings.Join(tagListStr, ",")
|
||||
}
|
||||
|
||||
// 包装袋金额
|
||||
store, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), order.VendorStoreID, model.VendorIDMTWM, order.VendorOrgCode)
|
||||
if store != nil {
|
||||
@@ -759,13 +765,20 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
return mobile, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string, refundParam interface{}) (err error) {
|
||||
if globals.EnableMtwmStoreWrite {
|
||||
if isAgree {
|
||||
err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").OrderRefundAgree(utils.Str2Int64(order.VendorOrderID), reason)
|
||||
} else {
|
||||
err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").OrderRefundReject(utils.Str2Int64(order.VendorOrderID), reason)
|
||||
var mtParam *mtwmapi.ReviewAfterSalesInfo
|
||||
data, _ := json.Marshal(refundParam)
|
||||
if err = json.Unmarshal(data, &mtParam); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").ReviewAfterSales(mtParam)
|
||||
//if isAgree {
|
||||
// err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").OrderRefundAgree(utils.Str2Int64(order.VendorOrderID), reason)
|
||||
//} else {
|
||||
// err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").OrderRefundReject(utils.Str2Int64(order.VendorOrderID), reason)
|
||||
//}
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -1075,3 +1088,13 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
||||
|
||||
return nil, nil, getAPI(goodsOrder.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(goodsOrder), goodsOrder.VendorStoreID).UploadInvoice(param.OrderId, param.InvoiceUrl, param.InvoiceId, param.InvoiceTaskId)
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), order.VendorStoreID).UploadMediaToOrder(order.VendorOrderID, imgList)
|
||||
}
|
||||
|
||||
func GetVendorDetail(order *model.GoodsOrder) (map[string]interface{}, error) {
|
||||
result, err := getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), order.VendorStoreID).OrderGetOrderDetail(utils.Str2Int64(order.VendorOrderID), true)
|
||||
return result, err
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package mtwm
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
@@ -40,8 +39,20 @@ var (
|
||||
mtwmapi.NotifyTypeCancelRefund: model.AfsOrderStatusFailed,
|
||||
mtwmapi.NotifyTypeCancelRefundComplaint: model.AfsOrderStatusFailed,
|
||||
}
|
||||
globalAfsChan = make(chan *mtwmapi.CallbackMsg, 1000)
|
||||
)
|
||||
|
||||
func init() {
|
||||
// 单协程串行处理所有售后消息,天然有序,无并发冲突
|
||||
go func() {
|
||||
for msg := range globalAfsChan {
|
||||
jxutils.CallMsgHandlerAsync(func() {
|
||||
_ = CurPurchaseHandler.onAfsOrderMsg(msg)
|
||||
}, jxutils.ComposeUniversalOrderID(GetOrderIDFromMsg(msg), model.VendorIDMTWM))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) isAfsMsg(msg *mtwmapi.CallbackMsg) bool {
|
||||
if msg.Cmd == mtwmapi.MsgTypeOrderRefund || msg.Cmd == mtwmapi.MsgTypeOrderPartialRefund {
|
||||
// refundData := msg.Data.(*mtwmapi.CallbackRefundInfo)
|
||||
@@ -55,13 +66,19 @@ func (c *PurchaseHandler) isAfsMsg(msg *mtwmapi.CallbackMsg) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// 回调函数简化
|
||||
func (c *PurchaseHandler) OnAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwmapi.CallbackResponse) {
|
||||
jxutils.CallMsgHandlerAsync(func() {
|
||||
retVal = c.onAfsOrderMsg(msg)
|
||||
}, jxutils.ComposeUniversalOrderID(GetOrderIDFromMsg(msg), model.VendorIDMTWM))
|
||||
return retVal
|
||||
globalAfsChan <- msg
|
||||
return mtwmapi.Err2CallbackResponse(nil, "")
|
||||
}
|
||||
|
||||
//func (c *PurchaseHandler) OnAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwmapi.CallbackResponse) {
|
||||
// jxutils.CallMsgHandlerAsync(func() {
|
||||
// retVal = c.onAfsOrderMsg(msg)
|
||||
// }, jxutils.ComposeUniversalOrderID(GetOrderIDFromMsg(msg), model.VendorIDMTWM))
|
||||
// return retVal
|
||||
//}
|
||||
|
||||
// todo 对于退款与部分退款,order.go与这个文件中对于状态的处理不一致
|
||||
func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwmapi.CallbackResponse) {
|
||||
var (
|
||||
@@ -354,15 +371,22 @@ func (c *PurchaseHandler) GetAfsStatusFromVendorStatus(resType int, notifyType s
|
||||
}
|
||||
|
||||
// 审核售后单申请
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
if globals.EnableMtwmStoreWrite {
|
||||
if approveType == partner.AfsApproveTypeRefused {
|
||||
err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromAfsOrder(order), order.VendorStoreID).OrderRefundReject(utils.Str2Int64(order.VendorOrderID), reason)
|
||||
} else if approveType == partner.AfsApproveTypeRefusedToRefundMoney {
|
||||
return errors.New("此平台暂时不支持")
|
||||
} else {
|
||||
err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromAfsOrder(order), order.VendorStoreID).OrderRefundAgree(utils.Str2Int64(order.VendorOrderID), reason)
|
||||
globals.SugarLogger.Debugf("-----AgreeOrRefuseRefund review:= %s", utils.Format4Output(review, false))
|
||||
var param *mtwmapi.ReviewAfterSalesInfo
|
||||
if err = utils.Map2StructByJson(review, ¶m, false); err != nil {
|
||||
return err
|
||||
}
|
||||
globals.SugarLogger.Debugf("-----AgreeOrRefuseRefund:= %s", utils.Format4Output(param, false))
|
||||
err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromAfsOrder(order), order.VendorStoreID).ReviewAfterSales(param)
|
||||
//if approveType == partner.AfsApproveTypeRefused {
|
||||
// err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromAfsOrder(order), order.VendorStoreID).OrderRefundReject(utils.Str2Int64(order.VendorOrderID), reason)
|
||||
//} else if approveType == partner.AfsApproveTypeRefusedToRefundMoney {
|
||||
// return errors.New("此平台暂时不支持")
|
||||
//} else {
|
||||
// err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromAfsOrder(order), order.VendorStoreID).OrderRefundAgree(utils.Str2Int64(order.VendorOrderID), reason)
|
||||
//}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -341,6 +341,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
} else {
|
||||
syncType = "更新商品"
|
||||
}
|
||||
|
||||
for i, storeSku := range storeSkuList {
|
||||
isNeedUpdatePrice := isCreate //storeSku.SkuSyncStatus&(model.SyncFlagPriceMask|model.SyncFlagNewMask) != 0
|
||||
foodData := make(map[string]interface{})
|
||||
@@ -399,7 +400,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
// img5 = storeSku.Img
|
||||
//}
|
||||
if storeSku.ImgMix != "" && ((storeSku.BrandID == storeSku.ExBrandID && storeSku.ExBrandID != 0) || storeSku.ExBrandID == 0) {
|
||||
foodData["picture"] = strings.Join(jxutils.BatchString2Slice(storeSku.ImgMix, img2, img3, img4, img5), ",")
|
||||
foodData["picture"] = strings.Join(jxutils.BatchString2Slice(storeSku.ImgMix, storeSku.Img, img2, img3, img4, img5), ",")
|
||||
} else {
|
||||
foodData["picture"] = strings.Join(jxutils.BatchString2Slice(storeSku.Img, img2, img3, img4, img5), ",")
|
||||
}
|
||||
@@ -469,6 +470,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
api := getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID)
|
||||
if globals.EnableMtwmStoreWrite {
|
||||
if len(foodDataList) == 1 {
|
||||
|
||||
@@ -659,7 +659,7 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
return mobile, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string,refundParam interface{}) (err error) {
|
||||
|
||||
db := dao.GetDB()
|
||||
afsOrder, err := partner.CurOrderManager.LoadAfsOrder(order.VendorOrderID, order.VendorID)
|
||||
@@ -1003,3 +1003,8 @@ func (c *PurchaseHandler) ApplyCompensationOrder(order *model.GoodsOrder) (strin
|
||||
func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string) ([]string, []string, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ func (c *PurchaseHandler) GetAfsStatusFromVendorStatus(notifyType string) int {
|
||||
}
|
||||
|
||||
// 审核售后单申请
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
db := dao.GetDB()
|
||||
if approveType == partner.AfsApproveTypeRefused {
|
||||
param := &request3156.AlibabaTclsAelophyRefundDisagreeRequest{
|
||||
|
||||
@@ -746,7 +746,7 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
}
|
||||
|
||||
// AgreeOrRefuseCancel 同意或拒绝(退款)
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string, refundParam interface{}) (err error) {
|
||||
afsOrder, err := partner.CurOrderManager.LoadAfsOrder(order.VendorOrderID, order.VendorID)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -1121,3 +1121,8 @@ func (c *PurchaseHandler) ApplyCompensationOrder(order *model.GoodsOrder) (strin
|
||||
func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string) ([]string, []string, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ var (
|
||||
)
|
||||
|
||||
// AgreeOrRefuseRefund todo 审核售后单申请 退货退款(同意退货,确认收货之后会自动退款) 审核售后有点问题
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
tiktokApi := getAPI(order.VendorOrgCode, order.JxStoreID, "")
|
||||
//afsOrderDetail, err := tiktokApi.QueryAfsOrderDetail(order.AfsOrderID, false)
|
||||
//if err != nil {
|
||||
|
||||
@@ -286,7 +286,7 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
return mobile, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string,refundParam interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -322,3 +322,8 @@ func (c *PurchaseHandler) GetOrderSettleAccounts(order *model.GoodsOrder) (int64
|
||||
func (c *PurchaseHandler) ApplyCompensationOrder(order *model.GoodsOrder) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
// 审核售后单申请
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ func (p *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
||||
func (p *PurchaseHandler) ReplyOrderComment(ctx *jxcontext.Context, vendorOrgCode string, orderComment *model.OrderComment, replyComment string) (err error) {
|
||||
return err
|
||||
}
|
||||
func (p *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error) {
|
||||
func (p *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string, refundParam interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
func (p *PurchaseHandler) CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string) (err error) {
|
||||
@@ -70,7 +70,7 @@ func (p *PurchaseHandler) RefundOrder(ctx *jxcontext.Context, order *model.Goods
|
||||
func (p *PurchaseHandler) PartRefundOrder(ctx *jxcontext.Context, order *model.GoodsOrder, refundSkuList []*model.OrderSku, reason string) (err error) {
|
||||
return err
|
||||
}
|
||||
func (p *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string) (err error) {
|
||||
func (p *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *model.AfsOrder, approveType int, reason string, review map[string]interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
func (p *PurchaseHandler) ConfirmReceivedReturnGoods(ctx *jxcontext.Context, order *model.AfsOrder) (err error) {
|
||||
@@ -127,3 +127,8 @@ func (c *PurchaseHandler) ApplyCompensationOrder(order *model.GoodsOrder) (strin
|
||||
func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string) ([]string, []string, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
// UploadPickingImg 上传拣货图片
|
||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -460,3 +460,19 @@ func (c *Auth2Controller) GetUserByMiniInfo() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 根据电话号码获取用户头肯
|
||||
// @Description 根据电话号码获取用户头肯
|
||||
// @Param phoneNumber query string true "电话号码"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetTokenByPhone [get]
|
||||
func (c *Auth2Controller) GetTokenByPhone() {
|
||||
c.callGetTokenByPhone(func(params *tAuth2GetTokenByPhoneParams) (retVal interface{}, errCode string, err error) {
|
||||
result := api.Cacher.Get(params.PhoneNumber)
|
||||
if result == nil {
|
||||
err = fmt.Errorf("暂未获取到此用户信息")
|
||||
}
|
||||
return result, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -308,12 +308,12 @@ func (c *BiddingController) UpdateStockBySkuID() {
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /UpdateMtActivity [get]
|
||||
func (c *BiddingController) UpdateMtActivity() {
|
||||
c.callUpdateMtActivity(func(params *tBindUpdateMtActivityParams) (retVal interface{}, hint string, err error) {
|
||||
retVal = bidding.GetMTInfo()
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
//func (c *BiddingController) UpdateMtActivity() {
|
||||
// c.callUpdateMtActivity(func(params *tBindUpdateMtActivityParams) (retVal interface{}, hint string, err error) {
|
||||
// retVal = bidding.GetMTInfo()
|
||||
// return retVal, "", err
|
||||
// })
|
||||
//}
|
||||
|
||||
// GetActivityList 更新美团任务数据
|
||||
// @Title 更新美团任务数据
|
||||
@@ -327,13 +327,37 @@ func (c *BiddingController) UpdateMtActivity() {
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetActivityList [get]
|
||||
func (c *BiddingController) GetActivityList() {
|
||||
c.callGetActivityList(func(params *tBindGetActivityListParams) (retVal interface{}, hint string, err error) {
|
||||
var storeIDs []int
|
||||
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs); err != nil {
|
||||
//func (c *BiddingController) GetActivityList() {
|
||||
// c.callGetActivityList(func(params *tBindGetActivityListParams) (retVal interface{}, hint string, err error) {
|
||||
// var storeIDs []int
|
||||
// if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs); err != nil {
|
||||
// return nil, "", err
|
||||
// }
|
||||
// retVal, err = bidding.GetStatisticsList(utils.Str2Time(params.StartTime), utils.Str2Time(params.EndTime), storeIDs, params.Offset, params.PageSize)
|
||||
// return
|
||||
// })
|
||||
//}
|
||||
|
||||
//StoreOrderList 统计相同负责人门店订单量
|
||||
//@Title 统计门店订单数量
|
||||
//@Description 统计门店订单数量
|
||||
//@Param token header string true "认证token"
|
||||
//@Param startTime query string true "开始时间"
|
||||
//@Param endTime query string true "结束时间"
|
||||
//@Param storeIDs query string false "门店ID"
|
||||
//@Param vendorId query string false "平台id"
|
||||
//@Param offset query int false "结果起始序号(以0开始,缺省为0)"
|
||||
//@Param pageSize query int false "结果页大小(缺省为50,-1表示全部)"
|
||||
//@Success 200 {object} controllers.CallResult
|
||||
//@Failure 200 {object} controllers.CallResult
|
||||
//@router /StoreOrderList [get]
|
||||
func (c *BiddingController) StoreOrderList() {
|
||||
c.callStoreOrderList(func(params *tBindStoreOrderListParams) (retVal interface{}, hint string, err error) {
|
||||
var storeIDs, vendorIds []int
|
||||
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.VendorId, &vendorIds); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
retVal, err = bidding.GetStatisticsList(utils.Str2Time(params.StartTime), utils.Str2Time(params.EndTime), storeIDs, params.Offset, params.PageSize)
|
||||
return
|
||||
retVal, err = bidding.StatisticsOrderCount(utils.Str2Time(params.StartTime), utils.Str2Time(params.EndTime), storeIDs, vendorIds, params.Offset, params.PageSize)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -250,21 +250,24 @@ func (c *DjswController) OrderInvoice() {
|
||||
|
||||
func (c *DjswController) imMsg() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
var callbackResponse *jdapi.CallbackResponse
|
||||
msg, url, err := jdapi.ImChatRiskMsg(getUsefulRequest(c.Ctx))
|
||||
if err != nil {
|
||||
callbackResponse = jdapi.Err2CallbackResponse(err, "")
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("-----------jdmsg := %s", utils.Format4Output(msg, false))
|
||||
globals.SugarLogger.Debugf("-----------jdmsg URL:= %s", url)
|
||||
if err == nil {
|
||||
var base *jdapi.BaseInfo
|
||||
if utils.UnmarshalUseNumber(msg, &base); err == nil {
|
||||
if url == "msgReadAck" || url == "chatRiskMsg" {
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", fmt.Sprintf("jdIm:%s消息推送", url), utils.Format4Output(msg, false))
|
||||
}
|
||||
callbackResponse = jdapi.Err2CallbackResponse(im.ReadMsgFromVendor(model.VendorIDJD, url, []byte(base.JdParamJson)), "")
|
||||
callbackResponse = jdapi.Err2CallbackResponse(nil, "")
|
||||
err = im.ReadMsgFromVendor(model.VendorIDJD, url, []byte(base.JdParamJson))
|
||||
}
|
||||
}
|
||||
c.Data["json"] = c.transferResponse("orderStatus", callbackResponse)
|
||||
|
||||
if err != nil {
|
||||
c.Data["json"] = -1
|
||||
} else {
|
||||
c.Data["json"] = 0
|
||||
}
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
c.Abort("404")
|
||||
|
||||
@@ -899,12 +899,18 @@ func (c *OrderController) AgreeOrRefuseCancel() {
|
||||
// @Param vendorID formData int true "订单所属厂商ID"
|
||||
// @Param approveType formData int true "操作类型"
|
||||
// @Param reason formData string false "原因"
|
||||
// @Param mtReview formData string false "美团必传map[string]interface{}"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /AgreeOrRefuseRefund [put]
|
||||
func (c *OrderController) AgreeOrRefuseRefund() {
|
||||
c.callAgreeOrRefuseRefund(func(params *tOrderAgreeOrRefuseRefundParams) (retVal interface{}, errCode string, err error) {
|
||||
err = defsch.FixedScheduler.AgreeOrRefuseRefund(params.Ctx, params.AfsOrderID, params.VendorID, params.ApproveType, params.Reason)
|
||||
var review map[string]interface{}
|
||||
if err = json.Unmarshal([]byte(params.MtReview), &review); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
err = defsch.FixedScheduler.AgreeOrRefuseRefund(params.Ctx, params.AfsOrderID, params.VendorID, params.ApproveType, params.Reason, review)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,13 +3,18 @@ package controllers
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -587,3 +592,74 @@ func (c *JxOrderController) CreateBrandOrder() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 上传订单拣货图片
|
||||
// @Description 上传订单拣货图片
|
||||
// @Param token header string true "认证token"
|
||||
// @Param orderId formData string true "订单ID"
|
||||
// @Param vendorID formData int true "平台ID"
|
||||
// @Param mediaList formData string true "返图参数"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /UploadOrderPicking [post]
|
||||
func (c *JxOrderController) UploadOrderPicking() {
|
||||
c.callUploadOrderPicking(func(params *tJxorderUploadOrderPickingParams) (retVal interface{}, errCode string, err error) {
|
||||
var mediaList = make([]*mtwmapi.UploadMedia, 0, 0)
|
||||
|
||||
if err = json.Unmarshal([]byte(params.MediaList), &mediaList); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
var imgList []string
|
||||
for _, v := range mediaList {
|
||||
if v.Url != "" {
|
||||
imgList = append(imgList, v.Url)
|
||||
}
|
||||
}
|
||||
|
||||
localOrder, err := partner.CurOrderManager.LoadOrder(params.OrderId, params.VendorID)
|
||||
if err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
handler, _ := partner.GetPurchasePlatformFromVendorID(params.VendorID).(partner.IPurchasePlatformStoreSkuHandler)
|
||||
if handler == nil {
|
||||
return retVal, "", fmt.Errorf("不存在的厂商ID:%d", params.VendorID)
|
||||
}
|
||||
err = handler.UploadPickingImg(localOrder, mediaList)
|
||||
if err == nil {
|
||||
originalOrder := &model.GoodsOrderImg{
|
||||
VendorOrderID: localOrder.VendorOrderID,
|
||||
VendorID: localOrder.VendorID,
|
||||
OriginalData: string(utils.MustMarshal(imgList)),
|
||||
CreatedAt: time.Now(),
|
||||
}
|
||||
dao.CreateEntity(dao.GetDB(), originalOrder)
|
||||
} else {
|
||||
for _, v := range imgList {
|
||||
aa := strings.Split(v, "/")[3]
|
||||
jxutils.DeleteExportContent(aa)
|
||||
}
|
||||
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 获取订单返图详情
|
||||
// @Description 获取订单返图详情
|
||||
// @Param token header string true "认证token"
|
||||
// @Param orderId formData string true "订单ID"
|
||||
// @Param vendorID formData int false "平台ID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetOrderRequirePicture [get]
|
||||
func (c *JxOrderController) GetOrderRequirePicture() {
|
||||
c.callGetOrderRequirePicture(func(params *tJxorderGetOrderRequirePictureParams) (retVal interface{}, errCode string, err error) {
|
||||
localOrder, err := partner.CurOrderManager.LoadOrder(params.OrderId, params.VendorID)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
retVal, err = mtwm.GetVendorDetail(localOrder)
|
||||
return retVal, errCode, err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,8 +2,11 @@ package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
||||
@@ -156,7 +159,6 @@ func (c *MtwmController) Invoice() {
|
||||
|
||||
data := &mtwmapi.InvoiceCallback{}
|
||||
utils.Map2StructByJson(utils.URLValues2Map(msg.FormData), data, false)
|
||||
|
||||
// 消息通知
|
||||
if err := mtwm.InvoiceCallback(data); err != nil {
|
||||
globals.SugarLogger.Errorf("mtwm Invoice err := %v", err)
|
||||
@@ -217,3 +219,65 @@ func pushMTWMOrder2GY(value url.Values, msgType string, serverType string) *mtwm
|
||||
|
||||
return &result
|
||||
}
|
||||
|
||||
// ImgCheckOutCallback 针对返图订单,当实拍审核失败时,通过该消息通知三方重新修改实拍
|
||||
// http://callback.jxc4.com//mtwm/imgCheckOutCallback
|
||||
func (c *MtwmController) ImgCheckOutCallback() {
|
||||
msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse != nil {
|
||||
c.Data["json"] = map[string]interface{}{"result_code": -1}
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
data := &CheckBackParam{}
|
||||
utils.Map2StructByJson(utils.URLValues2Map(msg.FormData), data, false)
|
||||
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "ImgCheckOutCallback", fmt.Sprintf("美团返图审核:%s", utils.Format4Output(data, false)))
|
||||
globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(data, false))
|
||||
c.Data["json"] = map[string]interface{}{"result_code": 1}
|
||||
c.ServeJSON()
|
||||
|
||||
}
|
||||
|
||||
type CheckBackParam struct {
|
||||
OrderViewId string `json:"order_view_id"` // 订单号,商家可根据订单号查询订单当前的详细信息。
|
||||
AuditStatus int `json:"audit_status"` // 审核状态,2:审核失败 ,3:审核通过
|
||||
RiskInfoList []struct {
|
||||
RiskInfo int `json:"risk_info"` // 1.含违规信息 2.重复上传 3.图片模糊
|
||||
RiskDesc string `json:"risk_desc"` // 含违规信息
|
||||
Url string `json:"url"` // 审核失败的图片url,注意:为美团侧转换后的url
|
||||
} `json:"risk_info_list"`
|
||||
}
|
||||
|
||||
// OrderImgStatusCallback 针对强制返图订单,当订单返图就绪满足发配条件时,通过该消息通知三方是否可发配
|
||||
// http://callback.jxc4.com//mtwm/orderImgStatusCallback
|
||||
func (c *MtwmController) OrderImgStatusCallback() {
|
||||
|
||||
msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse != nil {
|
||||
c.Data["json"] = map[string]interface{}{"result_code": -1}
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
data := &CanSendDelivery{}
|
||||
utils.Map2StructByJson(utils.URLValues2Map(msg.FormData), data, false)
|
||||
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "OrderImgStatusCallback", fmt.Sprintf("美团返图审核可发配:%s", utils.Format4Output(data, false)))
|
||||
globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(data, false))
|
||||
|
||||
c.Data["json"] = map[string]interface{}{"result_code": 1}
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
type CanSendDelivery struct {
|
||||
OrderViewId string `json:"order_view_id"` // 订单号,商家可根据订单号查询订单当前的详细信息。
|
||||
SendTime string `json:"send_time"` // 消息发送时间,秒级时间戳
|
||||
EnableDispatch bool `json:"enable_dispatch"` // true-可发配 false-不可发配
|
||||
DispatchConditionDetail []struct {
|
||||
ConditionType int `json:"condition_type"` // 发配条件限制类型 :1-强制返图
|
||||
EnableDispatch bool `json:"enable_dispatch"` // 某个发配条件限制类型是否已经满足
|
||||
} // 发货条件明细
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ func Init() {
|
||||
//orm.RegisterDataBase("default", "mysql", web.AppConfig.DefaultString("dbConnectStr", ""))
|
||||
//orm.RegisterDataBase("c4beta", "mysql", "ubuntu:WebServer@1@tcp(127.0.0.1:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
//orm.RegisterDataBase("api", "mysql", "root:WebServer@1@tcp(127.0.0.1:3306)/api?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
|
||||
// 开启sql打印
|
||||
//orm.Debug = true
|
||||
orm.RegisterModel(&model.SupermarketSign{})
|
||||
@@ -32,6 +31,7 @@ func Init() {
|
||||
// }
|
||||
orm.RegisterModel(new(model.GoodsOrder))
|
||||
orm.RegisterModel(new(model.GoodsOrderOriginal))
|
||||
orm.RegisterModel(new(model.GoodsOrderImg))
|
||||
orm.RegisterModel(new(model.TempGoodsOrderMobile))
|
||||
orm.RegisterModel(new(model.OrderSku))
|
||||
orm.RegisterModel(new(model.Waybill))
|
||||
|
||||
@@ -284,6 +284,14 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"],
|
||||
web.ControllerComments{
|
||||
Method: "GetTokenByPhone",
|
||||
Router: `/GetTokenByPhone`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"],
|
||||
web.ControllerComments{
|
||||
@@ -927,6 +935,24 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 上传订单拣货图
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||
web.ControllerComments{
|
||||
Method: "UploadOrderPicking",
|
||||
Router: `/UploadOrderPicking`,
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 获取订单返图详情
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||
web.ControllerComments{
|
||||
Method: "GetOrderRequirePicture",
|
||||
Router: `/GetOrderRequirePicture`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||
web.ControllerComments{
|
||||
@@ -4708,24 +4734,33 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 更新美团任务数据
|
||||
// 统计相同负责人门店订单数量
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"],
|
||||
web.ControllerComments{
|
||||
Method: "UpdateMtActivity",
|
||||
Router: `/UpdateMtActivity`,
|
||||
Method: "StoreOrderList",
|
||||
Router: `/StoreOrderList`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 更新美团任务数据
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"],
|
||||
web.ControllerComments{
|
||||
Method: "GetActivityList",
|
||||
Router: `/GetActivityList`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
//web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"],
|
||||
// web.ControllerComments{
|
||||
// Method: "UpdateMtActivity",
|
||||
// Router: `/UpdateMtActivity`,
|
||||
// AllowHTTPMethods: []string{"get"},
|
||||
// MethodParams: param.Make(),
|
||||
// Filters: nil,
|
||||
// Params: nil})
|
||||
// 更新美团任务数据
|
||||
//web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"],
|
||||
// web.ControllerComments{
|
||||
// Method: "GetActivityList",
|
||||
// Router: `/GetActivityList`,
|
||||
// AllowHTTPMethods: []string{"get"},
|
||||
// MethodParams: param.Make(),
|
||||
// Filters: nil,
|
||||
// Params: nil})
|
||||
|
||||
// 版本设置
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:VersionController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:VersionController"],
|
||||
|
||||
140208
swagger/param_parser.go.txt
140208
swagger/param_parser.go.txt
File diff suppressed because it is too large
Load Diff
@@ -1716,6 +1716,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth2/GetTokenByPhone": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"auth2"
|
||||
],
|
||||
"description": "根据电话号码获取用户头肯",
|
||||
"operationId": "Auth2Controller.根据电话号码获取用户头肯",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "phoneNumber",
|
||||
"description": "电话号码",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{object} controllers.CallResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth2/GetTokenInfo": {
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -2241,63 +2264,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bind/GetActivityList": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"bind"
|
||||
],
|
||||
"description": "更新美团任务数据",
|
||||
"operationId": "BiddingController.更新美团任务数据",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
"name": "token",
|
||||
"description": "认证token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "startTime",
|
||||
"description": "开始时间",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "endTime",
|
||||
"description": "结束时间",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "storeIDs",
|
||||
"description": "门店ID",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "offset",
|
||||
"description": "结果起始序号(以0开始,缺省为0)",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "pageSize",
|
||||
"description": "结果页大小(缺省为50,-1表示全部)",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{object} controllers.CallResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bind/GetBiddingMsg": {
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -2566,13 +2532,13 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bind/UpdateMtActivity": {
|
||||
"/bind/StoreOrderList": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"bind"
|
||||
],
|
||||
"description": "更新美团任务数据",
|
||||
"operationId": "BiddingController.更新美团任务数据",
|
||||
"description": "统计门店订单数量",
|
||||
"operationId": "BiddingController.统计门店订单数量",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
@@ -2580,6 +2546,46 @@
|
||||
"description": "认证token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "startTime",
|
||||
"description": "开始时间",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "endTime",
|
||||
"description": "结束时间",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "storeIDs",
|
||||
"description": "门店ID",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "vendorId",
|
||||
"description": "平台id",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "offset",
|
||||
"description": "结果起始序号(以0开始,缺省为0)",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "pageSize",
|
||||
"description": "结果页大小(缺省为50,-1表示全部)",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -5793,6 +5799,43 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/jxorder/GetOrderRequirePicture": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"jxorder"
|
||||
],
|
||||
"description": "获取订单返图详情",
|
||||
"operationId": "JxOrderController.获取订单返图详情",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
"name": "token",
|
||||
"description": "认证token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "orderId",
|
||||
"description": "订单ID",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "vendorID",
|
||||
"description": "平台ID",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{object} controllers.CallResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/jxorder/GetSupplySupportStoreSkus": {
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -6453,6 +6496,51 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/jxorder/UploadOrderPicking": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"jxorder"
|
||||
],
|
||||
"description": "上传订单拣货图片",
|
||||
"operationId": "JxOrderController.上传订单拣货图片",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
"name": "token",
|
||||
"description": "认证token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "orderId",
|
||||
"description": "订单ID",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "vendorID",
|
||||
"description": "平台ID",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "mediaList",
|
||||
"description": "返图参数",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{object} controllers.CallResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/jxshop/JxMsg": {
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -10008,13 +10096,6 @@
|
||||
"description": "审核售后单申请",
|
||||
"operationId": "OrderController.审核售后单申请",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
"name": "token",
|
||||
"description": "认证token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "afsOrderID",
|
||||
@@ -10043,6 +10124,12 @@
|
||||
"name": "reason",
|
||||
"description": "原因",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
"name": "mtReview",
|
||||
"description": "美团必传map[string]interface{}",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -17110,9 +17197,7 @@
|
||||
"in": "formData",
|
||||
"name": "storeId",
|
||||
"description": "门店ID",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "formData",
|
||||
|
||||
@@ -1177,6 +1177,21 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/auth2/GetTokenByPhone:
|
||||
get:
|
||||
tags:
|
||||
- auth2
|
||||
description: 根据电话号码获取用户头肯
|
||||
operationId: Auth2Controller.根据电话号码获取用户头肯
|
||||
parameters:
|
||||
- in: query
|
||||
name: phoneNumber
|
||||
description: 电话号码
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/auth2/GetTokenInfo:
|
||||
get:
|
||||
tags:
|
||||
@@ -1528,45 +1543,6 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/bind/GetActivityList:
|
||||
get:
|
||||
tags:
|
||||
- bind
|
||||
description: 更新美团任务数据
|
||||
operationId: BiddingController.更新美团任务数据
|
||||
parameters:
|
||||
- in: header
|
||||
name: token
|
||||
description: 认证token
|
||||
required: true
|
||||
type: string
|
||||
- in: formData
|
||||
name: startTime
|
||||
description: 开始时间
|
||||
required: true
|
||||
type: string
|
||||
- in: formData
|
||||
name: endTime
|
||||
description: 结束时间
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: storeIDs
|
||||
description: 门店ID
|
||||
type: string
|
||||
- in: query
|
||||
name: offset
|
||||
description: 结果起始序号(以0开始,缺省为0)
|
||||
type: integer
|
||||
format: int64
|
||||
- in: query
|
||||
name: pageSize
|
||||
description: 结果页大小(缺省为50,-1表示全部)
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/bind/GetBiddingMsg:
|
||||
get:
|
||||
tags:
|
||||
@@ -1748,18 +1724,46 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/bind/UpdateMtActivity:
|
||||
/bind/StoreOrderList:
|
||||
get:
|
||||
tags:
|
||||
- bind
|
||||
description: 更新美团任务数据
|
||||
operationId: BiddingController.更新美团任务数据
|
||||
description: 统计门店订单数量
|
||||
operationId: BiddingController.统计门店订单数量
|
||||
parameters:
|
||||
- in: header
|
||||
name: token
|
||||
description: 认证token
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: startTime
|
||||
description: 开始时间
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: endTime
|
||||
description: 结束时间
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: storeIDs
|
||||
description: 门店ID
|
||||
type: string
|
||||
- in: query
|
||||
name: vendorId
|
||||
description: 平台id
|
||||
type: string
|
||||
- in: query
|
||||
name: offset
|
||||
description: 结果起始序号(以0开始,缺省为0)
|
||||
type: integer
|
||||
format: int64
|
||||
- in: query
|
||||
name: pageSize
|
||||
description: 结果页大小(缺省为50,-1表示全部)
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
@@ -3923,6 +3927,31 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/jxorder/GetOrderRequirePicture:
|
||||
get:
|
||||
tags:
|
||||
- jxorder
|
||||
description: 获取订单返图详情
|
||||
operationId: JxOrderController.获取订单返图详情
|
||||
parameters:
|
||||
- in: header
|
||||
name: token
|
||||
description: 认证token
|
||||
required: true
|
||||
type: string
|
||||
- in: formData
|
||||
name: orderId
|
||||
description: 订单ID
|
||||
required: true
|
||||
type: string
|
||||
- in: formData
|
||||
name: vendorID
|
||||
description: 平台ID
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/jxorder/GetSupplySupportStoreSkus:
|
||||
get:
|
||||
tags:
|
||||
@@ -4371,6 +4400,37 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/jxorder/UploadOrderPicking:
|
||||
post:
|
||||
tags:
|
||||
- jxorder
|
||||
description: 上传订单拣货图片
|
||||
operationId: JxOrderController.上传订单拣货图片
|
||||
parameters:
|
||||
- in: header
|
||||
name: token
|
||||
description: 认证token
|
||||
required: true
|
||||
type: string
|
||||
- in: formData
|
||||
name: orderId
|
||||
description: 订单ID
|
||||
required: true
|
||||
type: string
|
||||
- in: formData
|
||||
name: vendorID
|
||||
description: 平台ID
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
- in: formData
|
||||
name: mediaList
|
||||
description: 返图参数
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/jxshop/JxMsg:
|
||||
post:
|
||||
tags:
|
||||
@@ -6783,11 +6843,6 @@ paths:
|
||||
description: 审核售后单申请
|
||||
operationId: OrderController.审核售后单申请
|
||||
parameters:
|
||||
- in: header
|
||||
name: token
|
||||
description: 认证token
|
||||
required: true
|
||||
type: string
|
||||
- in: formData
|
||||
name: afsOrderID
|
||||
description: 售后ID
|
||||
@@ -6809,6 +6864,10 @@ paths:
|
||||
name: reason
|
||||
description: 原因
|
||||
type: string
|
||||
- in: formData
|
||||
name: mtReview
|
||||
description: 美团必传map[string]interface{}
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
@@ -11608,9 +11667,7 @@ paths:
|
||||
- in: formData
|
||||
name: storeId
|
||||
description: 门店ID
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
type: string
|
||||
- in: formData
|
||||
name: vendorOrgCode
|
||||
description: 平台账号
|
||||
|
||||
Reference in New Issue
Block a user