Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -1194,7 +1194,7 @@ func UpdateSkuImg(ctx *jxcontext.Context, skuID int, payload map[string]interfac
|
||||
if skuID == 0 {
|
||||
return "skuID必传", nil
|
||||
} else if payload["img"] == "" {
|
||||
return "img必传", nil
|
||||
return "所有 img 字段必传", nil
|
||||
}
|
||||
if _, err := dao.ExecuteSQL(db, `
|
||||
UPDATE sku_name s
|
||||
|
||||
@@ -1623,6 +1623,10 @@ func DeleteStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
||||
err = AddEventDetail(db, ctx, model.OperateDelete, vendorID, model.ThingTypeStore, storeID, "", `{"VendorID":`+utils.Int2Str(vendorID)+`}`)
|
||||
}
|
||||
}
|
||||
//删除抖店映射
|
||||
if _, err1 := dao.ExecuteSQL(db, "DELETE FROM freight_template WHERE freight_template.store_id = ? ", storeID); err != nil {
|
||||
err = fmt.Errorf("%v,%v", err, err1)
|
||||
}
|
||||
return num, err
|
||||
}
|
||||
|
||||
|
||||
@@ -1018,7 +1018,7 @@ func (*BrandCategoryMap) TableUnique() [][]string {
|
||||
|
||||
// 抖店 运费模板、仓库以及电子围栏绑定
|
||||
type FreightTemplate struct {
|
||||
ModelIDCULD
|
||||
ID int `orm:"column(id)" json:"id"`
|
||||
StoreID int `orm:"column(store_id)" json:"storeID"` //京西本地门店ID即抖店门店编码
|
||||
VendorStoreID string `orm:"column(vendor_store_id)" json:"vendorStoreID"` //抖店平台门店ID
|
||||
TemplateID int64 `orm:"column(template_id)" json:"templateID"` //运费模板ID 1对1
|
||||
|
||||
@@ -253,11 +253,10 @@ func CreateOrUpdateAll(vendorOrgCode string, storeID, vendorStoreID, deliveryFee
|
||||
|
||||
//4. 设置门店打包费 默认为0
|
||||
if err := SetStorePackageFee(vendorOrgCode, vendorStoreID, deliveryFeeDeductionFee); err != nil {
|
||||
errList.AddErr(fmt.Errorf("设置门店打包费失败:%v", err))
|
||||
errList.AddErr(fmt.Errorf("设置门店打包费失败:%v", err))
|
||||
}
|
||||
|
||||
//5.同步进数据库
|
||||
FreightTemplate.DeletedAt = utils.DefaultTimeValue
|
||||
FreightTemplate = &model.FreightTemplate{
|
||||
StoreID: int(storeID),
|
||||
VendorStoreID: utils.Int64ToStr(vendorStoreID),
|
||||
@@ -369,7 +368,6 @@ func CreateAndBindAllV2(vendorOrgCode string, storeID, vendorStoreID, deliveryFe
|
||||
tasksch.ManageTask(task).Run()
|
||||
//6.同步进数据库
|
||||
globals.SugarLogger.Debugf("preTest TradeLimitID==%d,TemplateID==%d, WarehouseID==%d,FenceID==%s", FreightTemplate.TradeLimitID, FreightTemplate.TemplateID, FreightTemplate.WarehouseID, FreightTemplate.FenceID)
|
||||
dao.WrapAddIDCULDEntity(FreightTemplate, userName)
|
||||
if err := dao.CreateEntity(db, FreightTemplate); err != nil {
|
||||
_, err1 := dao.UpdateEntity(db, FreightTemplate, "TemplateID", "WarehouseID", "FenceID", "TradeLimitID")
|
||||
if err1 == nil {
|
||||
@@ -492,7 +490,6 @@ func (P *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
StoreID: storeID,
|
||||
VendorStoreID: storeInfo.VendorStoreID,
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(FreightTemplate, userName)
|
||||
if err = dao.CreateEntity(db, FreightTemplate); err != nil {
|
||||
if _, err1 := dao.UpdateEntity(db, FreightTemplate, "FenceID"); err1 != nil {
|
||||
globals.SugarLogger.Debugf("db update storeID,vendorStoreID defeat on :%v", err1)
|
||||
|
||||
@@ -2196,6 +2196,15 @@ func init() {
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"],
|
||||
web.ControllerComments{
|
||||
Method: "UpdateSkuImg",
|
||||
Router: `/UpdateSkuImg`,
|
||||
AllowHTTPMethods: []string{"put"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:SkuController"],
|
||||
web.ControllerComments{
|
||||
Method: "UpdateSkuNamesExPrefix",
|
||||
|
||||
Reference in New Issue
Block a user