门店商品分类

This commit is contained in:
苏尹岚
2020-07-23 15:15:47 +08:00
parent 24e9b4f571
commit 29673dd992
12 changed files with 521 additions and 40 deletions

View File

@@ -667,3 +667,111 @@ func (c *StoreController) DeletePrinterSeq() {
return retVal, "", err
})
}
// @Title 得到门店类别
// @Description 得到门店类别
// @Param token header string true "认证token"
// @Param parentID query int false "父ID"
// @Param level query int false "分类等级"
// @Param storeID query int true "门店ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetStoreCategoryMap [get]
func (c *StoreController) GetStoreCategoryMap() {
c.callGetStoreCategoryMap(func(params *tStoreGetStoreCategoryMapParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetStoreCategoryMap(params.Ctx, params.ParentID, params.Level, params.StoreID)
return retVal, "", err
})
}
// @Title 新增门店类别
// @Description 新增门店类别
// @Param token header string true "认证token"
// @Param storeID formData int true "门店ID"
// @Param categroyID formData int false "京西分类id"
// @Param level formData int true "分类级别"
// @Param parentID formData int true "分类父ID"
// @Param storeCategroyName formData string true "类别name"
// @Param storeCategroySeq formData int true "类别序号"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AddStoreCategoryMap [post]
func (c *StoreController) AddStoreCategoryMap() {
c.callAddStoreCategoryMap(func(params *tStoreAddStoreCategoryMapParams) (retVal interface{}, errCode string, err error) {
storeCategoryMap := &model.StoreCategoryMap{
StoreID: params.StoreID,
CategoryID: params.CategroyID,
StoreCategoryName: params.StoreCategroyName,
StoreCategorySeq: params.StoreCategroySeq,
Level: params.Level,
ParentID: params.ParentID,
}
retVal, err = cms.AddStoreCategoryMap(params.Ctx, storeCategoryMap)
return retVal, "", err
})
}
// @Title 修改门店类别
// @Description 修改门店类别
// @Param token header string true "认证token"
// @Param ID formData int true "记录ID"
// @Param categoryID formData int false "京西分类id"
// @Param storeCategroyName formData string false "类别name"
// @Param level formData int true "分类级别"
// @Param parentID formData int true "分类父ID"
// @Param isDelete formData bool false "是否是删除操作默认false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateStoreCategoryMap [put]
func (c *StoreController) UpdateStoreCategoryMap() {
c.callUpdateStoreCategoryMap(func(params *tStoreUpdateStoreCategoryMapParams) (retVal interface{}, errCode string, err error) {
storeCategoryMap := &model.StoreCategoryMap{
CategoryID: params.CategoryID,
StoreCategoryName: params.StoreCategroyName,
Level: params.Level,
ParentID: params.ParentID,
}
retVal, err = cms.UpdateStoreCategoryMap(params.Ctx, params.ID, storeCategoryMap, params.IsDelete)
return retVal, "", err
})
}
// @Title 门店类别重排序
// @Description 门店类别重排序
// @Param token header string true "认证token"
// @Param categoryID formData int true "父ID"
// @Param storeID formData int true "门店ID"
// @Param categoryIDs formData string true "同一父类别下的所有子类别ID列表([1,2,3,4])"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /ReorderStoreCategories [put]
func (c *SkuController) ReorderStoreCategories() {
c.callReorderStoreCategories(func(params *tSkuReorderStoreCategoriesParams) (retVal interface{}, errCode string, err error) {
var idList []int
if err = utils.UnmarshalUseNumber([]byte(params.CategoryIDs), &idList); err == nil {
err = cms.ReorderStoreCategories(params.Ctx, params.CategoryID, params.StoreID, idList)
}
return retVal, "", err
})
}
// @Title 复制门店类别
// @Description 复制门店类别
// @Param token header string true "认证token"
// @Param fromStoreID formData int true "源门店ID"
// @Param toStoreIDs formData string true "目标门店的IDs"
// @Param categoryIDs formData string false "原门店的分类IDs,不传代表整个复制"
// @Param isAsync formData bool false "是否异步操作"
// @Param isContinueWhenError formData bool false "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /CopyStoreCategories [put]
func (c *SkuController) CopyStoreCategories() {
var toStoreIDs, categoryIDs []int
c.callCopyStoreCategories(func(params *tSkuCopyStoreCategoriesParams) (retVal interface{}, errCode string, err error) {
if jxutils.Strings2Objs(params.ToStoreIDs, &toStoreIDs, params.CategoryIDs, &categoryIDs); err == nil {
retVal, err = cms.CopyStoreCategories(params.Ctx, params.FromStoreID, toStoreIDs, categoryIDs, params.IsAsync, params.IsContinueWhenError)
}
return retVal, "", err
})
}

View File

@@ -1112,7 +1112,7 @@ func (c *OrderController) SaveJdsOrders() {
// @Param skuID formData int true "商品ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AdjustJdsOrderSimple [delete]
// @router /AdjustJdsOrderSimple [post]
func (c *OrderController) AdjustJdsOrderSimple() {
c.callAdjustJdsOrderSimple(func(params *tOrderAdjustJdsOrderSimpleParams) (retVal interface{}, errCode string, err error) {
err = orderman.AdjustJdsOrderSimple(params.Ctx, params.VendorOrderID, params.SkuID)