1
This commit is contained in:
@@ -943,6 +943,7 @@ func AddSkuName(ctx *jxcontext.Context, skuNameExt *model.SkuNameExt, userName s
|
|||||||
}
|
}
|
||||||
|
|
||||||
func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interface{}, isExd bool) (num int64, err error) {
|
func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interface{}, isExd bool) (num int64, err error) {
|
||||||
|
globals.SugarLogger.Debugf("----------ployd1 := %s", utils.Format4Output(payload, false))
|
||||||
userName := ctx.GetUserName()
|
userName := ctx.GetUserName()
|
||||||
skuName := &model.SkuName{}
|
skuName := &model.SkuName{}
|
||||||
skuName.ID = nameID
|
skuName.ID = nameID
|
||||||
@@ -977,22 +978,10 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
|
|||||||
return 0, fmt.Errorf("upc:%s不合法,请仔细检查", upc)
|
return 0, fmt.Errorf("upc:%s不合法,请仔细检查", upc)
|
||||||
}
|
}
|
||||||
//有upc码时,单位不能为份
|
//有upc码时,单位不能为份
|
||||||
//upc1 := valid["Upc"].(string)
|
|
||||||
if upc != "" && valid["unit"] != nil && valid["unit"].(string) == "份" {
|
if upc != "" && valid["unit"] != nil && valid["unit"].(string) == "份" {
|
||||||
return 0, errors.New("商品有Upc码时,规格不能为份")
|
return 0, errors.New("商品有Upc码时,规格不能为份")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// globals.SugarLogger.Debugf("UpdateSkuName valid:%s", utils.Format4Output(valid, false))
|
|
||||||
// for _, imgName := range []string{"img", "img2", "img3", "img4", "img5"} {
|
|
||||||
// if valid[imgName] != nil {
|
|
||||||
// if imgStr := utils.Interface2String(valid[imgName]); imgStr != "" {
|
|
||||||
// _, err2 := datares.TryRegisterDataResource(ctx, skuName.Name, valid[imgName].(string), model.ImgTypeMain, true)
|
|
||||||
// if err = err2; err != nil {
|
|
||||||
// return 0, err
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if valid["descImg"] != nil {
|
if valid["descImg"] != nil {
|
||||||
descImg := valid["descImg"].(string)
|
descImg := valid["descImg"].(string)
|
||||||
@@ -1025,6 +1014,8 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
|
|||||||
panic(r)
|
panic(r)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
globals.SugarLogger.Debugf("----------ployd2 := %s", utils.Format4Output(payload, false))
|
||||||
|
globals.SugarLogger.Debugf("----------valid := %s", utils.Format4Output(valid, false))
|
||||||
if num, err = dao.UpdateEntityLogically(db, skuName, valid, userName, nil); err != nil {
|
if num, err = dao.UpdateEntityLogically(db, skuName, valid, userName, nil); err != nil {
|
||||||
dao.Rollback(db, txDB)
|
dao.Rollback(db, txDB)
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -1142,21 +1133,6 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
|
|||||||
return num, err
|
return num, err
|
||||||
}
|
}
|
||||||
|
|
||||||
type aa struct {
|
|
||||||
Id int `json:"id"`
|
|
||||||
SpecQuality int `json:"specQuality"`
|
|
||||||
SpecUnit string `json:"specUnit"`
|
|
||||||
Weight int `json:"weight"`
|
|
||||||
Status string `json:"status"`
|
|
||||||
Comment string `json:"comment"`
|
|
||||||
MinOrderCount int `json:"minOrderCount"`
|
|
||||||
LadderBoxNum int `json:"ladderBoxNum"`
|
|
||||||
LadderBoxPrice int `json:"ladderBoxPrice"`
|
|
||||||
EclpID string `json:"eclpID"`
|
|
||||||
CategoryID []interface{} `json:"categoryID"`
|
|
||||||
ExdSkuID string `json:"exdSkuID"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据名称获取商品分类[京东]
|
// 根据名称获取商品分类[京东]
|
||||||
func getCategoryByName(name string) string {
|
func getCategoryByName(name string) string {
|
||||||
handler, _ := partner.GetPurchasePlatformFromVendorID(model.VendorIDJD).(partner.IPurchasePlatformStoreSkuHandler)
|
handler, _ := partner.GetPurchasePlatformFromVendorID(model.VendorIDJD).(partner.IPurchasePlatformStoreSkuHandler)
|
||||||
|
|||||||
@@ -71,15 +71,13 @@ func OnImMsg(msg *mtwmapi.ImCallbackMsg) (response *mtwmapi.CallbackResponse) {
|
|||||||
return mtwmapi.SignatureIsNotOk
|
return mtwmapi.SignatureIsNotOk
|
||||||
}
|
}
|
||||||
storeDetail, err2 := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), PushContentReq.AppPoiCode, model.VendorIDMTWM, utils.Int2Str(PushContentReq.AppID))
|
storeDetail, err2 := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), PushContentReq.AppPoiCode, model.VendorIDMTWM, utils.Int2Str(PushContentReq.AppID))
|
||||||
if err2 == nil || storeDetail == nil {
|
if err2 != nil || storeDetail == nil {
|
||||||
msg.PushContent = string(str)
|
msg.PushContent = string(str)
|
||||||
switch beego.BConfig.RunMode {
|
switch beego.BConfig.RunMode {
|
||||||
case model.ServerTypeFruits:
|
case model.ServerTypeFruits:
|
||||||
globals.SugarLogger.Debugf("----------msg pet := %s", utils.Format4Output(msg, false))
|
|
||||||
pushIMToGyOrPet(msg, model.ServerTypePet)
|
pushIMToGyOrPet(msg, model.ServerTypePet)
|
||||||
return mtwmapi.SuccessResponse
|
return mtwmapi.SuccessResponse
|
||||||
case model.ServerTypeVegetable:
|
case model.ServerTypeVegetable:
|
||||||
globals.SugarLogger.Debugf("----------msg jxgy:= %s", utils.Format4Output(msg, false))
|
|
||||||
pushIMToGyOrPet(msg, model.ServerTypeFruits)
|
pushIMToGyOrPet(msg, model.ServerTypeFruits)
|
||||||
return mtwmapi.SuccessResponse
|
return mtwmapi.SuccessResponse
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user