
// this file was automatically generated by modified bee tool (https://github.com/GazeboXu/bee)
// bee generate docs
// please don't modify it manually!!!
package controllers

import (
	"encoding/json"
	"fmt"
	"strings"
	"time"
	"net/http"
	"git.rosy.net.cn/jx-callback/business/jxstore/event"
	"git.rosy.net.cn/jx-callback/business/jxstore/cms"

	"git.rosy.net.cn/baseapi/utils"
	"git.rosy.net.cn/jx-callback/business/jxutils/jsonerr"
	"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
	"git.rosy.net.cn/jx-callback/business/model"
	"git.rosy.net.cn/jx-callback/globals"
)

const (
	strRequiredParamIsEmpty = "参数[%s]为空或数值不合法！"
)

type tOrderCancelOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	Reason		string
}

// func (c *OrderController) CancelOrder() {
// 	c.callCancelOrder(func(params *tOrderCancelOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callCancelOrder(handler func(params *tOrderCancelOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderCancelOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("reason")) != "" {
		params.MapData["reason"] = params.Reason
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.CancelOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.CancelOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.CancelOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreAcctBalanceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *StoreController) GetStoreAcctBalance() {
// 	c.callGetStoreAcctBalance(func(params *tStoreGetStoreAcctBalanceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreAcctBalance(handler func(params *tStoreGetStoreAcctBalanceParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreAcctBalanceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreAcctBalance, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreAcctBalance, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreAcctBalance error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetTopCategoriesByStoreIDsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
}

// func (c *StoreSkuController) GetTopCategoriesByStoreIDs() {
// 	c.callGetTopCategoriesByStoreIDs(func(params *tStoreSkuGetTopCategoriesByStoreIDsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetTopCategoriesByStoreIDs(handler func(params *tStoreSkuGetTopCategoriesByStoreIDsParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetTopCategoriesByStoreIDsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetTopCategoriesByStoreIDs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetTopCategoriesByStoreIDs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetTopCategoriesByStoreIDs error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuReturnStoreSkuBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SnapshotAt		string
	StoreIDs		string
	SkuIDs		string
}

// func (c *StoreSkuController) ReturnStoreSkuBind() {
// 	c.callReturnStoreSkuBind(func(params *tStoreSkuReturnStoreSkuBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callReturnStoreSkuBind(handler func(params *tStoreSkuReturnStoreSkuBindParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuReturnStoreSkuBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.SnapshotAt = utils.TrimBlankChar(c.GetString("snapshotAt"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("snapshotAt") == "" {
		errParams = append(errParams, "snapshotAt")
	}
	params.MapData["snapshotAt"] = params.SnapshotAt
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.ReturnStoreSkuBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.ReturnStoreSkuBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.ReturnStoreSkuBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncFullSyncStoresSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) FullSyncStoresSkus() {
// 	c.callFullSyncStoresSkus(func(params *tSyncFullSyncStoresSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callFullSyncStoresSkus(handler func(params *tSyncFullSyncStoresSkusParams) (interface{}, string, error)) {
	var err error
	params := &tSyncFullSyncStoresSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.FullSyncStoresSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.FullSyncStoresSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.FullSyncStoresSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopCheckStoreAlertParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
}

// func (c *TempOpController) CheckStoreAlert() {
// 	c.callCheckStoreAlert(func(params *tTempopCheckStoreAlertParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callCheckStoreAlert(handler func(params *tTempopCheckStoreAlertParams) (interface{}, string, error)) {
	var err error
	params := &tTempopCheckStoreAlertParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.CheckStoreAlert, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.CheckStoreAlert, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.CheckStoreAlert error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tVersionGetVersionControllerParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppId		string
}

// func (c *VersionController) GetVersionController() {
// 	c.callGetVersionController(func(params *tVersionGetVersionControllerParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *VersionController) callGetVersionController(handler func(params *tVersionGetVersionControllerParams) (interface{}, string, error)) {
	var err error
	params := &tVersionGetVersionControllerParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppId = utils.TrimBlankChar(c.GetString("appId"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("appId")) != "" {
		params.MapData["appId"] = params.AppId
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API VersionController.GetVersionController, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API VersionController.GetVersionController, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API VersionController.GetVersionController error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderComplaintRiderListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *OrderController) ComplaintRiderList() {
// 	c.callComplaintRiderList(func(params *tOrderComplaintRiderListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callComplaintRiderList(handler func(params *tOrderComplaintRiderListParams) (interface{}, string, error)) {
	var err error
	params := &tOrderComplaintRiderListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ComplaintRiderList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ComplaintRiderList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ComplaintRiderList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderCreateBrandOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandID		int
	Price		int
}

// func (c *JxOrderController) CreateBrandOrder() {
// 	c.callCreateBrandOrder(func(params *tJxorderCreateBrandOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callCreateBrandOrder(handler func(params *tJxorderCreateBrandOrderParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderCreateBrandOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.Price, err = c.GetInt("price", 0); err != nil {
		errParams = append(errParams, "price")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if c.GetString("price") == "" {
		errParams = append(errParams, "price")
	}
	params.MapData["price"] = params.Price
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.CreateBrandOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.CreateBrandOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.CreateBrandOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetVendorCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ParentID		int
	Level		int
	VendorOrgCode		string
	VendorID		int
}

// func (c *SkuController) GetVendorCategoryMap() {
// 	c.callGetVendorCategoryMap(func(params *tSkuGetVendorCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetVendorCategoryMap(handler func(params *tSkuGetVendorCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetVendorCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("parentID")) != "" {
		params.MapData["parentID"] = params.ParentID
	}
	if utils.TrimBlankChar(c.GetString("level")) != "" {
		params.MapData["level"] = params.Level
	}
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetVendorCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetVendorCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetVendorCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateExianDaSkuCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SkuController) UpdateExianDaSkuCategory() {
// 	c.callUpdateExianDaSkuCategory(func(params *tSkuUpdateExianDaSkuCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateExianDaSkuCategory(handler func(params *tSkuUpdateExianDaSkuCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateExianDaSkuCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateExianDaSkuCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateExianDaSkuCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateExianDaSkuCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreBuySecretNoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PoolKey		string
}

// func (c *StoreController) BuySecretNo() {
// 	c.callBuySecretNo(func(params *tStoreBuySecretNoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callBuySecretNo(handler func(params *tStoreBuySecretNoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreBuySecretNoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PoolKey = utils.TrimBlankChar(c.GetString("poolKey"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("poolKey")) != "" {
		params.MapData["poolKey"] = params.PoolKey
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.BuySecretNo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.BuySecretNo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.BuySecretNo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tKnowAddMaterialParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	KnowIDs		string
	Title		string
	Digest		string
	Author		string
	ThumbMediaID		string
	ShowCoverPic		int
	NeedOpenComment		int
	OnlyFansCanComment		int
}

// func (c *KnowController) AddMaterial() {
// 	c.callAddMaterial(func(params *tKnowAddMaterialParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *KnowController) callAddMaterial(handler func(params *tKnowAddMaterialParams) (interface{}, string, error)) {
	var err error
	params := &tKnowAddMaterialParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.KnowIDs = utils.TrimBlankChar(c.GetString("knowIDs"))
	params.Title = utils.TrimBlankChar(c.GetString("title"))
	params.Digest = utils.TrimBlankChar(c.GetString("digest"))
	params.Author = utils.TrimBlankChar(c.GetString("author"))
	params.ThumbMediaID = utils.TrimBlankChar(c.GetString("thumbMediaID"))
	if params.ShowCoverPic, err = c.GetInt("showCoverPic", 0); err != nil {
		errParams = append(errParams, "showCoverPic")
	}
	if params.NeedOpenComment, err = c.GetInt("needOpenComment", 0); err != nil {
		errParams = append(errParams, "needOpenComment")
	}
	if params.OnlyFansCanComment, err = c.GetInt("onlyFansCanComment", 0); err != nil {
		errParams = append(errParams, "onlyFansCanComment")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("knowIDs")) != "" {
		params.MapData["knowIDs"] = params.KnowIDs
	}
	if c.GetString("title") == "" {
		errParams = append(errParams, "title")
	}
	params.MapData["title"] = params.Title
	if utils.TrimBlankChar(c.GetString("digest")) != "" {
		params.MapData["digest"] = params.Digest
	}
	if utils.TrimBlankChar(c.GetString("author")) != "" {
		params.MapData["author"] = params.Author
	}
	if c.GetString("thumbMediaID") == "" {
		errParams = append(errParams, "thumbMediaID")
	}
	params.MapData["thumbMediaID"] = params.ThumbMediaID
	if utils.TrimBlankChar(c.GetString("showCoverPic")) != "" {
		params.MapData["showCoverPic"] = params.ShowCoverPic
	}
	if utils.TrimBlankChar(c.GetString("needOpenComment")) != "" {
		params.MapData["needOpenComment"] = params.NeedOpenComment
	}
	if utils.TrimBlankChar(c.GetString("onlyFansCanComment")) != "" {
		params.MapData["onlyFansCanComment"] = params.OnlyFansCanComment
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API KnowController.AddMaterial, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API KnowController.AddMaterial, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API KnowController.AddMaterial error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSessionGetEnterpriseTokenParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
}

// func (c *SessionController) GetEnterpriseToken() {
// 	c.callGetEnterpriseToken(func(params *tSessionGetEnterpriseTokenParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SessionController) callGetEnterpriseToken(handler func(params *tSessionGetEnterpriseTokenParams) (interface{}, string, error)) {
	var err error
	params := &tSessionGetEnterpriseTokenParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SessionController.GetEnterpriseToken, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SessionController.GetEnterpriseToken, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SessionController.GetEnterpriseToken error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderBuyerCancelOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	Reason		string
}

// func (c *JxOrderController) BuyerCancelOrder() {
// 	c.callBuyerCancelOrder(func(params *tJxorderBuyerCancelOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callBuyerCancelOrder(handler func(params *tJxorderBuyerCancelOrderParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderBuyerCancelOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("reason") == "" {
		errParams = append(errParams, "reason")
	}
	params.MapData["reason"] = params.Reason
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.BuyerCancelOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.BuyerCancelOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.BuyerCancelOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetTiktokCategoryValueParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryId		int
	VendorOrgCode		string
}

// func (c *SkuController) GetTiktokCategoryValue() {
// 	c.callGetTiktokCategoryValue(func(params *tSkuGetTiktokCategoryValueParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetTiktokCategoryValue(handler func(params *tSkuGetTiktokCategoryValueParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetTiktokCategoryValueParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryId, err = c.GetInt("categoryId", 0); err != nil {
		errParams = append(errParams, "categoryId")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("categoryId")) != "" {
		params.MapData["categoryId"] = params.CategoryId
	}
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetTiktokCategoryValue, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetTiktokCategoryValue, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetTiktokCategoryValue error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetMTCategoryAttrListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppOrgCode		string
	CategoryId		int
}

// func (c *SkuController) GetMTCategoryAttrList() {
// 	c.callGetMTCategoryAttrList(func(params *tSkuGetMTCategoryAttrListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetMTCategoryAttrList(handler func(params *tSkuGetMTCategoryAttrListParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetMTCategoryAttrListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppOrgCode = utils.TrimBlankChar(c.GetString("appOrgCode"))
	if params.CategoryId, err = c.GetInt("categoryId", 0); err != nil {
		errParams = append(errParams, "categoryId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("appOrgCode") == "" {
		errParams = append(errParams, "appOrgCode")
	}
	params.MapData["appOrgCode"] = params.AppOrgCode
	if c.GetString("categoryId") == "" {
		errParams = append(errParams, "categoryId")
	}
	params.MapData["categoryId"] = params.CategoryId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetMTCategoryAttrList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetMTCategoryAttrList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetMTCategoryAttrList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreScoreStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
}

// func (c *StoreController) ScoreStore() {
// 	c.callScoreStore(func(params *tStoreScoreStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callScoreStore(handler func(params *tStoreScoreStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreScoreStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.ScoreStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.ScoreStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.ScoreStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysGetPushTokenParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	AccessKey		string
	OldToken		string
	WaitSecond		int
}

// func (c *SysController) GetPushToken() {
// 	c.callGetPushToken(func(params *tSysGetPushTokenParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callGetPushToken(handler func(params *tSysGetPushTokenParams) (interface{}, string, error)) {
	var err error
	params := &tSysGetPushTokenParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.AccessKey = utils.TrimBlankChar(c.GetString("accessKey"))
	params.OldToken = utils.TrimBlankChar(c.GetString("oldToken"))
	if params.WaitSecond, err = c.GetInt("waitSecond", 0); err != nil {
		errParams = append(errParams, "waitSecond")
	}
	if c.GetString("accessKey") == "" {
		errParams = append(errParams, "accessKey")
	}
	params.MapData["accessKey"] = params.AccessKey
	if utils.TrimBlankChar(c.GetString("oldToken")) != "" {
		params.MapData["oldToken"] = params.OldToken
	}
	if utils.TrimBlankChar(c.GetString("waitSecond")) != "" {
		params.MapData["waitSecond"] = params.WaitSecond
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.GetPushToken, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.GetPushToken, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.GetPushToken error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerGetRoleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
}

// func (c *PowerController) GetRole() {
// 	c.callGetRole(func(params *tPowerGetRoleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callGetRole(handler func(params *tPowerGetRoleParams) (interface{}, string, error)) {
	var err error
	params := &tPowerGetRoleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.GetRole, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.GetRole, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.GetRole error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryCustomerCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BusinessScene		string
	ParentCode		string
}

// func (c *LaKaLaController) QueryCustomerCategory() {
// 	c.callQueryCustomerCategory(func(params *tLakalaQueryCustomerCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryCustomerCategory(handler func(params *tLakalaQueryCustomerCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryCustomerCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.BusinessScene = utils.TrimBlankChar(c.GetString("businessScene"))
	params.ParentCode = utils.TrimBlankChar(c.GetString("parentCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("businessScene") == "" {
		errParams = append(errParams, "businessScene")
	}
	params.MapData["businessScene"] = params.BusinessScene
	if utils.TrimBlankChar(c.GetString("parentCode")) != "" {
		params.MapData["parentCode"] = params.ParentCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryCustomerCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryCustomerCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryCustomerCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderUpdateOrderWaybillTipParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	TipFee		int
	IsPay		int
}

// func (c *OrderController) UpdateOrderWaybillTip() {
// 	c.callUpdateOrderWaybillTip(func(params *tOrderUpdateOrderWaybillTipParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callUpdateOrderWaybillTip(handler func(params *tOrderUpdateOrderWaybillTipParams) (interface{}, string, error)) {
	var err error
	params := &tOrderUpdateOrderWaybillTipParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.TipFee, err = c.GetInt("tipFee", 0); err != nil {
		errParams = append(errParams, "tipFee")
	}
	if params.IsPay, err = c.GetInt("isPay", 0); err != nil {
		errParams = append(errParams, "isPay")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("tipFee") == "" {
		errParams = append(errParams, "tipFee")
	}
	params.MapData["tipFee"] = params.TipFee
	if utils.TrimBlankChar(c.GetString("isPay")) != "" {
		params.MapData["isPay"] = params.IsPay
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.UpdateOrderWaybillTip, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.UpdateOrderWaybillTip, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.UpdateOrderWaybillTip error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	IsFocus		bool
	Keyword		string
	NameID		int
	NameIDs		string
	SkuID		int
	SkuIDs		string
	Name		string
	Prefix		string
	CategoryID		int
	Unit		string
	FromStatus		int
	ToStatus		int
	StFromTime		string
	StToTime		string
	StFromCount		int
	StToCount		int
	IsGetOpRequest		bool
	Offset		int
	PageSize		int
	IsBySku		bool
	IsAct		bool
	ActVendorID		int
	JdSyncStatus		int
	EbaiSyncStatus		int
	MtwmSyncStatus		int
	TaoSyncStatus		int
	LockTime		string
}

// func (c *StoreSkuController) GetStoreSkus() {
// 	c.callGetStoreSkus(func(params *tStoreSkuGetStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetStoreSkus(handler func(params *tStoreSkuGetStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.IsFocus, err = c.GetBool("isFocus", false); err != nil {
		errParams = append(errParams, "isFocus")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.NameID, err = c.GetInt("nameID", 0); err != nil {
		errParams = append(errParams, "nameID")
	}
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.Prefix = utils.TrimBlankChar(c.GetString("prefix"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	params.Unit = utils.TrimBlankChar(c.GetString("unit"))
	if params.FromStatus, err = c.GetInt("fromStatus", 0); err != nil {
		errParams = append(errParams, "fromStatus")
	}
	if params.ToStatus, err = c.GetInt("toStatus", 0); err != nil {
		errParams = append(errParams, "toStatus")
	}
	params.StFromTime = utils.TrimBlankChar(c.GetString("stFromTime"))
	params.StToTime = utils.TrimBlankChar(c.GetString("stToTime"))
	if params.StFromCount, err = c.GetInt("stFromCount", 0); err != nil {
		errParams = append(errParams, "stFromCount")
	}
	if params.StToCount, err = c.GetInt("stToCount", 0); err != nil {
		errParams = append(errParams, "stToCount")
	}
	if params.IsGetOpRequest, err = c.GetBool("isGetOpRequest", false); err != nil {
		errParams = append(errParams, "isGetOpRequest")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.IsBySku, err = c.GetBool("isBySku", false); err != nil {
		errParams = append(errParams, "isBySku")
	}
	if params.IsAct, err = c.GetBool("isAct", false); err != nil {
		errParams = append(errParams, "isAct")
	}
	if params.ActVendorID, err = c.GetInt("actVendorID", 0); err != nil {
		errParams = append(errParams, "actVendorID")
	}
	if params.JdSyncStatus, err = c.GetInt("jdSyncStatus", 0); err != nil {
		errParams = append(errParams, "jdSyncStatus")
	}
	if params.EbaiSyncStatus, err = c.GetInt("ebaiSyncStatus", 0); err != nil {
		errParams = append(errParams, "ebaiSyncStatus")
	}
	if params.MtwmSyncStatus, err = c.GetInt("mtwmSyncStatus", 0); err != nil {
		errParams = append(errParams, "mtwmSyncStatus")
	}
	if params.TaoSyncStatus, err = c.GetInt("taoSyncStatus", 0); err != nil {
		errParams = append(errParams, "taoSyncStatus")
	}
	params.LockTime = utils.TrimBlankChar(c.GetString("lockTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("isFocus") == "" {
		errParams = append(errParams, "isFocus")
	}
	params.MapData["isFocus"] = params.IsFocus
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("nameID")) != "" {
		params.MapData["nameID"] = params.NameID
	}
	if utils.TrimBlankChar(c.GetString("nameIDs")) != "" {
		params.MapData["nameIDs"] = params.NameIDs
	}
	if utils.TrimBlankChar(c.GetString("skuID")) != "" {
		params.MapData["skuID"] = params.SkuID
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("prefix")) != "" {
		params.MapData["prefix"] = params.Prefix
	}
	if utils.TrimBlankChar(c.GetString("categoryID")) != "" {
		params.MapData["categoryID"] = params.CategoryID
	}
	if utils.TrimBlankChar(c.GetString("unit")) != "" {
		params.MapData["unit"] = params.Unit
	}
	if utils.TrimBlankChar(c.GetString("fromStatus")) != "" {
		params.MapData["fromStatus"] = params.FromStatus
	}
	if utils.TrimBlankChar(c.GetString("toStatus")) != "" {
		params.MapData["toStatus"] = params.ToStatus
	}
	if utils.TrimBlankChar(c.GetString("stFromTime")) != "" {
		params.MapData["stFromTime"] = params.StFromTime
	}
	if utils.TrimBlankChar(c.GetString("stToTime")) != "" {
		params.MapData["stToTime"] = params.StToTime
	}
	if utils.TrimBlankChar(c.GetString("stFromCount")) != "" {
		params.MapData["stFromCount"] = params.StFromCount
	}
	if utils.TrimBlankChar(c.GetString("stToCount")) != "" {
		params.MapData["stToCount"] = params.StToCount
	}
	if utils.TrimBlankChar(c.GetString("isGetOpRequest")) != "" {
		params.MapData["isGetOpRequest"] = params.IsGetOpRequest
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if utils.TrimBlankChar(c.GetString("isBySku")) != "" {
		params.MapData["isBySku"] = params.IsBySku
	}
	if utils.TrimBlankChar(c.GetString("isAct")) != "" {
		params.MapData["isAct"] = params.IsAct
	}
	if utils.TrimBlankChar(c.GetString("actVendorID")) != "" {
		params.MapData["actVendorID"] = params.ActVendorID
	}
	if utils.TrimBlankChar(c.GetString("jdSyncStatus")) != "" {
		params.MapData["jdSyncStatus"] = params.JdSyncStatus
	}
	if utils.TrimBlankChar(c.GetString("ebaiSyncStatus")) != "" {
		params.MapData["ebaiSyncStatus"] = params.EbaiSyncStatus
	}
	if utils.TrimBlankChar(c.GetString("mtwmSyncStatus")) != "" {
		params.MapData["mtwmSyncStatus"] = params.MtwmSyncStatus
	}
	if utils.TrimBlankChar(c.GetString("taoSyncStatus")) != "" {
		params.MapData["taoSyncStatus"] = params.TaoSyncStatus
	}
	if utils.TrimBlankChar(c.GetString("lockTime")) != "" {
		params.MapData["lockTime"] = params.LockTime
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaUploadAttachmentImgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrgCode		string
	AttType		string
	AttExtName		string
	AttContext		string
}

// func (c *LaKaLaController) UploadAttachmentImg() {
// 	c.callUploadAttachmentImg(func(params *tLakalaUploadAttachmentImgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callUploadAttachmentImg(handler func(params *tLakalaUploadAttachmentImgParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaUploadAttachmentImgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrgCode = utils.TrimBlankChar(c.GetString("orgCode"))
	params.AttType = utils.TrimBlankChar(c.GetString("attType"))
	params.AttExtName = utils.TrimBlankChar(c.GetString("attExtName"))
	params.AttContext = utils.TrimBlankChar(c.GetString("attContext"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("orgCode") == "" {
		errParams = append(errParams, "orgCode")
	}
	params.MapData["orgCode"] = params.OrgCode
	if c.GetString("attType") == "" {
		errParams = append(errParams, "attType")
	}
	params.MapData["attType"] = params.AttType
	if c.GetString("attExtName") == "" {
		errParams = append(errParams, "attExtName")
	}
	params.MapData["attExtName"] = params.AttExtName
	if c.GetString("attContext") == "" {
		errParams = append(errParams, "attContext")
	}
	params.MapData["attContext"] = params.AttContext
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.UploadAttachmentImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.UploadAttachmentImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.UploadAttachmentImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderComplaintRiderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	WaybillVendorID		string
	WaybillID		string
	ComplaintID		int
}

// func (c *OrderController) ComplaintRider() {
// 	c.callComplaintRider(func(params *tOrderComplaintRiderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callComplaintRider(handler func(params *tOrderComplaintRiderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderComplaintRiderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.WaybillVendorID = utils.TrimBlankChar(c.GetString("waybillVendorID"))
	params.WaybillID = utils.TrimBlankChar(c.GetString("waybillID"))
	if params.ComplaintID, err = c.GetInt("complaintID", 0); err != nil {
		errParams = append(errParams, "complaintID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("waybillVendorID") == "" {
		errParams = append(errParams, "waybillVendorID")
	}
	params.MapData["waybillVendorID"] = params.WaybillVendorID
	if utils.TrimBlankChar(c.GetString("waybillID")) != "" {
		params.MapData["waybillID"] = params.WaybillID
	}
	if c.GetString("complaintID") == "" {
		errParams = append(errParams, "complaintID")
	}
	params.MapData["complaintID"] = params.ComplaintID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ComplaintRider, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ComplaintRider, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ComplaintRider error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreCategoryNoDefaultParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ParentID		int
	Level		int
	StoreID		int
}

// func (c *StoreController) GetStoreCategoryNoDefault() {
// 	c.callGetStoreCategoryNoDefault(func(params *tStoreGetStoreCategoryNoDefaultParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreCategoryNoDefault(handler func(params *tStoreGetStoreCategoryNoDefaultParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreCategoryNoDefaultParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("parentID")) != "" {
		params.MapData["parentID"] = params.ParentID
	}
	if utils.TrimBlankChar(c.GetString("level")) != "" {
		params.MapData["level"] = params.Level
	}
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreCategoryNoDefault, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreCategoryNoDefault, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreCategoryNoDefault error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerGetMenuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserID		string
}

// func (c *PowerController) GetMenu() {
// 	c.callGetMenu(func(params *tPowerGetMenuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callGetMenu(handler func(params *tPowerGetMenuParams) (interface{}, string, error)) {
	var err error
	params := &tPowerGetMenuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("userID")) != "" {
		params.MapData["userID"] = params.UserID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.GetMenu, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.GetMenu, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.GetMenu error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tKnowGetMaterialListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Offset		int
	PageSize		int
}

// func (c *KnowController) GetMaterialList() {
// 	c.callGetMaterialList(func(params *tKnowGetMaterialListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *KnowController) callGetMaterialList(handler func(params *tKnowGetMaterialListParams) (interface{}, string, error)) {
	var err error
	params := &tKnowGetMaterialListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API KnowController.GetMaterialList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API KnowController.GetMaterialList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API KnowController.GetMaterialList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrdersSupplementParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorOrderID		string
	VendorIDs		string
	FromTime		string
	ToTime		string
	Statuss		string
	Type		int
	IsReverse		int
	Offset		int
	PageSize		int
}

// func (c *OrderController) GetOrdersSupplement() {
// 	c.callGetOrdersSupplement(func(params *tOrderGetOrdersSupplementParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrdersSupplement(handler func(params *tOrderGetOrdersSupplementParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrdersSupplementParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	if params.Type, err = c.GetInt("type", 0); err != nil {
		errParams = append(errParams, "type")
	}
	if params.IsReverse, err = c.GetInt("isReverse", 0); err != nil {
		errParams = append(errParams, "isReverse")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("type")) != "" {
		params.MapData["type"] = params.Type
	}
	if utils.TrimBlankChar(c.GetString("isReverse")) != "" {
		params.MapData["isReverse"] = params.IsReverse
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrdersSupplement, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrdersSupplement, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrdersSupplement error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuMTSku2LocalParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorSkuName		string
	VendorOrderID		string
}

// func (c *SkuController) MTSku2Local() {
// 	c.callMTSku2Local(func(params *tSkuMTSku2LocalParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callMTSku2Local(handler func(params *tSkuMTSku2LocalParams) (interface{}, string, error)) {
	var err error
	params := &tSkuMTSku2LocalParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorSkuName = utils.TrimBlankChar(c.GetString("vendorSkuName"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorSkuName") == "" {
		errParams = append(errParams, "vendorSkuName")
	}
	params.MapData["vendorSkuName"] = params.VendorSkuName
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.MTSku2Local, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.MTSku2Local, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.MTSku2Local error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSetStoreAutoCallRiderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
	OpenIDs		string
	CloseIDs		string
}

// func (c *StoreController) SetStoreAutoCallRider() {
// 	c.callSetStoreAutoCallRider(func(params *tStoreSetStoreAutoCallRiderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callSetStoreAutoCallRider(handler func(params *tStoreSetStoreAutoCallRiderParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSetStoreAutoCallRiderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.OpenIDs = utils.TrimBlankChar(c.GetString("openIDs"))
	params.CloseIDs = utils.TrimBlankChar(c.GetString("closeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if utils.TrimBlankChar(c.GetString("openIDs")) != "" {
		params.MapData["openIDs"] = params.OpenIDs
	}
	if utils.TrimBlankChar(c.GetString("closeIDs")) != "" {
		params.MapData["closeIDs"] = params.CloseIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.SetStoreAutoCallRider, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.SetStoreAutoCallRider, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.SetStoreAutoCallRider error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetStoresSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	IsFocus		bool
	Keyword		string
	NameIDs		string
	SkuIDs		string
	Upcs		string
	Name		string
	Prefix		string
	CategoryID		int
	Unit		string
	FromStatus		int
	ToStatus		int
	StFromTime		string
	StToTime		string
	StFromCount		int
	StToCount		int
	IsGetOpRequest		bool
	Offset		int
	PageSize		int
	IsBySku		bool
	IsAct		bool
	ActVendorID		int
	JdSyncStatus		int
	EbaiSyncStatus		int
	MtwmSyncStatus		int
	TaoSyncStatus		int
	LockTime		string
	IsHighPrice		bool
	PriceType		int
	HighestPrice		string
	MinimumPrice		string
	MinStock		int
	MaxStock		int
	IsLocationCode		bool
}

// func (c *StoreSkuController) GetStoresSkus() {
// 	c.callGetStoresSkus(func(params *tStoreSkuGetStoresSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetStoresSkus(handler func(params *tStoreSkuGetStoresSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetStoresSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsFocus, err = c.GetBool("isFocus", false); err != nil {
		errParams = append(errParams, "isFocus")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	params.Upcs = utils.TrimBlankChar(c.GetString("upcs"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.Prefix = utils.TrimBlankChar(c.GetString("prefix"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	params.Unit = utils.TrimBlankChar(c.GetString("unit"))
	if params.FromStatus, err = c.GetInt("fromStatus", 0); err != nil {
		errParams = append(errParams, "fromStatus")
	}
	if params.ToStatus, err = c.GetInt("toStatus", 0); err != nil {
		errParams = append(errParams, "toStatus")
	}
	params.StFromTime = utils.TrimBlankChar(c.GetString("stFromTime"))
	params.StToTime = utils.TrimBlankChar(c.GetString("stToTime"))
	if params.StFromCount, err = c.GetInt("stFromCount", 0); err != nil {
		errParams = append(errParams, "stFromCount")
	}
	if params.StToCount, err = c.GetInt("stToCount", 0); err != nil {
		errParams = append(errParams, "stToCount")
	}
	if params.IsGetOpRequest, err = c.GetBool("isGetOpRequest", false); err != nil {
		errParams = append(errParams, "isGetOpRequest")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.IsBySku, err = c.GetBool("isBySku", false); err != nil {
		errParams = append(errParams, "isBySku")
	}
	if params.IsAct, err = c.GetBool("isAct", false); err != nil {
		errParams = append(errParams, "isAct")
	}
	if params.ActVendorID, err = c.GetInt("actVendorID", 0); err != nil {
		errParams = append(errParams, "actVendorID")
	}
	if params.JdSyncStatus, err = c.GetInt("jdSyncStatus", 0); err != nil {
		errParams = append(errParams, "jdSyncStatus")
	}
	if params.EbaiSyncStatus, err = c.GetInt("ebaiSyncStatus", 0); err != nil {
		errParams = append(errParams, "ebaiSyncStatus")
	}
	if params.MtwmSyncStatus, err = c.GetInt("mtwmSyncStatus", 0); err != nil {
		errParams = append(errParams, "mtwmSyncStatus")
	}
	if params.TaoSyncStatus, err = c.GetInt("taoSyncStatus", 0); err != nil {
		errParams = append(errParams, "taoSyncStatus")
	}
	params.LockTime = utils.TrimBlankChar(c.GetString("lockTime"))
	if params.IsHighPrice, err = c.GetBool("isHighPrice", false); err != nil {
		errParams = append(errParams, "isHighPrice")
	}
	if params.PriceType, err = c.GetInt("priceType", 0); err != nil {
		errParams = append(errParams, "priceType")
	}
	params.HighestPrice = utils.TrimBlankChar(c.GetString("highestPrice"))
	params.MinimumPrice = utils.TrimBlankChar(c.GetString("minimumPrice"))
	if params.MinStock, err = c.GetInt("minStock", 0); err != nil {
		errParams = append(errParams, "minStock")
	}
	if params.MaxStock, err = c.GetInt("maxStock", 0); err != nil {
		errParams = append(errParams, "maxStock")
	}
	if params.IsLocationCode, err = c.GetBool("isLocationCode", false); err != nil {
		errParams = append(errParams, "isLocationCode")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if c.GetString("isFocus") == "" {
		errParams = append(errParams, "isFocus")
	}
	params.MapData["isFocus"] = params.IsFocus
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("nameIDs")) != "" {
		params.MapData["nameIDs"] = params.NameIDs
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("upcs")) != "" {
		params.MapData["upcs"] = params.Upcs
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("prefix")) != "" {
		params.MapData["prefix"] = params.Prefix
	}
	if utils.TrimBlankChar(c.GetString("categoryID")) != "" {
		params.MapData["categoryID"] = params.CategoryID
	}
	if utils.TrimBlankChar(c.GetString("unit")) != "" {
		params.MapData["unit"] = params.Unit
	}
	if utils.TrimBlankChar(c.GetString("fromStatus")) != "" {
		params.MapData["fromStatus"] = params.FromStatus
	}
	if utils.TrimBlankChar(c.GetString("toStatus")) != "" {
		params.MapData["toStatus"] = params.ToStatus
	}
	if utils.TrimBlankChar(c.GetString("stFromTime")) != "" {
		params.MapData["stFromTime"] = params.StFromTime
	}
	if utils.TrimBlankChar(c.GetString("stToTime")) != "" {
		params.MapData["stToTime"] = params.StToTime
	}
	if utils.TrimBlankChar(c.GetString("stFromCount")) != "" {
		params.MapData["stFromCount"] = params.StFromCount
	}
	if utils.TrimBlankChar(c.GetString("stToCount")) != "" {
		params.MapData["stToCount"] = params.StToCount
	}
	if utils.TrimBlankChar(c.GetString("isGetOpRequest")) != "" {
		params.MapData["isGetOpRequest"] = params.IsGetOpRequest
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if utils.TrimBlankChar(c.GetString("isBySku")) != "" {
		params.MapData["isBySku"] = params.IsBySku
	}
	if utils.TrimBlankChar(c.GetString("isAct")) != "" {
		params.MapData["isAct"] = params.IsAct
	}
	if utils.TrimBlankChar(c.GetString("actVendorID")) != "" {
		params.MapData["actVendorID"] = params.ActVendorID
	}
	if utils.TrimBlankChar(c.GetString("jdSyncStatus")) != "" {
		params.MapData["jdSyncStatus"] = params.JdSyncStatus
	}
	if utils.TrimBlankChar(c.GetString("ebaiSyncStatus")) != "" {
		params.MapData["ebaiSyncStatus"] = params.EbaiSyncStatus
	}
	if utils.TrimBlankChar(c.GetString("mtwmSyncStatus")) != "" {
		params.MapData["mtwmSyncStatus"] = params.MtwmSyncStatus
	}
	if utils.TrimBlankChar(c.GetString("taoSyncStatus")) != "" {
		params.MapData["taoSyncStatus"] = params.TaoSyncStatus
	}
	if utils.TrimBlankChar(c.GetString("lockTime")) != "" {
		params.MapData["lockTime"] = params.LockTime
	}
	if utils.TrimBlankChar(c.GetString("isHighPrice")) != "" {
		params.MapData["isHighPrice"] = params.IsHighPrice
	}
	if utils.TrimBlankChar(c.GetString("priceType")) != "" {
		params.MapData["priceType"] = params.PriceType
	}
	if utils.TrimBlankChar(c.GetString("highestPrice")) != "" {
		params.MapData["highestPrice"] = params.HighestPrice
	}
	if utils.TrimBlankChar(c.GetString("minimumPrice")) != "" {
		params.MapData["minimumPrice"] = params.MinimumPrice
	}
	if utils.TrimBlankChar(c.GetString("minStock")) != "" {
		params.MapData["minStock"] = params.MinStock
	}
	if utils.TrimBlankChar(c.GetString("maxStock")) != "" {
		params.MapData["maxStock"] = params.MaxStock
	}
	if utils.TrimBlankChar(c.GetString("isLocationCode")) != "" {
		params.MapData["isLocationCode"] = params.IsLocationCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetStoresSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetStoresSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetStoresSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportOrderDeliveryReportParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	BrandIDs		string
	VendorID		int
	DeliveryVendorID		int
	Keyword		string
	FromTime		string
	ToTime		string
	IsFinished		bool
	Offset		int
	PageSize		int
}

// func (c *ReportController) OrderDeliveryReport() {
// 	c.callOrderDeliveryReport(func(params *tReportOrderDeliveryReportParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callOrderDeliveryReport(handler func(params *tReportOrderDeliveryReportParams) (interface{}, string, error)) {
	var err error
	params := &tReportOrderDeliveryReportParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.BrandIDs = utils.TrimBlankChar(c.GetString("brandIDs"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.DeliveryVendorID, err = c.GetInt("deliveryVendorID", 0); err != nil {
		errParams = append(errParams, "deliveryVendorID")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.IsFinished, err = c.GetBool("isFinished", false); err != nil {
		errParams = append(errParams, "isFinished")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("brandIDs")) != "" {
		params.MapData["brandIDs"] = params.BrandIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("deliveryVendorID")) != "" {
		params.MapData["deliveryVendorID"] = params.DeliveryVendorID
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if utils.TrimBlankChar(c.GetString("isFinished")) != "" {
		params.MapData["isFinished"] = params.IsFinished
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.OrderDeliveryReport, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.OrderDeliveryReport, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.OrderDeliveryReport error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderAmendMissingOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromDate		string
	ToDate		string
	VendorIDs		string
	StoreID		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *OrderController) AmendMissingOrders() {
// 	c.callAmendMissingOrders(func(params *tOrderAmendMissingOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callAmendMissingOrders(handler func(params *tOrderAmendMissingOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tOrderAmendMissingOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.AmendMissingOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.AmendMissingOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.AmendMissingOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopRefreshMtpsWaybillFeeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *TempOpController) RefreshMtpsWaybillFee() {
// 	c.callRefreshMtpsWaybillFee(func(params *tTempopRefreshMtpsWaybillFeeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callRefreshMtpsWaybillFee(handler func(params *tTempopRefreshMtpsWaybillFeeParams) (interface{}, string, error)) {
	var err error
	params := &tTempopRefreshMtpsWaybillFeeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.RefreshMtpsWaybillFee, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.RefreshMtpsWaybillFee, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.RefreshMtpsWaybillFee error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderAcceptOrRefuseOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	IsAccept		bool
}

// func (c *OrderController) AcceptOrRefuseOrder() {
// 	c.callAcceptOrRefuseOrder(func(params *tOrderAcceptOrRefuseOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callAcceptOrRefuseOrder(handler func(params *tOrderAcceptOrRefuseOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderAcceptOrRefuseOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsAccept, err = c.GetBool("isAccept", false); err != nil {
		errParams = append(errParams, "isAccept")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("isAccept") == "" {
		errParams = append(errParams, "isAccept")
	}
	params.MapData["isAccept"] = params.IsAccept
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.AcceptOrRefuseOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.AcceptOrRefuseOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.AcceptOrRefuseOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreAddBrandCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandID		int
	CategroyID		int
	Level		int
	ParentID		int
	BrandCategroyName		string
	BrandCategroySeq		int
}

// func (c *StoreController) AddBrandCategoryMap() {
// 	c.callAddBrandCategoryMap(func(params *tStoreAddBrandCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callAddBrandCategoryMap(handler func(params *tStoreAddBrandCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreAddBrandCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.CategroyID, err = c.GetInt("categroyID", 0); err != nil {
		errParams = append(errParams, "categroyID")
	}
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	params.BrandCategroyName = utils.TrimBlankChar(c.GetString("brandCategroyName"))
	if params.BrandCategroySeq, err = c.GetInt("brandCategroySeq", 0); err != nil {
		errParams = append(errParams, "brandCategroySeq")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("brandID") == "" {
		errParams = append(errParams, "brandID")
	}
	params.MapData["brandID"] = params.BrandID
	if utils.TrimBlankChar(c.GetString("categroyID")) != "" {
		params.MapData["categroyID"] = params.CategroyID
	}
	if c.GetString("level") == "" {
		errParams = append(errParams, "level")
	}
	params.MapData["level"] = params.Level
	if c.GetString("parentID") == "" {
		errParams = append(errParams, "parentID")
	}
	params.MapData["parentID"] = params.ParentID
	if c.GetString("brandCategroyName") == "" {
		errParams = append(errParams, "brandCategroyName")
	}
	params.MapData["brandCategroyName"] = params.BrandCategroyName
	if c.GetString("brandCategroySeq") == "" {
		errParams = append(errParams, "brandCategroySeq")
	}
	params.MapData["brandCategroySeq"] = params.BrandCategroySeq
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.AddBrandCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.AddBrandCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.AddBrandCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetStoreAbnormalSkuCountParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	SyncStatus		int
	IsBySku		bool
	FromStatus		int
	ToStatus		int
}

// func (c *StoreSkuController) GetStoreAbnormalSkuCount() {
// 	c.callGetStoreAbnormalSkuCount(func(params *tStoreSkuGetStoreAbnormalSkuCountParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetStoreAbnormalSkuCount(handler func(params *tStoreSkuGetStoreAbnormalSkuCountParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetStoreAbnormalSkuCountParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.SyncStatus, err = c.GetInt("syncStatus", 0); err != nil {
		errParams = append(errParams, "syncStatus")
	}
	if params.IsBySku, err = c.GetBool("isBySku", false); err != nil {
		errParams = append(errParams, "isBySku")
	}
	if params.FromStatus, err = c.GetInt("fromStatus", 0); err != nil {
		errParams = append(errParams, "fromStatus")
	}
	if params.ToStatus, err = c.GetInt("toStatus", 0); err != nil {
		errParams = append(errParams, "toStatus")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("syncStatus") == "" {
		errParams = append(errParams, "syncStatus")
	}
	params.MapData["syncStatus"] = params.SyncStatus
	if utils.TrimBlankChar(c.GetString("isBySku")) != "" {
		params.MapData["isBySku"] = params.IsBySku
	}
	if utils.TrimBlankChar(c.GetString("fromStatus")) != "" {
		params.MapData["fromStatus"] = params.FromStatus
	}
	if utils.TrimBlankChar(c.GetString("toStatus")) != "" {
		params.MapData["toStatus"] = params.ToStatus
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetStoreAbnormalSkuCount, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetStoreAbnormalSkuCount, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetStoreAbnormalSkuCount error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncSyncStoresParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	VendorOrgCodes		string
	StoreIDs		string
	IsForce		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) SyncStores() {
// 	c.callSyncStores(func(params *tSyncSyncStoresParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callSyncStores(handler func(params *tSyncSyncStoresParams) (interface{}, string, error)) {
	var err error
	params := &tSyncSyncStoresParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.VendorOrgCodes = utils.TrimBlankChar(c.GetString("vendorOrgCodes"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorOrgCodes")) != "" {
		params.MapData["vendorOrgCodes"] = params.VendorOrgCodes
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.SyncStores, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.SyncStores, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.SyncStores error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2QueryMyDeliveryAddressParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *User2Controller) QueryMyDeliveryAddress() {
// 	c.callQueryMyDeliveryAddress(func(params *tUser2QueryMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callQueryMyDeliveryAddress(handler func(params *tUser2QueryMyDeliveryAddressParams) (interface{}, string, error)) {
	var err error
	params := &tUser2QueryMyDeliveryAddressParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.QueryMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.QueryMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.QueryMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysUpdateVendorOrgCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Id		int
	Payload		string
}

// func (c *SysController) UpdateVendorOrgCode() {
// 	c.callUpdateVendorOrgCode(func(params *tSysUpdateVendorOrgCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callUpdateVendorOrgCode(handler func(params *tSysUpdateVendorOrgCodeParams) (interface{}, string, error)) {
	var err error
	params := &tSysUpdateVendorOrgCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Id, err = c.GetInt("id", 0); err != nil {
		errParams = append(errParams, "id")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("id") == "" {
		errParams = append(errParams, "id")
	}
	params.MapData["id"] = params.Id
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.UpdateVendorOrgCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.UpdateVendorOrgCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.UpdateVendorOrgCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaUpdateAuthenticationParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	AuthType		string
}

// func (c *LaKaLaController) UpdateAuthentication() {
// 	c.callUpdateAuthentication(func(params *tLakalaUpdateAuthenticationParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callUpdateAuthentication(handler func(params *tLakalaUpdateAuthenticationParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaUpdateAuthenticationParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	params.AuthType = utils.TrimBlankChar(c.GetString("authType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("authType") == "" {
		errParams = append(errParams, "authType")
	}
	params.MapData["authType"] = params.AuthType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.UpdateAuthentication, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.UpdateAuthentication, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.UpdateAuthentication error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetComplaintReasonsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *OrderController) GetComplaintReasons() {
// 	c.callGetComplaintReasons(func(params *tOrderGetComplaintReasonsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetComplaintReasons(handler func(params *tOrderGetComplaintReasonsParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetComplaintReasonsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetComplaintReasons, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetComplaintReasons, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetComplaintReasons error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefreshJdShopOrdersEarningPriceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
}

// func (c *OrderController) RefreshJdShopOrdersEarningPrice() {
// 	c.callRefreshJdShopOrdersEarningPrice(func(params *tOrderRefreshJdShopOrdersEarningPriceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefreshJdShopOrdersEarningPrice(handler func(params *tOrderRefreshJdShopOrdersEarningPriceParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefreshJdShopOrdersEarningPriceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefreshJdShopOrdersEarningPrice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefreshJdShopOrdersEarningPrice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefreshJdShopOrdersEarningPrice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetMatterOrderStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *JxOrderController) GetMatterOrderStatus() {
// 	c.callGetMatterOrderStatus(func(params *tJxorderGetMatterOrderStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetMatterOrderStatus(handler func(params *tJxorderGetMatterOrderStatusParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetMatterOrderStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetMatterOrderStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetMatterOrderStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetMatterOrderStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStorePriceScoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	SnapDate		string
	FromScore		int
	ToScore		int
	Sort		int
	Offset		int
	PageSize		int
}

// func (c *StoreController) GetStorePriceScore() {
// 	c.callGetStorePriceScore(func(params *tStoreGetStorePriceScoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStorePriceScore(handler func(params *tStoreGetStorePriceScoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStorePriceScoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.SnapDate = utils.TrimBlankChar(c.GetString("snapDate"))
	if params.FromScore, err = c.GetInt("fromScore", 0); err != nil {
		errParams = append(errParams, "fromScore")
	}
	if params.ToScore, err = c.GetInt("toScore", 0); err != nil {
		errParams = append(errParams, "toScore")
	}
	if params.Sort, err = c.GetInt("sort", 0); err != nil {
		errParams = append(errParams, "sort")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if c.GetString("snapDate") == "" {
		errParams = append(errParams, "snapDate")
	}
	params.MapData["snapDate"] = params.SnapDate
	if utils.TrimBlankChar(c.GetString("fromScore")) != "" {
		params.MapData["fromScore"] = params.FromScore
	}
	if utils.TrimBlankChar(c.GetString("toScore")) != "" {
		params.MapData["toScore"] = params.ToScore
	}
	if utils.TrimBlankChar(c.GetString("sort")) != "" {
		params.MapData["sort"] = params.Sort
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStorePriceScore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStorePriceScore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStorePriceScore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuSyncMatterC4ToGyParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *StoreSkuController) SyncMatterC4ToGy() {
// 	c.callSyncMatterC4ToGy(func(params *tStoreSkuSyncMatterC4ToGyParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callSyncMatterC4ToGy(handler func(params *tStoreSkuSyncMatterC4ToGyParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuSyncMatterC4ToGyParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.SyncMatterC4ToGy, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.SyncMatterC4ToGy, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.SyncMatterC4ToGy error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tYonghuiUpdateJxPriceByWeimobParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *YongHuiController) UpdateJxPriceByWeimob() {
// 	c.callUpdateJxPriceByWeimob(func(params *tYonghuiUpdateJxPriceByWeimobParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *YongHuiController) callUpdateJxPriceByWeimob(handler func(params *tYonghuiUpdateJxPriceByWeimobParams) (interface{}, string, error)) {
	var err error
	params := &tYonghuiUpdateJxPriceByWeimobParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API YongHuiController.UpdateJxPriceByWeimob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API YongHuiController.UpdateJxPriceByWeimob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API YongHuiController.UpdateJxPriceByWeimob error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetDiffJxStoreAndMTWMStoreInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
}

// func (c *StoreController) GetDiffJxStoreAndMTWMStoreInfo() {
// 	c.callGetDiffJxStoreAndMTWMStoreInfo(func(params *tStoreGetDiffJxStoreAndMTWMStoreInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetDiffJxStoreAndMTWMStoreInfo(handler func(params *tStoreGetDiffJxStoreAndMTWMStoreInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetDiffJxStoreAndMTWMStoreInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetDiffJxStoreAndMTWMStoreInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetDiffJxStoreAndMTWMStoreInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetDiffJxStoreAndMTWMStoreInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImGetCustomReplyParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppID		string
	VendorStoreID		string
}

// func (c *IMController) GetCustomReply() {
// 	c.callGetCustomReply(func(params *tImGetCustomReplyParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callGetCustomReply(handler func(params *tImGetCustomReplyParams) (interface{}, string, error)) {
	var err error
	params := &tImGetCustomReplyParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppID = utils.TrimBlankChar(c.GetString("appID"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("appID") == "" {
		errParams = append(errParams, "appID")
	}
	params.MapData["appID"] = params.AppID
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.GetCustomReply, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.GetCustomReply, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.GetCustomReply error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetAfsOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AfsOrderID		string
	VendorOrderID		string
	VendorIDs		string
	AppealTypes		string
	StoreIDs		string
	Statuss		string
	Keyword		string
	FromTime		string
	ToTime		string
	SkuIDs		string
	IsDetail		bool
	Offset		int
	PageSize		int
}

// func (c *OrderController) GetAfsOrders() {
// 	c.callGetAfsOrders(func(params *tOrderGetAfsOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetAfsOrders(handler func(params *tOrderGetAfsOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetAfsOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AfsOrderID = utils.TrimBlankChar(c.GetString("afsOrderID"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.AppealTypes = utils.TrimBlankChar(c.GetString("appealTypes"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.IsDetail, err = c.GetBool("isDetail", false); err != nil {
		errParams = append(errParams, "isDetail")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("afsOrderID")) != "" {
		params.MapData["afsOrderID"] = params.AfsOrderID
	}
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("appealTypes")) != "" {
		params.MapData["appealTypes"] = params.AppealTypes
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("isDetail")) != "" {
		params.MapData["isDetail"] = params.IsDetail
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetAfsOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetAfsOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetAfsOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderAddUpdateOrdersSupplementParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *OrderController) AddUpdateOrdersSupplement() {
// 	c.callAddUpdateOrdersSupplement(func(params *tOrderAddUpdateOrdersSupplementParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callAddUpdateOrdersSupplement(handler func(params *tOrderAddUpdateOrdersSupplementParams) (interface{}, string, error)) {
	var err error
	params := &tOrderAddUpdateOrdersSupplementParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.AddUpdateOrdersSupplement, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.AddUpdateOrdersSupplement, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.AddUpdateOrdersSupplement error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetOrderPayParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *JxOrderController) GetOrderPay() {
// 	c.callGetOrderPay(func(params *tJxorderGetOrderPayParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetOrderPay(handler func(params *tJxorderGetOrderPayParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetOrderPayParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetOrderPay, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetOrderPay, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetOrderPay error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderSendFailedMatterOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *JxOrderController) SendFailedMatterOrder() {
// 	c.callSendFailedMatterOrder(func(params *tJxorderSendFailedMatterOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callSendFailedMatterOrder(handler func(params *tJxorderSendFailedMatterOrderParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderSendFailedMatterOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.SendFailedMatterOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.SendFailedMatterOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.SendFailedMatterOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetStoresSkusSaleInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	SkuIDs		string
	SkuNameIDs		string
	FromTime		string
	ToTime		string
	SaleCountBegin		int
	SaleCountEnd		int
	SortType		int
	Keyword		string
	Offset		int
	PageSize		int
}

// func (c *StoreSkuController) GetStoresSkusSaleInfo() {
// 	c.callGetStoresSkusSaleInfo(func(params *tStoreSkuGetStoresSkusSaleInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetStoresSkusSaleInfo(handler func(params *tStoreSkuGetStoresSkusSaleInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetStoresSkusSaleInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	params.SkuNameIDs = utils.TrimBlankChar(c.GetString("skuNameIDs"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.SaleCountBegin, err = c.GetInt("saleCountBegin", 0); err != nil {
		errParams = append(errParams, "saleCountBegin")
	}
	if params.SaleCountEnd, err = c.GetInt("saleCountEnd", 0); err != nil {
		errParams = append(errParams, "saleCountEnd")
	}
	if params.SortType, err = c.GetInt("sortType", 0); err != nil {
		errParams = append(errParams, "sortType")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("skuNameIDs")) != "" {
		params.MapData["skuNameIDs"] = params.SkuNameIDs
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("saleCountBegin")) != "" {
		params.MapData["saleCountBegin"] = params.SaleCountBegin
	}
	if utils.TrimBlankChar(c.GetString("saleCountEnd")) != "" {
		params.MapData["saleCountEnd"] = params.SaleCountEnd
	}
	if utils.TrimBlankChar(c.GetString("sortType")) != "" {
		params.MapData["sortType"] = params.SortType
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetStoresSkusSaleInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetStoresSkusSaleInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetStoresSkusSaleInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncCompareStoreWithOperatorParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) CompareStoreWithOperator() {
// 	c.callCompareStoreWithOperator(func(params *tSyncCompareStoreWithOperatorParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callCompareStoreWithOperator(handler func(params *tSyncCompareStoreWithOperatorParams) (interface{}, string, error)) {
	var err error
	params := &tSyncCompareStoreWithOperatorParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.CompareStoreWithOperator, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.CompareStoreWithOperator, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.CompareStoreWithOperator error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetJxShopUsersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	FromTime		string
	ToTime		string
	VendorIDs		string
	Offset		int
	PageSize		int
}

// func (c *User2Controller) GetJxShopUsers() {
// 	c.callGetJxShopUsers(func(params *tUser2GetJxShopUsersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetJxShopUsers(handler func(params *tUser2GetJxShopUsersParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetJxShopUsersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetJxShopUsers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetJxShopUsers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetJxShopUsers error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderFinishedPickupParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
}

// func (c *OrderController) FinishedPickup() {
// 	c.callFinishedPickup(func(params *tOrderFinishedPickupParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callFinishedPickup(handler func(params *tOrderFinishedPickupParams) (interface{}, string, error)) {
	var err error
	params := &tOrderFinishedPickupParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.FinishedPickup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.FinishedPickup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.FinishedPickup error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderAgreeOrRefuseCancelParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	AcceptIt		bool
	Reason		string
}

// func (c *OrderController) AgreeOrRefuseCancel() {
// 	c.callAgreeOrRefuseCancel(func(params *tOrderAgreeOrRefuseCancelParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callAgreeOrRefuseCancel(handler func(params *tOrderAgreeOrRefuseCancelParams) (interface{}, string, error)) {
	var err error
	params := &tOrderAgreeOrRefuseCancelParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.AcceptIt, err = c.GetBool("acceptIt", false); err != nil {
		errParams = append(errParams, "acceptIt")
	}
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("acceptIt") == "" {
		errParams = append(errParams, "acceptIt")
	}
	params.MapData["acceptIt"] = params.AcceptIt
	if utils.TrimBlankChar(c.GetString("reason")) != "" {
		params.MapData["reason"] = params.Reason
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.AgreeOrRefuseCancel, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.AgreeOrRefuseCancel, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.AgreeOrRefuseCancel error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetMtAuditListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppPoiCodes		string
	VendorOrgCode		string
}

// func (c *StoreController) GetMtAuditList() {
// 	c.callGetMtAuditList(func(params *tStoreGetMtAuditListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetMtAuditList(handler func(params *tStoreGetMtAuditListParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetMtAuditListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppPoiCodes = utils.TrimBlankChar(c.GetString("appPoiCodes"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("appPoiCodes") == "" {
		errParams = append(errParams, "appPoiCodes")
	}
	params.MapData["appPoiCodes"] = params.AppPoiCodes
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetMtAuditList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetMtAuditList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetMtAuditList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsSetConfigParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Key		string
	Value		string
}

// func (c *CmsController) SetConfig() {
// 	c.callSetConfig(func(params *tCmsSetConfigParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callSetConfig(handler func(params *tCmsSetConfigParams) (interface{}, string, error)) {
	var err error
	params := &tCmsSetConfigParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Key = utils.TrimBlankChar(c.GetString("key"))
	params.Value = utils.TrimBlankChar(c.GetString("value"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("key") == "" {
		errParams = append(errParams, "key")
	}
	params.MapData["key"] = params.Key
	if c.GetString("value") == "" {
		errParams = append(errParams, "value")
	}
	params.MapData["value"] = params.Value
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.SetConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.SetConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.SetConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportAutoFocusStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *ReportController) AutoFocusStoreSkus() {
// 	c.callAutoFocusStoreSkus(func(params *tReportAutoFocusStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callAutoFocusStoreSkus(handler func(params *tReportAutoFocusStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tReportAutoFocusStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.AutoFocusStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.AutoFocusStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.AutoFocusStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderStoreOrderRankParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Start		string
	End		string
	StoreID		string
	Rank		string
	Offset		int
	PageSize		int
}

// func (c *OrderController) StoreOrderRank() {
// 	c.callStoreOrderRank(func(params *tOrderStoreOrderRankParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callStoreOrderRank(handler func(params *tOrderStoreOrderRankParams) (interface{}, string, error)) {
	var err error
	params := &tOrderStoreOrderRankParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Start = utils.TrimBlankChar(c.GetString("start"))
	params.End = utils.TrimBlankChar(c.GetString("end"))
	params.StoreID = utils.TrimBlankChar(c.GetString("storeID"))
	params.Rank = utils.TrimBlankChar(c.GetString("rank"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("start") == "" {
		errParams = append(errParams, "start")
	}
	params.MapData["start"] = params.Start
	if c.GetString("end") == "" {
		errParams = append(errParams, "end")
	}
	params.MapData["end"] = params.End
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if c.GetString("rank") == "" {
		errParams = append(errParams, "rank")
	}
	params.MapData["rank"] = params.Rank
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.StoreOrderRank, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.StoreOrderRank, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.StoreOrderRank error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderSaveJdsOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
}

// func (c *OrderController) SaveJdsOrders() {
// 	c.callSaveJdsOrders(func(params *tOrderSaveJdsOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callSaveJdsOrders(handler func(params *tOrderSaveJdsOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tOrderSaveJdsOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.SaveJdsOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.SaveJdsOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.SaveJdsOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderCreateOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	JxOrder		string
	AddressID		int
	FromStoreID		int
	CouponIDs		string
	CreateType		int
	IsDeliverySelf		bool
}

// func (c *JxOrderController) CreateOrder() {
// 	c.callCreateOrder(func(params *tJxorderCreateOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callCreateOrder(handler func(params *tJxorderCreateOrderParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderCreateOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.JxOrder = utils.TrimBlankChar(c.GetString("jxOrder"))
	if params.AddressID, err = c.GetInt("addressID", 0); err != nil {
		errParams = append(errParams, "addressID")
	}
	if params.FromStoreID, err = c.GetInt("fromStoreID", 0); err != nil {
		errParams = append(errParams, "fromStoreID")
	}
	params.CouponIDs = utils.TrimBlankChar(c.GetString("couponIDs"))
	if params.CreateType, err = c.GetInt("createType", 0); err != nil {
		errParams = append(errParams, "createType")
	}
	if params.IsDeliverySelf, err = c.GetBool("isDeliverySelf", false); err != nil {
		errParams = append(errParams, "isDeliverySelf")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("jxOrder") == "" {
		errParams = append(errParams, "jxOrder")
	}
	params.MapData["jxOrder"] = params.JxOrder
	if c.GetString("addressID") == "" {
		errParams = append(errParams, "addressID")
	}
	params.MapData["addressID"] = params.AddressID
	if utils.TrimBlankChar(c.GetString("fromStoreID")) != "" {
		params.MapData["fromStoreID"] = params.FromStoreID
	}
	if utils.TrimBlankChar(c.GetString("couponIDs")) != "" {
		params.MapData["couponIDs"] = params.CouponIDs
	}
	if utils.TrimBlankChar(c.GetString("createType")) != "" {
		params.MapData["createType"] = params.CreateType
	}
	if utils.TrimBlankChar(c.GetString("isDeliverySelf")) != "" {
		params.MapData["isDeliverySelf"] = params.IsDeliverySelf
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.CreateOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.CreateOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.CreateOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateSkuNamesExPrefixParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameIDs		string
	ExPrefix		string
	FromDate		string
	ToDate		string
	ImgWaterMark		string
	VendorID		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SkuController) UpdateSkuNamesExPrefix() {
// 	c.callUpdateSkuNamesExPrefix(func(params *tSkuUpdateSkuNamesExPrefixParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateSkuNamesExPrefix(handler func(params *tSkuUpdateSkuNamesExPrefixParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateSkuNamesExPrefixParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	params.ExPrefix = utils.TrimBlankChar(c.GetString("exPrefix"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.ImgWaterMark = utils.TrimBlankChar(c.GetString("imgWaterMark"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("nameIDs") == "" {
		errParams = append(errParams, "nameIDs")
	}
	params.MapData["nameIDs"] = params.NameIDs
	if utils.TrimBlankChar(c.GetString("exPrefix")) != "" {
		params.MapData["exPrefix"] = params.ExPrefix
	}
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if c.GetString("toDate") == "" {
		errParams = append(errParams, "toDate")
	}
	params.MapData["toDate"] = params.ToDate
	if utils.TrimBlankChar(c.GetString("imgWaterMark")) != "" {
		params.MapData["imgWaterMark"] = params.ImgWaterMark
	}
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateSkuNamesExPrefix, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateSkuNamesExPrefix, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateSkuNamesExPrefix error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderApplyRefundOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	RefundSkuList		string
	Reason		string
}

// func (c *OrderController) ApplyRefundOrder() {
// 	c.callApplyRefundOrder(func(params *tOrderApplyRefundOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callApplyRefundOrder(handler func(params *tOrderApplyRefundOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderApplyRefundOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.RefundSkuList = utils.TrimBlankChar(c.GetString("refundSkuList"))
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("refundSkuList") == "" {
		errParams = append(errParams, "refundSkuList")
	}
	params.MapData["refundSkuList"] = params.RefundSkuList
	if c.GetString("reason") == "" {
		errParams = append(errParams, "reason")
	}
	params.MapData["reason"] = params.Reason
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ApplyRefundOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ApplyRefundOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ApplyRefundOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuSyncTiktokMainSkuToLocalSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StartTime		int
	EndTime		int
}

// func (c *SkuController) SyncTiktokMainSkuToLocalSku() {
// 	c.callSyncTiktokMainSkuToLocalSku(func(params *tSkuSyncTiktokMainSkuToLocalSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callSyncTiktokMainSkuToLocalSku(handler func(params *tSkuSyncTiktokMainSkuToLocalSkuParams) (interface{}, string, error)) {
	var err error
	params := &tSkuSyncTiktokMainSkuToLocalSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StartTime, err = c.GetInt("startTime", 0); err != nil {
		errParams = append(errParams, "startTime")
	}
	if params.EndTime, err = c.GetInt("endTime", 0); err != nil {
		errParams = append(errParams, "endTime")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("startTime") == "" {
		errParams = append(errParams, "startTime")
	}
	params.MapData["startTime"] = params.StartTime
	if c.GetString("endTime") == "" {
		errParams = append(errParams, "endTime")
	}
	params.MapData["endTime"] = params.EndTime
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.SyncTiktokMainSkuToLocalSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.SyncTiktokMainSkuToLocalSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.SyncTiktokMainSkuToLocalSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateVendorCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ID		int
	CategoryID		int
	VendorCategoryName		string
	Level		int
	ParentID		int
	IsDelete		bool
}

// func (c *SkuController) UpdateVendorCategoryMap() {
// 	c.callUpdateVendorCategoryMap(func(params *tSkuUpdateVendorCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateVendorCategoryMap(handler func(params *tSkuUpdateVendorCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateVendorCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ID, err = c.GetInt("ID", 0); err != nil {
		errParams = append(errParams, "ID")
	}
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	params.VendorCategoryName = utils.TrimBlankChar(c.GetString("vendorCategoryName"))
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if params.IsDelete, err = c.GetBool("isDelete", false); err != nil {
		errParams = append(errParams, "isDelete")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("ID") == "" {
		errParams = append(errParams, "ID")
	}
	params.MapData["ID"] = params.ID
	if utils.TrimBlankChar(c.GetString("categoryID")) != "" {
		params.MapData["categoryID"] = params.CategoryID
	}
	if utils.TrimBlankChar(c.GetString("vendorCategoryName")) != "" {
		params.MapData["vendorCategoryName"] = params.VendorCategoryName
	}
	if c.GetString("level") == "" {
		errParams = append(errParams, "level")
	}
	params.MapData["level"] = params.Level
	if c.GetString("parentID") == "" {
		errParams = append(errParams, "parentID")
	}
	params.MapData["parentID"] = params.ParentID
	if utils.TrimBlankChar(c.GetString("isDelete")) != "" {
		params.MapData["isDelete"] = params.IsDelete
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateVendorCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateVendorCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateVendorCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tVersionUpdateVersionControllerParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppId		string
	Version		string
}

// func (c *VersionController) UpdateVersionController() {
// 	c.callUpdateVersionController(func(params *tVersionUpdateVersionControllerParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *VersionController) callUpdateVersionController(handler func(params *tVersionUpdateVersionControllerParams) (interface{}, string, error)) {
	var err error
	params := &tVersionUpdateVersionControllerParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppId = utils.TrimBlankChar(c.GetString("appId"))
	params.Version = utils.TrimBlankChar(c.GetString("version"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("appId") == "" {
		errParams = append(errParams, "appId")
	}
	params.MapData["appId"] = params.AppId
	if c.GetString("version") == "" {
		errParams = append(errParams, "version")
	}
	params.MapData["version"] = params.Version
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API VersionController.UpdateVersionController, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API VersionController.UpdateVersionController, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API VersionController.UpdateVersionController error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateStoreTemplateParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	Content		string
	Sound		string
}

// func (c *StoreController) UpdateStoreTemplate() {
// 	c.callUpdateStoreTemplate(func(params *tStoreUpdateStoreTemplateParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateStoreTemplate(handler func(params *tStoreUpdateStoreTemplateParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateStoreTemplateParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Content = utils.TrimBlankChar(c.GetString("content"))
	params.Sound = utils.TrimBlankChar(c.GetString("sound"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("content")) != "" {
		params.MapData["content"] = params.Content
	}
	if utils.TrimBlankChar(c.GetString("sound")) != "" {
		params.MapData["sound"] = params.Sound
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateStoreTemplate, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateStoreTemplate, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateStoreTemplate error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreBindPrinterParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	Data		string
}

// func (c *StoreController) BindPrinter() {
// 	c.callBindPrinter(func(params *tStoreBindPrinterParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callBindPrinter(handler func(params *tStoreBindPrinterParams) (interface{}, string, error)) {
	var err error
	params := &tStoreBindPrinterParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Data = utils.TrimBlankChar(c.GetString("data"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("data") == "" {
		errParams = append(errParams, "data")
	}
	params.MapData["data"] = params.Data
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.BindPrinter, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.BindPrinter, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.BindPrinter error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateStorePriceScoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *StoreController) CreateStorePriceScore() {
// 	c.callCreateStorePriceScore(func(params *tStoreCreateStorePriceScoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateStorePriceScore(handler func(params *tStoreCreateStorePriceScoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateStorePriceScoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateStorePriceScore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateStorePriceScore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateStorePriceScore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2GetTokenByPhoneParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	PhoneNumber		string
}

// func (c *Auth2Controller) GetTokenByPhone() {
// 	c.callGetTokenByPhone(func(params *tAuth2GetTokenByPhoneParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callGetTokenByPhone(handler func(params *tAuth2GetTokenByPhoneParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2GetTokenByPhoneParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.PhoneNumber = utils.TrimBlankChar(c.GetString("phoneNumber"))
	if c.GetString("phoneNumber") == "" {
		errParams = append(errParams, "phoneNumber")
	}
	params.MapData["phoneNumber"] = params.PhoneNumber
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.GetTokenByPhone, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.GetTokenByPhone, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.GetTokenByPhone error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2UpdateUserLastInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	BrandID		int
}

// func (c *User2Controller) UpdateUserLastInfo() {
// 	c.callUpdateUserLastInfo(func(params *tUser2UpdateUserLastInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callUpdateUserLastInfo(handler func(params *tUser2UpdateUserLastInfoParams) (interface{}, string, error)) {
	var err error
	params := &tUser2UpdateUserLastInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.UpdateUserLastInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.UpdateUserLastInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.UpdateUserLastInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportUserMemberReportParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	Keyword		string
	Offset		int
	PageSize		int
}

// func (c *ReportController) UserMemberReport() {
// 	c.callUserMemberReport(func(params *tReportUserMemberReportParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callUserMemberReport(handler func(params *tReportUserMemberReportParams) (interface{}, string, error)) {
	var err error
	params := &tReportUserMemberReportParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.UserMemberReport, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.UserMemberReport, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.UserMemberReport error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaCreateSeparateRecipientParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Payload		string
}

// func (c *LaKaLaController) CreateSeparateRecipient() {
// 	c.callCreateSeparateRecipient(func(params *tLakalaCreateSeparateRecipientParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callCreateSeparateRecipient(handler func(params *tLakalaCreateSeparateRecipientParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaCreateSeparateRecipientParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.CreateSeparateRecipient, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.CreateSeparateRecipient, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.CreateSeparateRecipient error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderReceiveCouponsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CouponID		int
}

// func (c *JxOrderController) ReceiveCoupons() {
// 	c.callReceiveCoupons(func(params *tJxorderReceiveCouponsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callReceiveCoupons(handler func(params *tJxorderReceiveCouponsParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderReceiveCouponsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CouponID, err = c.GetInt("couponID", 0); err != nil {
		errParams = append(errParams, "couponID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("couponID") == "" {
		errParams = append(errParams, "couponID")
	}
	params.MapData["couponID"] = params.CouponID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.ReceiveCoupons, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.ReceiveCoupons, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.ReceiveCoupons error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreVendorMapsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
}

// func (c *StoreController) GetStoreVendorMaps() {
// 	c.callGetStoreVendorMaps(func(params *tStoreGetStoreVendorMapsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreVendorMaps(handler func(params *tStoreGetStoreVendorMapsParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreVendorMapsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreVendorMaps, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreVendorMaps, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreVendorMaps error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetStoreSkuAuditParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ApplyTimeStart		string
	ApplyTimeEnd		string
	AuditTimeStart		string
	AuditTimeEnd		string
	Name		string
	Remark		string
	StoreIDs		string
	NameIDs		string
	Statuss		string
	Types		string
	Keyword		string
	MarketManPhone		string
	CityName		string
	Offset		int
	PageSize		int
}

// func (c *StoreSkuController) GetStoreSkuAudit() {
// 	c.callGetStoreSkuAudit(func(params *tStoreSkuGetStoreSkuAuditParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetStoreSkuAudit(handler func(params *tStoreSkuGetStoreSkuAuditParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetStoreSkuAuditParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.ApplyTimeStart = utils.TrimBlankChar(c.GetString("applyTimeStart"))
	params.ApplyTimeEnd = utils.TrimBlankChar(c.GetString("applyTimeEnd"))
	params.AuditTimeStart = utils.TrimBlankChar(c.GetString("auditTimeStart"))
	params.AuditTimeEnd = utils.TrimBlankChar(c.GetString("auditTimeEnd"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.Remark = utils.TrimBlankChar(c.GetString("remark"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	params.Types = utils.TrimBlankChar(c.GetString("types"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.MarketManPhone = utils.TrimBlankChar(c.GetString("marketManPhone"))
	params.CityName = utils.TrimBlankChar(c.GetString("cityName"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("applyTimeStart")) != "" {
		params.MapData["applyTimeStart"] = params.ApplyTimeStart
	}
	if utils.TrimBlankChar(c.GetString("applyTimeEnd")) != "" {
		params.MapData["applyTimeEnd"] = params.ApplyTimeEnd
	}
	if utils.TrimBlankChar(c.GetString("auditTimeStart")) != "" {
		params.MapData["auditTimeStart"] = params.AuditTimeStart
	}
	if utils.TrimBlankChar(c.GetString("auditTimeEnd")) != "" {
		params.MapData["auditTimeEnd"] = params.AuditTimeEnd
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("remark")) != "" {
		params.MapData["remark"] = params.Remark
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("nameIDs")) != "" {
		params.MapData["nameIDs"] = params.NameIDs
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("types")) != "" {
		params.MapData["types"] = params.Types
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("marketManPhone")) != "" {
		params.MapData["marketManPhone"] = params.MarketManPhone
	}
	if utils.TrimBlankChar(c.GetString("cityName")) != "" {
		params.MapData["cityName"] = params.CityName
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetStoreSkuAudit, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetStoreSkuAudit, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetStoreSkuAudit error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataRefreshEbaiBadCommentParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *InitDataController) RefreshEbaiBadComment() {
// 	c.callRefreshEbaiBadComment(func(params *tInitdataRefreshEbaiBadCommentParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callRefreshEbaiBadComment(handler func(params *tInitdataRefreshEbaiBadCommentParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataRefreshEbaiBadCommentParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.RefreshEbaiBadComment, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.RefreshEbaiBadComment, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.RefreshEbaiBadComment error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQuerySeparateRecipientParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ReceiverNo		string
	OrgCode		string
}

// func (c *LaKaLaController) QuerySeparateRecipient() {
// 	c.callQuerySeparateRecipient(func(params *tLakalaQuerySeparateRecipientParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQuerySeparateRecipient(handler func(params *tLakalaQuerySeparateRecipientParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQuerySeparateRecipientParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.ReceiverNo = utils.TrimBlankChar(c.GetString("receiverNo"))
	params.OrgCode = utils.TrimBlankChar(c.GetString("orgCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("receiverNo") == "" {
		errParams = append(errParams, "receiverNo")
	}
	params.MapData["receiverNo"] = params.ReceiverNo
	if c.GetString("orgCode") == "" {
		errParams = append(errParams, "orgCode")
	}
	params.MapData["orgCode"] = params.OrgCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QuerySeparateRecipient, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QuerySeparateRecipient, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QuerySeparateRecipient error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tVersionAddVersionControllerParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppId		string
	Version		string
}

// func (c *VersionController) AddVersionController() {
// 	c.callAddVersionController(func(params *tVersionAddVersionControllerParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *VersionController) callAddVersionController(handler func(params *tVersionAddVersionControllerParams) (interface{}, string, error)) {
	var err error
	params := &tVersionAddVersionControllerParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppId = utils.TrimBlankChar(c.GetString("appId"))
	params.Version = utils.TrimBlankChar(c.GetString("version"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("appId") == "" {
		errParams = append(errParams, "appId")
	}
	params.MapData["appId"] = params.AppId
	if c.GetString("version") == "" {
		errParams = append(errParams, "version")
	}
	params.MapData["version"] = params.Version
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API VersionController.AddVersionController, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API VersionController.AddVersionController, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API VersionController.AddVersionController error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderSendJdwlForJdsOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *OrderController) SendJdwlForJdsOrder() {
// 	c.callSendJdwlForJdsOrder(func(params *tOrderSendJdwlForJdsOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callSendJdwlForJdsOrder(handler func(params *tOrderSendJdwlForJdsOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderSendJdwlForJdsOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.SendJdwlForJdsOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.SendJdwlForJdsOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.SendJdwlForJdsOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuUpdateStoresSkusByBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	IsContinueWhenError		bool
	IsAsync		bool
}

// func (c *StoreSkuController) UpdateStoresSkusByBind() {
// 	c.callUpdateStoresSkusByBind(func(params *tStoreSkuUpdateStoresSkusByBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callUpdateStoresSkusByBind(handler func(params *tStoreSkuUpdateStoresSkusByBindParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuUpdateStoresSkusByBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.UpdateStoresSkusByBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.UpdateStoresSkusByBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.UpdateStoresSkusByBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryAuthenticationParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	AuthType		string
}

// func (c *LaKaLaController) QueryAuthentication() {
// 	c.callQueryAuthentication(func(params *tLakalaQueryAuthenticationParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryAuthentication(handler func(params *tLakalaQueryAuthenticationParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryAuthenticationParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	params.AuthType = utils.TrimBlankChar(c.GetString("authType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("authType") == "" {
		errParams = append(errParams, "authType")
	}
	params.MapData["authType"] = params.AuthType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryAuthentication, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryAuthentication, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryAuthentication error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderPrintOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
}

// func (c *OrderController) PrintOrder() {
// 	c.callPrintOrder(func(params *tOrderPrintOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callPrintOrder(handler func(params *tOrderPrintOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderPrintOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.PrintOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.PrintOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.PrintOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuAddSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameID		int
	Payload		string
}

// func (c *SkuController) AddSku() {
// 	c.callAddSku(func(params *tSkuAddSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callAddSku(handler func(params *tSkuAddSkuParams) (interface{}, string, error)) {
	var err error
	params := &tSkuAddSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.NameID, err = c.GetInt("nameID", 0); err != nil {
		errParams = append(errParams, "nameID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("nameID") == "" {
		errParams = append(errParams, "nameID")
	}
	params.MapData["nameID"] = params.NameID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.AddSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.AddSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.AddSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuBatchSetBoxPriceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	StoreIDs		string
}

// func (c *SkuController) BatchSetBoxPrice() {
// 	c.callBatchSetBoxPrice(func(params *tSkuBatchSetBoxPriceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callBatchSetBoxPrice(handler func(params *tSkuBatchSetBoxPriceParams) (interface{}, string, error)) {
	var err error
	params := &tSkuBatchSetBoxPriceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.BatchSetBoxPrice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.BatchSetBoxPrice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.BatchSetBoxPrice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateStore2PrintParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Payload		string
}

// func (c *StoreController) CreateStore2Print() {
// 	c.callCreateStore2Print(func(params *tStoreCreateStore2PrintParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateStore2Print(handler func(params *tStoreCreateStore2PrintParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateStore2PrintParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateStore2Print, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateStore2Print, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateStore2Print error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerAddMenuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *PowerController) AddMenu() {
// 	c.callAddMenu(func(params *tPowerAddMenuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callAddMenu(handler func(params *tPowerAddMenuParams) (interface{}, string, error)) {
	var err error
	params := &tPowerAddMenuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.AddMenu, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.AddMenu, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.AddMenu error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaGetSeparateAmtParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	CmdType		string
	Status		string
	SeparateNo		string
	SeparateTimeStart		string
	SeparateTimeEnd		string
	VendorOrderId		string
	StoreId		int
	Offset		int
	PageSize		int
}

// func (c *LaKaLaController) GetSeparateAmt() {
// 	c.callGetSeparateAmt(func(params *tLakalaGetSeparateAmtParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callGetSeparateAmt(handler func(params *tLakalaGetSeparateAmtParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaGetSeparateAmtParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.CmdType = utils.TrimBlankChar(c.GetString("cmdType"))
	params.Status = utils.TrimBlankChar(c.GetString("status"))
	params.SeparateNo = utils.TrimBlankChar(c.GetString("separateNo"))
	params.SeparateTimeStart = utils.TrimBlankChar(c.GetString("separateTimeStart"))
	params.SeparateTimeEnd = utils.TrimBlankChar(c.GetString("separateTimeEnd"))
	params.VendorOrderId = utils.TrimBlankChar(c.GetString("vendorOrderId"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("merchantNo")) != "" {
		params.MapData["merchantNo"] = params.MerchantNo
	}
	if utils.TrimBlankChar(c.GetString("cmdType")) != "" {
		params.MapData["cmdType"] = params.CmdType
	}
	if utils.TrimBlankChar(c.GetString("status")) != "" {
		params.MapData["status"] = params.Status
	}
	if utils.TrimBlankChar(c.GetString("separateNo")) != "" {
		params.MapData["separateNo"] = params.SeparateNo
	}
	if utils.TrimBlankChar(c.GetString("separateTimeStart")) != "" {
		params.MapData["separateTimeStart"] = params.SeparateTimeStart
	}
	if utils.TrimBlankChar(c.GetString("separateTimeEnd")) != "" {
		params.MapData["separateTimeEnd"] = params.SeparateTimeEnd
	}
	if utils.TrimBlankChar(c.GetString("vendorOrderId")) != "" {
		params.MapData["vendorOrderId"] = params.VendorOrderId
	}
	if utils.TrimBlankChar(c.GetString("storeId")) != "" {
		params.MapData["storeId"] = params.StoreId
	}
	if c.GetString("offset") == "" {
		errParams = append(errParams, "offset")
	}
	params.MapData["offset"] = params.Offset
	if c.GetString("pageSize") == "" {
		errParams = append(errParams, "pageSize")
	}
	params.MapData["pageSize"] = params.PageSize
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.GetSeparateAmt, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.GetSeparateAmt, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.GetSeparateAmt error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderAddCouponsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	StoreIDs		string
	Count		int
}

// func (c *JxOrderController) AddCoupons() {
// 	c.callAddCoupons(func(params *tJxorderAddCouponsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callAddCoupons(handler func(params *tJxorderAddCouponsParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderAddCouponsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Count, err = c.GetInt("count", 0); err != nil {
		errParams = append(errParams, "count")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("count")) != "" {
		params.MapData["count"] = params.Count
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.AddCoupons, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.AddCoupons, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.AddCoupons error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuSumExianDaDepotParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SkuController) SumExianDaDepot() {
// 	c.callSumExianDaDepot(func(params *tSkuSumExianDaDepotParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callSumExianDaDepot(handler func(params *tSkuSumExianDaDepotParams) (interface{}, string, error)) {
	var err error
	params := &tSkuSumExianDaDepotParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.SumExianDaDepot, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.SumExianDaDepot, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.SumExianDaDepot error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFinancialGetStoreBillsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *FinancialController) GetStoreBills() {
// 	c.callGetStoreBills(func(params *tFinancialGetStoreBillsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FinancialController) callGetStoreBills(handler func(params *tFinancialGetStoreBillsParams) (interface{}, string, error)) {
	var err error
	params := &tFinancialGetStoreBillsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FinancialController.GetStoreBills, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FinancialController.GetStoreBills, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FinancialController.GetStoreBills error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopStoreOpenAllParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *TempOpController) StoreOpenAll() {
// 	c.callStoreOpenAll(func(params *tTempopStoreOpenAllParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callStoreOpenAll(handler func(params *tTempopStoreOpenAllParams) (interface{}, string, error)) {
	var err error
	params := &tTempopStoreOpenAllParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.StoreOpenAll, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.StoreOpenAll, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.StoreOpenAll error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImSetImMsgReadParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppID		string
	VendorStoreID		string
	VendorID		string
	UserID		string
}

// func (c *IMController) SetImMsgRead() {
// 	c.callSetImMsgRead(func(params *tImSetImMsgReadParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callSetImMsgRead(handler func(params *tImSetImMsgReadParams) (interface{}, string, error)) {
	var err error
	params := &tImSetImMsgReadParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppID = utils.TrimBlankChar(c.GetString("appID"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	params.VendorID = utils.TrimBlankChar(c.GetString("vendorID"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("appID") == "" {
		errParams = append(errParams, "appID")
	}
	params.MapData["appID"] = params.AppID
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("userID") == "" {
		errParams = append(errParams, "userID")
	}
	params.MapData["userID"] = params.UserID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.SetImMsgRead, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.SetImMsgRead, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.SetImMsgRead error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuLoadStoreVendorCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
	VendorID		int
	StoreID		int
}

// func (c *SkuController) LoadStoreVendorCategories() {
// 	c.callLoadStoreVendorCategories(func(params *tSkuLoadStoreVendorCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callLoadStoreVendorCategories(handler func(params *tSkuLoadStoreVendorCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuLoadStoreVendorCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.LoadStoreVendorCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.LoadStoreVendorCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.LoadStoreVendorCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuAddSkuNamePlaceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameID		int
	PlaceCode		int
}

// func (c *SkuController) AddSkuNamePlace() {
// 	c.callAddSkuNamePlace(func(params *tSkuAddSkuNamePlaceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callAddSkuNamePlace(handler func(params *tSkuAddSkuNamePlaceParams) (interface{}, string, error)) {
	var err error
	params := &tSkuAddSkuNamePlaceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.NameID, err = c.GetInt("nameID", 0); err != nil {
		errParams = append(errParams, "nameID")
	}
	if params.PlaceCode, err = c.GetInt("placeCode", 0); err != nil {
		errParams = append(errParams, "placeCode")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("nameID") == "" {
		errParams = append(errParams, "nameID")
	}
	params.MapData["nameID"] = params.NameID
	if c.GetString("placeCode") == "" {
		errParams = append(errParams, "placeCode")
	}
	params.MapData["placeCode"] = params.PlaceCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.AddSkuNamePlace, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.AddSkuNamePlace, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.AddSkuNamePlace error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataChange2JDSPU4StoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Step		int
	StoreIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *InitDataController) Change2JDSPU4Store() {
// 	c.callChange2JDSPU4Store(func(params *tInitdataChange2JDSPU4StoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callChange2JDSPU4Store(handler func(params *tInitdataChange2JDSPU4StoreParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataChange2JDSPU4StoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Step, err = c.GetInt("step", 0); err != nil {
		errParams = append(errParams, "step")
	}
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("step") == "" {
		errParams = append(errParams, "step")
	}
	params.MapData["step"] = params.Step
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.Change2JDSPU4Store, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.Change2JDSPU4Store, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.Change2JDSPU4Store error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataPullJdOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *InitDataController) PullJdOrder() {
// 	c.callPullJdOrder(func(params *tInitdataPullJdOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callPullJdOrder(handler func(params *tInitdataPullJdOrderParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataPullJdOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.PullJdOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.PullJdOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.PullJdOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopUploadJdsImageParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *TempOpController) UploadJdsImage() {
// 	c.callUploadJdsImage(func(params *tTempopUploadJdsImageParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callUploadJdsImage(handler func(params *tTempopUploadJdsImageParams) (interface{}, string, error)) {
	var err error
	params := &tTempopUploadJdsImageParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.UploadJdsImage, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.UploadJdsImage, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.UploadJdsImage error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActCancelActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ActID		int
}

// func (c *ActController) CancelAct() {
// 	c.callCancelAct(func(params *tActCancelActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callCancelAct(handler func(params *tActCancelActParams) (interface{}, string, error)) {
	var err error
	params := &tActCancelActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ActID, err = c.GetInt("actID", 0); err != nil {
		errParams = append(errParams, "actID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("actID") == "" {
		errParams = append(errParams, "actID")
	}
	params.MapData["actID"] = params.ActID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.CancelAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.CancelAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.CancelAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActCreateActForMtByOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
	Type		int
	VendorIDs		string
	VendorOrgCode		string
	BeginAt		string
	EndAt		string
	PricePercentage		int
	Advertising		string
	ActStoreSkuList		string
}

// func (c *ActController) CreateActForMtByOrder() {
// 	c.callCreateActForMtByOrder(func(params *tActCreateActForMtByOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callCreateActForMtByOrder(handler func(params *tActCreateActForMtByOrderParams) (interface{}, string, error)) {
	var err error
	params := &tActCreateActForMtByOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.Type, err = c.GetInt("type", 0); err != nil {
		errParams = append(errParams, "type")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.BeginAt = utils.TrimBlankChar(c.GetString("beginAt"))
	params.EndAt = utils.TrimBlankChar(c.GetString("endAt"))
	if params.PricePercentage, err = c.GetInt("pricePercentage", 0); err != nil {
		errParams = append(errParams, "pricePercentage")
	}
	params.Advertising = utils.TrimBlankChar(c.GetString("advertising"))
	params.ActStoreSkuList = utils.TrimBlankChar(c.GetString("actStoreSkuList"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("name") == "" {
		errParams = append(errParams, "name")
	}
	params.MapData["name"] = params.Name
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("beginAt") == "" {
		errParams = append(errParams, "beginAt")
	}
	params.MapData["beginAt"] = params.BeginAt
	if c.GetString("endAt") == "" {
		errParams = append(errParams, "endAt")
	}
	params.MapData["endAt"] = params.EndAt
	if c.GetString("pricePercentage") == "" {
		errParams = append(errParams, "pricePercentage")
	}
	params.MapData["pricePercentage"] = params.PricePercentage
	if c.GetString("advertising") == "" {
		errParams = append(errParams, "advertising")
	}
	params.MapData["advertising"] = params.Advertising
	if c.GetString("actStoreSkuList") == "" {
		errParams = append(errParams, "actStoreSkuList")
	}
	params.MapData["actStoreSkuList"] = params.ActStoreSkuList
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.CreateActForMtByOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.CreateActForMtByOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.CreateActForMtByOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSessionCreateBossSessionParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreId		int
}

// func (c *SessionController) CreateBossSession() {
// 	c.callCreateBossSession(func(params *tSessionCreateBossSessionParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SessionController) callCreateBossSession(handler func(params *tSessionCreateBossSessionParams) (interface{}, string, error)) {
	var err error
	params := &tSessionCreateBossSessionParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeId") == "" {
		errParams = append(errParams, "storeId")
	}
	params.MapData["storeId"] = params.StoreId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SessionController.CreateBossSession, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SessionController.CreateBossSession, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SessionController.CreateBossSession error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreDeleteStoreCourierMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
}

// func (c *StoreController) DeleteStoreCourierMap() {
// 	c.callDeleteStoreCourierMap(func(params *tStoreDeleteStoreCourierMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callDeleteStoreCourierMap(handler func(params *tStoreDeleteStoreCourierMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreDeleteStoreCourierMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.DeleteStoreCourierMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.DeleteStoreCourierMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.DeleteStoreCourierMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2CreateCaptchaParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Width		int
	Height		int
	CaptchaLen		int
}

// func (c *Auth2Controller) CreateCaptcha() {
// 	c.callCreateCaptcha(func(params *tAuth2CreateCaptchaParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callCreateCaptcha(handler func(params *tAuth2CreateCaptchaParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2CreateCaptchaParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if params.Width, err = c.GetInt("width", 0); err != nil {
		errParams = append(errParams, "width")
	}
	if params.Height, err = c.GetInt("height", 0); err != nil {
		errParams = append(errParams, "height")
	}
	if params.CaptchaLen, err = c.GetInt("captchaLen", 0); err != nil {
		errParams = append(errParams, "captchaLen")
	}
	if c.GetString("width") == "" {
		errParams = append(errParams, "width")
	}
	params.MapData["width"] = params.Width
	if c.GetString("height") == "" {
		errParams = append(errParams, "height")
	}
	params.MapData["height"] = params.Height
	if utils.TrimBlankChar(c.GetString("captchaLen")) != "" {
		params.MapData["captchaLen"] = params.CaptchaLen
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.CreateCaptcha, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.CreateCaptcha, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.CreateCaptcha error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tKnowGetKnowledgeDepotParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	Offset		int
	PageSize		int
}

// func (c *KnowController) GetKnowledgeDepot() {
// 	c.callGetKnowledgeDepot(func(params *tKnowGetKnowledgeDepotParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *KnowController) callGetKnowledgeDepot(handler func(params *tKnowGetKnowledgeDepotParams) (interface{}, string, error)) {
	var err error
	params := &tKnowGetKnowledgeDepotParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API KnowController.GetKnowledgeDepot, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API KnowController.GetKnowledgeDepot, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API KnowController.GetKnowledgeDepot error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderMergeJdsOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderIDs		string
}

// func (c *OrderController) MergeJdsOrders() {
// 	c.callMergeJdsOrders(func(params *tOrderMergeJdsOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callMergeJdsOrders(handler func(params *tOrderMergeJdsOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tOrderMergeJdsOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderIDs = utils.TrimBlankChar(c.GetString("vendorOrderIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderIDs") == "" {
		errParams = append(errParams, "vendorOrderIDs")
	}
	params.MapData["vendorOrderIDs"] = params.VendorOrderIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.MergeJdsOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.MergeJdsOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.MergeJdsOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderUpdateCouponsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	StoreIDs		string
	IsDel		bool
}

// func (c *JxOrderController) UpdateCoupons() {
// 	c.callUpdateCoupons(func(params *tJxorderUpdateCouponsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callUpdateCoupons(handler func(params *tJxorderUpdateCouponsParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderUpdateCouponsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsDel, err = c.GetBool("isDel", false); err != nil {
		errParams = append(errParams, "isDel")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("isDel")) != "" {
		params.MapData["isDel"] = params.IsDel
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.UpdateCoupons, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.UpdateCoupons, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.UpdateCoupons error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetMyJxStoreListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Mobile		string
}

// func (c *User2Controller) GetMyJxStoreList() {
// 	c.callGetMyJxStoreList(func(params *tUser2GetMyJxStoreListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetMyJxStoreList(handler func(params *tUser2GetMyJxStoreListParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetMyJxStoreListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Mobile = utils.TrimBlankChar(c.GetString("mobile"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("mobile") == "" {
		errParams = append(errParams, "mobile")
	}
	params.MapData["mobile"] = params.Mobile
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetMyJxStoreList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetMyJxStoreList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetMyJxStoreList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActRefreshMTActivityListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *ActController) RefreshMTActivityList() {
// 	c.callRefreshMTActivityList(func(params *tActRefreshMTActivityListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callRefreshMTActivityList(handler func(params *tActRefreshMTActivityListParams) (interface{}, string, error)) {
	var err error
	params := &tActRefreshMTActivityListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.RefreshMTActivityList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.RefreshMTActivityList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.RefreshMTActivityList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderUploadOrderInvoiceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrderId		string
	InvoiceUrl		string
	InvoiceId		string
	ImgBase64		string
}

// func (c *OrderController) UploadOrderInvoice() {
// 	c.callUploadOrderInvoice(func(params *tOrderUploadOrderInvoiceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callUploadOrderInvoice(handler func(params *tOrderUploadOrderInvoiceParams) (interface{}, string, error)) {
	var err error
	params := &tOrderUploadOrderInvoiceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrderId = utils.TrimBlankChar(c.GetString("orderId"))
	params.InvoiceUrl = utils.TrimBlankChar(c.GetString("invoiceUrl"))
	params.InvoiceId = utils.TrimBlankChar(c.GetString("invoiceId"))
	params.ImgBase64 = utils.TrimBlankChar(c.GetString("imgBase64"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("orderId") == "" {
		errParams = append(errParams, "orderId")
	}
	params.MapData["orderId"] = params.OrderId
	if c.GetString("invoiceUrl") == "" {
		errParams = append(errParams, "invoiceUrl")
	}
	params.MapData["invoiceUrl"] = params.InvoiceUrl
	if c.GetString("invoiceId") == "" {
		errParams = append(errParams, "invoiceId")
	}
	params.MapData["invoiceId"] = params.InvoiceId
	if utils.TrimBlankChar(c.GetString("imgBase64")) != "" {
		params.MapData["imgBase64"] = params.ImgBase64
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.UploadOrderInvoice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.UploadOrderInvoice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.UploadOrderInvoice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tEventGetImMessageRecordParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *EventController) GetImMessageRecord() {
// 	c.callGetImMessageRecord(func(params *tEventGetImMessageRecordParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *EventController) callGetImMessageRecord(handler func(params *tEventGetImMessageRecordParams) (interface{}, string, error)) {
	var err error
	params := &tEventGetImMessageRecordParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API EventController.GetImMessageRecord, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API EventController.GetImMessageRecord, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API EventController.GetImMessageRecord error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tKnowSendSNSMediaMsgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	MediaID		string
}

// func (c *KnowController) SendSNSMediaMsg() {
// 	c.callSendSNSMediaMsg(func(params *tKnowSendSNSMediaMsgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *KnowController) callSendSNSMediaMsg(handler func(params *tKnowSendSNSMediaMsgParams) (interface{}, string, error)) {
	var err error
	params := &tKnowSendSNSMediaMsgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.MediaID = utils.TrimBlankChar(c.GetString("mediaID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("mediaID")) != "" {
		params.MapData["mediaID"] = params.MediaID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API KnowController.SendSNSMediaMsg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API KnowController.SendSNSMediaMsg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API KnowController.SendSNSMediaMsg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaMerchantIncomingParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	StoreID		int
}

// func (c *LaKaLaController) MerchantIncoming() {
// 	c.callMerchantIncoming(func(params *tLakalaMerchantIncomingParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callMerchantIncoming(handler func(params *tLakalaMerchantIncomingParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaMerchantIncomingParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.MerchantIncoming, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.MerchantIncoming, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.MerchantIncoming error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaGetRecipientParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrgCode		string
	ReceiverNo		string
	ReceiverName		string
	Offset		int
	PageSize		int
}

// func (c *LaKaLaController) GetRecipient() {
// 	c.callGetRecipient(func(params *tLakalaGetRecipientParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callGetRecipient(handler func(params *tLakalaGetRecipientParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaGetRecipientParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrgCode = utils.TrimBlankChar(c.GetString("OrgCode"))
	params.ReceiverNo = utils.TrimBlankChar(c.GetString("ReceiverNo"))
	params.ReceiverName = utils.TrimBlankChar(c.GetString("ReceiverName"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("OrgCode")) != "" {
		params.MapData["OrgCode"] = params.OrgCode
	}
	if utils.TrimBlankChar(c.GetString("ReceiverNo")) != "" {
		params.MapData["ReceiverNo"] = params.ReceiverNo
	}
	if utils.TrimBlankChar(c.GetString("ReceiverName")) != "" {
		params.MapData["ReceiverName"] = params.ReceiverName
	}
	if c.GetString("offset") == "" {
		errParams = append(errParams, "offset")
	}
	params.MapData["offset"] = params.Offset
	if c.GetString("pageSize") == "" {
		errParams = append(errParams, "pageSize")
	}
	params.MapData["pageSize"] = params.PageSize
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.GetRecipient, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.GetRecipient, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.GetRecipient error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaCloseOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	VendorOrderId		string
	VendorId		int
}

// func (c *LaKaLaController) CloseOrder() {
// 	c.callCloseOrder(func(params *tLakalaCloseOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callCloseOrder(handler func(params *tLakalaCloseOrderParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaCloseOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.VendorOrderId = utils.TrimBlankChar(c.GetString("vendorOrderId"))
	if params.VendorId, err = c.GetInt("vendorId", 0); err != nil {
		errParams = append(errParams, "vendorId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("vendorOrderId") == "" {
		errParams = append(errParams, "vendorOrderId")
	}
	params.MapData["vendorOrderId"] = params.VendorOrderId
	if c.GetString("vendorId") == "" {
		errParams = append(errParams, "vendorId")
	}
	params.MapData["vendorId"] = params.VendorId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.CloseOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.CloseOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.CloseOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrdersAcceptParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *OrderController) GetOrdersAccept() {
// 	c.callGetOrdersAccept(func(params *tOrderGetOrdersAcceptParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrdersAccept(handler func(params *tOrderGetOrdersAcceptParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrdersAcceptParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrdersAccept, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrdersAccept, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrdersAccept error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsNewConfigParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Type		string
	Key		string
	Value		string
}

// func (c *CmsController) NewConfig() {
// 	c.callNewConfig(func(params *tCmsNewConfigParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callNewConfig(handler func(params *tCmsNewConfigParams) (interface{}, string, error)) {
	var err error
	params := &tCmsNewConfigParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Type = utils.TrimBlankChar(c.GetString("type"))
	params.Key = utils.TrimBlankChar(c.GetString("key"))
	params.Value = utils.TrimBlankChar(c.GetString("value"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if c.GetString("key") == "" {
		errParams = append(errParams, "key")
	}
	params.MapData["key"] = params.Key
	if c.GetString("value") == "" {
		errParams = append(errParams, "value")
	}
	params.MapData["value"] = params.Value
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.NewConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.NewConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.NewConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncDeleteRemoteStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) DeleteRemoteStoreSkus() {
// 	c.callDeleteRemoteStoreSkus(func(params *tSyncDeleteRemoteStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callDeleteRemoteStoreSkus(handler func(params *tSyncDeleteRemoteStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tSyncDeleteRemoteStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.DeleteRemoteStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.DeleteRemoteStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.DeleteRemoteStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetUserRoleListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserID		string
}

// func (c *User2Controller) GetUserRoleList() {
// 	c.callGetUserRoleList(func(params *tUser2GetUserRoleListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetUserRoleList(handler func(params *tUser2GetUserRoleListParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetUserRoleListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("userID") == "" {
		errParams = append(errParams, "userID")
	}
	params.MapData["userID"] = params.UserID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetUserRoleList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetUserRoleList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetUserRoleList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderUpdateOrderInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	Payload		string
}

// func (c *OrderController) UpdateOrderInfo() {
// 	c.callUpdateOrderInfo(func(params *tOrderUpdateOrderInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callUpdateOrderInfo(handler func(params *tOrderUpdateOrderInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderUpdateOrderInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.UpdateOrderInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.UpdateOrderInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.UpdateOrderInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetJddjStoreInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorStoreID		string
}

// func (c *StoreController) GetJddjStoreInfo() {
// 	c.callGetJddjStoreInfo(func(params *tStoreGetJddjStoreInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetJddjStoreInfo(handler func(params *tStoreGetJddjStoreInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetJddjStoreInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetJddjStoreInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetJddjStoreInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetJddjStoreInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tMsgSendUserMessageParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserIDs		string
	Title		string
	Content		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *MsgController) SendUserMessage() {
// 	c.callSendUserMessage(func(params *tMsgSendUserMessageParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *MsgController) callSendUserMessage(handler func(params *tMsgSendUserMessageParams) (interface{}, string, error)) {
	var err error
	params := &tMsgSendUserMessageParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserIDs = utils.TrimBlankChar(c.GetString("userIDs"))
	params.Title = utils.TrimBlankChar(c.GetString("title"))
	params.Content = utils.TrimBlankChar(c.GetString("content"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("userIDs") == "" {
		errParams = append(errParams, "userIDs")
	}
	params.MapData["userIDs"] = params.UserIDs
	if c.GetString("title") == "" {
		errParams = append(errParams, "title")
	}
	params.MapData["title"] = params.Title
	if c.GetString("content") == "" {
		errParams = append(errParams, "content")
	}
	params.MapData["content"] = params.Content
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API MsgController.SendUserMessage, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API MsgController.SendUserMessage, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API MsgController.SendUserMessage error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerAddRoleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
}

// func (c *PowerController) AddRole() {
// 	c.callAddRole(func(params *tPowerAddRoleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callAddRole(handler func(params *tPowerAddRoleParams) (interface{}, string, error)) {
	var err error
	params := &tPowerAddRoleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("name") == "" {
		errParams = append(errParams, "name")
	}
	params.MapData["name"] = params.Name
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.AddRole, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.AddRole, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.AddRole error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderUpdateWaybillDesiredFeeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	DesiredFee		int
}

// func (c *OrderController) UpdateWaybillDesiredFee() {
// 	c.callUpdateWaybillDesiredFee(func(params *tOrderUpdateWaybillDesiredFeeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callUpdateWaybillDesiredFee(handler func(params *tOrderUpdateWaybillDesiredFeeParams) (interface{}, string, error)) {
	var err error
	params := &tOrderUpdateWaybillDesiredFeeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.DesiredFee, err = c.GetInt("desiredFee", 0); err != nil {
		errParams = append(errParams, "desiredFee")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("desiredFee") == "" {
		errParams = append(errParams, "desiredFee")
	}
	params.MapData["desiredFee"] = params.DesiredFee
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.UpdateWaybillDesiredFee, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.UpdateWaybillDesiredFee, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.UpdateWaybillDesiredFee error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tMsgSendStoreMessageKnowledgeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	Title		string
	KnowIDs		string
}

// func (c *MsgController) SendStoreMessageKnowledge() {
// 	c.callSendStoreMessageKnowledge(func(params *tMsgSendStoreMessageKnowledgeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *MsgController) callSendStoreMessageKnowledge(handler func(params *tMsgSendStoreMessageKnowledgeParams) (interface{}, string, error)) {
	var err error
	params := &tMsgSendStoreMessageKnowledgeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Title = utils.TrimBlankChar(c.GetString("title"))
	params.KnowIDs = utils.TrimBlankChar(c.GetString("knowIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("title") == "" {
		errParams = append(errParams, "title")
	}
	params.MapData["title"] = params.Title
	if c.GetString("knowIDs") == "" {
		errParams = append(errParams, "knowIDs")
	}
	params.MapData["knowIDs"] = params.KnowIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API MsgController.SendStoreMessageKnowledge, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API MsgController.SendStoreMessageKnowledge, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API MsgController.SendStoreMessageKnowledge error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysGetYLYTokenParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	AccessKey		string
	OldToken		string
	WaitSecond		int
}

// func (c *SysController) GetYLYToken() {
// 	c.callGetYLYToken(func(params *tSysGetYLYTokenParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callGetYLYToken(handler func(params *tSysGetYLYTokenParams) (interface{}, string, error)) {
	var err error
	params := &tSysGetYLYTokenParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.AccessKey = utils.TrimBlankChar(c.GetString("accessKey"))
	params.OldToken = utils.TrimBlankChar(c.GetString("oldToken"))
	if params.WaitSecond, err = c.GetInt("waitSecond", 0); err != nil {
		errParams = append(errParams, "waitSecond")
	}
	if c.GetString("accessKey") == "" {
		errParams = append(errParams, "accessKey")
	}
	params.MapData["accessKey"] = params.AccessKey
	if utils.TrimBlankChar(c.GetString("oldToken")) != "" {
		params.MapData["oldToken"] = params.OldToken
	}
	if utils.TrimBlankChar(c.GetString("waitSecond")) != "" {
		params.MapData["waitSecond"] = params.WaitSecond
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.GetYLYToken, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.GetYLYToken, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.GetYLYToken error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaEwalletWithdrawD1Params struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	OrgNo		string
	PayType		string
	DrawAmt		string
}

// func (c *LaKaLaController) EwalletWithdrawD1() {
// 	c.callEwalletWithdrawD1(func(params *tLakalaEwalletWithdrawD1Params) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callEwalletWithdrawD1(handler func(params *tLakalaEwalletWithdrawD1Params) (interface{}, string, error)) {
	var err error
	params := &tLakalaEwalletWithdrawD1Params{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.OrgNo = utils.TrimBlankChar(c.GetString("orgNo"))
	params.PayType = utils.TrimBlankChar(c.GetString("payType"))
	params.DrawAmt = utils.TrimBlankChar(c.GetString("drawAmt"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("orgNo") == "" {
		errParams = append(errParams, "orgNo")
	}
	params.MapData["orgNo"] = params.OrgNo
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if c.GetString("drawAmt") == "" {
		errParams = append(errParams, "drawAmt")
	}
	params.MapData["drawAmt"] = params.DrawAmt
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.EwalletWithdrawD1, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.EwalletWithdrawD1, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.EwalletWithdrawD1 error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuCopyVendorCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromVendorOrgCode		int
	VendorID		int
	ToVendorOrgCodes		string
	CategoryIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SkuController) CopyVendorCategories() {
// 	c.callCopyVendorCategories(func(params *tSkuCopyVendorCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callCopyVendorCategories(handler func(params *tSkuCopyVendorCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuCopyVendorCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.FromVendorOrgCode, err = c.GetInt("fromVendorOrgCode", 0); err != nil {
		errParams = append(errParams, "fromVendorOrgCode")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.ToVendorOrgCodes = utils.TrimBlankChar(c.GetString("toVendorOrgCodes"))
	params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromVendorOrgCode") == "" {
		errParams = append(errParams, "fromVendorOrgCode")
	}
	params.MapData["fromVendorOrgCode"] = params.FromVendorOrgCode
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("toVendorOrgCodes") == "" {
		errParams = append(errParams, "toVendorOrgCodes")
	}
	params.MapData["toVendorOrgCodes"] = params.ToVendorOrgCodes
	if utils.TrimBlankChar(c.GetString("categoryIDs")) != "" {
		params.MapData["categoryIDs"] = params.CategoryIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.CopyVendorCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.CopyVendorCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.CopyVendorCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreBindJxPrinterParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreId		int
	PrintSn		string
	PrintKey		string
}

// func (c *StoreController) BindJxPrinter() {
// 	c.callBindJxPrinter(func(params *tStoreBindJxPrinterParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callBindJxPrinter(handler func(params *tStoreBindJxPrinterParams) (interface{}, string, error)) {
	var err error
	params := &tStoreBindJxPrinterParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	params.PrintSn = utils.TrimBlankChar(c.GetString("printSn"))
	params.PrintKey = utils.TrimBlankChar(c.GetString("printKey"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeId") == "" {
		errParams = append(errParams, "storeId")
	}
	params.MapData["storeId"] = params.StoreId
	if c.GetString("printSn") == "" {
		errParams = append(errParams, "printSn")
	}
	params.MapData["printSn"] = params.PrintSn
	if c.GetString("printKey") == "" {
		errParams = append(errParams, "printKey")
	}
	params.MapData["printKey"] = params.PrintKey
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.BindJxPrinter, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.BindJxPrinter, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.BindJxPrinter error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetBrandUserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandID		int
}

// func (c *StoreController) GetBrandUser() {
// 	c.callGetBrandUser(func(params *tStoreGetBrandUserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetBrandUser(handler func(params *tStoreGetBrandUserParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetBrandUserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("brandID") == "" {
		errParams = append(errParams, "brandID")
	}
	params.MapData["brandID"] = params.BrandID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetBrandUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetBrandUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetBrandUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActCreateActByExcelParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	VendorOrgCode		string
	MixType		int
	IsFocus		bool
	IsSync		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *ActController) CreateActByExcel() {
// 	c.callCreateActByExcel(func(params *tActCreateActByExcelParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callCreateActByExcel(handler func(params *tActCreateActByExcelParams) (interface{}, string, error)) {
	var err error
	params := &tActCreateActByExcelParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.MixType, err = c.GetInt("mixType", 0); err != nil {
		errParams = append(errParams, "mixType")
	}
	if params.IsFocus, err = c.GetBool("isFocus", false); err != nil {
		errParams = append(errParams, "isFocus")
	}
	if params.IsSync, err = c.GetBool("isSync", false); err != nil {
		errParams = append(errParams, "isSync")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if c.GetString("mixType") == "" {
		errParams = append(errParams, "mixType")
	}
	params.MapData["mixType"] = params.MixType
	if c.GetString("isFocus") == "" {
		errParams = append(errParams, "isFocus")
	}
	params.MapData["isFocus"] = params.IsFocus
	if c.GetString("isSync") == "" {
		errParams = append(errParams, "isSync")
	}
	params.MapData["isSync"] = params.IsSync
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.CreateActByExcel, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.CreateActByExcel, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.CreateActByExcel error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindUpdateStockBySkuIDParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	StoreID		int
	Stock		string
	Token		string
}

// func (c *BiddingController) UpdateStockBySkuID() {
// 	c.callUpdateStockBySkuID(func(params *tBindUpdateStockBySkuIDParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callUpdateStockBySkuID(handler func(params *tBindUpdateStockBySkuIDParams) (interface{}, string, error)) {
	var err error
	params := &tBindUpdateStockBySkuIDParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Stock = utils.TrimBlankChar(c.GetString("stock"))
	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("stock") == "" {
		errParams = append(errParams, "stock")
	}
	params.MapData["stock"] = params.Stock
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.UpdateStockBySkuID, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.UpdateStockBySkuID, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.UpdateStockBySkuID error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetRiderLngParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	OrderId		string
	DeliveryId		string
	WaybillVendorId		int
	OrderVendorId		int
}

// func (c *OrderController) GetRiderLng() {
// 	c.callGetRiderLng(func(params *tOrderGetRiderLngParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetRiderLng(handler func(params *tOrderGetRiderLngParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetRiderLngParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.OrderId = utils.TrimBlankChar(c.GetString("orderId"))
	params.DeliveryId = utils.TrimBlankChar(c.GetString("deliveryId"))
	if params.WaybillVendorId, err = c.GetInt("waybillVendorId", 0); err != nil {
		errParams = append(errParams, "waybillVendorId")
	}
	if params.OrderVendorId, err = c.GetInt("orderVendorId", 0); err != nil {
		errParams = append(errParams, "orderVendorId")
	}
	if c.GetString("orderId") == "" {
		errParams = append(errParams, "orderId")
	}
	params.MapData["orderId"] = params.OrderId
	if c.GetString("deliveryId") == "" {
		errParams = append(errParams, "deliveryId")
	}
	params.MapData["deliveryId"] = params.DeliveryId
	if c.GetString("waybillVendorId") == "" {
		errParams = append(errParams, "waybillVendorId")
	}
	params.MapData["waybillVendorId"] = params.WaybillVendorId
	if c.GetString("orderVendorId") == "" {
		errParams = append(errParams, "orderVendorId")
	}
	params.MapData["orderVendorId"] = params.OrderVendorId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetRiderLng, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetRiderLng, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetRiderLng error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateSensitiveWordParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Word		string
	VendorID		int
	ID		int
	Status		int
}

// func (c *SkuController) UpdateSensitiveWord() {
// 	c.callUpdateSensitiveWord(func(params *tSkuUpdateSensitiveWordParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateSensitiveWord(handler func(params *tSkuUpdateSensitiveWordParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateSensitiveWordParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Word = utils.TrimBlankChar(c.GetString("word"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.ID, err = c.GetInt("ID", 0); err != nil {
		errParams = append(errParams, "ID")
	}
	if params.Status, err = c.GetInt("Status", 0); err != nil {
		errParams = append(errParams, "Status")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("word") == "" {
		errParams = append(errParams, "word")
	}
	params.MapData["word"] = params.Word
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("ID")) != "" {
		params.MapData["ID"] = params.ID
	}
	if utils.TrimBlankChar(c.GetString("Status")) != "" {
		params.MapData["Status"] = params.Status
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateSensitiveWord, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateSensitiveWord, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateSensitiveWord error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetNearSupplyGoodsStoreByStoreIDParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *StoreController) GetNearSupplyGoodsStoreByStoreID() {
// 	c.callGetNearSupplyGoodsStoreByStoreID(func(params *tStoreGetNearSupplyGoodsStoreByStoreIDParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetNearSupplyGoodsStoreByStoreID(handler func(params *tStoreGetNearSupplyGoodsStoreByStoreIDParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetNearSupplyGoodsStoreByStoreIDParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetNearSupplyGoodsStoreByStoreID, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetNearSupplyGoodsStoreByStoreID, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetNearSupplyGoodsStoreByStoreID error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSyncStoresQualifyParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorID		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreController) SyncStoresQualify() {
// 	c.callSyncStoresQualify(func(params *tStoreSyncStoresQualifyParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callSyncStoresQualify(handler func(params *tStoreSyncStoresQualifyParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSyncStoresQualifyParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.SyncStoresQualify, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.SyncStoresQualify, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.SyncStoresQualify error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2UpdateMyDeliveryAddressParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Id		int
	ConsigneeName		string
	ConsigneeMobile		string
	Address		string
	DetailAddress		string
	Lng		float64
	Lat		float64
	Tag		string
	Remark		string
	IsDefault		int
	CityCode		int
	DistrictCode		int
}

// func (c *User2Controller) UpdateMyDeliveryAddress() {
// 	c.callUpdateMyDeliveryAddress(func(params *tUser2UpdateMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callUpdateMyDeliveryAddress(handler func(params *tUser2UpdateMyDeliveryAddressParams) (interface{}, string, error)) {
	var err error
	params := &tUser2UpdateMyDeliveryAddressParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Id, err = c.GetInt("id", 0); err != nil {
		errParams = append(errParams, "id")
	}
	params.ConsigneeName = utils.TrimBlankChar(c.GetString("consigneeName"))
	params.ConsigneeMobile = utils.TrimBlankChar(c.GetString("consigneeMobile"))
	params.Address = utils.TrimBlankChar(c.GetString("address"))
	params.DetailAddress = utils.TrimBlankChar(c.GetString("detailAddress"))
	if params.Lng, err = c.GetFloat("lng", 0); err != nil {
		errParams = append(errParams, "lng")
	}
	if params.Lat, err = c.GetFloat("lat", 0); err != nil {
		errParams = append(errParams, "lat")
	}
	params.Tag = utils.TrimBlankChar(c.GetString("tag"))
	params.Remark = utils.TrimBlankChar(c.GetString("remark"))
	if params.IsDefault, err = c.GetInt("isDefault", 0); err != nil {
		errParams = append(errParams, "isDefault")
	}
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	if params.DistrictCode, err = c.GetInt("districtCode", 0); err != nil {
		errParams = append(errParams, "districtCode")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("id") == "" {
		errParams = append(errParams, "id")
	}
	params.MapData["id"] = params.Id
	if utils.TrimBlankChar(c.GetString("consigneeName")) != "" {
		params.MapData["consigneeName"] = params.ConsigneeName
	}
	if utils.TrimBlankChar(c.GetString("consigneeMobile")) != "" {
		params.MapData["consigneeMobile"] = params.ConsigneeMobile
	}
	if utils.TrimBlankChar(c.GetString("address")) != "" {
		params.MapData["address"] = params.Address
	}
	if utils.TrimBlankChar(c.GetString("detailAddress")) != "" {
		params.MapData["detailAddress"] = params.DetailAddress
	}
	if utils.TrimBlankChar(c.GetString("lng")) != "" {
		params.MapData["lng"] = params.Lng
	}
	if utils.TrimBlankChar(c.GetString("lat")) != "" {
		params.MapData["lat"] = params.Lat
	}
	if utils.TrimBlankChar(c.GetString("tag")) != "" {
		params.MapData["tag"] = params.Tag
	}
	if utils.TrimBlankChar(c.GetString("remark")) != "" {
		params.MapData["remark"] = params.Remark
	}
	if utils.TrimBlankChar(c.GetString("isDefault")) != "" {
		params.MapData["isDefault"] = params.IsDefault
	}
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("districtCode")) != "" {
		params.MapData["districtCode"] = params.DistrictCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.UpdateMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.UpdateMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.UpdateMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetActMtwmVendorSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	Keyword		string
	ActType		int
	Offset		int
	PageSize		int
}

// func (c *ActController) GetActMtwmVendorSku() {
// 	c.callGetActMtwmVendorSku(func(params *tActGetActMtwmVendorSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetActMtwmVendorSku(handler func(params *tActGetActMtwmVendorSkuParams) (interface{}, string, error)) {
	var err error
	params := &tActGetActMtwmVendorSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.ActType, err = c.GetInt("actType", 0); err != nil {
		errParams = append(errParams, "actType")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("actType")) != "" {
		params.MapData["actType"] = params.ActType
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetActMtwmVendorSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetActMtwmVendorSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetActMtwmVendorSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaUpdateBasicInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CustomerNo		string
	Payload		string
}

// func (c *LaKaLaController) UpdateBasicInfo() {
// 	c.callUpdateBasicInfo(func(params *tLakalaUpdateBasicInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callUpdateBasicInfo(handler func(params *tLakalaUpdateBasicInfoParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaUpdateBasicInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CustomerNo = utils.TrimBlankChar(c.GetString("customerNo"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("customerNo") == "" {
		errParams = append(errParams, "customerNo")
	}
	params.MapData["customerNo"] = params.CustomerNo
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.UpdateBasicInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.UpdateBasicInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.UpdateBasicInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreTmpGetJxBadCommentsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Type		int
	Keyword		string
	StoreIDs		string
	FromTime		string
	ToTime		string
	OrderFlag		string
	OperatorPhone		string
	Offset		int
	PageSize		int
}

// func (c *StoreController) TmpGetJxBadComments() {
// 	c.callTmpGetJxBadComments(func(params *tStoreTmpGetJxBadCommentsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callTmpGetJxBadComments(handler func(params *tStoreTmpGetJxBadCommentsParams) (interface{}, string, error)) {
	var err error
	params := &tStoreTmpGetJxBadCommentsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Type, err = c.GetInt("type", 0); err != nil {
		errParams = append(errParams, "type")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.OrderFlag = utils.TrimBlankChar(c.GetString("orderFlag"))
	params.OperatorPhone = utils.TrimBlankChar(c.GetString("operatorPhone"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("orderFlag")) != "" {
		params.MapData["orderFlag"] = params.OrderFlag
	}
	if utils.TrimBlankChar(c.GetString("operatorPhone")) != "" {
		params.MapData["operatorPhone"] = params.OperatorPhone
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.TmpGetJxBadComments, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.TmpGetJxBadComments, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.TmpGetJxBadComments error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerGetRoleMenuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RoleID		int
}

// func (c *PowerController) GetRoleMenu() {
// 	c.callGetRoleMenu(func(params *tPowerGetRoleMenuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callGetRoleMenu(handler func(params *tPowerGetRoleMenuParams) (interface{}, string, error)) {
	var err error
	params := &tPowerGetRoleMenuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.RoleID, err = c.GetInt("roleID", 0); err != nil {
		errParams = append(errParams, "roleID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("roleID")) != "" {
		params.MapData["roleID"] = params.RoleID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.GetRoleMenu, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.GetRoleMenu, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.GetRoleMenu error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaWithdrawalListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	DrawJnl		string
	AcctName		string
	StartTime		string
	EndTime		string
	SeparateNo		string
	Offset		int
	PageSize		int
}

// func (c *LaKaLaController) WithdrawalList() {
// 	c.callWithdrawalList(func(params *tLakalaWithdrawalListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callWithdrawalList(handler func(params *tLakalaWithdrawalListParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaWithdrawalListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.DrawJnl = utils.TrimBlankChar(c.GetString("drawJnl"))
	params.AcctName = utils.TrimBlankChar(c.GetString("acctName"))
	params.StartTime = utils.TrimBlankChar(c.GetString("startTime"))
	params.EndTime = utils.TrimBlankChar(c.GetString("endTime"))
	params.SeparateNo = utils.TrimBlankChar(c.GetString("separateNo"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("merchantNo")) != "" {
		params.MapData["merchantNo"] = params.MerchantNo
	}
	if utils.TrimBlankChar(c.GetString("drawJnl")) != "" {
		params.MapData["drawJnl"] = params.DrawJnl
	}
	if utils.TrimBlankChar(c.GetString("acctName")) != "" {
		params.MapData["acctName"] = params.AcctName
	}
	if utils.TrimBlankChar(c.GetString("startTime")) != "" {
		params.MapData["startTime"] = params.StartTime
	}
	if utils.TrimBlankChar(c.GetString("endTime")) != "" {
		params.MapData["endTime"] = params.EndTime
	}
	if utils.TrimBlankChar(c.GetString("separateNo")) != "" {
		params.MapData["separateNo"] = params.SeparateNo
	}
	if c.GetString("offset") == "" {
		errParams = append(errParams, "offset")
	}
	params.MapData["offset"] = params.Offset
	if c.GetString("pageSize") == "" {
		errParams = append(errParams, "pageSize")
	}
	params.MapData["pageSize"] = params.PageSize
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.WithdrawalList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.WithdrawalList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.WithdrawalList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetStoreOrderCountInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	LastHours		int
	LastMinutes		int
	IsIncludeFake		bool
}

// func (c *OrderController) GetStoreOrderCountInfo() {
// 	c.callGetStoreOrderCountInfo(func(params *tOrderGetStoreOrderCountInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetStoreOrderCountInfo(handler func(params *tOrderGetStoreOrderCountInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetStoreOrderCountInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.LastHours, err = c.GetInt("lastHours", 0); err != nil {
		errParams = append(errParams, "lastHours")
	}
	if params.LastMinutes, err = c.GetInt("lastMinutes", 0); err != nil {
		errParams = append(errParams, "lastMinutes")
	}
	if params.IsIncludeFake, err = c.GetBool("isIncludeFake", false); err != nil {
		errParams = append(errParams, "isIncludeFake")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("lastHours")) != "" {
		params.MapData["lastHours"] = params.LastHours
	}
	if utils.TrimBlankChar(c.GetString("lastMinutes")) != "" {
		params.MapData["lastMinutes"] = params.LastMinutes
	}
	if utils.TrimBlankChar(c.GetString("isIncludeFake")) != "" {
		params.MapData["isIncludeFake"] = params.IsIncludeFake
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetStoreOrderCountInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetStoreOrderCountInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetStoreOrderCountInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderExportOrderWithSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrderID		string
	VendorOrderID		string
	Keyword		string
	FromDate		string
	ToDate		string
	IsDateFinish		bool
	VendorIDs		string
	WaybillVendorIDs		string
	StoreIDs		string
	Statuss		string
	LockStatuss		string
	Cities		string
	IsIncludeFake		bool
	SkuIDs		string
	IsJxFirst		bool
	AdjustCount		int
	BrandID		int
	MustInvoice		bool
	DeliveryTypes		string
	JxIncomeBegin		string
	JxIncomeEnd		string
	MarketManPhone		string
	JdPhone		string
	MtPhone		string
	EbaiPhone		string
	Offset		int
	PageSize		int
}

// func (c *OrderController) ExportOrderWithSku() {
// 	c.callExportOrderWithSku(func(params *tOrderExportOrderWithSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callExportOrderWithSku(handler func(params *tOrderExportOrderWithSkuParams) (interface{}, string, error)) {
	var err error
	params := &tOrderExportOrderWithSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrderID = utils.TrimBlankChar(c.GetString("orderID"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	if params.IsDateFinish, err = c.GetBool("isDateFinish", false); err != nil {
		errParams = append(errParams, "isDateFinish")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.WaybillVendorIDs = utils.TrimBlankChar(c.GetString("waybillVendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	params.LockStatuss = utils.TrimBlankChar(c.GetString("lockStatuss"))
	params.Cities = utils.TrimBlankChar(c.GetString("cities"))
	if params.IsIncludeFake, err = c.GetBool("isIncludeFake", false); err != nil {
		errParams = append(errParams, "isIncludeFake")
	}
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.IsJxFirst, err = c.GetBool("isJxFirst", false); err != nil {
		errParams = append(errParams, "isJxFirst")
	}
	if params.AdjustCount, err = c.GetInt("adjustCount", 0); err != nil {
		errParams = append(errParams, "adjustCount")
	}
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.MustInvoice, err = c.GetBool("mustInvoice", false); err != nil {
		errParams = append(errParams, "mustInvoice")
	}
	params.DeliveryTypes = utils.TrimBlankChar(c.GetString("deliveryTypes"))
	params.JxIncomeBegin = utils.TrimBlankChar(c.GetString("jxIncomeBegin"))
	params.JxIncomeEnd = utils.TrimBlankChar(c.GetString("jxIncomeEnd"))
	params.MarketManPhone = utils.TrimBlankChar(c.GetString("marketManPhone"))
	params.JdPhone = utils.TrimBlankChar(c.GetString("jdPhone"))
	params.MtPhone = utils.TrimBlankChar(c.GetString("mtPhone"))
	params.EbaiPhone = utils.TrimBlankChar(c.GetString("ebaiPhone"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("orderID")) != "" {
		params.MapData["orderID"] = params.OrderID
	}
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("fromDate")) != "" {
		params.MapData["fromDate"] = params.FromDate
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("isDateFinish")) != "" {
		params.MapData["isDateFinish"] = params.IsDateFinish
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("waybillVendorIDs")) != "" {
		params.MapData["waybillVendorIDs"] = params.WaybillVendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("lockStatuss")) != "" {
		params.MapData["lockStatuss"] = params.LockStatuss
	}
	if utils.TrimBlankChar(c.GetString("cities")) != "" {
		params.MapData["cities"] = params.Cities
	}
	if utils.TrimBlankChar(c.GetString("isIncludeFake")) != "" {
		params.MapData["isIncludeFake"] = params.IsIncludeFake
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("isJxFirst")) != "" {
		params.MapData["isJxFirst"] = params.IsJxFirst
	}
	if utils.TrimBlankChar(c.GetString("adjustCount")) != "" {
		params.MapData["adjustCount"] = params.AdjustCount
	}
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if utils.TrimBlankChar(c.GetString("mustInvoice")) != "" {
		params.MapData["mustInvoice"] = params.MustInvoice
	}
	if utils.TrimBlankChar(c.GetString("deliveryTypes")) != "" {
		params.MapData["deliveryTypes"] = params.DeliveryTypes
	}
	if utils.TrimBlankChar(c.GetString("jxIncomeBegin")) != "" {
		params.MapData["jxIncomeBegin"] = params.JxIncomeBegin
	}
	if utils.TrimBlankChar(c.GetString("jxIncomeEnd")) != "" {
		params.MapData["jxIncomeEnd"] = params.JxIncomeEnd
	}
	if utils.TrimBlankChar(c.GetString("marketManPhone")) != "" {
		params.MapData["marketManPhone"] = params.MarketManPhone
	}
	if utils.TrimBlankChar(c.GetString("jdPhone")) != "" {
		params.MapData["jdPhone"] = params.JdPhone
	}
	if utils.TrimBlankChar(c.GetString("mtPhone")) != "" {
		params.MapData["mtPhone"] = params.MtPhone
	}
	if utils.TrimBlankChar(c.GetString("ebaiPhone")) != "" {
		params.MapData["ebaiPhone"] = params.EbaiPhone
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ExportOrderWithSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ExportOrderWithSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ExportOrderWithSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSyncStoresCourierInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreController) SyncStoresCourierInfo() {
// 	c.callSyncStoresCourierInfo(func(params *tStoreSyncStoresCourierInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callSyncStoresCourierInfo(handler func(params *tStoreSyncStoresCourierInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSyncStoresCourierInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.SyncStoresCourierInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.SyncStoresCourierInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.SyncStoresCourierInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tMsgSendStoreMessageParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	Title		string
	Content		string
	MessageType		int
	ActInfo		string
	Imgs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *MsgController) SendStoreMessage() {
// 	c.callSendStoreMessage(func(params *tMsgSendStoreMessageParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *MsgController) callSendStoreMessage(handler func(params *tMsgSendStoreMessageParams) (interface{}, string, error)) {
	var err error
	params := &tMsgSendStoreMessageParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Title = utils.TrimBlankChar(c.GetString("title"))
	params.Content = utils.TrimBlankChar(c.GetString("content"))
	if params.MessageType, err = c.GetInt("messageType", 0); err != nil {
		errParams = append(errParams, "messageType")
	}
	params.ActInfo = utils.TrimBlankChar(c.GetString("actInfo"))
	params.Imgs = utils.TrimBlankChar(c.GetString("imgs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("title") == "" {
		errParams = append(errParams, "title")
	}
	params.MapData["title"] = params.Title
	if c.GetString("content") == "" {
		errParams = append(errParams, "content")
	}
	params.MapData["content"] = params.Content
	if c.GetString("messageType") == "" {
		errParams = append(errParams, "messageType")
	}
	params.MapData["messageType"] = params.MessageType
	if utils.TrimBlankChar(c.GetString("actInfo")) != "" {
		params.MapData["actInfo"] = params.ActInfo
	}
	if utils.TrimBlankChar(c.GetString("imgs")) != "" {
		params.MapData["imgs"] = params.Imgs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API MsgController.SendStoreMessage, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API MsgController.SendStoreMessage, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API MsgController.SendStoreMessage error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2CreateUserAgreementParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *User2Controller) CreateUserAgreement() {
// 	c.callCreateUserAgreement(func(params *tUser2CreateUserAgreementParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callCreateUserAgreement(handler func(params *tUser2CreateUserAgreementParams) (interface{}, string, error)) {
	var err error
	params := &tUser2CreateUserAgreementParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.CreateUserAgreement, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.CreateUserAgreement, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.CreateUserAgreement error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopTestItParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *TempOpController) TestIt() {
// 	c.callTestIt(func(params *tTempopTestItParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callTestIt(handler func(params *tTempopTestItParams) (interface{}, string, error)) {
	var err error
	params := &tTempopTestItParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.TestIt, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.TestIt, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.TestIt error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetActMtwmVendorParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	SkuIDs		string
	Keyword		string
	BeginAt		string
	EndAt		string
	ActType		int
	Offset		int
	PageSize		int
}

// func (c *ActController) GetActMtwmVendor() {
// 	c.callGetActMtwmVendor(func(params *tActGetActMtwmVendorParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetActMtwmVendor(handler func(params *tActGetActMtwmVendorParams) (interface{}, string, error)) {
	var err error
	params := &tActGetActMtwmVendorParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.BeginAt = utils.TrimBlankChar(c.GetString("beginAt"))
	params.EndAt = utils.TrimBlankChar(c.GetString("endAt"))
	if params.ActType, err = c.GetInt("actType", 0); err != nil {
		errParams = append(errParams, "actType")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("beginAt")) != "" {
		params.MapData["beginAt"] = params.BeginAt
	}
	if utils.TrimBlankChar(c.GetString("endAt")) != "" {
		params.MapData["endAt"] = params.EndAt
	}
	if utils.TrimBlankChar(c.GetString("actType")) != "" {
		params.MapData["actType"] = params.ActType
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetActMtwmVendor, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetActMtwmVendor, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetActMtwmVendor error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderPrintAfsOrderOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	VendorOrderID		string
	PrintType		int
}

// func (c *OrderController) PrintAfsOrderOrder() {
// 	c.callPrintAfsOrderOrder(func(params *tOrderPrintAfsOrderOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callPrintAfsOrderOrder(handler func(params *tOrderPrintAfsOrderOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderPrintAfsOrderOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.PrintType, err = c.GetInt("printType", 0); err != nil {
		errParams = append(errParams, "printType")
	}
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("printType") == "" {
		errParams = append(errParams, "printType")
	}
	params.MapData["printType"] = params.PrintType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.PrintAfsOrderOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.PrintAfsOrderOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.PrintAfsOrderOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetSecretNumberBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PoolKey		string
	SecretNumber		string
}

// func (c *StoreController) GetSecretNumberBind() {
// 	c.callGetSecretNumberBind(func(params *tStoreGetSecretNumberBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetSecretNumberBind(handler func(params *tStoreGetSecretNumberBindParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetSecretNumberBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PoolKey = utils.TrimBlankChar(c.GetString("poolKey"))
	params.SecretNumber = utils.TrimBlankChar(c.GetString("secretNumber"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("poolKey") == "" {
		errParams = append(errParams, "poolKey")
	}
	params.MapData["poolKey"] = params.PoolKey
	if c.GetString("secretNumber") == "" {
		errParams = append(errParams, "secretNumber")
	}
	params.MapData["secretNumber"] = params.SecretNumber
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetSecretNumberBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetSecretNumberBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetSecretNumberBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetMTOnlineActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorStoreID		string
	VendorOrgCode		string
	BeginAt		int
	EndAt		int
	ActType		int
}

// func (c *ActController) GetMTOnlineAct() {
// 	c.callGetMTOnlineAct(func(params *tActGetMTOnlineActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetMTOnlineAct(handler func(params *tActGetMTOnlineActParams) (interface{}, string, error)) {
	var err error
	params := &tActGetMTOnlineActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.BeginAt, err = c.GetInt("beginAt", 0); err != nil {
		errParams = append(errParams, "beginAt")
	}
	if params.EndAt, err = c.GetInt("endAt", 0); err != nil {
		errParams = append(errParams, "endAt")
	}
	if params.ActType, err = c.GetInt("actType", 0); err != nil {
		errParams = append(errParams, "actType")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("beginAt") == "" {
		errParams = append(errParams, "beginAt")
	}
	params.MapData["beginAt"] = params.BeginAt
	if c.GetString("endAt") == "" {
		errParams = append(errParams, "endAt")
	}
	params.MapData["endAt"] = params.EndAt
	if c.GetString("actType") == "" {
		errParams = append(errParams, "actType")
	}
	params.MapData["actType"] = params.ActType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetMTOnlineAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetMTOnlineAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetMTOnlineAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetVendorCategoriesWithMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
}

// func (c *SkuController) GetVendorCategoriesWithMap() {
// 	c.callGetVendorCategoriesWithMap(func(params *tSkuGetVendorCategoriesWithMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetVendorCategoriesWithMap(handler func(params *tSkuGetVendorCategoriesWithMapParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetVendorCategoriesWithMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetVendorCategoriesWithMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetVendorCategoriesWithMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetVendorCategoriesWithMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSessionCheckVendorSkuDifferParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreId		int
	VendorIDs		string
}

// func (c *SessionController) CheckVendorSkuDiffer() {
// 	c.callCheckVendorSkuDiffer(func(params *tSessionCheckVendorSkuDifferParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SessionController) callCheckVendorSkuDiffer(handler func(params *tSessionCheckVendorSkuDifferParams) (interface{}, string, error)) {
	var err error
	params := &tSessionCheckVendorSkuDifferParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeId") == "" {
		errParams = append(errParams, "storeId")
	}
	params.MapData["storeId"] = params.StoreId
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SessionController.CheckVendorSkuDiffer, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SessionController.CheckVendorSkuDiffer, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SessionController.CheckVendorSkuDiffer error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderExportOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrderID		string
	VendorOrderID		string
	Keyword		string
	FromDate		string
	ToDate		string
	VendorIDs		string
	WaybillVendorIDs		string
	StoreIDs		string
	Statuss		string
	LockStatuss		string
	Cities		string
	IsAsync		bool
}

// func (c *OrderController) ExportOrders() {
// 	c.callExportOrders(func(params *tOrderExportOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callExportOrders(handler func(params *tOrderExportOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tOrderExportOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrderID = utils.TrimBlankChar(c.GetString("orderID"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.WaybillVendorIDs = utils.TrimBlankChar(c.GetString("waybillVendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	params.LockStatuss = utils.TrimBlankChar(c.GetString("lockStatuss"))
	params.Cities = utils.TrimBlankChar(c.GetString("cities"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("orderID")) != "" {
		params.MapData["orderID"] = params.OrderID
	}
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("fromDate")) != "" {
		params.MapData["fromDate"] = params.FromDate
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("waybillVendorIDs")) != "" {
		params.MapData["waybillVendorIDs"] = params.WaybillVendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("lockStatuss")) != "" {
		params.MapData["lockStatuss"] = params.LockStatuss
	}
	if utils.TrimBlankChar(c.GetString("cities")) != "" {
		params.MapData["cities"] = params.Cities
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ExportOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ExportOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ExportOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateOrCreateCourierStoresByBrandParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandID		int
	VendorID		int
}

// func (c *StoreController) UpdateOrCreateCourierStoresByBrand() {
// 	c.callUpdateOrCreateCourierStoresByBrand(func(params *tStoreUpdateOrCreateCourierStoresByBrandParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateOrCreateCourierStoresByBrand(handler func(params *tStoreUpdateOrCreateCourierStoresByBrandParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateOrCreateCourierStoresByBrandParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("brandID") == "" {
		errParams = append(errParams, "brandID")
	}
	params.MapData["brandID"] = params.BrandID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateOrCreateCourierStoresByBrand, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateOrCreateCourierStoresByBrand, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateOrCreateCourierStoresByBrand error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreJdStoreInfoCoordinateRecoverParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
}

// func (c *StoreController) JdStoreInfoCoordinateRecover() {
// 	c.callJdStoreInfoCoordinateRecover(func(params *tStoreJdStoreInfoCoordinateRecoverParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callJdStoreInfoCoordinateRecover(handler func(params *tStoreJdStoreInfoCoordinateRecoverParams) (interface{}, string, error)) {
	var err error
	params := &tStoreJdStoreInfoCoordinateRecoverParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.JdStoreInfoCoordinateRecover, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.JdStoreInfoCoordinateRecover, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.JdStoreInfoCoordinateRecover error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateVendorStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
	Payload		string
}

// func (c *StoreController) CreateVendorStore() {
// 	c.callCreateVendorStore(func(params *tStoreCreateVendorStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateVendorStore(handler func(params *tStoreCreateVendorStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateVendorStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateVendorStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateVendorStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateVendorStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2LoadMyCartParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
}

// func (c *User2Controller) LoadMyCart() {
// 	c.callLoadMyCart(func(params *tUser2LoadMyCartParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callLoadMyCart(handler func(params *tUser2LoadMyCartParams) (interface{}, string, error)) {
	var err error
	params := &tUser2LoadMyCartParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.LoadMyCart, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.LoadMyCart, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.LoadMyCart error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetJdUsersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *User2Controller) GetJdUsers() {
// 	c.callGetJdUsers(func(params *tUser2GetJdUsersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetJdUsers(handler func(params *tUser2GetJdUsersParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetJdUsersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetJdUsers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetJdUsers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetJdUsers error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetSensitiveWordListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
}

// func (c *SkuController) GetSensitiveWordList() {
// 	c.callGetSensitiveWordList(func(params *tSkuGetSensitiveWordListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetSensitiveWordList(handler func(params *tSkuGetSensitiveWordListParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetSensitiveWordListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetSensitiveWordList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetSensitiveWordList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetSensitiveWordList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImSendToVendorV2Params struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
	SendData		string
}

// func (c *IMController) SendToVendorV2() {
// 	c.callSendToVendorV2(func(params *tImSendToVendorV2Params) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callSendToVendorV2(handler func(params *tImSendToVendorV2Params) (interface{}, string, error)) {
	var err error
	params := &tImSendToVendorV2Params{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.SendData = utils.TrimBlankChar(c.GetString("sendData"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("sendData") == "" {
		errParams = append(errParams, "sendData")
	}
	params.MapData["sendData"] = params.SendData
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.SendToVendorV2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.SendToVendorV2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.SendToVendorV2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderExportMTWaybillsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromDate		string
	ToDate		string
}

// func (c *OrderController) ExportMTWaybills() {
// 	c.callExportMTWaybills(func(params *tOrderExportMTWaybillsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callExportMTWaybills(handler func(params *tOrderExportMTWaybillsParams) (interface{}, string, error)) {
	var err error
	params := &tOrderExportMTWaybillsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ExportMTWaybills, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ExportMTWaybills, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ExportMTWaybills error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	Payload		string
}

// func (c *StoreController) UpdateStore() {
// 	c.callUpdateStore(func(params *tStoreUpdateStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateStore(handler func(params *tStoreUpdateStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderQueryUnansweredInvoiceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorId		string
	VendorStoreID		string
	StoreID		int
}

// func (c *OrderController) QueryUnansweredInvoice() {
// 	c.callQueryUnansweredInvoice(func(params *tOrderQueryUnansweredInvoiceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callQueryUnansweredInvoice(handler func(params *tOrderQueryUnansweredInvoiceParams) (interface{}, string, error)) {
	var err error
	params := &tOrderQueryUnansweredInvoiceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorId = utils.TrimBlankChar(c.GetString("vendorId"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorId") == "" {
		errParams = append(errParams, "vendorId")
	}
	params.MapData["vendorId"] = params.VendorId
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.QueryUnansweredInvoice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.QueryUnansweredInvoice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.QueryUnansweredInvoice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderPay4OrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SubAppID		string
	VendorOrderID		string
	PayType		int
	VendorPayType		string
}

// func (c *JxOrderController) Pay4Order() {
// 	c.callPay4Order(func(params *tJxorderPay4OrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callPay4Order(handler func(params *tJxorderPay4OrderParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderPay4OrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.SubAppID = utils.TrimBlankChar(c.GetString("subAppID"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.PayType, err = c.GetInt("payType", 0); err != nil {
		errParams = append(errParams, "payType")
	}
	params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("subAppID")) != "" {
		params.MapData["subAppID"] = params.SubAppID
	}
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if c.GetString("vendorPayType") == "" {
		errParams = append(errParams, "vendorPayType")
	}
	params.MapData["vendorPayType"] = params.VendorPayType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.Pay4Order, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.Pay4Order, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.Pay4Order error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSingleBindTaoVegetableParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
	BindInfos		string
}

// func (c *StoreController) SingleBindTaoVegetable() {
// 	c.callSingleBindTaoVegetable(func(params *tStoreSingleBindTaoVegetableParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callSingleBindTaoVegetable(handler func(params *tStoreSingleBindTaoVegetableParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSingleBindTaoVegetableParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.BindInfos = utils.TrimBlankChar(c.GetString("bindInfos"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("bindInfos") == "" {
		errParams = append(errParams, "bindInfos")
	}
	params.MapData["bindInfos"] = params.BindInfos
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.SingleBindTaoVegetable, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.SingleBindTaoVegetable, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.SingleBindTaoVegetable error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuBackUpStoreSkuBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) BackUpStoreSkuBind() {
// 	c.callBackUpStoreSkuBind(func(params *tStoreSkuBackUpStoreSkuBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callBackUpStoreSkuBind(handler func(params *tStoreSkuBackUpStoreSkuBindParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuBackUpStoreSkuBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.BackUpStoreSkuBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.BackUpStoreSkuBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.BackUpStoreSkuBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuUpdateStoresSkusSaleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	Payload		string
	IsContinueWhenError		bool
	AutoSaleAt		string
	IgnoreDontSale		bool
	IsAsync		bool
}

// func (c *StoreSkuController) UpdateStoresSkusSale() {
// 	c.callUpdateStoresSkusSale(func(params *tStoreSkuUpdateStoresSkusSaleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callUpdateStoresSkusSale(handler func(params *tStoreSkuUpdateStoresSkusSaleParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuUpdateStoresSkusSaleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.AutoSaleAt = utils.TrimBlankChar(c.GetString("autoSaleAt"))
	if params.IgnoreDontSale, err = c.GetBool("ignoreDontSale", false); err != nil {
		errParams = append(errParams, "ignoreDontSale")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if utils.TrimBlankChar(c.GetString("autoSaleAt")) != "" {
		params.MapData["autoSaleAt"] = params.AutoSaleAt
	}
	if utils.TrimBlankChar(c.GetString("ignoreDontSale")) != "" {
		params.MapData["ignoreDontSale"] = params.IgnoreDontSale
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.UpdateStoresSkusSale, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.UpdateStoresSkusSale, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.UpdateStoresSkusSale error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFinancialShowStoreLatestBillParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	StoreID		int
}

// func (c *FinancialController) ShowStoreLatestBill() {
// 	c.callShowStoreLatestBill(func(params *tFinancialShowStoreLatestBillParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FinancialController) callShowStoreLatestBill(handler func(params *tFinancialShowStoreLatestBillParams) (interface{}, string, error)) {
	var err error
	params := &tFinancialShowStoreLatestBillParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FinancialController.ShowStoreLatestBill, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FinancialController.ShowStoreLatestBill, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FinancialController.ShowStoreLatestBill error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2WeixinMPOAuth2Params struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Code		string
	Block		string
	State		string
}

// func (c *Auth2Controller) WeixinMPOAuth2() {
// 	c.callWeixinMPOAuth2(func(params *tAuth2WeixinMPOAuth2Params) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callWeixinMPOAuth2(handler func(params *tAuth2WeixinMPOAuth2Params) (interface{}, string, error)) {
	var err error
	params := &tAuth2WeixinMPOAuth2Params{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Code = utils.TrimBlankChar(c.GetString("code"))
	params.Block = utils.TrimBlankChar(c.GetString("block"))
	params.State = utils.TrimBlankChar(c.GetString("state"))
	if c.GetString("code") == "" {
		errParams = append(errParams, "code")
	}
	params.MapData["code"] = params.Code
	if c.GetString("block") == "" {
		errParams = append(errParams, "block")
	}
	params.MapData["block"] = params.Block
	if utils.TrimBlankChar(c.GetString("state")) != "" {
		params.MapData["state"] = params.State
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.WeixinMPOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.WeixinMPOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.WeixinMPOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tNetspiderRefreshPageShopsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *NetSpiderController) RefreshPageShops() {
// 	c.callRefreshPageShops(func(params *tNetspiderRefreshPageShopsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *NetSpiderController) callRefreshPageShops(handler func(params *tNetspiderRefreshPageShopsParams) (interface{}, string, error)) {
	var err error
	params := &tNetspiderRefreshPageShopsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API NetSpiderController.RefreshPageShops, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API NetSpiderController.RefreshPageShops, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API NetSpiderController.RefreshPageShops error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *StoreController) CreateStore() {
// 	c.callCreateStore(func(params *tStoreCreateStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateStore(handler func(params *tStoreCreateStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsQueryConfigsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Type		string
	Key		string
	Keyword		string
}

// func (c *CmsController) QueryConfigs() {
// 	c.callQueryConfigs(func(params *tCmsQueryConfigsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callQueryConfigs(handler func(params *tCmsQueryConfigsParams) (interface{}, string, error)) {
	var err error
	params := &tCmsQueryConfigsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Type = utils.TrimBlankChar(c.GetString("type"))
	params.Key = utils.TrimBlankChar(c.GetString("key"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("type")) != "" {
		params.MapData["type"] = params.Type
	}
	if utils.TrimBlankChar(c.GetString("key")) != "" {
		params.MapData["key"] = params.Key
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.QueryConfigs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.QueryConfigs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.QueryConfigs error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderSelfDeliveredParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
}

// func (c *OrderController) SelfDelivered() {
// 	c.callSelfDelivered(func(params *tOrderSelfDeliveredParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callSelfDelivered(handler func(params *tOrderSelfDeliveredParams) (interface{}, string, error)) {
	var err error
	params := &tOrderSelfDeliveredParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.SelfDelivered, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.SelfDelivered, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.SelfDelivered error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncRefreshAllStoresIDParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	IsAsync		bool
}

// func (c *SyncController) RefreshAllStoresID() {
// 	c.callRefreshAllStoresID(func(params *tSyncRefreshAllStoresIDParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callRefreshAllStoresID(handler func(params *tSyncRefreshAllStoresIDParams) (interface{}, string, error)) {
	var err error
	params := &tSyncRefreshAllStoresIDParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.RefreshAllStoresID, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.RefreshAllStoresID, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.RefreshAllStoresID error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataReProcessJdBadCommentParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsForce		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *InitDataController) ReProcessJdBadComment() {
// 	c.callReProcessJdBadComment(func(params *tInitdataReProcessJdBadCommentParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callReProcessJdBadComment(handler func(params *tInitdataReProcessJdBadCommentParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataReProcessJdBadCommentParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.ReProcessJdBadComment, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.ReProcessJdBadComment, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.ReProcessJdBadComment error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFoodrecipeGetRecipeDetailParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RecipeID		int
}

// func (c *FoodRecipeController) GetRecipeDetail() {
// 	c.callGetRecipeDetail(func(params *tFoodrecipeGetRecipeDetailParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FoodRecipeController) callGetRecipeDetail(handler func(params *tFoodrecipeGetRecipeDetailParams) (interface{}, string, error)) {
	var err error
	params := &tFoodrecipeGetRecipeDetailParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.RecipeID, err = c.GetInt("recipeID", 0); err != nil {
		errParams = append(errParams, "recipeID")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("recipeID") == "" {
		errParams = append(errParams, "recipeID")
	}
	params.MapData["recipeID"] = params.RecipeID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FoodRecipeController.GetRecipeDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FoodRecipeController.GetRecipeDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FoodRecipeController.GetRecipeDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryCustomerFeeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CustomerNo		string
	ProductCode		string
}

// func (c *LaKaLaController) QueryCustomerFee() {
// 	c.callQueryCustomerFee(func(params *tLakalaQueryCustomerFeeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryCustomerFee(handler func(params *tLakalaQueryCustomerFeeParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryCustomerFeeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CustomerNo = utils.TrimBlankChar(c.GetString("customerNo"))
	params.ProductCode = utils.TrimBlankChar(c.GetString("productCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("customerNo") == "" {
		errParams = append(errParams, "customerNo")
	}
	params.MapData["customerNo"] = params.CustomerNo
	if utils.TrimBlankChar(c.GetString("productCode")) != "" {
		params.MapData["productCode"] = params.ProductCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryCustomerFee, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryCustomerFee, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryCustomerFee error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetPlacesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	ParentCode		int
	Level		int
	IncludeDisabled		bool
}

// func (c *CmsController) GetPlaces() {
// 	c.callGetPlaces(func(params *tCmsGetPlacesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetPlaces(handler func(params *tCmsGetPlacesParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetPlacesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.ParentCode, err = c.GetInt("parentCode", 0); err != nil {
		errParams = append(errParams, "parentCode")
	}
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.IncludeDisabled, err = c.GetBool("includeDisabled", false); err != nil {
		errParams = append(errParams, "includeDisabled")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("parentCode")) != "" {
		params.MapData["parentCode"] = params.ParentCode
	}
	if utils.TrimBlankChar(c.GetString("level")) != "" {
		params.MapData["level"] = params.Level
	}
	if utils.TrimBlankChar(c.GetString("includeDisabled")) != "" {
		params.MapData["includeDisabled"] = params.IncludeDisabled
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetPlaces, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetPlaces, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetPlaces error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetUserInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *User2Controller) GetUserInfo() {
// 	c.callGetUserInfo(func(params *tUser2GetUserInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetUserInfo(handler func(params *tUser2GetUserInfoParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetUserInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetUserInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetUserInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetUserInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tDdapiSendDDmsgToUserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Title		string
	Content		string
	Mobiles		string
}

// func (c *DDAPIController) SendDDmsgToUser() {
// 	c.callSendDDmsgToUser(func(params *tDdapiSendDDmsgToUserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *DDAPIController) callSendDDmsgToUser(handler func(params *tDdapiSendDDmsgToUserParams) (interface{}, string, error)) {
	var err error
	params := &tDdapiSendDDmsgToUserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Title = utils.TrimBlankChar(c.GetString("title"))
	params.Content = utils.TrimBlankChar(c.GetString("content"))
	params.Mobiles = utils.TrimBlankChar(c.GetString("mobiles"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("title") == "" {
		errParams = append(errParams, "title")
	}
	params.MapData["title"] = params.Title
	if c.GetString("content") == "" {
		errParams = append(errParams, "content")
	}
	params.MapData["content"] = params.Content
	if c.GetString("mobiles") == "" {
		errParams = append(errParams, "mobiles")
	}
	params.MapData["mobiles"] = params.Mobiles
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API DDAPIController.SendDDmsgToUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API DDAPIController.SendDDmsgToUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API DDAPIController.SendDDmsgToUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetAfsOrderSkuInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	VendorOrderID		string
	AfsOrderID		string
	IsNotFaild		bool
}

// func (c *OrderController) GetAfsOrderSkuInfo() {
// 	c.callGetAfsOrderSkuInfo(func(params *tOrderGetAfsOrderSkuInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetAfsOrderSkuInfo(handler func(params *tOrderGetAfsOrderSkuInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetAfsOrderSkuInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.AfsOrderID = utils.TrimBlankChar(c.GetString("afsOrderID"))
	if params.IsNotFaild, err = c.GetBool("isNotFaild", false); err != nil {
		errParams = append(errParams, "isNotFaild")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("afsOrderID")) != "" {
		params.MapData["afsOrderID"] = params.AfsOrderID
	}
	if utils.TrimBlankChar(c.GetString("isNotFaild")) != "" {
		params.MapData["isNotFaild"] = params.IsNotFaild
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetAfsOrderSkuInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetAfsOrderSkuInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetAfsOrderSkuInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderTerminalRegisterParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreId		int
	Operation		string
}

// func (c *JxOrderController) TerminalRegister() {
// 	c.callTerminalRegister(func(params *tJxorderTerminalRegisterParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callTerminalRegister(handler func(params *tJxorderTerminalRegisterParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderTerminalRegisterParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	params.Operation = utils.TrimBlankChar(c.GetString("operation"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeId") == "" {
		errParams = append(errParams, "storeId")
	}
	params.MapData["storeId"] = params.StoreId
	if c.GetString("operation") == "" {
		errParams = append(errParams, "operation")
	}
	params.MapData["operation"] = params.Operation
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.TerminalRegister, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.TerminalRegister, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.TerminalRegister error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetMyOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	Keyword		string
	FromDate		string
	ToDate		string
	Statuss		string
	Offset		int
	PageSize		int
}

// func (c *JxOrderController) GetMyOrders() {
// 	c.callGetMyOrders(func(params *tJxorderGetMyOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetMyOrders(handler func(params *tJxorderGetMyOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetMyOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("fromDate")) != "" {
		params.MapData["fromDate"] = params.FromDate
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetMyOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetMyOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetMyOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSyncJdStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *StoreController) SyncJdStore() {
// 	c.callSyncJdStore(func(params *tStoreSyncJdStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callSyncJdStore(handler func(params *tStoreSyncJdStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSyncJdStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.SyncJdStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.SyncJdStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.SyncJdStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreCourierMapsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorId		int
}

// func (c *StoreController) GetStoreCourierMaps() {
// 	c.callGetStoreCourierMaps(func(params *tStoreGetStoreCourierMapsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreCourierMaps(handler func(params *tStoreGetStoreCourierMapsParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreCourierMapsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorId, err = c.GetInt("vendorId", 0); err != nil {
		errParams = append(errParams, "vendorId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("vendorId")) != "" {
		params.MapData["vendorId"] = params.VendorId
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreCourierMaps, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreCourierMaps, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreCourierMaps error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsRegisterDataResourceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	HashCode		string
	ResourceURL		string
	MimeType		string
	Name		string
}

// func (c *CmsController) RegisterDataResource() {
// 	c.callRegisterDataResource(func(params *tCmsRegisterDataResourceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callRegisterDataResource(handler func(params *tCmsRegisterDataResourceParams) (interface{}, string, error)) {
	var err error
	params := &tCmsRegisterDataResourceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.HashCode = utils.TrimBlankChar(c.GetString("hashCode"))
	params.ResourceURL = utils.TrimBlankChar(c.GetString("resourceURL"))
	params.MimeType = utils.TrimBlankChar(c.GetString("mimeType"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("hashCode") == "" {
		errParams = append(errParams, "hashCode")
	}
	params.MapData["hashCode"] = params.HashCode
	if c.GetString("resourceURL") == "" {
		errParams = append(errParams, "resourceURL")
	}
	params.MapData["resourceURL"] = params.ResourceURL
	if c.GetString("mimeType") == "" {
		errParams = append(errParams, "mimeType")
	}
	params.MapData["mimeType"] = params.MimeType
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.RegisterDataResource, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.RegisterDataResource, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.RegisterDataResource error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tNetspiderQueryPageSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	VendorStoreIDs		string
	Keyword		string
	CityCode		int
	Lng		string
	Lat		string
	Radius		int
	SortType		int
	Offset		int
	PageSize		int
}

// func (c *NetSpiderController) QueryPageSkus() {
// 	c.callQueryPageSkus(func(params *tNetspiderQueryPageSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *NetSpiderController) callQueryPageSkus(handler func(params *tNetspiderQueryPageSkusParams) (interface{}, string, error)) {
	var err error
	params := &tNetspiderQueryPageSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorStoreIDs = utils.TrimBlankChar(c.GetString("vendorStoreIDs"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	params.Lng = utils.TrimBlankChar(c.GetString("lng"))
	params.Lat = utils.TrimBlankChar(c.GetString("lat"))
	if params.Radius, err = c.GetInt("radius", 0); err != nil {
		errParams = append(errParams, "radius")
	}
	if params.SortType, err = c.GetInt("sortType", 0); err != nil {
		errParams = append(errParams, "sortType")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("vendorStoreIDs")) != "" {
		params.MapData["vendorStoreIDs"] = params.VendorStoreIDs
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("lng")) != "" {
		params.MapData["lng"] = params.Lng
	}
	if utils.TrimBlankChar(c.GetString("lat")) != "" {
		params.MapData["lat"] = params.Lat
	}
	if utils.TrimBlankChar(c.GetString("radius")) != "" {
		params.MapData["radius"] = params.Radius
	}
	if utils.TrimBlankChar(c.GetString("sortType")) != "" {
		params.MapData["sortType"] = params.SortType
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API NetSpiderController.QueryPageSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API NetSpiderController.QueryPageSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API NetSpiderController.QueryPageSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImGetElmMediaParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PlatformShopID		string
	MediaID		string
}

// func (c *IMController) GetElmMedia() {
// 	c.callGetElmMedia(func(params *tImGetElmMediaParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callGetElmMedia(handler func(params *tImGetElmMediaParams) (interface{}, string, error)) {
	var err error
	params := &tImGetElmMediaParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PlatformShopID = utils.TrimBlankChar(c.GetString("platformShopID"))
	params.MediaID = utils.TrimBlankChar(c.GetString("mediaID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("platformShopID") == "" {
		errParams = append(errParams, "platformShopID")
	}
	params.MapData["platformShopID"] = params.PlatformShopID
	if c.GetString("mediaID") == "" {
		errParams = append(errParams, "mediaID")
	}
	params.MapData["mediaID"] = params.MediaID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.GetElmMedia, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.GetElmMedia, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.GetElmMedia error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderPay4StoreMyselfDeliverOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SubAppID		string
	PayType		int
	VendorPayType		string
	PayMoney		int
	StoreId		int
}

// func (c *JxOrderController) Pay4StoreMyselfDeliverOrder() {
// 	c.callPay4StoreMyselfDeliverOrder(func(params *tJxorderPay4StoreMyselfDeliverOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callPay4StoreMyselfDeliverOrder(handler func(params *tJxorderPay4StoreMyselfDeliverOrderParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderPay4StoreMyselfDeliverOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.SubAppID = utils.TrimBlankChar(c.GetString("subAppID"))
	if params.PayType, err = c.GetInt("payType", 0); err != nil {
		errParams = append(errParams, "payType")
	}
	params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType"))
	if params.PayMoney, err = c.GetInt("payMoney", 0); err != nil {
		errParams = append(errParams, "payMoney")
	}
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("subAppID")) != "" {
		params.MapData["subAppID"] = params.SubAppID
	}
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if c.GetString("vendorPayType") == "" {
		errParams = append(errParams, "vendorPayType")
	}
	params.MapData["vendorPayType"] = params.VendorPayType
	if c.GetString("payMoney") == "" {
		errParams = append(errParams, "payMoney")
	}
	params.MapData["payMoney"] = params.PayMoney
	if c.GetString("storeId") == "" {
		errParams = append(errParams, "storeId")
	}
	params.MapData["storeId"] = params.StoreId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.Pay4StoreMyselfDeliverOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.Pay4StoreMyselfDeliverOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.Pay4StoreMyselfDeliverOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreDelSecretBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PoolKey		string
	SubsID		string
	SecretNumber		string
}

// func (c *StoreController) DelSecretBind() {
// 	c.callDelSecretBind(func(params *tStoreDelSecretBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callDelSecretBind(handler func(params *tStoreDelSecretBindParams) (interface{}, string, error)) {
	var err error
	params := &tStoreDelSecretBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PoolKey = utils.TrimBlankChar(c.GetString("poolKey"))
	params.SubsID = utils.TrimBlankChar(c.GetString("subsID"))
	params.SecretNumber = utils.TrimBlankChar(c.GetString("secretNumber"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("poolKey") == "" {
		errParams = append(errParams, "poolKey")
	}
	params.MapData["poolKey"] = params.PoolKey
	if c.GetString("subsID") == "" {
		errParams = append(errParams, "subsID")
	}
	params.MapData["subsID"] = params.SubsID
	if c.GetString("secretNumber") == "" {
		errParams = append(errParams, "secretNumber")
	}
	params.MapData["secretNumber"] = params.SecretNumber
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.DelSecretBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.DelSecretBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.DelSecretBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuUpdateStoreSkusSpecTagParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) UpdateStoreSkusSpecTag() {
// 	c.callUpdateStoreSkusSpecTag(func(params *tStoreSkuUpdateStoreSkusSpecTagParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callUpdateStoreSkusSpecTag(handler func(params *tStoreSkuUpdateStoreSkusSpecTagParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuUpdateStoreSkusSpecTagParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.UpdateStoreSkusSpecTag, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.UpdateStoreSkusSpecTag, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.UpdateStoreSkusSpecTag error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActRefreshVendorActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
}

// func (c *ActController) RefreshVendorAct() {
// 	c.callRefreshVendorAct(func(params *tActRefreshVendorActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callRefreshVendorAct(handler func(params *tActRefreshVendorActParams) (interface{}, string, error)) {
	var err error
	params := &tActRefreshVendorActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.RefreshVendorAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.RefreshVendorAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.RefreshVendorAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaUnionPayMerInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	LarName		string
	LarIdCard		string
}

// func (c *LaKaLaController) UnionPayMerInfo() {
// 	c.callUnionPayMerInfo(func(params *tLakalaUnionPayMerInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callUnionPayMerInfo(handler func(params *tLakalaUnionPayMerInfoParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaUnionPayMerInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.LarName = utils.TrimBlankChar(c.GetString("larName"))
	params.LarIdCard = utils.TrimBlankChar(c.GetString("larIdCard"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("larName") == "" {
		errParams = append(errParams, "larName")
	}
	params.MapData["larName"] = params.LarName
	if c.GetString("larIdCard") == "" {
		errParams = append(errParams, "larIdCard")
	}
	params.MapData["larIdCard"] = params.LarIdCard
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.UnionPayMerInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.UnionPayMerInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.UnionPayMerInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoresParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	StoreID		int
	StartStoreID		int
	CoordinateType		int
	StoreIDs		string
	Name		string
	PlaceID		int
	PlaceLevel		int
	Address		string
	Tel		string
	Statuss		string
	VendorStoreCond		string
	VendorStoreConds		string
	CourierStoreCond		string
	CourierStoreConds		string
	MapLongitude		string
	MapLatitude		string
	MapRadius		int
	OrderTimeFrom		string
	OrderTimeTo		string
	OrderCountFrom		int
	OrderCountTo		int
	MarketManPhone		string
	BriefLevel		int
	StoreLevels		string
	BrandID		int
	MarketManPhones		string
	JdPhone		string
	MtPhone		string
	EbaiPhone		string
	EarningType		int
	IsBussinessStatus		bool
	Offset		int
	PageSize		int
}

// func (c *StoreController) GetStores() {
// 	c.callGetStores(func(params *tStoreGetStoresParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStores(handler func(params *tStoreGetStoresParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoresParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.StartStoreID, err = c.GetInt("startStoreID", 0); err != nil {
		errParams = append(errParams, "startStoreID")
	}
	if params.CoordinateType, err = c.GetInt("coordinateType", 0); err != nil {
		errParams = append(errParams, "coordinateType")
	}
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.PlaceID, err = c.GetInt("placeID", 0); err != nil {
		errParams = append(errParams, "placeID")
	}
	if params.PlaceLevel, err = c.GetInt("placeLevel", 0); err != nil {
		errParams = append(errParams, "placeLevel")
	}
	params.Address = utils.TrimBlankChar(c.GetString("address"))
	params.Tel = utils.TrimBlankChar(c.GetString("tel"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	params.VendorStoreCond = utils.TrimBlankChar(c.GetString("vendorStoreCond"))
	params.VendorStoreConds = utils.TrimBlankChar(c.GetString("vendorStoreConds"))
	params.CourierStoreCond = utils.TrimBlankChar(c.GetString("courierStoreCond"))
	params.CourierStoreConds = utils.TrimBlankChar(c.GetString("courierStoreConds"))
	params.MapLongitude = utils.TrimBlankChar(c.GetString("mapLongitude"))
	params.MapLatitude = utils.TrimBlankChar(c.GetString("mapLatitude"))
	if params.MapRadius, err = c.GetInt("mapRadius", 0); err != nil {
		errParams = append(errParams, "mapRadius")
	}
	params.OrderTimeFrom = utils.TrimBlankChar(c.GetString("orderTimeFrom"))
	params.OrderTimeTo = utils.TrimBlankChar(c.GetString("orderTimeTo"))
	if params.OrderCountFrom, err = c.GetInt("orderCountFrom", 0); err != nil {
		errParams = append(errParams, "orderCountFrom")
	}
	if params.OrderCountTo, err = c.GetInt("orderCountTo", 0); err != nil {
		errParams = append(errParams, "orderCountTo")
	}
	params.MarketManPhone = utils.TrimBlankChar(c.GetString("marketManPhone"))
	if params.BriefLevel, err = c.GetInt("briefLevel", 0); err != nil {
		errParams = append(errParams, "briefLevel")
	}
	params.StoreLevels = utils.TrimBlankChar(c.GetString("storeLevels"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	params.MarketManPhones = utils.TrimBlankChar(c.GetString("marketManPhones"))
	params.JdPhone = utils.TrimBlankChar(c.GetString("jdPhone"))
	params.MtPhone = utils.TrimBlankChar(c.GetString("mtPhone"))
	params.EbaiPhone = utils.TrimBlankChar(c.GetString("ebaiPhone"))
	if params.EarningType, err = c.GetInt("earningType", 0); err != nil {
		errParams = append(errParams, "earningType")
	}
	if params.IsBussinessStatus, err = c.GetBool("isBussinessStatus", false); err != nil {
		errParams = append(errParams, "isBussinessStatus")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("startStoreID")) != "" {
		params.MapData["startStoreID"] = params.StartStoreID
	}
	if utils.TrimBlankChar(c.GetString("coordinateType")) != "" {
		params.MapData["coordinateType"] = params.CoordinateType
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("placeID")) != "" {
		params.MapData["placeID"] = params.PlaceID
	}
	if utils.TrimBlankChar(c.GetString("placeLevel")) != "" {
		params.MapData["placeLevel"] = params.PlaceLevel
	}
	if utils.TrimBlankChar(c.GetString("address")) != "" {
		params.MapData["address"] = params.Address
	}
	if utils.TrimBlankChar(c.GetString("tel")) != "" {
		params.MapData["tel"] = params.Tel
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("vendorStoreCond")) != "" {
		params.MapData["vendorStoreCond"] = params.VendorStoreCond
	}
	if utils.TrimBlankChar(c.GetString("vendorStoreConds")) != "" {
		params.MapData["vendorStoreConds"] = params.VendorStoreConds
	}
	if utils.TrimBlankChar(c.GetString("courierStoreCond")) != "" {
		params.MapData["courierStoreCond"] = params.CourierStoreCond
	}
	if utils.TrimBlankChar(c.GetString("courierStoreConds")) != "" {
		params.MapData["courierStoreConds"] = params.CourierStoreConds
	}
	if utils.TrimBlankChar(c.GetString("mapLongitude")) != "" {
		params.MapData["mapLongitude"] = params.MapLongitude
	}
	if utils.TrimBlankChar(c.GetString("mapLatitude")) != "" {
		params.MapData["mapLatitude"] = params.MapLatitude
	}
	if utils.TrimBlankChar(c.GetString("mapRadius")) != "" {
		params.MapData["mapRadius"] = params.MapRadius
	}
	if utils.TrimBlankChar(c.GetString("orderTimeFrom")) != "" {
		params.MapData["orderTimeFrom"] = params.OrderTimeFrom
	}
	if utils.TrimBlankChar(c.GetString("orderTimeTo")) != "" {
		params.MapData["orderTimeTo"] = params.OrderTimeTo
	}
	if utils.TrimBlankChar(c.GetString("orderCountFrom")) != "" {
		params.MapData["orderCountFrom"] = params.OrderCountFrom
	}
	if utils.TrimBlankChar(c.GetString("orderCountTo")) != "" {
		params.MapData["orderCountTo"] = params.OrderCountTo
	}
	if utils.TrimBlankChar(c.GetString("marketManPhone")) != "" {
		params.MapData["marketManPhone"] = params.MarketManPhone
	}
	if utils.TrimBlankChar(c.GetString("briefLevel")) != "" {
		params.MapData["briefLevel"] = params.BriefLevel
	}
	if utils.TrimBlankChar(c.GetString("storeLevels")) != "" {
		params.MapData["storeLevels"] = params.StoreLevels
	}
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if utils.TrimBlankChar(c.GetString("marketManPhones")) != "" {
		params.MapData["marketManPhones"] = params.MarketManPhones
	}
	if utils.TrimBlankChar(c.GetString("jdPhone")) != "" {
		params.MapData["jdPhone"] = params.JdPhone
	}
	if utils.TrimBlankChar(c.GetString("mtPhone")) != "" {
		params.MapData["mtPhone"] = params.MtPhone
	}
	if utils.TrimBlankChar(c.GetString("ebaiPhone")) != "" {
		params.MapData["ebaiPhone"] = params.EbaiPhone
	}
	if utils.TrimBlankChar(c.GetString("earningType")) != "" {
		params.MapData["earningType"] = params.EarningType
	}
	if utils.TrimBlankChar(c.GetString("isBussinessStatus")) != "" {
		params.MapData["isBussinessStatus"] = params.IsBussinessStatus
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStores, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStores, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStores error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreExportShopsHealthInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	StoreIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreController) ExportShopsHealthInfo() {
// 	c.callExportShopsHealthInfo(func(params *tStoreExportShopsHealthInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callExportShopsHealthInfo(handler func(params *tStoreExportShopsHealthInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreExportShopsHealthInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.ExportShopsHealthInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.ExportShopsHealthInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.ExportShopsHealthInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncSyncStoreSkusFromYbParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) SyncStoreSkusFromYb() {
// 	c.callSyncStoreSkusFromYb(func(params *tSyncSyncStoreSkusFromYbParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callSyncStoreSkusFromYb(handler func(params *tSyncSyncStoreSkusFromYbParams) (interface{}, string, error)) {
	var err error
	params := &tSyncSyncStoreSkusFromYbParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.SyncStoreSkusFromYb, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.SyncStoreSkusFromYb, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.SyncStoreSkusFromYb error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataUploadImage4VendorsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *InitDataController) UploadImage4Vendors() {
// 	c.callUploadImage4Vendors(func(params *tInitdataUploadImage4VendorsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callUploadImage4Vendors(handler func(params *tInitdataUploadImage4VendorsParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataUploadImage4VendorsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.UploadImage4Vendors, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.UploadImage4Vendors, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.UploadImage4Vendors error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2TiktokDecryptParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Iv		string
	SessionKey		string
	Msg		string
	LoginType		string
}

// func (c *Auth2Controller) TiktokDecrypt() {
// 	c.callTiktokDecrypt(func(params *tAuth2TiktokDecryptParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callTiktokDecrypt(handler func(params *tAuth2TiktokDecryptParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2TiktokDecryptParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Iv = utils.TrimBlankChar(c.GetString("iv"))
	params.SessionKey = utils.TrimBlankChar(c.GetString("sessionKey"))
	params.Msg = utils.TrimBlankChar(c.GetString("msg"))
	params.LoginType = utils.TrimBlankChar(c.GetString("loginType"))
	if c.GetString("iv") == "" {
		errParams = append(errParams, "iv")
	}
	params.MapData["iv"] = params.Iv
	if c.GetString("sessionKey") == "" {
		errParams = append(errParams, "sessionKey")
	}
	params.MapData["sessionKey"] = params.SessionKey
	if c.GetString("msg") == "" {
		errParams = append(errParams, "msg")
	}
	params.MapData["msg"] = params.Msg
	if c.GetString("loginType") == "" {
		errParams = append(errParams, "loginType")
	}
	params.MapData["loginType"] = params.LoginType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.TiktokDecrypt, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.TiktokDecrypt, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.TiktokDecrypt error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxshopJxMsgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	AppKey		string
	MsgType		string
	SubMsgType		string
	ThingID		string
	Data		string
}

// func (c *JxShopController) JxMsg() {
// 	c.callJxMsg(func(params *tJxshopJxMsgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxShopController) callJxMsg(handler func(params *tJxshopJxMsgParams) (interface{}, string, error)) {
	var err error
	params := &tJxshopJxMsgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.AppKey = utils.TrimBlankChar(c.GetString("appKey"))
	params.MsgType = utils.TrimBlankChar(c.GetString("msgType"))
	params.SubMsgType = utils.TrimBlankChar(c.GetString("subMsgType"))
	params.ThingID = utils.TrimBlankChar(c.GetString("thingID"))
	params.Data = utils.TrimBlankChar(c.GetString("data"))
	if c.GetString("appKey") == "" {
		errParams = append(errParams, "appKey")
	}
	params.MapData["appKey"] = params.AppKey
	if c.GetString("msgType") == "" {
		errParams = append(errParams, "msgType")
	}
	params.MapData["msgType"] = params.MsgType
	if utils.TrimBlankChar(c.GetString("subMsgType")) != "" {
		params.MapData["subMsgType"] = params.SubMsgType
	}
	if utils.TrimBlankChar(c.GetString("thingID")) != "" {
		params.MapData["thingID"] = params.ThingID
	}
	if utils.TrimBlankChar(c.GetString("data")) != "" {
		params.MapData["data"] = params.Data
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxShopController.JxMsg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxShopController.JxMsg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxShopController.JxMsg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportGetStoreManageStateParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	BrandIDs		string
	VendorID		int
	SortType		int
	Offset		int
	PageSize		int
}

// func (c *ReportController) GetStoreManageState() {
// 	c.callGetStoreManageState(func(params *tReportGetStoreManageStateParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callGetStoreManageState(handler func(params *tReportGetStoreManageStateParams) (interface{}, string, error)) {
	var err error
	params := &tReportGetStoreManageStateParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.BrandIDs = utils.TrimBlankChar(c.GetString("brandIDs"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.SortType, err = c.GetInt("sortType", 0); err != nil {
		errParams = append(errParams, "sortType")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("brandIDs")) != "" {
		params.MapData["brandIDs"] = params.BrandIDs
	}
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("sortType")) != "" {
		params.MapData["sortType"] = params.SortType
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.GetStoreManageState, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.GetStoreManageState, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.GetStoreManageState error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tEventGetWeixinUnlimitedParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Scene		string
	Page		string
	MinType		string
}

// func (c *EventController) GetWeixinUnlimited() {
// 	c.callGetWeixinUnlimited(func(params *tEventGetWeixinUnlimitedParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *EventController) callGetWeixinUnlimited(handler func(params *tEventGetWeixinUnlimitedParams) (interface{}, string, error)) {
	var err error
	params := &tEventGetWeixinUnlimitedParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Scene = utils.TrimBlankChar(c.GetString("scene"))
	params.Page = utils.TrimBlankChar(c.GetString("page"))
	params.MinType = utils.TrimBlankChar(c.GetString("minType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("scene") == "" {
		errParams = append(errParams, "scene")
	}
	params.MapData["scene"] = params.Scene
	if utils.TrimBlankChar(c.GetString("page")) != "" {
		params.MapData["page"] = params.Page
	}
	if utils.TrimBlankChar(c.GetString("minType")) != "" {
		params.MapData["minType"] = params.MinType
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API EventController.GetWeixinUnlimited, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API EventController.GetWeixinUnlimited, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API EventController.GetWeixinUnlimited error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tEventTestUniAppPushParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *EventController) TestUniAppPush() {
// 	c.callTestUniAppPush(func(params *tEventTestUniAppPushParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *EventController) callTestUniAppPush(handler func(params *tEventTestUniAppPushParams) (interface{}, string, error)) {
	var err error
	params := &tEventTestUniAppPushParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API EventController.TestUniAppPush, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API EventController.TestUniAppPush, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API EventController.TestUniAppPush error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderAgreeOrRefuseRefundParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	AfsOrderID		string
	VendorID		int
	ApproveType		int
	Reason		string
	MtReview		string
}

// func (c *OrderController) AgreeOrRefuseRefund() {
// 	c.callAgreeOrRefuseRefund(func(params *tOrderAgreeOrRefuseRefundParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callAgreeOrRefuseRefund(handler func(params *tOrderAgreeOrRefuseRefundParams) (interface{}, string, error)) {
	var err error
	params := &tOrderAgreeOrRefuseRefundParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.AfsOrderID = utils.TrimBlankChar(c.GetString("afsOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.ApproveType, err = c.GetInt("approveType", 0); err != nil {
		errParams = append(errParams, "approveType")
	}
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	params.MtReview = utils.TrimBlankChar(c.GetString("mtReview"))
	if c.GetString("afsOrderID") == "" {
		errParams = append(errParams, "afsOrderID")
	}
	params.MapData["afsOrderID"] = params.AfsOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("approveType") == "" {
		errParams = append(errParams, "approveType")
	}
	params.MapData["approveType"] = params.ApproveType
	if utils.TrimBlankChar(c.GetString("reason")) != "" {
		params.MapData["reason"] = params.Reason
	}
	if utils.TrimBlankChar(c.GetString("mtReview")) != "" {
		params.MapData["mtReview"] = params.MtReview
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.AgreeOrRefuseRefund, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.AgreeOrRefuseRefund, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.AgreeOrRefuseRefund error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderPay4OrderByBarCodeScannerParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	PaymentLabel		string
	PayType		string
}

// func (c *JxOrderController) Pay4OrderByBarCodeScanner() {
// 	c.callPay4OrderByBarCodeScanner(func(params *tJxorderPay4OrderByBarCodeScannerParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callPay4OrderByBarCodeScanner(handler func(params *tJxorderPay4OrderByBarCodeScannerParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderPay4OrderByBarCodeScannerParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.PaymentLabel = utils.TrimBlankChar(c.GetString("paymentLabel"))
	params.PayType = utils.TrimBlankChar(c.GetString("payType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("paymentLabel") == "" {
		errParams = append(errParams, "paymentLabel")
	}
	params.MapData["paymentLabel"] = params.PaymentLabel
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.Pay4OrderByBarCodeScanner, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.Pay4OrderByBarCodeScanner, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.Pay4OrderByBarCodeScanner error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetOrderRequirePictureParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrderId		string
	VendorID		int
}

// func (c *JxOrderController) GetOrderRequirePicture() {
// 	c.callGetOrderRequirePicture(func(params *tJxorderGetOrderRequirePictureParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetOrderRequirePicture(handler func(params *tJxorderGetOrderRequirePictureParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetOrderRequirePictureParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrderId = utils.TrimBlankChar(c.GetString("orderId"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("orderId") == "" {
		errParams = append(errParams, "orderId")
	}
	params.MapData["orderId"] = params.OrderId
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetOrderRequirePicture, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetOrderRequirePicture, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetOrderRequirePicture error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetMTCategoryAttrValueListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppOrgCode		string
	AttrId		int
	Keyword		string
}

// func (c *SkuController) GetMTCategoryAttrValueList() {
// 	c.callGetMTCategoryAttrValueList(func(params *tSkuGetMTCategoryAttrValueListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetMTCategoryAttrValueList(handler func(params *tSkuGetMTCategoryAttrValueListParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetMTCategoryAttrValueListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppOrgCode = utils.TrimBlankChar(c.GetString("appOrgCode"))
	if params.AttrId, err = c.GetInt("attrId", 0); err != nil {
		errParams = append(errParams, "attrId")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("appOrgCode") == "" {
		errParams = append(errParams, "appOrgCode")
	}
	params.MapData["appOrgCode"] = params.AppOrgCode
	if c.GetString("attrId") == "" {
		errParams = append(errParams, "attrId")
	}
	params.MapData["attrId"] = params.AttrId
	if c.GetString("keyword") == "" {
		errParams = append(errParams, "keyword")
	}
	params.MapData["keyword"] = params.Keyword
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetMTCategoryAttrValueList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetMTCategoryAttrValueList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetMTCategoryAttrValueList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetCitySettlementInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CityCode		string
	VendorIds		string
	Start		string
	End		string
	Size		int
	Offset		int
	Ranke		string
}

// func (c *StoreController) GetCitySettlementInfo() {
// 	c.callGetCitySettlementInfo(func(params *tStoreGetCitySettlementInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetCitySettlementInfo(handler func(params *tStoreGetCitySettlementInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetCitySettlementInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CityCode = utils.TrimBlankChar(c.GetString("cityCode"))
	params.VendorIds = utils.TrimBlankChar(c.GetString("vendorIds"))
	params.Start = utils.TrimBlankChar(c.GetString("start"))
	params.End = utils.TrimBlankChar(c.GetString("end"))
	if params.Size, err = c.GetInt("size", 0); err != nil {
		errParams = append(errParams, "size")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	params.Ranke = utils.TrimBlankChar(c.GetString("ranke"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("vendorIds")) != "" {
		params.MapData["vendorIds"] = params.VendorIds
	}
	if c.GetString("start") == "" {
		errParams = append(errParams, "start")
	}
	params.MapData["start"] = params.Start
	if c.GetString("end") == "" {
		errParams = append(errParams, "end")
	}
	params.MapData["end"] = params.End
	if c.GetString("size") == "" {
		errParams = append(errParams, "size")
	}
	params.MapData["size"] = params.Size
	if c.GetString("offset") == "" {
		errParams = append(errParams, "offset")
	}
	params.MapData["offset"] = params.Offset
	if utils.TrimBlankChar(c.GetString("ranke")) != "" {
		params.MapData["ranke"] = params.Ranke
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetCitySettlementInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetCitySettlementInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetCitySettlementInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetVendorStoreSkusInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorIDs		string
	SkuIDs		string
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) GetVendorStoreSkusInfo() {
// 	c.callGetVendorStoreSkusInfo(func(params *tStoreSkuGetVendorStoreSkusInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetVendorStoreSkusInfo(handler func(params *tStoreSkuGetVendorStoreSkusInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetVendorStoreSkusInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if c.GetString("skuIDs") == "" {
		errParams = append(errParams, "skuIDs")
	}
	params.MapData["skuIDs"] = params.SkuIDs
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetVendorStoreSkusInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetVendorStoreSkusInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetVendorStoreSkusInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTaskGetTasksParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	TaskID		string
	FromStatus		int
	ToStatus		int
	LastHours		int
	CreatedBy		string
}

// func (c *TaskController) GetTasks() {
// 	c.callGetTasks(func(params *tTaskGetTasksParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TaskController) callGetTasks(handler func(params *tTaskGetTasksParams) (interface{}, string, error)) {
	var err error
	params := &tTaskGetTasksParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.TaskID = utils.TrimBlankChar(c.GetString("taskID"))
	if params.FromStatus, err = c.GetInt("fromStatus", 0); err != nil {
		errParams = append(errParams, "fromStatus")
	}
	if params.ToStatus, err = c.GetInt("toStatus", 0); err != nil {
		errParams = append(errParams, "toStatus")
	}
	if params.LastHours, err = c.GetInt("lastHours", 0); err != nil {
		errParams = append(errParams, "lastHours")
	}
	params.CreatedBy = utils.TrimBlankChar(c.GetString("createdBy"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("taskID")) != "" {
		params.MapData["taskID"] = params.TaskID
	}
	if utils.TrimBlankChar(c.GetString("fromStatus")) != "" {
		params.MapData["fromStatus"] = params.FromStatus
	}
	if utils.TrimBlankChar(c.GetString("toStatus")) != "" {
		params.MapData["toStatus"] = params.ToStatus
	}
	if utils.TrimBlankChar(c.GetString("lastHours")) != "" {
		params.MapData["lastHours"] = params.LastHours
	}
	if utils.TrimBlankChar(c.GetString("createdBy")) != "" {
		params.MapData["createdBy"] = params.CreatedBy
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TaskController.GetTasks, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TaskController.GetTasks, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TaskController.GetTasks error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2LogoutParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *Auth2Controller) Logout() {
// 	c.callLogout(func(params *tAuth2LogoutParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callLogout(handler func(params *tAuth2LogoutParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2LogoutParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.Logout, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.Logout, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.Logout error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActDeleteStoresFromActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorID		int
	Types		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *ActController) DeleteStoresFromAct() {
// 	c.callDeleteStoresFromAct(func(params *tActDeleteStoresFromActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callDeleteStoresFromAct(handler func(params *tActDeleteStoresFromActParams) (interface{}, string, error)) {
	var err error
	params := &tActDeleteStoresFromActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Types = utils.TrimBlankChar(c.GetString("types"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("types")) != "" {
		params.MapData["types"] = params.Types
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.DeleteStoresFromAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.DeleteStoresFromAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.DeleteStoresFromAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreTmpGetJxBadCommentsNoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	JxStoreId		int
}

// func (c *StoreController) TmpGetJxBadCommentsNo() {
// 	c.callTmpGetJxBadCommentsNo(func(params *tStoreTmpGetJxBadCommentsNoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callTmpGetJxBadCommentsNo(handler func(params *tStoreTmpGetJxBadCommentsNoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreTmpGetJxBadCommentsNoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.JxStoreId, err = c.GetInt("jxStoreId", 0); err != nil {
		errParams = append(errParams, "jxStoreId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("jxStoreId") == "" {
		errParams = append(errParams, "jxStoreId")
	}
	params.MapData["jxStoreId"] = params.JxStoreId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.TmpGetJxBadCommentsNo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.TmpGetJxBadCommentsNo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.TmpGetJxBadCommentsNo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsFakeNewOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
}

// func (c *CmsController) FakeNewOrder() {
// 	c.callFakeNewOrder(func(params *tCmsFakeNewOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callFakeNewOrder(handler func(params *tCmsFakeNewOrderParams) (interface{}, string, error)) {
	var err error
	params := &tCmsFakeNewOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.FakeNewOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.FakeNewOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.FakeNewOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2DeleteUserInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserID		string
}

// func (c *User2Controller) DeleteUserInfo() {
// 	c.callDeleteUserInfo(func(params *tUser2DeleteUserInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callDeleteUserInfo(handler func(params *tUser2DeleteUserInfoParams) (interface{}, string, error)) {
	var err error
	params := &tUser2DeleteUserInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("userID") == "" {
		errParams = append(errParams, "userID")
	}
	params.MapData["userID"] = params.UserID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.DeleteUserInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.DeleteUserInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.DeleteUserInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaLaKaLaApplyContractParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	StoreID		int
}

// func (c *LaKaLaController) LaKaLaApplyContract() {
// 	c.callLaKaLaApplyContract(func(params *tLakalaLaKaLaApplyContractParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callLaKaLaApplyContract(handler func(params *tLakalaLaKaLaApplyContractParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaLaKaLaApplyContractParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.LaKaLaApplyContract, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.LaKaLaApplyContract, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.LaKaLaApplyContract error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderSetOrderPrintStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	IsPrinted		bool
}

// func (c *OrderController) SetOrderPrintStatus() {
// 	c.callSetOrderPrintStatus(func(params *tOrderSetOrderPrintStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callSetOrderPrintStatus(handler func(params *tOrderSetOrderPrintStatusParams) (interface{}, string, error)) {
	var err error
	params := &tOrderSetOrderPrintStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsPrinted, err = c.GetBool("isPrinted", false); err != nil {
		errParams = append(errParams, "isPrinted")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("isPrinted") == "" {
		errParams = append(errParams, "isPrinted")
	}
	params.MapData["isPrinted"] = params.IsPrinted
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.SetOrderPrintStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.SetOrderPrintStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.SetOrderPrintStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderQueryBarCodeRefundStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AfsOrderId		string
	PayType		string
}

// func (c *JxOrderController) QueryBarCodeRefundStatus() {
// 	c.callQueryBarCodeRefundStatus(func(params *tJxorderQueryBarCodeRefundStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callQueryBarCodeRefundStatus(handler func(params *tJxorderQueryBarCodeRefundStatusParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderQueryBarCodeRefundStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AfsOrderId = utils.TrimBlankChar(c.GetString("afsOrderId"))
	params.PayType = utils.TrimBlankChar(c.GetString("payType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("afsOrderId") == "" {
		errParams = append(errParams, "afsOrderId")
	}
	params.MapData["afsOrderId"] = params.AfsOrderId
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.QueryBarCodeRefundStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.QueryBarCodeRefundStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.QueryBarCodeRefundStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetMTProductRuleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryId		int
	VendorId		int
}

// func (c *SkuController) GetMTProductRule() {
// 	c.callGetMTProductRule(func(params *tSkuGetMTProductRuleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetMTProductRule(handler func(params *tSkuGetMTProductRuleParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetMTProductRuleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryId, err = c.GetInt("categoryId", 0); err != nil {
		errParams = append(errParams, "categoryId")
	}
	if params.VendorId, err = c.GetInt("vendorId", 0); err != nil {
		errParams = append(errParams, "vendorId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categoryId") == "" {
		errParams = append(errParams, "categoryId")
	}
	params.MapData["categoryId"] = params.CategoryId
	if c.GetString("vendorId") == "" {
		errParams = append(errParams, "vendorId")
	}
	params.MapData["vendorId"] = params.VendorId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetMTProductRule, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetMTProductRule, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetMTProductRule error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetStoreRoleListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *User2Controller) GetStoreRoleList() {
// 	c.callGetStoreRoleList(func(params *tUser2GetStoreRoleListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetStoreRoleList(handler func(params *tUser2GetStoreRoleListParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetStoreRoleListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetStoreRoleList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetStoreRoleList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetStoreRoleList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerUpdateMenuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	MenuID		int
	IsDelete		bool
}

// func (c *PowerController) UpdateMenu() {
// 	c.callUpdateMenu(func(params *tPowerUpdateMenuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callUpdateMenu(handler func(params *tPowerUpdateMenuParams) (interface{}, string, error)) {
	var err error
	params := &tPowerUpdateMenuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.MenuID, err = c.GetInt("menuID", 0); err != nil {
		errParams = append(errParams, "menuID")
	}
	if params.IsDelete, err = c.GetBool("isDelete", false); err != nil {
		errParams = append(errParams, "isDelete")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("menuID") == "" {
		errParams = append(errParams, "menuID")
	}
	params.MapData["menuID"] = params.MenuID
	if c.GetString("isDelete") == "" {
		errParams = append(errParams, "isDelete")
	}
	params.MapData["isDelete"] = params.IsDelete
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.UpdateMenu, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.UpdateMenu, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.UpdateMenu error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreBatchGetMTStoreLogosParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
	StoreIDs		string
}

// func (c *StoreController) BatchGetMTStoreLogos() {
// 	c.callBatchGetMTStoreLogos(func(params *tStoreBatchGetMTStoreLogosParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callBatchGetMTStoreLogos(handler func(params *tStoreBatchGetMTStoreLogosParams) (interface{}, string, error)) {
	var err error
	params := &tStoreBatchGetMTStoreLogosParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.BatchGetMTStoreLogos, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.BatchGetMTStoreLogos, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.BatchGetMTStoreLogos error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuDeleteSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SkuID		int
}

// func (c *SkuController) DeleteSku() {
// 	c.callDeleteSku(func(params *tSkuDeleteSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callDeleteSku(handler func(params *tSkuDeleteSkuParams) (interface{}, string, error)) {
	var err error
	params := &tSkuDeleteSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("skuID") == "" {
		errParams = append(errParams, "skuID")
	}
	params.MapData["skuID"] = params.SkuID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.DeleteSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.DeleteSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.DeleteSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateStoreVendorMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
	Payload		string
}

// func (c *StoreController) UpdateStoreVendorMap() {
// 	c.callUpdateStoreVendorMap(func(params *tStoreUpdateStoreVendorMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateStoreVendorMap(handler func(params *tStoreUpdateStoreVendorMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateStoreVendorMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateStoreVendorMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateStoreVendorMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateStoreVendorMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2UpdateUserWxNoAndPercentParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserID		string
	DividePercentage		int
	IsReceiver		bool
}

// func (c *User2Controller) UpdateUserWxNoAndPercent() {
// 	c.callUpdateUserWxNoAndPercent(func(params *tUser2UpdateUserWxNoAndPercentParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callUpdateUserWxNoAndPercent(handler func(params *tUser2UpdateUserWxNoAndPercentParams) (interface{}, string, error)) {
	var err error
	params := &tUser2UpdateUserWxNoAndPercentParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	if params.DividePercentage, err = c.GetInt("dividePercentage", 0); err != nil {
		errParams = append(errParams, "dividePercentage")
	}
	if params.IsReceiver, err = c.GetBool("isReceiver", false); err != nil {
		errParams = append(errParams, "isReceiver")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("userID") == "" {
		errParams = append(errParams, "userID")
	}
	params.MapData["userID"] = params.UserID
	if utils.TrimBlankChar(c.GetString("dividePercentage")) != "" {
		params.MapData["dividePercentage"] = params.DividePercentage
	}
	if c.GetString("isReceiver") == "" {
		errParams = append(errParams, "isReceiver")
	}
	params.MapData["isReceiver"] = params.IsReceiver
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.UpdateUserWxNoAndPercent, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.UpdateUserWxNoAndPercent, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.UpdateUserWxNoAndPercent error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActSyncActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ActID		int
	VendorIDs		string
	IsAsync		bool
}

// func (c *ActController) SyncAct() {
// 	c.callSyncAct(func(params *tActSyncActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callSyncAct(handler func(params *tActSyncActParams) (interface{}, string, error)) {
	var err error
	params := &tActSyncActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ActID, err = c.GetInt("actID", 0); err != nil {
		errParams = append(errParams, "actID")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("actID") == "" {
		errParams = append(errParams, "actID")
	}
	params.MapData["actID"] = params.ActID
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.SyncAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.SyncAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.SyncAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetWaybillsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	FromDate		string
	ToDate		string
	WaybillVendorIDs		string
	Statuss		string
	Offset		int
	PageSize		int
}

// func (c *OrderController) GetWaybills() {
// 	c.callGetWaybills(func(params *tOrderGetWaybillsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetWaybills(handler func(params *tOrderGetWaybillsParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetWaybillsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.WaybillVendorIDs = utils.TrimBlankChar(c.GetString("waybillVendorIDs"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("waybillVendorIDs")) != "" {
		params.MapData["waybillVendorIDs"] = params.WaybillVendorIDs
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetWaybills, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetWaybills, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetWaybills error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateSkuImgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SkuID		int
	Payload		string
}

// func (c *SkuController) UpdateSkuImg() {
// 	c.callUpdateSkuImg(func(params *tSkuUpdateSkuImgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateSkuImg(handler func(params *tSkuUpdateSkuImgParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateSkuImgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("skuID") == "" {
		errParams = append(errParams, "skuID")
	}
	params.MapData["skuID"] = params.SkuID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateSkuImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateSkuImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateSkuImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreRefreshJdLevelParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *StoreController) RefreshJdLevel() {
// 	c.callRefreshJdLevel(func(params *tStoreRefreshJdLevelParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callRefreshJdLevel(handler func(params *tStoreRefreshJdLevelParams) (interface{}, string, error)) {
	var err error
	params := &tStoreRefreshJdLevelParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.RefreshJdLevel, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.RefreshJdLevel, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.RefreshJdLevel error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreListByLocationParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Lng		float64
	Lat		float64
	NeedWalkDistance		bool
	BrandID		int
}

// func (c *StoreController) GetStoreListByLocation() {
// 	c.callGetStoreListByLocation(func(params *tStoreGetStoreListByLocationParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreListByLocation(handler func(params *tStoreGetStoreListByLocationParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreListByLocationParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if params.Lng, err = c.GetFloat("lng", 0); err != nil {
		errParams = append(errParams, "lng")
	}
	if params.Lat, err = c.GetFloat("lat", 0); err != nil {
		errParams = append(errParams, "lat")
	}
	if params.NeedWalkDistance, err = c.GetBool("needWalkDistance", false); err != nil {
		errParams = append(errParams, "needWalkDistance")
	}
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if c.GetString("lng") == "" {
		errParams = append(errParams, "lng")
	}
	params.MapData["lng"] = params.Lng
	if c.GetString("lat") == "" {
		errParams = append(errParams, "lat")
	}
	params.MapData["lat"] = params.Lat
	if utils.TrimBlankChar(c.GetString("needWalkDistance")) != "" {
		params.MapData["needWalkDistance"] = params.NeedWalkDistance
	}
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreListByLocation, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreListByLocation, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreListByLocation error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetVendorStoreSkuPriceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SkuID		int
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) GetVendorStoreSkuPrice() {
// 	c.callGetVendorStoreSkuPrice(func(params *tStoreSkuGetVendorStoreSkuPriceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetVendorStoreSkuPrice(handler func(params *tStoreSkuGetVendorStoreSkuPriceParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetVendorStoreSkuPriceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("skuID") == "" {
		errParams = append(errParams, "skuID")
	}
	params.MapData["skuID"] = params.SkuID
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetVendorStoreSkuPrice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetVendorStoreSkuPrice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetVendorStoreSkuPrice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFoodrecipeVoteFoodRecipeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RecipeID		int
	VoteType		int
}

// func (c *FoodRecipeController) VoteFoodRecipe() {
// 	c.callVoteFoodRecipe(func(params *tFoodrecipeVoteFoodRecipeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FoodRecipeController) callVoteFoodRecipe(handler func(params *tFoodrecipeVoteFoodRecipeParams) (interface{}, string, error)) {
	var err error
	params := &tFoodrecipeVoteFoodRecipeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.RecipeID, err = c.GetInt("recipeID", 0); err != nil {
		errParams = append(errParams, "recipeID")
	}
	if params.VoteType, err = c.GetInt("voteType", 0); err != nil {
		errParams = append(errParams, "voteType")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("recipeID") == "" {
		errParams = append(errParams, "recipeID")
	}
	params.MapData["recipeID"] = params.RecipeID
	if c.GetString("voteType") == "" {
		errParams = append(errParams, "voteType")
	}
	params.MapData["voteType"] = params.VoteType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FoodRecipeController.VoteFoodRecipe, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FoodRecipeController.VoteFoodRecipe, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FoodRecipeController.VoteFoodRecipe error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderUploadOrderPickingParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrderId		string
	VendorID		int
	MediaList		string
}

// func (c *JxOrderController) UploadOrderPicking() {
// 	c.callUploadOrderPicking(func(params *tJxorderUploadOrderPickingParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callUploadOrderPicking(handler func(params *tJxorderUploadOrderPickingParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderUploadOrderPickingParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrderId = utils.TrimBlankChar(c.GetString("orderId"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.MediaList = utils.TrimBlankChar(c.GetString("mediaList"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("orderId") == "" {
		errParams = append(errParams, "orderId")
	}
	params.MapData["orderId"] = params.OrderId
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("mediaList") == "" {
		errParams = append(errParams, "mediaList")
	}
	params.MapData["mediaList"] = params.MediaList
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.UploadOrderPicking, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.UploadOrderPicking, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.UploadOrderPicking error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreBatchUpdateMTStoreLogosParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		int
	RelInfos		string
}

// func (c *StoreController) BatchUpdateMTStoreLogos() {
// 	c.callBatchUpdateMTStoreLogos(func(params *tStoreBatchUpdateMTStoreLogosParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callBatchUpdateMTStoreLogos(handler func(params *tStoreBatchUpdateMTStoreLogosParams) (interface{}, string, error)) {
	var err error
	params := &tStoreBatchUpdateMTStoreLogosParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorOrgCode, err = c.GetInt("vendorOrgCode", 0); err != nil {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.RelInfos = utils.TrimBlankChar(c.GetString("relInfos"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("relInfos") == "" {
		errParams = append(errParams, "relInfos")
	}
	params.MapData["relInfos"] = params.RelInfos
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.BatchUpdateMTStoreLogos, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.BatchUpdateMTStoreLogos, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.BatchUpdateMTStoreLogos error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuUpdateStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	Payload		string
	CauseFlag		int
	IsContinueWhenError		bool
	IsAsync		bool
}

// func (c *StoreSkuController) UpdateStoreSkus() {
// 	c.callUpdateStoreSkus(func(params *tStoreSkuUpdateStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callUpdateStoreSkus(handler func(params *tStoreSkuUpdateStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuUpdateStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.CauseFlag, err = c.GetInt("causeFlag", 0); err != nil {
		errParams = append(errParams, "causeFlag")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("causeFlag")) != "" {
		params.MapData["causeFlag"] = params.CauseFlag
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.UpdateStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.UpdateStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.UpdateStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImAddCustomReplyParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AppID		string
	VendorStoreID		string
	ReplyTemplate		string
}

// func (c *IMController) AddCustomReply() {
// 	c.callAddCustomReply(func(params *tImAddCustomReplyParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callAddCustomReply(handler func(params *tImAddCustomReplyParams) (interface{}, string, error)) {
	var err error
	params := &tImAddCustomReplyParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AppID = utils.TrimBlankChar(c.GetString("appID"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	params.ReplyTemplate = utils.TrimBlankChar(c.GetString("replyTemplate"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("appID") == "" {
		errParams = append(errParams, "appID")
	}
	params.MapData["appID"] = params.AppID
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if c.GetString("replyTemplate") == "" {
		errParams = append(errParams, "replyTemplate")
	}
	params.MapData["replyTemplate"] = params.ReplyTemplate
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.AddCustomReply, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.AddCustomReply, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.AddCustomReply error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetMyOrderCountInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromDate		string
	ToDate		string
	Statuss		string
}

// func (c *JxOrderController) GetMyOrderCountInfo() {
// 	c.callGetMyOrderCountInfo(func(params *tJxorderGetMyOrderCountInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetMyOrderCountInfo(handler func(params *tJxorderGetMyOrderCountInfoParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetMyOrderCountInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("fromDate")) != "" {
		params.MapData["fromDate"] = params.FromDate
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetMyOrderCountInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetMyOrderCountInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetMyOrderCountInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreBindSecretNumberParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SecretNumber		string
	NumberA		string
	NumberB		string
	Expiration		string
}

// func (c *StoreController) BindSecretNumber() {
// 	c.callBindSecretNumber(func(params *tStoreBindSecretNumberParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callBindSecretNumber(handler func(params *tStoreBindSecretNumberParams) (interface{}, string, error)) {
	var err error
	params := &tStoreBindSecretNumberParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.SecretNumber = utils.TrimBlankChar(c.GetString("secretNumber"))
	params.NumberA = utils.TrimBlankChar(c.GetString("numberA"))
	params.NumberB = utils.TrimBlankChar(c.GetString("numberB"))
	params.Expiration = utils.TrimBlankChar(c.GetString("expiration"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("secretNumber") == "" {
		errParams = append(errParams, "secretNumber")
	}
	params.MapData["secretNumber"] = params.SecretNumber
	if c.GetString("numberA") == "" {
		errParams = append(errParams, "numberA")
	}
	params.MapData["numberA"] = params.NumberA
	if c.GetString("numberB") == "" {
		errParams = append(errParams, "numberB")
	}
	params.MapData["numberB"] = params.NumberB
	if c.GetString("expiration") == "" {
		errParams = append(errParams, "expiration")
	}
	params.MapData["expiration"] = params.Expiration
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.BindSecretNumber, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.BindSecretNumber, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.BindSecretNumber error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetCorporationInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	LicenceCode		string
	LicenceImg		string
}

// func (c *StoreController) GetCorporationInfo() {
// 	c.callGetCorporationInfo(func(params *tStoreGetCorporationInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetCorporationInfo(handler func(params *tStoreGetCorporationInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetCorporationInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.LicenceCode = utils.TrimBlankChar(c.GetString("licenceCode"))
	params.LicenceImg = utils.TrimBlankChar(c.GetString("licenceImg"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("licenceCode") == "" {
		errParams = append(errParams, "licenceCode")
	}
	params.MapData["licenceCode"] = params.LicenceCode
	if c.GetString("licenceImg") == "" {
		errParams = append(errParams, "licenceImg")
	}
	params.MapData["licenceImg"] = params.LicenceImg
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetCorporationInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetCorporationInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetCorporationInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetRoleUserListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RoleName		string
	StoreID		int
}

// func (c *User2Controller) GetRoleUserList() {
// 	c.callGetRoleUserList(func(params *tUser2GetRoleUserListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetRoleUserList(handler func(params *tUser2GetRoleUserListParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetRoleUserListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.RoleName = utils.TrimBlankChar(c.GetString("roleName"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("roleName") == "" {
		errParams = append(errParams, "roleName")
	}
	params.MapData["roleName"] = params.RoleName
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetRoleUserList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetRoleUserList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetRoleUserList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysGetWX2TokenParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	AccessKey		string
	OldToken		string
	WaitSecond		int
}

// func (c *SysController) GetWX2Token() {
// 	c.callGetWX2Token(func(params *tSysGetWX2TokenParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callGetWX2Token(handler func(params *tSysGetWX2TokenParams) (interface{}, string, error)) {
	var err error
	params := &tSysGetWX2TokenParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.AccessKey = utils.TrimBlankChar(c.GetString("accessKey"))
	params.OldToken = utils.TrimBlankChar(c.GetString("oldToken"))
	if params.WaitSecond, err = c.GetInt("waitSecond", 0); err != nil {
		errParams = append(errParams, "waitSecond")
	}
	if c.GetString("accessKey") == "" {
		errParams = append(errParams, "accessKey")
	}
	params.MapData["accessKey"] = params.AccessKey
	if utils.TrimBlankChar(c.GetString("oldToken")) != "" {
		params.MapData["oldToken"] = params.OldToken
	}
	if utils.TrimBlankChar(c.GetString("waitSecond")) != "" {
		params.MapData["waitSecond"] = params.WaitSecond
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.GetWX2Token, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.GetWX2Token, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.GetWX2Token error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryApplyContractListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreId		int
	OrderNo		string
	Offset		int
	PageSize		int
}

// func (c *LaKaLaController) QueryApplyContractList() {
// 	c.callQueryApplyContractList(func(params *tLakalaQueryApplyContractListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryApplyContractList(handler func(params *tLakalaQueryApplyContractListParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryApplyContractListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeId")) != "" {
		params.MapData["storeId"] = params.StoreId
	}
	if utils.TrimBlankChar(c.GetString("orderNo")) != "" {
		params.MapData["orderNo"] = params.OrderNo
	}
	if c.GetString("offset") == "" {
		errParams = append(errParams, "offset")
	}
	params.MapData["offset"] = params.Offset
	if c.GetString("pageSize") == "" {
		errParams = append(errParams, "pageSize")
	}
	params.MapData["pageSize"] = params.PageSize
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryApplyContractList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryApplyContractList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryApplyContractList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrderID		string
	VendorOrderID		string
	Keyword		string
	FromDate		string
	ToDate		string
	IsDateFinish		bool
	VendorIDs		string
	WaybillVendorIDs		string
	StoreIDs		string
	FromStoreIDs		string
	Statuss		string
	LockStatuss		string
	Cities		string
	IsIncludeFake		bool
	SkuIDs		string
	IsJxFirst		bool
	AdjustCount		int
	BrandID		int
	MustInvoice		bool
	DeliveryTypes		string
	JxIncomeBegin		string
	JxIncomeEnd		string
	MarketManPhone		string
	JdPhone		string
	MtPhone		string
	EbaiPhone		string
	Offset		int
	PageSize		int
}

// func (c *OrderController) GetOrders() {
// 	c.callGetOrders(func(params *tOrderGetOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrders(handler func(params *tOrderGetOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrderID = utils.TrimBlankChar(c.GetString("orderID"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	if params.IsDateFinish, err = c.GetBool("isDateFinish", false); err != nil {
		errParams = append(errParams, "isDateFinish")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.WaybillVendorIDs = utils.TrimBlankChar(c.GetString("waybillVendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.FromStoreIDs = utils.TrimBlankChar(c.GetString("fromStoreIDs"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	params.LockStatuss = utils.TrimBlankChar(c.GetString("lockStatuss"))
	params.Cities = utils.TrimBlankChar(c.GetString("cities"))
	if params.IsIncludeFake, err = c.GetBool("isIncludeFake", false); err != nil {
		errParams = append(errParams, "isIncludeFake")
	}
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.IsJxFirst, err = c.GetBool("isJxFirst", false); err != nil {
		errParams = append(errParams, "isJxFirst")
	}
	if params.AdjustCount, err = c.GetInt("adjustCount", 0); err != nil {
		errParams = append(errParams, "adjustCount")
	}
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.MustInvoice, err = c.GetBool("mustInvoice", false); err != nil {
		errParams = append(errParams, "mustInvoice")
	}
	params.DeliveryTypes = utils.TrimBlankChar(c.GetString("deliveryTypes"))
	params.JxIncomeBegin = utils.TrimBlankChar(c.GetString("jxIncomeBegin"))
	params.JxIncomeEnd = utils.TrimBlankChar(c.GetString("jxIncomeEnd"))
	params.MarketManPhone = utils.TrimBlankChar(c.GetString("marketManPhone"))
	params.JdPhone = utils.TrimBlankChar(c.GetString("jdPhone"))
	params.MtPhone = utils.TrimBlankChar(c.GetString("mtPhone"))
	params.EbaiPhone = utils.TrimBlankChar(c.GetString("ebaiPhone"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("orderID")) != "" {
		params.MapData["orderID"] = params.OrderID
	}
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("fromDate")) != "" {
		params.MapData["fromDate"] = params.FromDate
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("isDateFinish")) != "" {
		params.MapData["isDateFinish"] = params.IsDateFinish
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("waybillVendorIDs")) != "" {
		params.MapData["waybillVendorIDs"] = params.WaybillVendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("fromStoreIDs")) != "" {
		params.MapData["fromStoreIDs"] = params.FromStoreIDs
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("lockStatuss")) != "" {
		params.MapData["lockStatuss"] = params.LockStatuss
	}
	if utils.TrimBlankChar(c.GetString("cities")) != "" {
		params.MapData["cities"] = params.Cities
	}
	if utils.TrimBlankChar(c.GetString("isIncludeFake")) != "" {
		params.MapData["isIncludeFake"] = params.IsIncludeFake
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("isJxFirst")) != "" {
		params.MapData["isJxFirst"] = params.IsJxFirst
	}
	if utils.TrimBlankChar(c.GetString("adjustCount")) != "" {
		params.MapData["adjustCount"] = params.AdjustCount
	}
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if utils.TrimBlankChar(c.GetString("mustInvoice")) != "" {
		params.MapData["mustInvoice"] = params.MustInvoice
	}
	if utils.TrimBlankChar(c.GetString("deliveryTypes")) != "" {
		params.MapData["deliveryTypes"] = params.DeliveryTypes
	}
	if utils.TrimBlankChar(c.GetString("jxIncomeBegin")) != "" {
		params.MapData["jxIncomeBegin"] = params.JxIncomeBegin
	}
	if utils.TrimBlankChar(c.GetString("jxIncomeEnd")) != "" {
		params.MapData["jxIncomeEnd"] = params.JxIncomeEnd
	}
	if utils.TrimBlankChar(c.GetString("marketManPhone")) != "" {
		params.MapData["marketManPhone"] = params.MarketManPhone
	}
	if utils.TrimBlankChar(c.GetString("jdPhone")) != "" {
		params.MapData["jdPhone"] = params.JdPhone
	}
	if utils.TrimBlankChar(c.GetString("mtPhone")) != "" {
		params.MapData["mtPhone"] = params.MtPhone
	}
	if utils.TrimBlankChar(c.GetString("ebaiPhone")) != "" {
		params.MapData["ebaiPhone"] = params.EbaiPhone
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateSkuExinfoMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameIDs		string
	ExPrefix		string
	FromDate		string
	ToDate		string
	ImgWaterMark		string
	BrandID		int
	VendorID		int
	StoreId		string
	VendorOrgCode		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SkuController) UpdateSkuExinfoMap() {
// 	c.callUpdateSkuExinfoMap(func(params *tSkuUpdateSkuExinfoMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateSkuExinfoMap(handler func(params *tSkuUpdateSkuExinfoMapParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateSkuExinfoMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	params.ExPrefix = utils.TrimBlankChar(c.GetString("exPrefix"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.ImgWaterMark = utils.TrimBlankChar(c.GetString("imgWaterMark"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.StoreId = utils.TrimBlankChar(c.GetString("storeId"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("nameIDs") == "" {
		errParams = append(errParams, "nameIDs")
	}
	params.MapData["nameIDs"] = params.NameIDs
	if utils.TrimBlankChar(c.GetString("exPrefix")) != "" {
		params.MapData["exPrefix"] = params.ExPrefix
	}
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if c.GetString("toDate") == "" {
		errParams = append(errParams, "toDate")
	}
	params.MapData["toDate"] = params.ToDate
	if utils.TrimBlankChar(c.GetString("imgWaterMark")) != "" {
		params.MapData["imgWaterMark"] = params.ImgWaterMark
	}
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("storeId")) != "" {
		params.MapData["storeId"] = params.StoreId
	}
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateSkuExinfoMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateSkuExinfoMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateSkuExinfoMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreAddStoreVendorMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
	VendorOrgCode		string
	Payload		string
}

// func (c *StoreController) AddStoreVendorMap() {
// 	c.callAddStoreVendorMap(func(params *tStoreAddStoreVendorMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callAddStoreVendorMap(handler func(params *tStoreAddStoreVendorMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreAddStoreVendorMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.AddStoreVendorMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.AddStoreVendorMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.AddStoreVendorMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreAddStoreCourierMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
	Payload		string
}

// func (c *StoreController) AddStoreCourierMap() {
// 	c.callAddStoreCourierMap(func(params *tStoreAddStoreCourierMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callAddStoreCourierMap(handler func(params *tStoreAddStoreCourierMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreAddStoreCourierMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.AddStoreCourierMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.AddStoreCourierMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.AddStoreCourierMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataDeleteWrongSpuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *InitDataController) DeleteWrongSpu() {
// 	c.callDeleteWrongSpu(func(params *tInitdataDeleteWrongSpuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callDeleteWrongSpu(handler func(params *tInitdataDeleteWrongSpuParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataDeleteWrongSpuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.DeleteWrongSpu, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.DeleteWrongSpu, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.DeleteWrongSpu error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2AddAuthBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AuthToken		string
}

// func (c *Auth2Controller) AddAuthBind() {
// 	c.callAddAuthBind(func(params *tAuth2AddAuthBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callAddAuthBind(handler func(params *tAuth2AddAuthBindParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2AddAuthBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AuthToken = utils.TrimBlankChar(c.GetString("authToken"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("authToken") == "" {
		errParams = append(errParams, "authToken")
	}
	params.MapData["authToken"] = params.AuthToken
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.AddAuthBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.AddAuthBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.AddAuthBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tKnowUpdateKnowledgeDepotParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Id		int
	Content		string
	IsDel		bool
}

// func (c *KnowController) UpdateKnowledgeDepot() {
// 	c.callUpdateKnowledgeDepot(func(params *tKnowUpdateKnowledgeDepotParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *KnowController) callUpdateKnowledgeDepot(handler func(params *tKnowUpdateKnowledgeDepotParams) (interface{}, string, error)) {
	var err error
	params := &tKnowUpdateKnowledgeDepotParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Id, err = c.GetInt("id", 0); err != nil {
		errParams = append(errParams, "id")
	}
	params.Content = utils.TrimBlankChar(c.GetString("content"))
	if params.IsDel, err = c.GetBool("isDel", false); err != nil {
		errParams = append(errParams, "isDel")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("id") == "" {
		errParams = append(errParams, "id")
	}
	params.MapData["id"] = params.Id
	if utils.TrimBlankChar(c.GetString("content")) != "" {
		params.MapData["content"] = params.Content
	}
	if c.GetString("isDel") == "" {
		errParams = append(errParams, "isDel")
	}
	params.MapData["isDel"] = params.IsDel
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API KnowController.UpdateKnowledgeDepot, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API KnowController.UpdateKnowledgeDepot, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API KnowController.UpdateKnowledgeDepot error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrderWaybillInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	IsNotEnded		bool
	IsGetPos		bool
}

// func (c *OrderController) GetOrderWaybillInfo() {
// 	c.callGetOrderWaybillInfo(func(params *tOrderGetOrderWaybillInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrderWaybillInfo(handler func(params *tOrderGetOrderWaybillInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrderWaybillInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsNotEnded, err = c.GetBool("isNotEnded", false); err != nil {
		errParams = append(errParams, "isNotEnded")
	}
	if params.IsGetPos, err = c.GetBool("isGetPos", false); err != nil {
		errParams = append(errParams, "isGetPos")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("isNotEnded")) != "" {
		params.MapData["isNotEnded"] = params.IsNotEnded
	}
	if utils.TrimBlankChar(c.GetString("isGetPos")) != "" {
		params.MapData["isGetPos"] = params.IsGetPos
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrderWaybillInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrderWaybillInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrderWaybillInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderTestDefendParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *JxOrderController) TestDefend() {
// 	c.callTestDefend(func(params *tJxorderTestDefendParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callTestDefend(handler func(params *tJxorderTestDefendParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderTestDefendParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.TestDefend, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.TestDefend, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.TestDefend error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ParentID		int
	Level		int
	StoreID		int
}

// func (c *StoreController) GetStoreCategoryMap() {
// 	c.callGetStoreCategoryMap(func(params *tStoreGetStoreCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreCategoryMap(handler func(params *tStoreGetStoreCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("parentID")) != "" {
		params.MapData["parentID"] = params.ParentID
	}
	if utils.TrimBlankChar(c.GetString("level")) != "" {
		params.MapData["level"] = params.Level
	}
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderTerminalQueryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreId		int
}

// func (c *JxOrderController) TerminalQuery() {
// 	c.callTerminalQuery(func(params *tJxorderTerminalQueryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callTerminalQuery(handler func(params *tJxorderTerminalQueryParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderTerminalQueryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeId") == "" {
		errParams = append(errParams, "storeId")
	}
	params.MapData["storeId"] = params.StoreId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.TerminalQuery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.TerminalQuery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.TerminalQuery error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateTxdStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
	TxdStores		string
}

// func (c *StoreController) UpdateTxdStore() {
// 	c.callUpdateTxdStore(func(params *tStoreUpdateTxdStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateTxdStore(handler func(params *tStoreUpdateTxdStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateTxdStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.TxdStores = utils.TrimBlankChar(c.GetString("txdStores"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("txdStores") == "" {
		errParams = append(errParams, "txdStores")
	}
	params.MapData["txdStores"] = params.TxdStores
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateTxdStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateTxdStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateTxdStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreFineDescParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	FromTime		string
	ToTime		string
}

// func (c *StoreController) GetStoreFineDesc() {
// 	c.callGetStoreFineDesc(func(params *tStoreGetStoreFineDescParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreFineDesc(handler func(params *tStoreGetStoreFineDescParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreFineDescParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreFineDesc, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreFineDesc, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreFineDesc error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuFocusStoreSkusBySkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) FocusStoreSkusBySku() {
// 	c.callFocusStoreSkusBySku(func(params *tStoreSkuFocusStoreSkusBySkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callFocusStoreSkusBySku(handler func(params *tStoreSkuFocusStoreSkusBySkuParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuFocusStoreSkusBySkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.FocusStoreSkusBySku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.FocusStoreSkusBySku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.FocusStoreSkusBySku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncSyncStoresSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	SkuIDs		string
	IsForce		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) SyncStoresSkus() {
// 	c.callSyncStoresSkus(func(params *tSyncSyncStoresSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callSyncStoresSkus(handler func(params *tSyncSyncStoresSkusParams) (interface{}, string, error)) {
	var err error
	params := &tSyncSyncStoresSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.SyncStoresSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.SyncStoresSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.SyncStoresSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActUpdateActStoreSkuBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ActID		int
	ActStoreSkuAddList		string
	ActStoreSkuDeleteList		string
	IsAsync		bool
}

// func (c *ActController) UpdateActStoreSkuBind() {
// 	c.callUpdateActStoreSkuBind(func(params *tActUpdateActStoreSkuBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callUpdateActStoreSkuBind(handler func(params *tActUpdateActStoreSkuBindParams) (interface{}, string, error)) {
	var err error
	params := &tActUpdateActStoreSkuBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ActID, err = c.GetInt("actID", 0); err != nil {
		errParams = append(errParams, "actID")
	}
	params.ActStoreSkuAddList = utils.TrimBlankChar(c.GetString("actStoreSkuAddList"))
	params.ActStoreSkuDeleteList = utils.TrimBlankChar(c.GetString("actStoreSkuDeleteList"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("actID") == "" {
		errParams = append(errParams, "actID")
	}
	params.MapData["actID"] = params.ActID
	if utils.TrimBlankChar(c.GetString("actStoreSkuAddList")) != "" {
		params.MapData["actStoreSkuAddList"] = params.ActStoreSkuAddList
	}
	if utils.TrimBlankChar(c.GetString("actStoreSkuDeleteList")) != "" {
		params.MapData["actStoreSkuDeleteList"] = params.ActStoreSkuDeleteList
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.UpdateActStoreSkuBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.UpdateActStoreSkuBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.UpdateActStoreSkuBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetStoreAfsOrderCountInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	LastHours		int
}

// func (c *OrderController) GetStoreAfsOrderCountInfo() {
// 	c.callGetStoreAfsOrderCountInfo(func(params *tOrderGetStoreAfsOrderCountInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetStoreAfsOrderCountInfo(handler func(params *tOrderGetStoreAfsOrderCountInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetStoreAfsOrderCountInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.LastHours, err = c.GetInt("lastHours", 0); err != nil {
		errParams = append(errParams, "lastHours")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("lastHours")) != "" {
		params.MapData["lastHours"] = params.LastHours
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetStoreAfsOrderCountInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetStoreAfsOrderCountInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetStoreAfsOrderCountInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefreshOrdersPriceInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *OrderController) RefreshOrdersPriceInfo() {
// 	c.callRefreshOrdersPriceInfo(func(params *tOrderRefreshOrdersPriceInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefreshOrdersPriceInfo(handler func(params *tOrderRefreshOrdersPriceInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefreshOrdersPriceInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefreshOrdersPriceInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefreshOrdersPriceInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefreshOrdersPriceInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderCallPMCourierParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
}

// func (c *OrderController) CallPMCourier() {
// 	c.callCallPMCourier(func(params *tOrderCallPMCourierParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callCallPMCourier(handler func(params *tOrderCallPMCourierParams) (interface{}, string, error)) {
	var err error
	params := &tOrderCallPMCourierParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.CallPMCourier, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.CallPMCourier, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.CallPMCourier error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuSortCategorySkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CatID		int
	SkuIDs		string
}

// func (c *SkuController) SortCategorySkus() {
// 	c.callSortCategorySkus(func(params *tSkuSortCategorySkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callSortCategorySkus(handler func(params *tSkuSortCategorySkusParams) (interface{}, string, error)) {
	var err error
	params := &tSkuSortCategorySkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CatID, err = c.GetInt("catID", 0); err != nil {
		errParams = append(errParams, "catID")
	}
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("catID") == "" {
		errParams = append(errParams, "catID")
	}
	params.MapData["catID"] = params.CatID
	if c.GetString("skuIDs") == "" {
		errParams = append(errParams, "skuIDs")
	}
	params.MapData["skuIDs"] = params.SkuIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.SortCategorySkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.SortCategorySkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.SortCategorySkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStorePrintCheckAccountAuthorizationParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorStoreId		string
	VendorId		int
}

// func (c *StoreController) PrintCheckAccountAuthorization() {
// 	c.callPrintCheckAccountAuthorization(func(params *tStorePrintCheckAccountAuthorizationParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callPrintCheckAccountAuthorization(handler func(params *tStorePrintCheckAccountAuthorizationParams) (interface{}, string, error)) {
	var err error
	params := &tStorePrintCheckAccountAuthorizationParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorStoreId = utils.TrimBlankChar(c.GetString("vendorStoreId"))
	if params.VendorId, err = c.GetInt("vendorId", 0); err != nil {
		errParams = append(errParams, "vendorId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorStoreId") == "" {
		errParams = append(errParams, "vendorStoreId")
	}
	params.MapData["vendorStoreId"] = params.VendorStoreId
	if c.GetString("vendorId") == "" {
		errParams = append(errParams, "vendorId")
	}
	params.MapData["vendorId"] = params.VendorId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.PrintCheckAccountAuthorization, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.PrintCheckAccountAuthorization, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.PrintCheckAccountAuthorization error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreTmpGetJxBadCommentsByStoreIdParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	JxStoreId		int
	Type		int
	Page		int
	Size		int
	FromTime		string
	ToTime		string
}

// func (c *StoreController) TmpGetJxBadCommentsByStoreId() {
// 	c.callTmpGetJxBadCommentsByStoreId(func(params *tStoreTmpGetJxBadCommentsByStoreIdParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callTmpGetJxBadCommentsByStoreId(handler func(params *tStoreTmpGetJxBadCommentsByStoreIdParams) (interface{}, string, error)) {
	var err error
	params := &tStoreTmpGetJxBadCommentsByStoreIdParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.JxStoreId, err = c.GetInt("jxStoreId", 0); err != nil {
		errParams = append(errParams, "jxStoreId")
	}
	if params.Type, err = c.GetInt("type", 0); err != nil {
		errParams = append(errParams, "type")
	}
	if params.Page, err = c.GetInt("page", 0); err != nil {
		errParams = append(errParams, "page")
	}
	if params.Size, err = c.GetInt("size", 0); err != nil {
		errParams = append(errParams, "size")
	}
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("jxStoreId") == "" {
		errParams = append(errParams, "jxStoreId")
	}
	params.MapData["jxStoreId"] = params.JxStoreId
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if c.GetString("page") == "" {
		errParams = append(errParams, "page")
	}
	params.MapData["page"] = params.Page
	if c.GetString("size") == "" {
		errParams = append(errParams, "size")
	}
	params.MapData["size"] = params.Size
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.TmpGetJxBadCommentsByStoreId, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.TmpGetJxBadCommentsByStoreId, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.TmpGetJxBadCommentsByStoreId error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopUpdateAllWeiXinRemarkParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *TempOpController) UpdateAllWeiXinRemark() {
// 	c.callUpdateAllWeiXinRemark(func(params *tTempopUpdateAllWeiXinRemarkParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callUpdateAllWeiXinRemark(handler func(params *tTempopUpdateAllWeiXinRemarkParams) (interface{}, string, error)) {
	var err error
	params := &tTempopUpdateAllWeiXinRemarkParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.UpdateAllWeiXinRemark, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.UpdateAllWeiXinRemark, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.UpdateAllWeiXinRemark error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetActEbaiVendorParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	SkuIDs		string
	Keyword		string
	BeginAt		string
	EndAt		string
	ActType		int
	Offset		int
	PageSize		int
}

// func (c *ActController) GetActEbaiVendor() {
// 	c.callGetActEbaiVendor(func(params *tActGetActEbaiVendorParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetActEbaiVendor(handler func(params *tActGetActEbaiVendorParams) (interface{}, string, error)) {
	var err error
	params := &tActGetActEbaiVendorParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.BeginAt = utils.TrimBlankChar(c.GetString("beginAt"))
	params.EndAt = utils.TrimBlankChar(c.GetString("endAt"))
	if params.ActType, err = c.GetInt("actType", 0); err != nil {
		errParams = append(errParams, "actType")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("beginAt")) != "" {
		params.MapData["beginAt"] = params.BeginAt
	}
	if utils.TrimBlankChar(c.GetString("endAt")) != "" {
		params.MapData["endAt"] = params.EndAt
	}
	if utils.TrimBlankChar(c.GetString("actType")) != "" {
		params.MapData["actType"] = params.ActType
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetActEbaiVendor, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetActEbaiVendor, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetActEbaiVendor error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaCustomerSettleFeeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CustomerNo		string
	Payload		string
}

// func (c *LaKaLaController) CustomerSettleFee() {
// 	c.callCustomerSettleFee(func(params *tLakalaCustomerSettleFeeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callCustomerSettleFee(handler func(params *tLakalaCustomerSettleFeeParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaCustomerSettleFeeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CustomerNo = utils.TrimBlankChar(c.GetString("customerNo"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("customerNo") == "" {
		errParams = append(errParams, "customerNo")
	}
	params.MapData["customerNo"] = params.CustomerNo
	if utils.TrimBlankChar(c.GetString("payload")) != "" {
		params.MapData["payload"] = params.Payload
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.CustomerSettleFee, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.CustomerSettleFee, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.CustomerSettleFee error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSeparateFallBackParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	SeparateNo		string
	Reason		string
}

// func (c *LaKaLaController) SeparateFallBack() {
// 	c.callSeparateFallBack(func(params *tLakalaSeparateFallBackParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSeparateFallBack(handler func(params *tLakalaSeparateFallBackParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSeparateFallBackParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.SeparateNo = utils.TrimBlankChar(c.GetString("separateNo"))
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("separateNo") == "" {
		errParams = append(errParams, "separateNo")
	}
	params.MapData["separateNo"] = params.SeparateNo
	if c.GetString("reason") == "" {
		errParams = append(errParams, "reason")
	}
	params.MapData["reason"] = params.Reason
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SeparateFallBack, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SeparateFallBack, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SeparateFallBack error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetInvoiceRecordParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreId		int
	StartTime		string
	EndTime		string
	Status		string
	Offset		int
	PageSize		int
}

// func (c *OrderController) GetInvoiceRecord() {
// 	c.callGetInvoiceRecord(func(params *tOrderGetInvoiceRecordParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetInvoiceRecord(handler func(params *tOrderGetInvoiceRecordParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetInvoiceRecordParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	params.StartTime = utils.TrimBlankChar(c.GetString("startTime"))
	params.EndTime = utils.TrimBlankChar(c.GetString("endTime"))
	params.Status = utils.TrimBlankChar(c.GetString("status"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeId")) != "" {
		params.MapData["storeId"] = params.StoreId
	}
	if c.GetString("startTime") == "" {
		errParams = append(errParams, "startTime")
	}
	params.MapData["startTime"] = params.StartTime
	if c.GetString("endTime") == "" {
		errParams = append(errParams, "endTime")
	}
	params.MapData["endTime"] = params.EndTime
	if utils.TrimBlankChar(c.GetString("status")) != "" {
		params.MapData["status"] = params.Status
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetInvoiceRecord, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetInvoiceRecord, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetInvoiceRecord error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetSupplySupportStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromDate		string
	ToDate		string
	FromStoreID		int
	StoreID		int
	Percentage		string
}

// func (c *JxOrderController) GetSupplySupportStoreSkus() {
// 	c.callGetSupplySupportStoreSkus(func(params *tJxorderGetSupplySupportStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetSupplySupportStoreSkus(handler func(params *tJxorderGetSupplySupportStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetSupplySupportStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	if params.FromStoreID, err = c.GetInt("fromStoreID", 0); err != nil {
		errParams = append(errParams, "fromStoreID")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Percentage = utils.TrimBlankChar(c.GetString("percentage"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("fromDate")) != "" {
		params.MapData["fromDate"] = params.FromDate
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("fromStoreID")) != "" {
		params.MapData["fromStoreID"] = params.FromStoreID
	}
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("percentage")) != "" {
		params.MapData["percentage"] = params.Percentage
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetSupplySupportStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetSupplySupportStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetSupplySupportStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetCouponsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CouponType		int
	CouponStatuss		string
	StoreIDs		string
	Keyword		string
}

// func (c *JxOrderController) GetCoupons() {
// 	c.callGetCoupons(func(params *tJxorderGetCouponsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetCoupons(handler func(params *tJxorderGetCouponsParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetCouponsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CouponType, err = c.GetInt("couponType", 0); err != nil {
		errParams = append(errParams, "couponType")
	}
	params.CouponStatuss = utils.TrimBlankChar(c.GetString("couponStatuss"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("couponType")) != "" {
		params.MapData["couponType"] = params.CouponType
	}
	if utils.TrimBlankChar(c.GetString("couponStatuss")) != "" {
		params.MapData["couponStatuss"] = params.CouponStatuss
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetCoupons, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetCoupons, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetCoupons error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateStorePricePackParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
	PricePack		string
	Value		string
}

// func (c *StoreController) UpdateStorePricePack() {
// 	c.callUpdateStorePricePack(func(params *tStoreUpdateStorePricePackParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateStorePricePack(handler func(params *tStoreUpdateStorePricePackParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateStorePricePackParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.PricePack = utils.TrimBlankChar(c.GetString("pricePack"))
	params.Value = utils.TrimBlankChar(c.GetString("value"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("pricePack") == "" {
		errParams = append(errParams, "pricePack")
	}
	params.MapData["pricePack"] = params.PricePack
	if utils.TrimBlankChar(c.GetString("value")) != "" {
		params.MapData["value"] = params.Value
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateStorePricePack, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateStorePricePack, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateStorePricePack error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreAuditParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ApplyTimeStart		string
	ApplyTimeEnd		string
	AuditTimeStart		string
	AuditTimeEnd		string
	Name		string
	Statuss		string
	Keyword		string
	Offset		int
	PageSize		int
}

// func (c *StoreController) GetStoreAudit() {
// 	c.callGetStoreAudit(func(params *tStoreGetStoreAuditParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreAudit(handler func(params *tStoreGetStoreAuditParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreAuditParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.ApplyTimeStart = utils.TrimBlankChar(c.GetString("applyTimeStart"))
	params.ApplyTimeEnd = utils.TrimBlankChar(c.GetString("applyTimeEnd"))
	params.AuditTimeStart = utils.TrimBlankChar(c.GetString("auditTimeStart"))
	params.AuditTimeEnd = utils.TrimBlankChar(c.GetString("auditTimeEnd"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("applyTimeStart")) != "" {
		params.MapData["applyTimeStart"] = params.ApplyTimeStart
	}
	if utils.TrimBlankChar(c.GetString("applyTimeEnd")) != "" {
		params.MapData["applyTimeEnd"] = params.ApplyTimeEnd
	}
	if utils.TrimBlankChar(c.GetString("auditTimeStart")) != "" {
		params.MapData["auditTimeStart"] = params.AuditTimeStart
	}
	if utils.TrimBlankChar(c.GetString("auditTimeEnd")) != "" {
		params.MapData["auditTimeEnd"] = params.AuditTimeEnd
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreAudit, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreAudit, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreAudit error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetActEbaiVendorSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ActID		string
	Keyword		string
	Offset		int
	PageSize		int
}

// func (c *ActController) GetActEbaiVendorSku() {
// 	c.callGetActEbaiVendorSku(func(params *tActGetActEbaiVendorSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetActEbaiVendorSku(handler func(params *tActGetActEbaiVendorSkuParams) (interface{}, string, error)) {
	var err error
	params := &tActGetActEbaiVendorSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.ActID = utils.TrimBlankChar(c.GetString("actID"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("actID") == "" {
		errParams = append(errParams, "actID")
	}
	params.MapData["actID"] = params.ActID
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetActEbaiVendorSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetActEbaiVendorSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetActEbaiVendorSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ParentID		int
	IsExd		bool
}

// func (c *SkuController) GetCategories() {
// 	c.callGetCategories(func(params *tSkuGetCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetCategories(handler func(params *tSkuGetCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if params.IsExd, err = c.GetBool("isExd", false); err != nil {
		errParams = append(errParams, "isExd")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("parentID")) != "" {
		params.MapData["parentID"] = params.ParentID
	}
	if utils.TrimBlankChar(c.GetString("isExd")) != "" {
		params.MapData["isExd"] = params.IsExd
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetWeeklyStoreScoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	WeekIndex		int
}

// func (c *StoreController) GetWeeklyStoreScore() {
// 	c.callGetWeeklyStoreScore(func(params *tStoreGetWeeklyStoreScoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetWeeklyStoreScore(handler func(params *tStoreGetWeeklyStoreScoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetWeeklyStoreScoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.WeekIndex, err = c.GetInt("weekIndex", 0); err != nil {
		errParams = append(errParams, "weekIndex")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("weekIndex") == "" {
		errParams = append(errParams, "weekIndex")
	}
	params.MapData["weekIndex"] = params.WeekIndex
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetWeeklyStoreScore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetWeeklyStoreScore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetWeeklyStoreScore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetBrandStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
}

// func (c *StoreController) GetBrandStore() {
// 	c.callGetBrandStore(func(params *tStoreGetBrandStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetBrandStore(handler func(params *tStoreGetBrandStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetBrandStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetBrandStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetBrandStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetBrandStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetCoordinateDistrictCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Lng		float64
	Lat		float64
}

// func (c *CmsController) GetCoordinateDistrictCode() {
// 	c.callGetCoordinateDistrictCode(func(params *tCmsGetCoordinateDistrictCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetCoordinateDistrictCode(handler func(params *tCmsGetCoordinateDistrictCodeParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetCoordinateDistrictCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Lng, err = c.GetFloat("lng", 0); err != nil {
		errParams = append(errParams, "lng")
	}
	if params.Lat, err = c.GetFloat("lat", 0); err != nil {
		errParams = append(errParams, "lat")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("lng") == "" {
		errParams = append(errParams, "lng")
	}
	params.MapData["lng"] = params.Lng
	if c.GetString("lat") == "" {
		errParams = append(errParams, "lat")
	}
	params.MapData["lat"] = params.Lat
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetCoordinateDistrictCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetCoordinateDistrictCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetCoordinateDistrictCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuUpdateStoreSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	Payload		string
	CauseFlag		int
	IsContinueWhenError		bool
	IsAsync		bool
}

// func (c *StoreSkuController) UpdateStoreSku() {
// 	c.callUpdateStoreSku(func(params *tStoreSkuUpdateStoreSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callUpdateStoreSku(handler func(params *tStoreSkuUpdateStoreSkuParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuUpdateStoreSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.CauseFlag, err = c.GetInt("causeFlag", 0); err != nil {
		errParams = append(errParams, "causeFlag")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("causeFlag")) != "" {
		params.MapData["causeFlag"] = params.CauseFlag
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.UpdateStoreSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.UpdateStoreSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.UpdateStoreSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuCreateSkusAndFocusFromYbParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) CreateSkusAndFocusFromYb() {
// 	c.callCreateSkusAndFocusFromYb(func(params *tStoreSkuCreateSkusAndFocusFromYbParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callCreateSkusAndFocusFromYb(handler func(params *tStoreSkuCreateSkusAndFocusFromYbParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuCreateSkusAndFocusFromYbParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.CreateSkusAndFocusFromYb, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.CreateSkusAndFocusFromYb, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.CreateSkusAndFocusFromYb error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2LoginParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	AuthType		string
	AuthSecret		string
	AuthID		string
	AuthIDType		string
	CId		string
}

// func (c *Auth2Controller) Login() {
// 	c.callLogin(func(params *tAuth2LoginParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callLogin(handler func(params *tAuth2LoginParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2LoginParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.AuthType = utils.TrimBlankChar(c.GetString("authType"))
	params.AuthSecret = utils.TrimBlankChar(c.GetString("authSecret"))
	params.AuthID = utils.TrimBlankChar(c.GetString("authID"))
	params.AuthIDType = utils.TrimBlankChar(c.GetString("authIDType"))
	params.CId = utils.TrimBlankChar(c.GetString("cId"))
	if c.GetString("authType") == "" {
		errParams = append(errParams, "authType")
	}
	params.MapData["authType"] = params.AuthType
	if c.GetString("authSecret") == "" {
		errParams = append(errParams, "authSecret")
	}
	params.MapData["authSecret"] = params.AuthSecret
	if utils.TrimBlankChar(c.GetString("authID")) != "" {
		params.MapData["authID"] = params.AuthID
	}
	if utils.TrimBlankChar(c.GetString("authIDType")) != "" {
		params.MapData["authIDType"] = params.AuthIDType
	}
	if utils.TrimBlankChar(c.GetString("cId")) != "" {
		params.MapData["cId"] = params.CId
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.Login, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.Login, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.Login error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tYonghuiGetWeimobOrdersExcelParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrderNo		string
}

// func (c *YongHuiController) GetWeimobOrdersExcel() {
// 	c.callGetWeimobOrdersExcel(func(params *tYonghuiGetWeimobOrdersExcelParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *YongHuiController) callGetWeimobOrdersExcel(handler func(params *tYonghuiGetWeimobOrdersExcelParams) (interface{}, string, error)) {
	var err error
	params := &tYonghuiGetWeimobOrdersExcelParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("orderNo") == "" {
		errParams = append(errParams, "orderNo")
	}
	params.MapData["orderNo"] = params.OrderNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API YongHuiController.GetWeimobOrdersExcel, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API YongHuiController.GetWeimobOrdersExcel, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API YongHuiController.GetWeimobOrdersExcel error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryElectronicContractParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	OrderNo		string
	OrgId		int
	EcApplyId		string
	QueryType		string
}

// func (c *LaKaLaController) QueryElectronicContract() {
// 	c.callQueryElectronicContract(func(params *tLakalaQueryElectronicContractParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryElectronicContract(handler func(params *tLakalaQueryElectronicContractParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryElectronicContractParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo"))
	if params.OrgId, err = c.GetInt("orgId", 0); err != nil {
		errParams = append(errParams, "orgId")
	}
	params.EcApplyId = utils.TrimBlankChar(c.GetString("ecApplyId"))
	params.QueryType = utils.TrimBlankChar(c.GetString("queryType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("orderNo") == "" {
		errParams = append(errParams, "orderNo")
	}
	params.MapData["orderNo"] = params.OrderNo
	if c.GetString("orgId") == "" {
		errParams = append(errParams, "orgId")
	}
	params.MapData["orgId"] = params.OrgId
	if c.GetString("ecApplyId") == "" {
		errParams = append(errParams, "ecApplyId")
	}
	params.MapData["ecApplyId"] = params.EcApplyId
	if c.GetString("queryType") == "" {
		errParams = append(errParams, "queryType")
	}
	params.MapData["queryType"] = params.QueryType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryElectronicContract, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryElectronicContract, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryElectronicContract error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderUpdateTiktokSettlementParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreId		int
	StartTime		string
	EndTime		string
}

// func (c *OrderController) UpdateTiktokSettlement() {
// 	c.callUpdateTiktokSettlement(func(params *tOrderUpdateTiktokSettlementParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callUpdateTiktokSettlement(handler func(params *tOrderUpdateTiktokSettlementParams) (interface{}, string, error)) {
	var err error
	params := &tOrderUpdateTiktokSettlementParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	params.StartTime = utils.TrimBlankChar(c.GetString("startTime"))
	params.EndTime = utils.TrimBlankChar(c.GetString("endTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeId")) != "" {
		params.MapData["storeId"] = params.StoreId
	}
	if c.GetString("startTime") == "" {
		errParams = append(errParams, "startTime")
	}
	params.MapData["startTime"] = params.StartTime
	if c.GetString("endTime") == "" {
		errParams = append(errParams, "endTime")
	}
	params.MapData["endTime"] = params.EndTime
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.UpdateTiktokSettlement, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.UpdateTiktokSettlement, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.UpdateTiktokSettlement error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuCreateUpcSkuByExcelParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategroyID		int
}

// func (c *SkuController) CreateUpcSkuByExcel() {
// 	c.callCreateUpcSkuByExcel(func(params *tSkuCreateUpcSkuByExcelParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callCreateUpcSkuByExcel(handler func(params *tSkuCreateUpcSkuByExcelParams) (interface{}, string, error)) {
	var err error
	params := &tSkuCreateUpcSkuByExcelParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategroyID, err = c.GetInt("categroyID", 0); err != nil {
		errParams = append(errParams, "categroyID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categroyID") == "" {
		errParams = append(errParams, "categroyID")
	}
	params.MapData["categroyID"] = params.CategroyID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.CreateUpcSkuByExcel, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.CreateUpcSkuByExcel, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.CreateUpcSkuByExcel error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindUpdateTiktokOrderPhoneAddressParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
}

// func (c *BiddingController) UpdateTiktokOrderPhoneAddress() {
// 	c.callUpdateTiktokOrderPhoneAddress(func(params *tBindUpdateTiktokOrderPhoneAddressParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callUpdateTiktokOrderPhoneAddress(handler func(params *tBindUpdateTiktokOrderPhoneAddressParams) (interface{}, string, error)) {
	var err error
	params := &tBindUpdateTiktokOrderPhoneAddressParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.UpdateTiktokOrderPhoneAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.UpdateTiktokOrderPhoneAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.UpdateTiktokOrderPhoneAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrderStatusListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	OrderType		int
}

// func (c *OrderController) GetOrderStatusList() {
// 	c.callGetOrderStatusList(func(params *tOrderGetOrderStatusListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrderStatusList(handler func(params *tOrderGetOrderStatusListParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrderStatusListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.OrderType, err = c.GetInt("orderType", 0); err != nil {
		errParams = append(errParams, "orderType")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("orderType") == "" {
		errParams = append(errParams, "orderType")
	}
	params.MapData["orderType"] = params.OrderType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrderStatusList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrderStatusList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrderStatusList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetStoresOrderSaleInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	FromTime		string
	ToTime		string
	Statuss		string
}

// func (c *OrderController) GetStoresOrderSaleInfo() {
// 	c.callGetStoresOrderSaleInfo(func(params *tOrderGetStoresOrderSaleInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetStoresOrderSaleInfo(handler func(params *tOrderGetStoresOrderSaleInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetStoresOrderSaleInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetStoresOrderSaleInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetStoresOrderSaleInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetStoresOrderSaleInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFinancialGetOrdersFinancialParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrderID		string
	FromDate		string
	ToDate		string
	VendorIDs		string
	StoreIDs		string
	Statuss		string
	Cities		string
	Offset		int
	PageSize		int
}

// func (c *FinancialController) GetOrdersFinancial() {
// 	c.callGetOrdersFinancial(func(params *tFinancialGetOrdersFinancialParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FinancialController) callGetOrdersFinancial(handler func(params *tFinancialGetOrdersFinancialParams) (interface{}, string, error)) {
	var err error
	params := &tFinancialGetOrdersFinancialParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrderID = utils.TrimBlankChar(c.GetString("orderID"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Statuss = utils.TrimBlankChar(c.GetString("statuss"))
	params.Cities = utils.TrimBlankChar(c.GetString("cities"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("orderID")) != "" {
		params.MapData["orderID"] = params.OrderID
	}
	if utils.TrimBlankChar(c.GetString("fromDate")) != "" {
		params.MapData["fromDate"] = params.FromDate
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("statuss")) != "" {
		params.MapData["statuss"] = params.Statuss
	}
	if utils.TrimBlankChar(c.GetString("cities")) != "" {
		params.MapData["cities"] = params.Cities
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FinancialController.GetOrdersFinancial, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FinancialController.GetOrdersFinancial, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FinancialController.GetOrdersFinancial error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryExamineParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CustomerNo		string
	ReviewRelatedId		string
}

// func (c *LaKaLaController) QueryExamine() {
// 	c.callQueryExamine(func(params *tLakalaQueryExamineParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryExamine(handler func(params *tLakalaQueryExamineParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryExamineParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CustomerNo = utils.TrimBlankChar(c.GetString("customerNo"))
	params.ReviewRelatedId = utils.TrimBlankChar(c.GetString("reviewRelatedId"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("customerNo") == "" {
		errParams = append(errParams, "customerNo")
	}
	params.MapData["customerNo"] = params.CustomerNo
	if c.GetString("reviewRelatedId") == "" {
		errParams = append(errParams, "reviewRelatedId")
	}
	params.MapData["reviewRelatedId"] = params.ReviewRelatedId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryExamine, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryExamine, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryExamine error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetStoreSkuSalesInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *SkuController) GetStoreSkuSalesInfo() {
// 	c.callGetStoreSkuSalesInfo(func(params *tSkuGetStoreSkuSalesInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetStoreSkuSalesInfo(handler func(params *tSkuGetStoreSkuSalesInfoParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetStoreSkuSalesInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetStoreSkuSalesInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetStoreSkuSalesInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetStoreSkuSalesInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataTransformJdSpu2SkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameIDs		string
	Count		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *InitDataController) TransformJdSpu2Sku() {
// 	c.callTransformJdSpu2Sku(func(params *tInitdataTransformJdSpu2SkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callTransformJdSpu2Sku(handler func(params *tInitdataTransformJdSpu2SkuParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataTransformJdSpu2SkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	if params.Count, err = c.GetInt("count", 0); err != nil {
		errParams = append(errParams, "count")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("nameIDs")) != "" {
		params.MapData["nameIDs"] = params.NameIDs
	}
	if utils.TrimBlankChar(c.GetString("count")) != "" {
		params.MapData["count"] = params.Count
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.TransformJdSpu2Sku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.TransformJdSpu2Sku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.TransformJdSpu2Sku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetActStoreSkuInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ActID		int
	VendorIDs		string
	Keyword		string
	Offset		int
	PageSize		int
}

// func (c *ActController) GetActStoreSkuInfo() {
// 	c.callGetActStoreSkuInfo(func(params *tActGetActStoreSkuInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetActStoreSkuInfo(handler func(params *tActGetActStoreSkuInfoParams) (interface{}, string, error)) {
	var err error
	params := &tActGetActStoreSkuInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ActID, err = c.GetInt("actID", 0); err != nil {
		errParams = append(errParams, "actID")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("actID") == "" {
		errParams = append(errParams, "actID")
	}
	params.MapData["actID"] = params.ActID
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetActStoreSkuInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetActStoreSkuInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetActStoreSkuInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindGetBiddingMsgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Title		string
	City		string
	StartTime		string
	EndTime		string
	PageSize		int
	PageNumber		int
}

// func (c *BiddingController) GetBiddingMsg() {
// 	c.callGetBiddingMsg(func(params *tBindGetBiddingMsgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callGetBiddingMsg(handler func(params *tBindGetBiddingMsgParams) (interface{}, string, error)) {
	var err error
	params := &tBindGetBiddingMsgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Title = utils.TrimBlankChar(c.GetString("title"))
	params.City = utils.TrimBlankChar(c.GetString("city"))
	params.StartTime = utils.TrimBlankChar(c.GetString("startTime"))
	params.EndTime = utils.TrimBlankChar(c.GetString("endTime"))
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.PageNumber, err = c.GetInt("pageNumber", 0); err != nil {
		errParams = append(errParams, "pageNumber")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("title")) != "" {
		params.MapData["title"] = params.Title
	}
	if utils.TrimBlankChar(c.GetString("city")) != "" {
		params.MapData["city"] = params.City
	}
	if utils.TrimBlankChar(c.GetString("startTime")) != "" {
		params.MapData["startTime"] = params.StartTime
	}
	if utils.TrimBlankChar(c.GetString("endTime")) != "" {
		params.MapData["endTime"] = params.EndTime
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if utils.TrimBlankChar(c.GetString("pageNumber")) != "" {
		params.MapData["pageNumber"] = params.PageNumber
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.GetBiddingMsg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.GetBiddingMsg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.GetBiddingMsg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSeparateResultQueryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	SeparateNo		string
}

// func (c *LaKaLaController) SeparateResultQuery() {
// 	c.callSeparateResultQuery(func(params *tLakalaSeparateResultQueryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSeparateResultQuery(handler func(params *tLakalaSeparateResultQueryParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSeparateResultQueryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.SeparateNo = utils.TrimBlankChar(c.GetString("separateNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("separateNo") == "" {
		errParams = append(errParams, "separateNo")
	}
	params.MapData["separateNo"] = params.SeparateNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SeparateResultQuery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SeparateResultQuery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SeparateResultQuery error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaCustomerFeeChangeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CustomerNo		string
	Payload		string
}

// func (c *LaKaLaController) CustomerFeeChange() {
// 	c.callCustomerFeeChange(func(params *tLakalaCustomerFeeChangeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callCustomerFeeChange(handler func(params *tLakalaCustomerFeeChangeParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaCustomerFeeChangeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CustomerNo = utils.TrimBlankChar(c.GetString("customerNo"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("customerNo") == "" {
		errParams = append(errParams, "customerNo")
	}
	params.MapData["customerNo"] = params.CustomerNo
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.CustomerFeeChange, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.CustomerFeeChange, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.CustomerFeeChange error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSeparateQueryAmtParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	LogDate		string
	LogNo		string
	VendorOrderId		string
}

// func (c *LaKaLaController) SeparateQueryAmt() {
// 	c.callSeparateQueryAmt(func(params *tLakalaSeparateQueryAmtParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSeparateQueryAmt(handler func(params *tLakalaSeparateQueryAmtParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSeparateQueryAmtParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.LogDate = utils.TrimBlankChar(c.GetString("logDate"))
	params.LogNo = utils.TrimBlankChar(c.GetString("logNo"))
	params.VendorOrderId = utils.TrimBlankChar(c.GetString("vendorOrderId"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("logDate") == "" {
		errParams = append(errParams, "logDate")
	}
	params.MapData["logDate"] = params.LogDate
	if c.GetString("logNo") == "" {
		errParams = append(errParams, "logNo")
	}
	params.MapData["logNo"] = params.LogNo
	if c.GetString("vendorOrderId") == "" {
		errParams = append(errParams, "vendorOrderId")
	}
	params.MapData["vendorOrderId"] = params.VendorOrderId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SeparateQueryAmt, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SeparateQueryAmt, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SeparateQueryAmt error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderPayForPopluarManParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	UserID		string
	Price		int
}

// func (c *JxOrderController) PayForPopluarMan() {
// 	c.callPayForPopluarMan(func(params *tJxorderPayForPopluarManParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callPayForPopluarMan(handler func(params *tJxorderPayForPopluarManParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderPayForPopluarManParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	if params.Price, err = c.GetInt("price", 0); err != nil {
		errParams = append(errParams, "price")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("userID") == "" {
		errParams = append(errParams, "userID")
	}
	params.MapData["userID"] = params.UserID
	if c.GetString("price") == "" {
		errParams = append(errParams, "price")
	}
	params.MapData["price"] = params.Price
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.PayForPopluarMan, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.PayForPopluarMan, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.PayForPopluarMan error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetMyPriceDefendOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
}

// func (c *JxOrderController) GetMyPriceDefendOrders() {
// 	c.callGetMyPriceDefendOrders(func(params *tJxorderGetMyPriceDefendOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetMyPriceDefendOrders(handler func(params *tJxorderGetMyPriceDefendOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetMyPriceDefendOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetMyPriceDefendOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetMyPriceDefendOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetMyPriceDefendOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsUpdatePlacesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *CmsController) UpdatePlaces() {
// 	c.callUpdatePlaces(func(params *tCmsUpdatePlacesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callUpdatePlaces(handler func(params *tCmsUpdatePlacesParams) (interface{}, string, error)) {
	var err error
	params := &tCmsUpdatePlacesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.UpdatePlaces, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.UpdatePlaces, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.UpdatePlaces error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTaskCancelTaskParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	TaskID		string
}

// func (c *TaskController) CancelTask() {
// 	c.callCancelTask(func(params *tTaskCancelTaskParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TaskController) callCancelTask(handler func(params *tTaskCancelTaskParams) (interface{}, string, error)) {
	var err error
	params := &tTaskCancelTaskParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.TaskID = utils.TrimBlankChar(c.GetString("taskID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("taskID") == "" {
		errParams = append(errParams, "taskID")
	}
	params.MapData["taskID"] = params.TaskID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TaskController.CancelTask, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TaskController.CancelTask, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TaskController.CancelTask error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncAmendAndPruneStoreStuffParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	OptType		int
	IsForce		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) AmendAndPruneStoreStuff() {
// 	c.callAmendAndPruneStoreStuff(func(params *tSyncAmendAndPruneStoreStuffParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callAmendAndPruneStoreStuff(handler func(params *tSyncAmendAndPruneStoreStuffParams) (interface{}, string, error)) {
	var err error
	params := &tSyncAmendAndPruneStoreStuffParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.OptType, err = c.GetInt("optType", 0); err != nil {
		errParams = append(errParams, "optType")
	}
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if c.GetString("optType") == "" {
		errParams = append(errParams, "optType")
	}
	params.MapData["optType"] = params.OptType
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.AmendAndPruneStoreStuff, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.AmendAndPruneStoreStuff, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.AmendAndPruneStoreStuff error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindNeedDeleteGetStoreBindStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
}

// func (c *BiddingController) NeedDeleteGetStoreBindStatus() {
// 	c.callNeedDeleteGetStoreBindStatus(func(params *tBindNeedDeleteGetStoreBindStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callNeedDeleteGetStoreBindStatus(handler func(params *tBindNeedDeleteGetStoreBindStatusParams) (interface{}, string, error)) {
	var err error
	params := &tBindNeedDeleteGetStoreBindStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.NeedDeleteGetStoreBindStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.NeedDeleteGetStoreBindStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.NeedDeleteGetStoreBindStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderPartRefundOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	RefundSkuList		string
	Reason		string
}

// func (c *OrderController) PartRefundOrder() {
// 	c.callPartRefundOrder(func(params *tOrderPartRefundOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callPartRefundOrder(handler func(params *tOrderPartRefundOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderPartRefundOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.RefundSkuList = utils.TrimBlankChar(c.GetString("refundSkuList"))
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("refundSkuList") == "" {
		errParams = append(errParams, "refundSkuList")
	}
	params.MapData["refundSkuList"] = params.RefundSkuList
	if c.GetString("reason") == "" {
		errParams = append(errParams, "reason")
	}
	params.MapData["reason"] = params.Reason
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.PartRefundOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.PartRefundOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.PartRefundOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreDeletePrinterSeqParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
}

// func (c *StoreController) DeletePrinterSeq() {
// 	c.callDeletePrinterSeq(func(params *tStoreDeletePrinterSeqParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callDeletePrinterSeq(handler func(params *tStoreDeletePrinterSeqParams) (interface{}, string, error)) {
	var err error
	params := &tStoreDeletePrinterSeqParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.DeletePrinterSeq, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.DeletePrinterSeq, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.DeletePrinterSeq error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	VendorOrderId		string
	VendorId		int
}

// func (c *LaKaLaController) QueryOrder() {
// 	c.callQueryOrder(func(params *tLakalaQueryOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryOrder(handler func(params *tLakalaQueryOrderParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.VendorOrderId = utils.TrimBlankChar(c.GetString("vendorOrderId"))
	if params.VendorId, err = c.GetInt("vendorId", 0); err != nil {
		errParams = append(errParams, "vendorId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("vendorOrderId") == "" {
		errParams = append(errParams, "vendorOrderId")
	}
	params.MapData["vendorOrderId"] = params.VendorOrderId
	if c.GetString("vendorId") == "" {
		errParams = append(errParams, "vendorId")
	}
	params.MapData["vendorId"] = params.VendorId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuCopyStoreCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromStoreID		int
	ToStoreIDs		string
	CategoryIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SkuController) CopyStoreCategories() {
// 	c.callCopyStoreCategories(func(params *tSkuCopyStoreCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callCopyStoreCategories(handler func(params *tSkuCopyStoreCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuCopyStoreCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.FromStoreID, err = c.GetInt("fromStoreID", 0); err != nil {
		errParams = append(errParams, "fromStoreID")
	}
	params.ToStoreIDs = utils.TrimBlankChar(c.GetString("toStoreIDs"))
	params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromStoreID") == "" {
		errParams = append(errParams, "fromStoreID")
	}
	params.MapData["fromStoreID"] = params.FromStoreID
	if c.GetString("toStoreIDs") == "" {
		errParams = append(errParams, "toStoreIDs")
	}
	params.MapData["toStoreIDs"] = params.ToStoreIDs
	if utils.TrimBlankChar(c.GetString("categoryIDs")) != "" {
		params.MapData["categoryIDs"] = params.CategoryIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.CopyStoreCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.CopyStoreCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.CopyStoreCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuReorderStoreCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryID		int
	StoreID		int
	CategoryIDs		string
}

// func (c *SkuController) ReorderStoreCategories() {
// 	c.callReorderStoreCategories(func(params *tSkuReorderStoreCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callReorderStoreCategories(handler func(params *tSkuReorderStoreCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuReorderStoreCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categoryID") == "" {
		errParams = append(errParams, "categoryID")
	}
	params.MapData["categoryID"] = params.CategoryID
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("categoryIDs") == "" {
		errParams = append(errParams, "categoryIDs")
	}
	params.MapData["categoryIDs"] = params.CategoryIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.ReorderStoreCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.ReorderStoreCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.ReorderStoreCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetVendorStoreInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreController) GetVendorStoreInfo() {
// 	c.callGetVendorStoreInfo(func(params *tStoreGetVendorStoreInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetVendorStoreInfo(handler func(params *tStoreGetVendorStoreInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetVendorStoreInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetVendorStoreInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetVendorStoreInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetVendorStoreInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsCreateQrOrBarCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Width		int
	Height		int
	Codetype		string
	SrcData		string
}

// func (c *CmsController) CreateQrOrBarCode() {
// 	c.callCreateQrOrBarCode(func(params *tCmsCreateQrOrBarCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callCreateQrOrBarCode(handler func(params *tCmsCreateQrOrBarCodeParams) (interface{}, string, error)) {
	var err error
	params := &tCmsCreateQrOrBarCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Width, err = c.GetInt("width", 0); err != nil {
		errParams = append(errParams, "width")
	}
	if params.Height, err = c.GetInt("height", 0); err != nil {
		errParams = append(errParams, "height")
	}
	params.Codetype = utils.TrimBlankChar(c.GetString("codetype"))
	params.SrcData = utils.TrimBlankChar(c.GetString("srcData"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("width") == "" {
		errParams = append(errParams, "width")
	}
	params.MapData["width"] = params.Width
	if c.GetString("height") == "" {
		errParams = append(errParams, "height")
	}
	params.MapData["height"] = params.Height
	if c.GetString("codetype") == "" {
		errParams = append(errParams, "codetype")
	}
	params.MapData["codetype"] = params.Codetype
	if c.GetString("srcData") == "" {
		errParams = append(errParams, "srcData")
	}
	params.MapData["srcData"] = params.SrcData
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.CreateQrOrBarCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.CreateQrOrBarCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.CreateQrOrBarCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportStatisticsReportForAfsOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	FromDate		string
	ToDate		string
}

// func (c *ReportController) StatisticsReportForAfsOrders() {
// 	c.callStatisticsReportForAfsOrders(func(params *tReportStatisticsReportForAfsOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callStatisticsReportForAfsOrders(handler func(params *tReportStatisticsReportForAfsOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tReportStatisticsReportForAfsOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if c.GetString("toDate") == "" {
		errParams = append(errParams, "toDate")
	}
	params.MapData["toDate"] = params.ToDate
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.StatisticsReportForAfsOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.StatisticsReportForAfsOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.StatisticsReportForAfsOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderQueryJxPrintListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PrintNo		string
	PrintKey		string
	Status		int
	IsOnline		int
	Page		int
	Size		int
}

// func (c *OrderController) QueryJxPrintList() {
// 	c.callQueryJxPrintList(func(params *tOrderQueryJxPrintListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callQueryJxPrintList(handler func(params *tOrderQueryJxPrintListParams) (interface{}, string, error)) {
	var err error
	params := &tOrderQueryJxPrintListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PrintNo = utils.TrimBlankChar(c.GetString("printNo"))
	params.PrintKey = utils.TrimBlankChar(c.GetString("printKey"))
	if params.Status, err = c.GetInt("status", 0); err != nil {
		errParams = append(errParams, "status")
	}
	if params.IsOnline, err = c.GetInt("isOnline", 0); err != nil {
		errParams = append(errParams, "isOnline")
	}
	if params.Page, err = c.GetInt("page", 0); err != nil {
		errParams = append(errParams, "page")
	}
	if params.Size, err = c.GetInt("size", 0); err != nil {
		errParams = append(errParams, "size")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("printNo")) != "" {
		params.MapData["printNo"] = params.PrintNo
	}
	if utils.TrimBlankChar(c.GetString("printKey")) != "" {
		params.MapData["printKey"] = params.PrintKey
	}
	if utils.TrimBlankChar(c.GetString("status")) != "" {
		params.MapData["status"] = params.Status
	}
	if utils.TrimBlankChar(c.GetString("isOnline")) != "" {
		params.MapData["isOnline"] = params.IsOnline
	}
	if c.GetString("page") == "" {
		errParams = append(errParams, "page")
	}
	params.MapData["page"] = params.Page
	if c.GetString("size") == "" {
		errParams = append(errParams, "size")
	}
	params.MapData["size"] = params.Size
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.QueryJxPrintList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.QueryJxPrintList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.QueryJxPrintList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateMtCatToJdParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MtCatID		string
	JdCatID		string
}

// func (c *SkuController) UpdateMtCatToJd() {
// 	c.callUpdateMtCatToJd(func(params *tSkuUpdateMtCatToJdParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateMtCatToJd(handler func(params *tSkuUpdateMtCatToJdParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateMtCatToJdParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MtCatID = utils.TrimBlankChar(c.GetString("mtCatID"))
	params.JdCatID = utils.TrimBlankChar(c.GetString("jdCatID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("mtCatID") == "" {
		errParams = append(errParams, "mtCatID")
	}
	params.MapData["mtCatID"] = params.MtCatID
	if c.GetString("jdCatID") == "" {
		errParams = append(errParams, "jdCatID")
	}
	params.MapData["jdCatID"] = params.JdCatID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateMtCatToJd, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateMtCatToJd, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateMtCatToJd error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateDDStoreFenceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *StoreController) CreateDDStoreFence() {
// 	c.callCreateDDStoreFence(func(params *tStoreCreateDDStoreFenceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateDDStoreFence(handler func(params *tStoreCreateDDStoreFenceParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateDDStoreFenceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateDDStoreFence, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateDDStoreFence, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateDDStoreFence error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataConvert2JDSPUParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Count		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *InitDataController) Convert2JDSPU() {
// 	c.callConvert2JDSPU(func(params *tInitdataConvert2JDSPUParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callConvert2JDSPU(handler func(params *tInitdataConvert2JDSPUParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataConvert2JDSPUParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Count, err = c.GetInt("count", 0); err != nil {
		errParams = append(errParams, "count")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("count")) != "" {
		params.MapData["count"] = params.Count
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.Convert2JDSPU, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.Convert2JDSPU, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.Convert2JDSPU error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2WeixinOAuth2Params struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Code		string
	Block		string
	State		string
}

// func (c *Auth2Controller) WeixinOAuth2() {
// 	c.callWeixinOAuth2(func(params *tAuth2WeixinOAuth2Params) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callWeixinOAuth2(handler func(params *tAuth2WeixinOAuth2Params) (interface{}, string, error)) {
	var err error
	params := &tAuth2WeixinOAuth2Params{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Code = utils.TrimBlankChar(c.GetString("code"))
	params.Block = utils.TrimBlankChar(c.GetString("block"))
	params.State = utils.TrimBlankChar(c.GetString("state"))
	if c.GetString("code") == "" {
		errParams = append(errParams, "code")
	}
	params.MapData["code"] = params.Code
	if c.GetString("block") == "" {
		errParams = append(errParams, "block")
	}
	params.MapData["block"] = params.Block
	if utils.TrimBlankChar(c.GetString("state")) != "" {
		params.MapData["state"] = params.State
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.WeixinOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.WeixinOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.WeixinOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetNotHaveSkuActListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SkuID		int
	Offset		int
	PageSize		int
}

// func (c *ActController) GetNotHaveSkuActList() {
// 	c.callGetNotHaveSkuActList(func(params *tActGetNotHaveSkuActListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetNotHaveSkuActList(handler func(params *tActGetNotHaveSkuActListParams) (interface{}, string, error)) {
	var err error
	params := &tActGetNotHaveSkuActListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("skuID")) != "" {
		params.MapData["skuID"] = params.SkuID
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetNotHaveSkuActList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetNotHaveSkuActList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetNotHaveSkuActList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefreshOrderSkuInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	SkuID		int
}

// func (c *OrderController) RefreshOrderSkuInfo() {
// 	c.callRefreshOrderSkuInfo(func(params *tOrderRefreshOrderSkuInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefreshOrderSkuInfo(handler func(params *tOrderRefreshOrderSkuInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefreshOrderSkuInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("skuID") == "" {
		errParams = append(errParams, "skuID")
	}
	params.MapData["skuID"] = params.SkuID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefreshOrderSkuInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefreshOrderSkuInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefreshOrderSkuInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsUpdateConfigParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Type		string
	Key		string
	Value		string
}

// func (c *CmsController) UpdateConfig() {
// 	c.callUpdateConfig(func(params *tCmsUpdateConfigParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callUpdateConfig(handler func(params *tCmsUpdateConfigParams) (interface{}, string, error)) {
	var err error
	params := &tCmsUpdateConfigParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Type = utils.TrimBlankChar(c.GetString("type"))
	params.Key = utils.TrimBlankChar(c.GetString("key"))
	params.Value = utils.TrimBlankChar(c.GetString("value"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if c.GetString("key") == "" {
		errParams = append(errParams, "key")
	}
	params.MapData["key"] = params.Key
	if c.GetString("value") == "" {
		errParams = append(errParams, "value")
	}
	params.MapData["value"] = params.Value
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.UpdateConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.UpdateConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.UpdateConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncUploadFakeJdThingMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsSyncNow		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) UploadFakeJdThingMap() {
// 	c.callUploadFakeJdThingMap(func(params *tSyncUploadFakeJdThingMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callUploadFakeJdThingMap(handler func(params *tSyncUploadFakeJdThingMapParams) (interface{}, string, error)) {
	var err error
	params := &tSyncUploadFakeJdThingMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsSyncNow, err = c.GetBool("isSyncNow", false); err != nil {
		errParams = append(errParams, "isSyncNow")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("isSyncNow")) != "" {
		params.MapData["isSyncNow"] = params.IsSyncNow
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.UploadFakeJdThingMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.UploadFakeJdThingMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.UploadFakeJdThingMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2AddAuthBindWithMobileParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AuthToken		string
	Mobile		string
}

// func (c *Auth2Controller) AddAuthBindWithMobile() {
// 	c.callAddAuthBindWithMobile(func(params *tAuth2AddAuthBindWithMobileParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callAddAuthBindWithMobile(handler func(params *tAuth2AddAuthBindWithMobileParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2AddAuthBindWithMobileParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AuthToken = utils.TrimBlankChar(c.GetString("authToken"))
	params.Mobile = utils.TrimBlankChar(c.GetString("mobile"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("authToken") == "" {
		errParams = append(errParams, "authToken")
	}
	params.MapData["authToken"] = params.AuthToken
	if c.GetString("mobile") == "" {
		errParams = append(errParams, "mobile")
	}
	params.MapData["mobile"] = params.Mobile
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.AddAuthBindWithMobile, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.AddAuthBindWithMobile, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.AddAuthBindWithMobile error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2AddRoles4UserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserID		string
	RoleList		string
}

// func (c *User2Controller) AddRoles4User() {
// 	c.callAddRoles4User(func(params *tUser2AddRoles4UserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callAddRoles4User(handler func(params *tUser2AddRoles4UserParams) (interface{}, string, error)) {
	var err error
	params := &tUser2AddRoles4UserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	params.RoleList = utils.TrimBlankChar(c.GetString("roleList"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("userID") == "" {
		errParams = append(errParams, "userID")
	}
	params.MapData["userID"] = params.UserID
	if c.GetString("roleList") == "" {
		errParams = append(errParams, "roleList")
	}
	params.MapData["roleList"] = params.RoleList
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.AddRoles4User, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.AddRoles4User, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.AddRoles4User error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysAddVendorOrgCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *SysController) AddVendorOrgCode() {
// 	c.callAddVendorOrgCode(func(params *tSysAddVendorOrgCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callAddVendorOrgCode(handler func(params *tSysAddVendorOrgCodeParams) (interface{}, string, error)) {
	var err error
	params := &tSysAddVendorOrgCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.AddVendorOrgCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.AddVendorOrgCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.AddVendorOrgCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportStatisticsReportForOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	MarketManPhone		string
	JdPhone		string
	MtPhone		string
	EbaiPhone		string
	FromDate		string
	ToDate		string
}

// func (c *ReportController) StatisticsReportForOrders() {
// 	c.callStatisticsReportForOrders(func(params *tReportStatisticsReportForOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callStatisticsReportForOrders(handler func(params *tReportStatisticsReportForOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tReportStatisticsReportForOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.MarketManPhone = utils.TrimBlankChar(c.GetString("marketManPhone"))
	params.JdPhone = utils.TrimBlankChar(c.GetString("jdPhone"))
	params.MtPhone = utils.TrimBlankChar(c.GetString("mtPhone"))
	params.EbaiPhone = utils.TrimBlankChar(c.GetString("ebaiPhone"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("marketManPhone")) != "" {
		params.MapData["marketManPhone"] = params.MarketManPhone
	}
	if utils.TrimBlankChar(c.GetString("jdPhone")) != "" {
		params.MapData["jdPhone"] = params.JdPhone
	}
	if utils.TrimBlankChar(c.GetString("mtPhone")) != "" {
		params.MapData["mtPhone"] = params.MtPhone
	}
	if utils.TrimBlankChar(c.GetString("ebaiPhone")) != "" {
		params.MapData["ebaiPhone"] = params.EbaiPhone
	}
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if c.GetString("toDate") == "" {
		errParams = append(errParams, "toDate")
	}
	params.MapData["toDate"] = params.ToDate
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.StatisticsReportForOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.StatisticsReportForOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.StatisticsReportForOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerGetUserRoleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserID		string
}

// func (c *PowerController) GetUserRole() {
// 	c.callGetUserRole(func(params *tPowerGetUserRoleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callGetUserRole(handler func(params *tPowerGetUserRoleParams) (interface{}, string, error)) {
	var err error
	params := &tPowerGetUserRoleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("userID")) != "" {
		params.MapData["userID"] = params.UserID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.GetUserRole, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.GetUserRole, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.GetUserRole error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderConfirmReceiveGoodsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
}

// func (c *OrderController) ConfirmReceiveGoods() {
// 	c.callConfirmReceiveGoods(func(params *tOrderConfirmReceiveGoodsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callConfirmReceiveGoods(handler func(params *tOrderConfirmReceiveGoodsParams) (interface{}, string, error)) {
	var err error
	params := &tOrderConfirmReceiveGoodsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ConfirmReceiveGoods, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ConfirmReceiveGoods, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ConfirmReceiveGoods error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefreshOrdersWithoutJxStoreIDParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromDate		string
	ToDate		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *OrderController) RefreshOrdersWithoutJxStoreID() {
// 	c.callRefreshOrdersWithoutJxStoreID(func(params *tOrderRefreshOrdersWithoutJxStoreIDParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefreshOrdersWithoutJxStoreID(handler func(params *tOrderRefreshOrdersWithoutJxStoreIDParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefreshOrdersWithoutJxStoreIDParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("fromDate")) != "" {
		params.MapData["fromDate"] = params.FromDate
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefreshOrdersWithoutJxStoreID, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefreshOrdersWithoutJxStoreID, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefreshOrdersWithoutJxStoreID error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tMsgGetStoreMessagesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	MsgIDs		string
	StoreIDs		string
	Types		string
	FromTime		string
	ToTime		string
	Offset		int
	PageSize		int
}

// func (c *MsgController) GetStoreMessages() {
// 	c.callGetStoreMessages(func(params *tMsgGetStoreMessagesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *MsgController) callGetStoreMessages(handler func(params *tMsgGetStoreMessagesParams) (interface{}, string, error)) {
	var err error
	params := &tMsgGetStoreMessagesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.MsgIDs = utils.TrimBlankChar(c.GetString("msgIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Types = utils.TrimBlankChar(c.GetString("types"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("msgIDs")) != "" {
		params.MapData["msgIDs"] = params.MsgIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("types")) != "" {
		params.MapData["types"] = params.Types
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API MsgController.GetStoreMessages, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API MsgController.GetStoreMessages, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API MsgController.GetStoreMessages error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetVendorPopActDetailParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	StoreID		int
	ActID		int
}

// func (c *ActController) GetVendorPopActDetail() {
// 	c.callGetVendorPopActDetail(func(params *tActGetVendorPopActDetailParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetVendorPopActDetail(handler func(params *tActGetVendorPopActDetailParams) (interface{}, string, error)) {
	var err error
	params := &tActGetVendorPopActDetailParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.ActID, err = c.GetInt("actID", 0); err != nil {
		errParams = append(errParams, "actID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if c.GetString("actID") == "" {
		errParams = append(errParams, "actID")
	}
	params.MapData["actID"] = params.ActID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetVendorPopActDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetVendorPopActDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetVendorPopActDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaAccountStatusQueryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	TradeMode		string
	SubMerchantId		string
	MerchantNo		string
}

// func (c *LaKaLaController) AccountStatusQuery() {
// 	c.callAccountStatusQuery(func(params *tLakalaAccountStatusQueryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callAccountStatusQuery(handler func(params *tLakalaAccountStatusQueryParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaAccountStatusQueryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.TradeMode = utils.TrimBlankChar(c.GetString("tradeMode"))
	params.SubMerchantId = utils.TrimBlankChar(c.GetString("subMerchantId"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("tradeMode") == "" {
		errParams = append(errParams, "tradeMode")
	}
	params.MapData["tradeMode"] = params.TradeMode
	if c.GetString("subMerchantId") == "" {
		errParams = append(errParams, "subMerchantId")
	}
	params.MapData["subMerchantId"] = params.SubMerchantId
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.AccountStatusQuery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.AccountStatusQuery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.AccountStatusQuery error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreAddStoreCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	CategroyID		int
	Level		int
	ParentID		int
	StoreCategroyName		string
	IsHidden		int
	StoreCategroySeq		int
}

// func (c *StoreController) AddStoreCategoryMap() {
// 	c.callAddStoreCategoryMap(func(params *tStoreAddStoreCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callAddStoreCategoryMap(handler func(params *tStoreAddStoreCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreAddStoreCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.CategroyID, err = c.GetInt("categroyID", 0); err != nil {
		errParams = append(errParams, "categroyID")
	}
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	params.StoreCategroyName = utils.TrimBlankChar(c.GetString("storeCategroyName"))
	if params.IsHidden, err = c.GetInt("isHidden", 0); err != nil {
		errParams = append(errParams, "isHidden")
	}
	if params.StoreCategroySeq, err = c.GetInt("storeCategroySeq", 0); err != nil {
		errParams = append(errParams, "storeCategroySeq")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("categroyID")) != "" {
		params.MapData["categroyID"] = params.CategroyID
	}
	if c.GetString("level") == "" {
		errParams = append(errParams, "level")
	}
	params.MapData["level"] = params.Level
	if c.GetString("parentID") == "" {
		errParams = append(errParams, "parentID")
	}
	params.MapData["parentID"] = params.ParentID
	if c.GetString("storeCategroyName") == "" {
		errParams = append(errParams, "storeCategroyName")
	}
	params.MapData["storeCategroyName"] = params.StoreCategroyName
	if c.GetString("isHidden") == "" {
		errParams = append(errParams, "isHidden")
	}
	params.MapData["isHidden"] = params.IsHidden
	if c.GetString("storeCategroySeq") == "" {
		errParams = append(errParams, "storeCategroySeq")
	}
	params.MapData["storeCategroySeq"] = params.StoreCategroySeq
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.AddStoreCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.AddStoreCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.AddStoreCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetBrandCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ParentID		int
	Level		int
	BrandID		int
}

// func (c *StoreController) GetBrandCategoryMap() {
// 	c.callGetBrandCategoryMap(func(params *tStoreGetBrandCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetBrandCategoryMap(handler func(params *tStoreGetBrandCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetBrandCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("parentID")) != "" {
		params.MapData["parentID"] = params.ParentID
	}
	if utils.TrimBlankChar(c.GetString("level")) != "" {
		params.MapData["level"] = params.Level
	}
	if c.GetString("brandID") == "" {
		errParams = append(errParams, "brandID")
	}
	params.MapData["brandID"] = params.BrandID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetBrandCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetBrandCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetBrandCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncSyncJdsStoresSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) SyncJdsStoresSkus() {
// 	c.callSyncJdsStoresSkus(func(params *tSyncSyncJdsStoresSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callSyncJdsStoresSkus(handler func(params *tSyncSyncJdsStoresSkusParams) (interface{}, string, error)) {
	var err error
	params := &tSyncSyncJdsStoresSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.SyncJdsStoresSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.SyncJdsStoresSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.SyncJdsStoresSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetRolesUserListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RoleNames		string
	StoreIDs		string
}

// func (c *User2Controller) GetRolesUserList() {
// 	c.callGetRolesUserList(func(params *tUser2GetRolesUserListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetRolesUserList(handler func(params *tUser2GetRolesUserListParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetRolesUserListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.RoleNames = utils.TrimBlankChar(c.GetString("roleNames"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("roleNames") == "" {
		errParams = append(errParams, "roleNames")
	}
	params.MapData["roleNames"] = params.RoleNames
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetRolesUserList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetRolesUserList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetRolesUserList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaLaKaLaApplyContractByPeopleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	StoreID		int
}

// func (c *LaKaLaController) LaKaLaApplyContractByPeople() {
// 	c.callLaKaLaApplyContractByPeople(func(params *tLakalaLaKaLaApplyContractByPeopleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callLaKaLaApplyContractByPeople(handler func(params *tLakalaLaKaLaApplyContractByPeopleParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaLaKaLaApplyContractByPeopleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.LaKaLaApplyContractByPeople, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.LaKaLaApplyContractByPeople, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.LaKaLaApplyContractByPeople error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaEwalletWithdrawQueryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	OrgNo		string
	DrawJnl		string
}

// func (c *LaKaLaController) EwalletWithdrawQuery() {
// 	c.callEwalletWithdrawQuery(func(params *tLakalaEwalletWithdrawQueryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callEwalletWithdrawQuery(handler func(params *tLakalaEwalletWithdrawQueryParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaEwalletWithdrawQueryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.OrgNo = utils.TrimBlankChar(c.GetString("orgNo"))
	params.DrawJnl = utils.TrimBlankChar(c.GetString("drawJnl"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("orgNo") == "" {
		errParams = append(errParams, "orgNo")
	}
	params.MapData["orgNo"] = params.OrgNo
	if c.GetString("drawJnl") == "" {
		errParams = append(errParams, "drawJnl")
	}
	params.MapData["drawJnl"] = params.DrawJnl
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.EwalletWithdrawQuery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.EwalletWithdrawQuery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.EwalletWithdrawQuery error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefreshJdsOrderConsigneeInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *OrderController) RefreshJdsOrderConsigneeInfo() {
// 	c.callRefreshJdsOrderConsigneeInfo(func(params *tOrderRefreshJdsOrderConsigneeInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefreshJdsOrderConsigneeInfo(handler func(params *tOrderRefreshJdsOrderConsigneeInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefreshJdsOrderConsigneeInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefreshJdsOrderConsigneeInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefreshJdsOrderConsigneeInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefreshJdsOrderConsigneeInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreStoreConfirmActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Status		int
	MsgStatusID		int
}

// func (c *StoreController) StoreConfirmAct() {
// 	c.callStoreConfirmAct(func(params *tStoreStoreConfirmActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callStoreConfirmAct(handler func(params *tStoreStoreConfirmActParams) (interface{}, string, error)) {
	var err error
	params := &tStoreStoreConfirmActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Status, err = c.GetInt("status", 0); err != nil {
		errParams = append(errParams, "status")
	}
	if params.MsgStatusID, err = c.GetInt("msgStatusID", 0); err != nil {
		errParams = append(errParams, "msgStatusID")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("status") == "" {
		errParams = append(errParams, "status")
	}
	params.MapData["status"] = params.Status
	if c.GetString("msgStatusID") == "" {
		errParams = append(errParams, "msgStatusID")
	}
	params.MapData["msgStatusID"] = params.MsgStatusID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.StoreConfirmAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.StoreConfirmAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.StoreConfirmAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetTopSkusByStoreIDsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
}

// func (c *StoreSkuController) GetTopSkusByStoreIDs() {
// 	c.callGetTopSkusByStoreIDs(func(params *tStoreSkuGetTopSkusByStoreIDsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetTopSkusByStoreIDs(handler func(params *tStoreSkuGetTopSkusByStoreIDsParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetTopSkusByStoreIDsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetTopSkusByStoreIDs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetTopSkusByStoreIDs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetTopSkusByStoreIDs error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncSyncStoresCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	IsForce		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) SyncStoresCategory() {
// 	c.callSyncStoresCategory(func(params *tSyncSyncStoresCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callSyncStoresCategory(handler func(params *tSyncSyncStoresCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tSyncSyncStoresCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.SyncStoresCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.SyncStoresCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.SyncStoresCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetSelfInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *User2Controller) GetSelfInfo() {
// 	c.callGetSelfInfo(func(params *tUser2GetSelfInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetSelfInfo(handler func(params *tUser2GetSelfInfoParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetSelfInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetSelfInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetSelfInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetSelfInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuAddCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *SkuController) AddCategory() {
// 	c.callAddCategory(func(params *tSkuAddCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callAddCategory(handler func(params *tSkuAddCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tSkuAddCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.AddCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.AddCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.AddCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFoodrecipeUpdateFoodRecipeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RecipeID		int
	Name		string
	Description		string
	Img		string
	TimeInMinute		int
	RecipeItems		string
	RecipeSteps		string
}

// func (c *FoodRecipeController) UpdateFoodRecipe() {
// 	c.callUpdateFoodRecipe(func(params *tFoodrecipeUpdateFoodRecipeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FoodRecipeController) callUpdateFoodRecipe(handler func(params *tFoodrecipeUpdateFoodRecipeParams) (interface{}, string, error)) {
	var err error
	params := &tFoodrecipeUpdateFoodRecipeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.RecipeID, err = c.GetInt("recipeID", 0); err != nil {
		errParams = append(errParams, "recipeID")
	}
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.Description = utils.TrimBlankChar(c.GetString("description"))
	params.Img = utils.TrimBlankChar(c.GetString("img"))
	if params.TimeInMinute, err = c.GetInt("timeInMinute", 0); err != nil {
		errParams = append(errParams, "timeInMinute")
	}
	params.RecipeItems = utils.TrimBlankChar(c.GetString("recipeItems"))
	params.RecipeSteps = utils.TrimBlankChar(c.GetString("recipeSteps"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("recipeID") == "" {
		errParams = append(errParams, "recipeID")
	}
	params.MapData["recipeID"] = params.RecipeID
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("description")) != "" {
		params.MapData["description"] = params.Description
	}
	if utils.TrimBlankChar(c.GetString("img")) != "" {
		params.MapData["img"] = params.Img
	}
	if utils.TrimBlankChar(c.GetString("timeInMinute")) != "" {
		params.MapData["timeInMinute"] = params.TimeInMinute
	}
	if utils.TrimBlankChar(c.GetString("recipeItems")) != "" {
		params.MapData["recipeItems"] = params.RecipeItems
	}
	if utils.TrimBlankChar(c.GetString("recipeSteps")) != "" {
		params.MapData["recipeSteps"] = params.RecipeSteps
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FoodRecipeController.UpdateFoodRecipe, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FoodRecipeController.UpdateFoodRecipe, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FoodRecipeController.UpdateFoodRecipe error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryBankListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AreaCode		string
	BankName		string
}

// func (c *LaKaLaController) QueryBankList() {
// 	c.callQueryBankList(func(params *tLakalaQueryBankListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryBankList(handler func(params *tLakalaQueryBankListParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryBankListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AreaCode = utils.TrimBlankChar(c.GetString("areaCode"))
	params.BankName = utils.TrimBlankChar(c.GetString("bankName"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("areaCode") == "" {
		errParams = append(errParams, "areaCode")
	}
	params.MapData["areaCode"] = params.AreaCode
	if utils.TrimBlankChar(c.GetString("bankName")) != "" {
		params.MapData["bankName"] = params.BankName
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryBankList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryBankList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryBankList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaGetMerchantReportStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CustomerNo		string
	AgentNo		string
	OrgCode		string
}

// func (c *LaKaLaController) GetMerchantReportStatus() {
// 	c.callGetMerchantReportStatus(func(params *tLakalaGetMerchantReportStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callGetMerchantReportStatus(handler func(params *tLakalaGetMerchantReportStatusParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaGetMerchantReportStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CustomerNo = utils.TrimBlankChar(c.GetString("customerNo"))
	params.AgentNo = utils.TrimBlankChar(c.GetString("agentNo"))
	params.OrgCode = utils.TrimBlankChar(c.GetString("orgCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("customerNo") == "" {
		errParams = append(errParams, "customerNo")
	}
	params.MapData["customerNo"] = params.CustomerNo
	if c.GetString("agentNo") == "" {
		errParams = append(errParams, "agentNo")
	}
	params.MapData["agentNo"] = params.AgentNo
	if c.GetString("orgCode") == "" {
		errParams = append(errParams, "orgCode")
	}
	params.MapData["orgCode"] = params.OrgCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.GetMerchantReportStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.GetMerchantReportStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.GetMerchantReportStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateBrandParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	IsDel		bool
}

// func (c *StoreController) UpdateBrand() {
// 	c.callUpdateBrand(func(params *tStoreUpdateBrandParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateBrand(handler func(params *tStoreUpdateBrandParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateBrandParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.IsDel, err = c.GetBool("isDel", false); err != nil {
		errParams = append(errParams, "isDel")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("isDel")) != "" {
		params.MapData["isDel"] = params.IsDel
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateBrand, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateBrand, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateBrand error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateVendorStoreBussinessStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorIDs		string
	Status		int
}

// func (c *StoreController) UpdateVendorStoreBussinessStatus() {
// 	c.callUpdateVendorStoreBussinessStatus(func(params *tStoreUpdateVendorStoreBussinessStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateVendorStoreBussinessStatus(handler func(params *tStoreUpdateVendorStoreBussinessStatusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateVendorStoreBussinessStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.Status, err = c.GetInt("status", 0); err != nil {
		errParams = append(errParams, "status")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("status") == "" {
		errParams = append(errParams, "status")
	}
	params.MapData["status"] = params.Status
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateVendorStoreBussinessStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateVendorStoreBussinessStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateVendorStoreBussinessStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreAuditStoreMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ID		int
	VendorOrgCode		string
	VendorStoreID		string
	AuditStatus		int
	Comment		string
}

// func (c *StoreController) AuditStoreMap() {
// 	c.callAuditStoreMap(func(params *tStoreAuditStoreMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callAuditStoreMap(handler func(params *tStoreAuditStoreMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreAuditStoreMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ID, err = c.GetInt("ID", 0); err != nil {
		errParams = append(errParams, "ID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.AuditStatus, err = c.GetInt("auditStatus", 0); err != nil {
		errParams = append(errParams, "auditStatus")
	}
	params.Comment = utils.TrimBlankChar(c.GetString("comment"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("ID") == "" {
		errParams = append(errParams, "ID")
	}
	params.MapData["ID"] = params.ID
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if utils.TrimBlankChar(c.GetString("vendorStoreID")) != "" {
		params.MapData["vendorStoreID"] = params.VendorStoreID
	}
	if utils.TrimBlankChar(c.GetString("auditStatus")) != "" {
		params.MapData["auditStatus"] = params.AuditStatus
	}
	if utils.TrimBlankChar(c.GetString("comment")) != "" {
		params.MapData["comment"] = params.Comment
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.AuditStoreMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.AuditStoreMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.AuditStoreMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuCreateSkusAndFocusFromWxParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	StoreID		int
	Price		int
}

// func (c *StoreSkuController) CreateSkusAndFocusFromWx() {
// 	c.callCreateSkusAndFocusFromWx(func(params *tStoreSkuCreateSkusAndFocusFromWxParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callCreateSkusAndFocusFromWx(handler func(params *tStoreSkuCreateSkusAndFocusFromWxParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuCreateSkusAndFocusFromWxParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Price, err = c.GetInt("price", 0); err != nil {
		errParams = append(errParams, "price")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("price") == "" {
		errParams = append(errParams, "price")
	}
	params.MapData["price"] = params.Price
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.CreateSkusAndFocusFromWx, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.CreateSkusAndFocusFromWx, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.CreateSkusAndFocusFromWx error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetUserStoreAuthParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *User2Controller) GetUserStoreAuth() {
// 	c.callGetUserStoreAuth(func(params *tUser2GetUserStoreAuthParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetUserStoreAuth(handler func(params *tUser2GetUserStoreAuthParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetUserStoreAuthParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetUserStoreAuth, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetUserStoreAuth, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetUserStoreAuth error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2SolveNullMobileUserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *User2Controller) SolveNullMobileUser() {
// 	c.callSolveNullMobileUser(func(params *tUser2SolveNullMobileUserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callSolveNullMobileUser(handler func(params *tUser2SolveNullMobileUserParams) (interface{}, string, error)) {
	var err error
	params := &tUser2SolveNullMobileUserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.SolveNullMobileUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.SolveNullMobileUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.SolveNullMobileUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindGetSupermarketSignParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	StoreID		string
	StoreName		string
	StartTime		int
	EndTime		int
	ExpirationStart		int
	ExpirationEnd		int
	CityName		string
	StoreType		string
	SignPeople		string
	Page		int
	Size		int
	Token		string
}

// func (c *BiddingController) GetSupermarketSign() {
// 	c.callGetSupermarketSign(func(params *tBindGetSupermarketSignParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callGetSupermarketSign(handler func(params *tBindGetSupermarketSignParams) (interface{}, string, error)) {
	var err error
	params := &tBindGetSupermarketSignParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.StoreID = utils.TrimBlankChar(c.GetString("storeID"))
	params.StoreName = utils.TrimBlankChar(c.GetString("storeName"))
	if params.StartTime, err = c.GetInt("startTime", 0); err != nil {
		errParams = append(errParams, "startTime")
	}
	if params.EndTime, err = c.GetInt("endTime", 0); err != nil {
		errParams = append(errParams, "endTime")
	}
	if params.ExpirationStart, err = c.GetInt("expirationStart", 0); err != nil {
		errParams = append(errParams, "expirationStart")
	}
	if params.ExpirationEnd, err = c.GetInt("expirationEnd", 0); err != nil {
		errParams = append(errParams, "expirationEnd")
	}
	params.CityName = utils.TrimBlankChar(c.GetString("cityName"))
	params.StoreType = utils.TrimBlankChar(c.GetString("storeType"))
	params.SignPeople = utils.TrimBlankChar(c.GetString("signPeople"))
	if params.Page, err = c.GetInt("page", 0); err != nil {
		errParams = append(errParams, "page")
	}
	if params.Size, err = c.GetInt("size", 0); err != nil {
		errParams = append(errParams, "size")
	}
	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("storeName")) != "" {
		params.MapData["storeName"] = params.StoreName
	}
	if utils.TrimBlankChar(c.GetString("startTime")) != "" {
		params.MapData["startTime"] = params.StartTime
	}
	if utils.TrimBlankChar(c.GetString("endTime")) != "" {
		params.MapData["endTime"] = params.EndTime
	}
	if utils.TrimBlankChar(c.GetString("expirationStart")) != "" {
		params.MapData["expirationStart"] = params.ExpirationStart
	}
	if utils.TrimBlankChar(c.GetString("expirationEnd")) != "" {
		params.MapData["expirationEnd"] = params.ExpirationEnd
	}
	if utils.TrimBlankChar(c.GetString("cityName")) != "" {
		params.MapData["cityName"] = params.CityName
	}
	if utils.TrimBlankChar(c.GetString("storeType")) != "" {
		params.MapData["storeType"] = params.StoreType
	}
	if utils.TrimBlankChar(c.GetString("signPeople")) != "" {
		params.MapData["signPeople"] = params.SignPeople
	}
	if c.GetString("page") == "" {
		errParams = append(errParams, "page")
	}
	params.MapData["page"] = params.Page
	if c.GetString("size") == "" {
		errParams = append(errParams, "size")
	}
	params.MapData["size"] = params.Size
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.GetSupermarketSign, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.GetSupermarketSign, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.GetSupermarketSign error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrderSimpleInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *OrderController) GetOrderSimpleInfo() {
// 	c.callGetOrderSimpleInfo(func(params *tOrderGetOrderSimpleInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrderSimpleInfo(handler func(params *tOrderGetOrderSimpleInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrderSimpleInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrderSimpleInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrderSimpleInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrderSimpleInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopRetrieveEbaiShopLicenceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *TempOpController) RetrieveEbaiShopLicence() {
// 	c.callRetrieveEbaiShopLicence(func(params *tTempopRetrieveEbaiShopLicenceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callRetrieveEbaiShopLicence(handler func(params *tTempopRetrieveEbaiShopLicenceParams) (interface{}, string, error)) {
	var err error
	params := &tTempopRetrieveEbaiShopLicenceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.RetrieveEbaiShopLicence, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.RetrieveEbaiShopLicence, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.RetrieveEbaiShopLicence error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderCancelWaybillParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorWaybillID		string
	WaybillVendorID		int
	ReasonID		int
	Reason		string
}

// func (c *OrderController) CancelWaybill() {
// 	c.callCancelWaybill(func(params *tOrderCancelWaybillParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callCancelWaybill(handler func(params *tOrderCancelWaybillParams) (interface{}, string, error)) {
	var err error
	params := &tOrderCancelWaybillParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID"))
	if params.WaybillVendorID, err = c.GetInt("waybillVendorID", 0); err != nil {
		errParams = append(errParams, "waybillVendorID")
	}
	if params.ReasonID, err = c.GetInt("reasonID", 0); err != nil {
		errParams = append(errParams, "reasonID")
	}
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorWaybillID") == "" {
		errParams = append(errParams, "vendorWaybillID")
	}
	params.MapData["vendorWaybillID"] = params.VendorWaybillID
	if c.GetString("waybillVendorID") == "" {
		errParams = append(errParams, "waybillVendorID")
	}
	params.MapData["waybillVendorID"] = params.WaybillVendorID
	if utils.TrimBlankChar(c.GetString("reasonID")) != "" {
		params.MapData["reasonID"] = params.ReasonID
	}
	if utils.TrimBlankChar(c.GetString("reason")) != "" {
		params.MapData["reason"] = params.Reason
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.CancelWaybill, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.CancelWaybill, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.CancelWaybill error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetAvailableDeliverTimeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *JxOrderController) GetAvailableDeliverTime() {
// 	c.callGetAvailableDeliverTime(func(params *tJxorderGetAvailableDeliverTimeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetAvailableDeliverTime(handler func(params *tJxorderGetAvailableDeliverTimeParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetAvailableDeliverTimeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetAvailableDeliverTime, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetAvailableDeliverTime, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetAvailableDeliverTime error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataInitVendorCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	IsAsync		bool
}

// func (c *InitDataController) InitVendorCategory() {
// 	c.callInitVendorCategory(func(params *tInitdataInitVendorCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callInitVendorCategory(handler func(params *tInitdataInitVendorCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataInitVendorCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.InitVendorCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.InitVendorCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.InitVendorCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderRefreshAllMatterOrderStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *JxOrderController) RefreshAllMatterOrderStatus() {
// 	c.callRefreshAllMatterOrderStatus(func(params *tJxorderRefreshAllMatterOrderStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callRefreshAllMatterOrderStatus(handler func(params *tJxorderRefreshAllMatterOrderStatusParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderRefreshAllMatterOrderStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.RefreshAllMatterOrderStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.RefreshAllMatterOrderStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.RefreshAllMatterOrderStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryID		int
	Payload		string
}

// func (c *SkuController) UpdateCategory() {
// 	c.callUpdateCategory(func(params *tSkuUpdateCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateCategory(handler func(params *tSkuUpdateCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categoryID") == "" {
		errParams = append(errParams, "categoryID")
	}
	params.MapData["categoryID"] = params.CategoryID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuRefreshMatterStockParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *StoreSkuController) RefreshMatterStock() {
// 	c.callRefreshMatterStock(func(params *tStoreSkuRefreshMatterStockParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callRefreshMatterStock(handler func(params *tStoreSkuRefreshMatterStockParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuRefreshMatterStockParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.RefreshMatterStock, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.RefreshMatterStock, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.RefreshMatterStock error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tMsgReadStoreMessageParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MsgID		int
	MsgStatusID		int
	RedirectURL		string
}

// func (c *MsgController) ReadStoreMessage() {
// 	c.callReadStoreMessage(func(params *tMsgReadStoreMessageParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *MsgController) callReadStoreMessage(handler func(params *tMsgReadStoreMessageParams) (interface{}, string, error)) {
	var err error
	params := &tMsgReadStoreMessageParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.MsgID, err = c.GetInt("msgID", 0); err != nil {
		errParams = append(errParams, "msgID")
	}
	if params.MsgStatusID, err = c.GetInt("msgStatusID", 0); err != nil {
		errParams = append(errParams, "msgStatusID")
	}
	params.RedirectURL = utils.TrimBlankChar(c.GetString("redirectURL"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("msgID") == "" {
		errParams = append(errParams, "msgID")
	}
	params.MapData["msgID"] = params.MsgID
	if c.GetString("msgStatusID") == "" {
		errParams = append(errParams, "msgStatusID")
	}
	params.MapData["msgStatusID"] = params.MsgStatusID
	if utils.TrimBlankChar(c.GetString("redirectURL")) != "" {
		params.MapData["redirectURL"] = params.RedirectURL
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API MsgController.ReadStoreMessage, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API MsgController.ReadStoreMessage, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API MsgController.ReadStoreMessage error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportPriceReferParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *ReportController) PriceRefer() {
// 	c.callPriceRefer(func(params *tReportPriceReferParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callPriceRefer(handler func(params *tReportPriceReferParams) (interface{}, string, error)) {
	var err error
	params := &tReportPriceReferParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.PriceRefer, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.PriceRefer, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.PriceRefer error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateDDWarehouseParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
	VendorStoreID		int
	StoreID		int
}

// func (c *StoreController) CreateDDWarehouse() {
// 	c.callCreateDDWarehouse(func(params *tStoreCreateDDWarehouseParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateDDWarehouse(handler func(params *tStoreCreateDDWarehouseParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateDDWarehouseParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.VendorStoreID, err = c.GetInt("vendorStoreID", 0); err != nil {
		errParams = append(errParams, "vendorStoreID")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateDDWarehouse, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateDDWarehouse, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateDDWarehouse error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetConfigParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Key		string
}

// func (c *CmsController) GetConfig() {
// 	c.callGetConfig(func(params *tCmsGetConfigParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetConfig(handler func(params *tCmsGetConfigParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetConfigParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Key = utils.TrimBlankChar(c.GetString("key"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("key") == "" {
		errParams = append(errParams, "key")
	}
	params.MapData["key"] = params.Key
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuRefreshStoresSkuByVendorParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorID		int
	IsAsync		bool
}

// func (c *StoreSkuController) RefreshStoresSkuByVendor() {
// 	c.callRefreshStoresSkuByVendor(func(params *tStoreSkuRefreshStoresSkuByVendorParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callRefreshStoresSkuByVendor(handler func(params *tStoreSkuRefreshStoresSkuByVendorParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuRefreshStoresSkuByVendorParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.RefreshStoresSkuByVendor, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.RefreshStoresSkuByVendor, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.RefreshStoresSkuByVendor error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tDdapiSignParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Url		string
	NonceStr		string
	TimeStamp		string
}

// func (c *DDAPIController) Sign() {
// 	c.callSign(func(params *tDdapiSignParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *DDAPIController) callSign(handler func(params *tDdapiSignParams) (interface{}, string, error)) {
	var err error
	params := &tDdapiSignParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Url = utils.TrimBlankChar(c.GetString("url"))
	params.NonceStr = utils.TrimBlankChar(c.GetString("nonceStr"))
	params.TimeStamp = utils.TrimBlankChar(c.GetString("timeStamp"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("url") == "" {
		errParams = append(errParams, "url")
	}
	params.MapData["url"] = params.Url
	if c.GetString("nonceStr") == "" {
		errParams = append(errParams, "nonceStr")
	}
	params.MapData["nonceStr"] = params.NonceStr
	if c.GetString("timeStamp") == "" {
		errParams = append(errParams, "timeStamp")
	}
	params.MapData["timeStamp"] = params.TimeStamp
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API DDAPIController.Sign, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API DDAPIController.Sign, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API DDAPIController.Sign error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuBatchSetRestockingPriceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *SkuController) BatchSetRestockingPrice() {
// 	c.callBatchSetRestockingPrice(func(params *tSkuBatchSetRestockingPriceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callBatchSetRestockingPrice(handler func(params *tSkuBatchSetRestockingPriceParams) (interface{}, string, error)) {
	var err error
	params := &tSkuBatchSetRestockingPriceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.BatchSetRestockingPrice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.BatchSetRestockingPrice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.BatchSetRestockingPrice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncPruneMissingStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) PruneMissingStoreSkus() {
// 	c.callPruneMissingStoreSkus(func(params *tSyncPruneMissingStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callPruneMissingStoreSkus(handler func(params *tSyncPruneMissingStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tSyncPruneMissingStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.PruneMissingStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.PruneMissingStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.PruneMissingStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetUsersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserType		int
	Keyword		string
	UserIDs		string
	UserID2		string
	Mobile		string
	Offset		int
	PageSize		int
}

// func (c *User2Controller) GetUsers() {
// 	c.callGetUsers(func(params *tUser2GetUsersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetUsers(handler func(params *tUser2GetUsersParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetUsersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.UserType, err = c.GetInt("userType", 0); err != nil {
		errParams = append(errParams, "userType")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.UserIDs = utils.TrimBlankChar(c.GetString("userIDs"))
	params.UserID2 = utils.TrimBlankChar(c.GetString("userID2"))
	params.Mobile = utils.TrimBlankChar(c.GetString("mobile"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("userType") == "" {
		errParams = append(errParams, "userType")
	}
	params.MapData["userType"] = params.UserType
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("userIDs")) != "" {
		params.MapData["userIDs"] = params.UserIDs
	}
	if utils.TrimBlankChar(c.GetString("userID2")) != "" {
		params.MapData["userID2"] = params.UserID2
	}
	if utils.TrimBlankChar(c.GetString("mobile")) != "" {
		params.MapData["mobile"] = params.Mobile
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetUsers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetUsers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetUsers error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2RegisterUserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	MobileVerifyCode		string
	AuthToken		string
	Version		string
}

// func (c *User2Controller) RegisterUser() {
// 	c.callRegisterUser(func(params *tUser2RegisterUserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callRegisterUser(handler func(params *tUser2RegisterUserParams) (interface{}, string, error)) {
	var err error
	params := &tUser2RegisterUserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	params.MobileVerifyCode = utils.TrimBlankChar(c.GetString("mobileVerifyCode"))
	params.AuthToken = utils.TrimBlankChar(c.GetString("authToken"))
	params.Version = utils.TrimBlankChar(c.GetString("version"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("mobileVerifyCode")) != "" {
		params.MapData["mobileVerifyCode"] = params.MobileVerifyCode
	}
	if utils.TrimBlankChar(c.GetString("authToken")) != "" {
		params.MapData["authToken"] = params.AuthToken
	}
	if utils.TrimBlankChar(c.GetString("version")) != "" {
		params.MapData["version"] = params.Version
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.RegisterUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.RegisterUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.RegisterUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaUpdateSeparateRecipientParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *LaKaLaController) UpdateSeparateRecipient() {
// 	c.callUpdateSeparateRecipient(func(params *tLakalaUpdateSeparateRecipientParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callUpdateSeparateRecipient(handler func(params *tLakalaUpdateSeparateRecipientParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaUpdateSeparateRecipientParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.UpdateSeparateRecipient, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.UpdateSeparateRecipient, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.UpdateSeparateRecipient error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreMapAuditParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	AuditStatuss		string
	FromTime		string
	ToTime		string
	Offset		int
	PageSize		int
}

// func (c *StoreController) GetStoreMapAudit() {
// 	c.callGetStoreMapAudit(func(params *tStoreGetStoreMapAuditParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreMapAudit(handler func(params *tStoreGetStoreMapAuditParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreMapAuditParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.AuditStatuss = utils.TrimBlankChar(c.GetString("auditStatuss"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("auditStatuss")) != "" {
		params.MapData["auditStatuss"] = params.AuditStatuss
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreMapAudit, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreMapAudit, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreMapAudit error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tNetspiderGetAndStoreCitiesShopsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	CityCodes		string
	Radius		int
	GridWith		int
	IsShuffle		bool
	IsAsync		bool
}

// func (c *NetSpiderController) GetAndStoreCitiesShops() {
// 	c.callGetAndStoreCitiesShops(func(params *tNetspiderGetAndStoreCitiesShopsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *NetSpiderController) callGetAndStoreCitiesShops(handler func(params *tNetspiderGetAndStoreCitiesShopsParams) (interface{}, string, error)) {
	var err error
	params := &tNetspiderGetAndStoreCitiesShopsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes"))
	if params.Radius, err = c.GetInt("radius", 0); err != nil {
		errParams = append(errParams, "radius")
	}
	if params.GridWith, err = c.GetInt("gridWith", 0); err != nil {
		errParams = append(errParams, "gridWith")
	}
	if params.IsShuffle, err = c.GetBool("isShuffle", false); err != nil {
		errParams = append(errParams, "isShuffle")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("cityCodes")) != "" {
		params.MapData["cityCodes"] = params.CityCodes
	}
	if utils.TrimBlankChar(c.GetString("radius")) != "" {
		params.MapData["radius"] = params.Radius
	}
	if utils.TrimBlankChar(c.GetString("gridWith")) != "" {
		params.MapData["gridWith"] = params.GridWith
	}
	if utils.TrimBlankChar(c.GetString("isShuffle")) != "" {
		params.MapData["isShuffle"] = params.IsShuffle
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API NetSpiderController.GetAndStoreCitiesShops, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API NetSpiderController.GetAndStoreCitiesShops, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API NetSpiderController.GetAndStoreCitiesShops error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderAdjustOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	RemovedSkuInfo		string
	Reason		string
}

// func (c *OrderController) AdjustOrder() {
// 	c.callAdjustOrder(func(params *tOrderAdjustOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callAdjustOrder(handler func(params *tOrderAdjustOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderAdjustOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.RemovedSkuInfo = utils.TrimBlankChar(c.GetString("removedSkuInfo"))
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("removedSkuInfo") == "" {
		errParams = append(errParams, "removedSkuInfo")
	}
	params.MapData["removedSkuInfo"] = params.RemovedSkuInfo
	if c.GetString("reason") == "" {
		errParams = append(errParams, "reason")
	}
	params.MapData["reason"] = params.Reason
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.AdjustOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.AdjustOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.AdjustOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuAddSkuNameParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *SkuController) AddSkuName() {
// 	c.callAddSkuName(func(params *tSkuAddSkuNameParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callAddSkuName(handler func(params *tSkuAddSkuNameParams) (interface{}, string, error)) {
	var err error
	params := &tSkuAddSkuNameParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.AddSkuName, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.AddSkuName, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.AddSkuName error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuDeleteSkuNameParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameID		int
}

// func (c *SkuController) DeleteSkuName() {
// 	c.callDeleteSkuName(func(params *tSkuDeleteSkuNameParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callDeleteSkuName(handler func(params *tSkuDeleteSkuNameParams) (interface{}, string, error)) {
	var err error
	params := &tSkuDeleteSkuNameParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.NameID, err = c.GetInt("nameID", 0); err != nil {
		errParams = append(errParams, "nameID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("nameID") == "" {
		errParams = append(errParams, "nameID")
	}
	params.MapData["nameID"] = params.NameID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.DeleteSkuName, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.DeleteSkuName, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.DeleteSkuName error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuUpdateStoresSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	Payload		string
	IsScale		bool
	CauseFlag		int
	IsRefreshHigh		bool
	IsContinueWhenError		bool
	IsAsync		bool
}

// func (c *StoreSkuController) UpdateStoresSkus() {
// 	c.callUpdateStoresSkus(func(params *tStoreSkuUpdateStoresSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callUpdateStoresSkus(handler func(params *tStoreSkuUpdateStoresSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuUpdateStoresSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.IsScale, err = c.GetBool("isScale", false); err != nil {
		errParams = append(errParams, "isScale")
	}
	if params.CauseFlag, err = c.GetInt("causeFlag", 0); err != nil {
		errParams = append(errParams, "causeFlag")
	}
	if params.IsRefreshHigh, err = c.GetBool("isRefreshHigh", false); err != nil {
		errParams = append(errParams, "isRefreshHigh")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("isScale")) != "" {
		params.MapData["isScale"] = params.IsScale
	}
	if utils.TrimBlankChar(c.GetString("causeFlag")) != "" {
		params.MapData["causeFlag"] = params.CauseFlag
	}
	if utils.TrimBlankChar(c.GetString("isRefreshHigh")) != "" {
		params.MapData["isRefreshHigh"] = params.IsRefreshHigh
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.UpdateStoresSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.UpdateStoresSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.UpdateStoresSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuDeleteCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryID		int
}

// func (c *SkuController) DeleteCategory() {
// 	c.callDeleteCategory(func(params *tSkuDeleteCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callDeleteCategory(handler func(params *tSkuDeleteCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tSkuDeleteCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categoryID") == "" {
		errParams = append(errParams, "categoryID")
	}
	params.MapData["categoryID"] = params.CategoryID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.DeleteCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.DeleteCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.DeleteCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncSyncCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	VendorOrgCode		string
	IsForce		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) SyncCategories() {
// 	c.callSyncCategories(func(params *tSyncSyncCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callSyncCategories(handler func(params *tSyncSyncCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSyncSyncCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.SyncCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.SyncCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.SyncCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreReplaceInsertFreightParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorStoreID		string
	TemplateID		int
	WarehouseID		int
	FenceID		string
	TradeLimitID		int
}

// func (c *StoreController) ReplaceInsertFreight() {
// 	c.callReplaceInsertFreight(func(params *tStoreReplaceInsertFreightParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callReplaceInsertFreight(handler func(params *tStoreReplaceInsertFreightParams) (interface{}, string, error)) {
	var err error
	params := &tStoreReplaceInsertFreightParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.TemplateID, err = c.GetInt("templateID", 0); err != nil {
		errParams = append(errParams, "templateID")
	}
	if params.WarehouseID, err = c.GetInt("warehouseID", 0); err != nil {
		errParams = append(errParams, "warehouseID")
	}
	params.FenceID = utils.TrimBlankChar(c.GetString("fenceID"))
	if params.TradeLimitID, err = c.GetInt("tradeLimitID", 0); err != nil {
		errParams = append(errParams, "tradeLimitID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("vendorStoreID")) != "" {
		params.MapData["vendorStoreID"] = params.VendorStoreID
	}
	if utils.TrimBlankChar(c.GetString("templateID")) != "" {
		params.MapData["templateID"] = params.TemplateID
	}
	if utils.TrimBlankChar(c.GetString("warehouseID")) != "" {
		params.MapData["warehouseID"] = params.WarehouseID
	}
	if utils.TrimBlankChar(c.GetString("fenceID")) != "" {
		params.MapData["fenceID"] = params.FenceID
	}
	if utils.TrimBlankChar(c.GetString("tradeLimitID")) != "" {
		params.MapData["tradeLimitID"] = params.TradeLimitID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.ReplaceInsertFreight, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.ReplaceInsertFreight, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.ReplaceInsertFreight error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreAutoCallRiderInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrgCode		string
	StoreIDs		string
}

// func (c *StoreController) GetStoreAutoCallRiderInfo() {
// 	c.callGetStoreAutoCallRiderInfo(func(params *tStoreGetStoreAutoCallRiderInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreAutoCallRiderInfo(handler func(params *tStoreGetStoreAutoCallRiderInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreAutoCallRiderInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreAutoCallRiderInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreAutoCallRiderInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreAutoCallRiderInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuRefreshJxPriceByVendorParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	VendorID		int
	IgnoreLow		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) RefreshJxPriceByVendor() {
// 	c.callRefreshJxPriceByVendor(func(params *tStoreSkuRefreshJxPriceByVendorParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callRefreshJxPriceByVendor(handler func(params *tStoreSkuRefreshJxPriceByVendorParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuRefreshJxPriceByVendorParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IgnoreLow, err = c.GetBool("ignoreLow", false); err != nil {
		errParams = append(errParams, "ignoreLow")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("ignoreLow") == "" {
		errParams = append(errParams, "ignoreLow")
	}
	params.MapData["ignoreLow"] = params.IgnoreLow
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.RefreshJxPriceByVendor, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.RefreshJxPriceByVendor, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.RefreshJxPriceByVendor error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaCloseOrderByMiniParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerCupNo		string
	TermNo		string
	OrderNo		string
}

// func (c *LaKaLaController) CloseOrderByMini() {
// 	c.callCloseOrderByMini(func(params *tLakalaCloseOrderByMiniParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callCloseOrderByMini(handler func(params *tLakalaCloseOrderByMiniParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaCloseOrderByMiniParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerCupNo = utils.TrimBlankChar(c.GetString("merCupNo"))
	params.TermNo = utils.TrimBlankChar(c.GetString("termNo"))
	params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merCupNo") == "" {
		errParams = append(errParams, "merCupNo")
	}
	params.MapData["merCupNo"] = params.MerCupNo
	if c.GetString("termNo") == "" {
		errParams = append(errParams, "termNo")
	}
	params.MapData["termNo"] = params.TermNo
	if c.GetString("orderNo") == "" {
		errParams = append(errParams, "orderNo")
	}
	params.MapData["orderNo"] = params.OrderNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.CloseOrderByMini, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.CloseOrderByMini, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.CloseOrderByMini error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetPrinterStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *OrderController) GetPrinterStatus() {
// 	c.callGetPrinterStatus(func(params *tOrderGetPrinterStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetPrinterStatus(handler func(params *tOrderGetPrinterStatusParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetPrinterStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetPrinterStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetPrinterStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetPrinterStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuSyncJdStoreProductsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	SkuIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) SyncJdStoreProducts() {
// 	c.callSyncJdStoreProducts(func(params *tStoreSkuSyncJdStoreProductsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callSyncJdStoreProducts(handler func(params *tStoreSkuSyncJdStoreProductsParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuSyncJdStoreProductsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.SyncJdStoreProducts, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.SyncJdStoreProducts, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.SyncJdStoreProducts error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopCheckSkuDiffBetweenJxAndVendorParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	StoreIDs		string
}

// func (c *TempOpController) CheckSkuDiffBetweenJxAndVendor() {
// 	c.callCheckSkuDiffBetweenJxAndVendor(func(params *tTempopCheckSkuDiffBetweenJxAndVendorParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callCheckSkuDiffBetweenJxAndVendor(handler func(params *tTempopCheckSkuDiffBetweenJxAndVendorParams) (interface{}, string, error)) {
	var err error
	params := &tTempopCheckSkuDiffBetweenJxAndVendorParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.CheckSkuDiffBetweenJxAndVendor, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.CheckSkuDiffBetweenJxAndVendor, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.CheckSkuDiffBetweenJxAndVendor error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerUpdateRoleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
	RoleID		int
	IsDelete		bool
	BrandID		int
	CityCodes		string
	StoreIDs		string
}

// func (c *PowerController) UpdateRole() {
// 	c.callUpdateRole(func(params *tPowerUpdateRoleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callUpdateRole(handler func(params *tPowerUpdateRoleParams) (interface{}, string, error)) {
	var err error
	params := &tPowerUpdateRoleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.RoleID, err = c.GetInt("roleID", 0); err != nil {
		errParams = append(errParams, "roleID")
	}
	if params.IsDelete, err = c.GetBool("isDelete", false); err != nil {
		errParams = append(errParams, "isDelete")
	}
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("name") == "" {
		errParams = append(errParams, "name")
	}
	params.MapData["name"] = params.Name
	if c.GetString("roleID") == "" {
		errParams = append(errParams, "roleID")
	}
	params.MapData["roleID"] = params.RoleID
	if c.GetString("isDelete") == "" {
		errParams = append(errParams, "isDelete")
	}
	params.MapData["isDelete"] = params.IsDelete
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if utils.TrimBlankChar(c.GetString("cityCodes")) != "" {
		params.MapData["cityCodes"] = params.CityCodes
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.UpdateRole, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.UpdateRole, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.UpdateRole error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSettleDrawPatternParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *LaKaLaController) SettleDrawPattern() {
// 	c.callSettleDrawPattern(func(params *tLakalaSettleDrawPatternParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSettleDrawPattern(handler func(params *tLakalaSettleDrawPatternParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSettleDrawPatternParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SettleDrawPattern, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SettleDrawPattern, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SettleDrawPattern error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaImgSupplementParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *LaKaLaController) ImgSupplement() {
// 	c.callImgSupplement(func(params *tLakalaImgSupplementParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callImgSupplement(handler func(params *tLakalaImgSupplementParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaImgSupplementParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.ImgSupplement, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.ImgSupplement, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.ImgSupplement error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderTransferJdsOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorOrderID		string
}

// func (c *OrderController) TransferJdsOrder() {
// 	c.callTransferJdsOrder(func(params *tOrderTransferJdsOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callTransferJdsOrder(handler func(params *tOrderTransferJdsOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderTransferJdsOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.TransferJdsOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.TransferJdsOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.TransferJdsOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderPay4UserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ThingID		int
	SubAppID		string
	VendorOrderID		string
	PayType		int
	VendorPayType		string
	Code		string
}

// func (c *JxOrderController) Pay4User() {
// 	c.callPay4User(func(params *tJxorderPay4UserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callPay4User(handler func(params *tJxorderPay4UserParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderPay4UserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ThingID, err = c.GetInt("thingID", 0); err != nil {
		errParams = append(errParams, "thingID")
	}
	params.SubAppID = utils.TrimBlankChar(c.GetString("subAppID"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.PayType, err = c.GetInt("payType", 0); err != nil {
		errParams = append(errParams, "payType")
	}
	params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType"))
	params.Code = utils.TrimBlankChar(c.GetString("code"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("thingID")) != "" {
		params.MapData["thingID"] = params.ThingID
	}
	if utils.TrimBlankChar(c.GetString("subAppID")) != "" {
		params.MapData["subAppID"] = params.SubAppID
	}
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if c.GetString("vendorPayType") == "" {
		errParams = append(errParams, "vendorPayType")
	}
	params.MapData["vendorPayType"] = params.VendorPayType
	if utils.TrimBlankChar(c.GetString("code")) != "" {
		params.MapData["code"] = params.Code
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.Pay4User, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.Pay4User, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.Pay4User error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateSkuNameParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameID		int
	Payload		string
	IsExd		bool
}

// func (c *SkuController) UpdateSkuName() {
// 	c.callUpdateSkuName(func(params *tSkuUpdateSkuNameParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateSkuName(handler func(params *tSkuUpdateSkuNameParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateSkuNameParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.NameID, err = c.GetInt("nameID", 0); err != nil {
		errParams = append(errParams, "nameID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.IsExd, err = c.GetBool("isExd", false); err != nil {
		errParams = append(errParams, "isExd")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("nameID") == "" {
		errParams = append(errParams, "nameID")
	}
	params.MapData["nameID"] = params.NameID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("isExd")) != "" {
		params.MapData["isExd"] = params.IsExd
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateSkuName, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateSkuName, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateSkuName error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderCreateStoreAcctOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	OrderType		int
	StoreID		int
	Price		int
}

// func (c *JxOrderController) CreateStoreAcctOrder() {
// 	c.callCreateStoreAcctOrder(func(params *tJxorderCreateStoreAcctOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callCreateStoreAcctOrder(handler func(params *tJxorderCreateStoreAcctOrderParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderCreateStoreAcctOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.OrderType, err = c.GetInt("orderType", 0); err != nil {
		errParams = append(errParams, "orderType")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Price, err = c.GetInt("price", 0); err != nil {
		errParams = append(errParams, "price")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if c.GetString("orderType") == "" {
		errParams = append(errParams, "orderType")
	}
	params.MapData["orderType"] = params.OrderType
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("price") == "" {
		errParams = append(errParams, "price")
	}
	params.MapData["price"] = params.Price
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.CreateStoreAcctOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.CreateStoreAcctOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.CreateStoreAcctOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportStatisticsReportForStoreSkusPriceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CityCodes		string
	SkuIDs		string
	SnapDate		string
	Offset		int
	PageSize		int
}

// func (c *ReportController) StatisticsReportForStoreSkusPrice() {
// 	c.callStatisticsReportForStoreSkusPrice(func(params *tReportStatisticsReportForStoreSkusPriceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callStatisticsReportForStoreSkusPrice(handler func(params *tReportStatisticsReportForStoreSkusPriceParams) (interface{}, string, error)) {
	var err error
	params := &tReportStatisticsReportForStoreSkusPriceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	params.SnapDate = utils.TrimBlankChar(c.GetString("snapDate"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("cityCodes") == "" {
		errParams = append(errParams, "cityCodes")
	}
	params.MapData["cityCodes"] = params.CityCodes
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if c.GetString("snapDate") == "" {
		errParams = append(errParams, "snapDate")
	}
	params.MapData["snapDate"] = params.SnapDate
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.StatisticsReportForStoreSkusPrice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.StatisticsReportForStoreSkusPrice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.StatisticsReportForStoreSkusPrice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImGetImUserListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PayLoad		string
}

// func (c *IMController) GetImUserList() {
// 	c.callGetImUserList(func(params *tImGetImUserListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callGetImUserList(handler func(params *tImGetImUserListParams) (interface{}, string, error)) {
	var err error
	params := &tImGetImUserListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PayLoad = utils.TrimBlankChar(c.GetString("payLoad"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payLoad") == "" {
		errParams = append(errParams, "payLoad")
	}
	params.MapData["payLoad"] = params.PayLoad
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.GetImUserList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.GetImUserList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.GetImUserList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuRefreshJdDepotParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *SkuController) RefreshJdDepot() {
// 	c.callRefreshJdDepot(func(params *tSkuRefreshJdDepotParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callRefreshJdDepot(handler func(params *tSkuRefreshJdDepotParams) (interface{}, string, error)) {
	var err error
	params := &tSkuRefreshJdDepotParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.RefreshJdDepot, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.RefreshJdDepot, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.RefreshJdDepot error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetTopSkusByCityCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CityCode		int
	StoreID		int
}

// func (c *StoreSkuController) GetTopSkusByCityCode() {
// 	c.callGetTopSkusByCityCode(func(params *tStoreSkuGetTopSkusByCityCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetTopSkusByCityCode(handler func(params *tStoreSkuGetTopSkusByCityCodeParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetTopSkusByCityCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetTopSkusByCityCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetTopSkusByCityCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetTopSkusByCityCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFinancialSendFilesToStoresParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Title		string
	ShopName		string
	IsAsync		bool
}

// func (c *FinancialController) SendFilesToStores() {
// 	c.callSendFilesToStores(func(params *tFinancialSendFilesToStoresParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FinancialController) callSendFilesToStores(handler func(params *tFinancialSendFilesToStoresParams) (interface{}, string, error)) {
	var err error
	params := &tFinancialSendFilesToStoresParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Title = utils.TrimBlankChar(c.GetString("title"))
	params.ShopName = utils.TrimBlankChar(c.GetString("shopName"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("title")) != "" {
		params.MapData["title"] = params.Title
	}
	if utils.TrimBlankChar(c.GetString("shopName")) != "" {
		params.MapData["shopName"] = params.ShopName
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FinancialController.SendFilesToStores, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FinancialController.SendFilesToStores, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FinancialController.SendFilesToStores error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrderSkuInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
}

// func (c *OrderController) GetOrderSkuInfo() {
// 	c.callGetOrderSkuInfo(func(params *tOrderGetOrderSkuInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrderSkuInfo(handler func(params *tOrderGetOrderSkuInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrderSkuInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrderSkuInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrderSkuInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrderSkuInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderAutoPayForPopluarManParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *JxOrderController) AutoPayForPopluarMan() {
// 	c.callAutoPayForPopluarMan(func(params *tJxorderAutoPayForPopluarManParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callAutoPayForPopluarMan(handler func(params *tJxorderAutoPayForPopluarManParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderAutoPayForPopluarManParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.AutoPayForPopluarMan, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.AutoPayForPopluarMan, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.AutoPayForPopluarMan error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuSetSkuBestSellerParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SkuNameId		string
	BestSeller		int
}

// func (c *SkuController) SetSkuBestSeller() {
// 	c.callSetSkuBestSeller(func(params *tSkuSetSkuBestSellerParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callSetSkuBestSeller(handler func(params *tSkuSetSkuBestSellerParams) (interface{}, string, error)) {
	var err error
	params := &tSkuSetSkuBestSellerParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.SkuNameId = utils.TrimBlankChar(c.GetString("skuNameId"))
	if params.BestSeller, err = c.GetInt("bestSeller", 0); err != nil {
		errParams = append(errParams, "bestSeller")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("skuNameId") == "" {
		errParams = append(errParams, "skuNameId")
	}
	params.MapData["skuNameId"] = params.SkuNameId
	if c.GetString("bestSeller") == "" {
		errParams = append(errParams, "bestSeller")
	}
	params.MapData["bestSeller"] = params.BestSeller
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.SetSkuBestSeller, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.SetSkuBestSeller, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.SetSkuBestSeller error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuRefreshNoImgSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SkuNameID		int
}

// func (c *SkuController) RefreshNoImgSku() {
// 	c.callRefreshNoImgSku(func(params *tSkuRefreshNoImgSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callRefreshNoImgSku(handler func(params *tSkuRefreshNoImgSkuParams) (interface{}, string, error)) {
	var err error
	params := &tSkuRefreshNoImgSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.SkuNameID, err = c.GetInt("skuNameID", 0); err != nil {
		errParams = append(errParams, "skuNameID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("skuNameID")) != "" {
		params.MapData["skuNameID"] = params.SkuNameID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.RefreshNoImgSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.RefreshNoImgSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.RefreshNoImgSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateStorePushClientParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	ClientID		string
}

// func (c *StoreController) UpdateStorePushClient() {
// 	c.callUpdateStorePushClient(func(params *tStoreUpdateStorePushClientParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateStorePushClient(handler func(params *tStoreUpdateStorePushClientParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateStorePushClientParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.ClientID = utils.TrimBlankChar(c.GetString("clientID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("clientID") == "" {
		errParams = append(errParams, "clientID")
	}
	params.MapData["clientID"] = params.ClientID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateStorePushClient, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateStorePushClient, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateStorePushClient error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreInsertBrandCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandID		int
}

// func (c *StoreController) InsertBrandCategories() {
// 	c.callInsertBrandCategories(func(params *tStoreInsertBrandCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callInsertBrandCategories(handler func(params *tStoreInsertBrandCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tStoreInsertBrandCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("brandID") == "" {
		errParams = append(errParams, "brandID")
	}
	params.MapData["brandID"] = params.BrandID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.InsertBrandCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.InsertBrandCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.InsertBrandCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuRefreshJxPriceByExcelParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) RefreshJxPriceByExcel() {
// 	c.callRefreshJxPriceByExcel(func(params *tStoreSkuRefreshJxPriceByExcelParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callRefreshJxPriceByExcel(handler func(params *tStoreSkuRefreshJxPriceByExcelParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuRefreshJxPriceByExcelParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.RefreshJxPriceByExcel, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.RefreshJxPriceByExcel, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.RefreshJxPriceByExcel error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuAutoFocusStoreSkusForTopSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) AutoFocusStoreSkusForTopSkus() {
// 	c.callAutoFocusStoreSkusForTopSkus(func(params *tStoreSkuAutoFocusStoreSkusForTopSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callAutoFocusStoreSkusForTopSkus(handler func(params *tStoreSkuAutoFocusStoreSkusForTopSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuAutoFocusStoreSkusForTopSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.AutoFocusStoreSkusForTopSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.AutoFocusStoreSkusForTopSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.AutoFocusStoreSkusForTopSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuRefreshJxPriceByVendor2Params struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorID		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) RefreshJxPriceByVendor2() {
// 	c.callRefreshJxPriceByVendor2(func(params *tStoreSkuRefreshJxPriceByVendor2Params) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callRefreshJxPriceByVendor2(handler func(params *tStoreSkuRefreshJxPriceByVendor2Params) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuRefreshJxPriceByVendor2Params{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.RefreshJxPriceByVendor2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.RefreshJxPriceByVendor2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.RefreshJxPriceByVendor2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2RemoveAuthBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AuthType		string
	AuthTypeID		string
}

// func (c *Auth2Controller) RemoveAuthBind() {
// 	c.callRemoveAuthBind(func(params *tAuth2RemoveAuthBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callRemoveAuthBind(handler func(params *tAuth2RemoveAuthBindParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2RemoveAuthBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AuthType = utils.TrimBlankChar(c.GetString("authType"))
	params.AuthTypeID = utils.TrimBlankChar(c.GetString("authTypeID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("authType") == "" {
		errParams = append(errParams, "authType")
	}
	params.MapData["authType"] = params.AuthType
	if utils.TrimBlankChar(c.GetString("authTypeID")) != "" {
		params.MapData["authTypeID"] = params.AuthTypeID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.RemoveAuthBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.RemoveAuthBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.RemoveAuthBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2AddUsers4RoleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RoleName		string
	StoreID		int
	UserIDs		string
}

// func (c *User2Controller) AddUsers4Role() {
// 	c.callAddUsers4Role(func(params *tUser2AddUsers4RoleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callAddUsers4Role(handler func(params *tUser2AddUsers4RoleParams) (interface{}, string, error)) {
	var err error
	params := &tUser2AddUsers4RoleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.RoleName = utils.TrimBlankChar(c.GetString("roleName"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.UserIDs = utils.TrimBlankChar(c.GetString("userIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("roleName") == "" {
		errParams = append(errParams, "roleName")
	}
	params.MapData["roleName"] = params.RoleName
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if c.GetString("userIDs") == "" {
		errParams = append(errParams, "userIDs")
	}
	params.MapData["userIDs"] = params.UserIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.AddUsers4Role, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.AddUsers4Role, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.AddUsers4Role error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSeparateAmtParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	VendorOrderId		string
}

// func (c *LaKaLaController) SeparateAmt() {
// 	c.callSeparateAmt(func(params *tLakalaSeparateAmtParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSeparateAmt(handler func(params *tLakalaSeparateAmtParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSeparateAmtParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	params.VendorOrderId = utils.TrimBlankChar(c.GetString("vendorOrderId"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("vendorOrderId") == "" {
		errParams = append(errParams, "vendorOrderId")
	}
	params.MapData["vendorOrderId"] = params.VendorOrderId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SeparateAmt, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SeparateAmt, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SeparateAmt error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetServiceInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *CmsController) GetServiceInfo() {
// 	c.callGetServiceInfo(func(params *tCmsGetServiceInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetServiceInfo(handler func(params *tCmsGetServiceInfoParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetServiceInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetServiceInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetServiceInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetServiceInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2UpdateUserByMiniInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Data		string
	Iv		string
	JsCode		string
}

// func (c *Auth2Controller) UpdateUserByMiniInfo() {
// 	c.callUpdateUserByMiniInfo(func(params *tAuth2UpdateUserByMiniInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callUpdateUserByMiniInfo(handler func(params *tAuth2UpdateUserByMiniInfoParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2UpdateUserByMiniInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Data = utils.TrimBlankChar(c.GetString("data"))
	params.Iv = utils.TrimBlankChar(c.GetString("iv"))
	params.JsCode = utils.TrimBlankChar(c.GetString("jsCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("data") == "" {
		errParams = append(errParams, "data")
	}
	params.MapData["data"] = params.Data
	if c.GetString("iv") == "" {
		errParams = append(errParams, "iv")
	}
	params.MapData["iv"] = params.Iv
	if utils.TrimBlankChar(c.GetString("jsCode")) != "" {
		params.MapData["jsCode"] = params.JsCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.UpdateUserByMiniInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.UpdateUserByMiniInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.UpdateUserByMiniInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2SaveMyCartParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	Payload		string
}

// func (c *User2Controller) SaveMyCart() {
// 	c.callSaveMyCart(func(params *tUser2SaveMyCartParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callSaveMyCart(handler func(params *tUser2SaveMyCartParams) (interface{}, string, error)) {
	var err error
	params := &tUser2SaveMyCartParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("payload")) != "" {
		params.MapData["payload"] = params.Payload
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.SaveMyCart, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.SaveMyCart, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.SaveMyCart error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindDeleteSignDataParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	StoreID		string
	Token		string
}

// func (c *BiddingController) DeleteSignData() {
// 	c.callDeleteSignData(func(params *tBindDeleteSignDataParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callDeleteSignData(handler func(params *tBindDeleteSignDataParams) (interface{}, string, error)) {
	var err error
	params := &tBindDeleteSignDataParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.StoreID = utils.TrimBlankChar(c.GetString("storeID"))
	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.DeleteSignData, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.DeleteSignData, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.DeleteSignData error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaGetMerchantTerminalParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AgentNo		string
	OrgCode		string
	CustomerNo		string
	PosSn		string
}

// func (c *LaKaLaController) GetMerchantTerminal() {
// 	c.callGetMerchantTerminal(func(params *tLakalaGetMerchantTerminalParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callGetMerchantTerminal(handler func(params *tLakalaGetMerchantTerminalParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaGetMerchantTerminalParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AgentNo = utils.TrimBlankChar(c.GetString("agentNo"))
	params.OrgCode = utils.TrimBlankChar(c.GetString("orgCode"))
	params.CustomerNo = utils.TrimBlankChar(c.GetString("customerNo"))
	params.PosSn = utils.TrimBlankChar(c.GetString("posSn"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("agentNo") == "" {
		errParams = append(errParams, "agentNo")
	}
	params.MapData["agentNo"] = params.AgentNo
	if c.GetString("orgCode") == "" {
		errParams = append(errParams, "orgCode")
	}
	params.MapData["orgCode"] = params.OrgCode
	if c.GetString("customerNo") == "" {
		errParams = append(errParams, "customerNo")
	}
	params.MapData["customerNo"] = params.CustomerNo
	if c.GetString("posSn") == "" {
		errParams = append(errParams, "posSn")
	}
	params.MapData["posSn"] = params.PosSn
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.GetMerchantTerminal, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.GetMerchantTerminal, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.GetMerchantTerminal error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSeparateModifyParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *LaKaLaController) SeparateModify() {
// 	c.callSeparateModify(func(params *tLakalaSeparateModifyParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSeparateModify(handler func(params *tLakalaSeparateModifyParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSeparateModifyParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SeparateModify, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SeparateModify, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SeparateModify error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetVendorCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	ParentID		string
}

// func (c *SkuController) GetVendorCategories() {
// 	c.callGetVendorCategories(func(params *tSkuGetVendorCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetVendorCategories(handler func(params *tSkuGetVendorCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetVendorCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.ParentID = utils.TrimBlankChar(c.GetString("parentID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("parentID")) != "" {
		params.MapData["parentID"] = params.ParentID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetVendorCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetVendorCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetVendorCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreAddBrandParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *StoreController) AddBrand() {
// 	c.callAddBrand(func(params *tStoreAddBrandParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callAddBrand(handler func(params *tStoreAddBrandParams) (interface{}, string, error)) {
	var err error
	params := &tStoreAddBrandParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.AddBrand, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.AddBrand, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.AddBrand error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2SendVerifyCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	CaptchaID		string
	CaptchaValue		string
	AuthToken		string
	AuthID		string
}

// func (c *Auth2Controller) SendVerifyCode() {
// 	c.callSendVerifyCode(func(params *tAuth2SendVerifyCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callSendVerifyCode(handler func(params *tAuth2SendVerifyCodeParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2SendVerifyCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.CaptchaID = utils.TrimBlankChar(c.GetString("captchaID"))
	params.CaptchaValue = utils.TrimBlankChar(c.GetString("captchaValue"))
	params.AuthToken = utils.TrimBlankChar(c.GetString("authToken"))
	params.AuthID = utils.TrimBlankChar(c.GetString("authID"))
	if utils.TrimBlankChar(c.GetString("captchaID")) != "" {
		params.MapData["captchaID"] = params.CaptchaID
	}
	if utils.TrimBlankChar(c.GetString("captchaValue")) != "" {
		params.MapData["captchaValue"] = params.CaptchaValue
	}
	if utils.TrimBlankChar(c.GetString("authToken")) != "" {
		params.MapData["authToken"] = params.AuthToken
	}
	if c.GetString("authID") == "" {
		errParams = append(errParams, "authID")
	}
	params.MapData["authID"] = params.AuthID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.SendVerifyCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.SendVerifyCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.SendVerifyCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryBillBalanceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	OrgNo		string
	PayType		string
}

// func (c *LaKaLaController) QueryBillBalance() {
// 	c.callQueryBillBalance(func(params *tLakalaQueryBillBalanceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryBillBalance(handler func(params *tLakalaQueryBillBalanceParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryBillBalanceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.OrgNo = utils.TrimBlankChar(c.GetString("orgNo"))
	params.PayType = utils.TrimBlankChar(c.GetString("payType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("orgNo") == "" {
		errParams = append(errParams, "orgNo")
	}
	params.MapData["orgNo"] = params.OrgNo
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryBillBalance, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryBillBalance, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryBillBalance error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateTiktokCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
}

// func (c *SkuController) UpdateTiktokCategory() {
// 	c.callUpdateTiktokCategory(func(params *tSkuUpdateTiktokCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateTiktokCategory(handler func(params *tSkuUpdateTiktokCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateTiktokCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateTiktokCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateTiktokCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateTiktokCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreTotalScoreListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	CityCode		int
	Keyword		string
	BeginTime		string
	EndTime		string
	IsDesc		bool
	CheckScoreLow		int
	CheckScoreHigh		int
	Offset		int
	PageSize		int
}

// func (c *StoreController) GetStoreTotalScoreList() {
// 	c.callGetStoreTotalScoreList(func(params *tStoreGetStoreTotalScoreListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreTotalScoreList(handler func(params *tStoreGetStoreTotalScoreListParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreTotalScoreListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.BeginTime = utils.TrimBlankChar(c.GetString("beginTime"))
	params.EndTime = utils.TrimBlankChar(c.GetString("endTime"))
	if params.IsDesc, err = c.GetBool("isDesc", false); err != nil {
		errParams = append(errParams, "isDesc")
	}
	if params.CheckScoreLow, err = c.GetInt("checkScoreLow", 0); err != nil {
		errParams = append(errParams, "checkScoreLow")
	}
	if params.CheckScoreHigh, err = c.GetInt("checkScoreHigh", 0); err != nil {
		errParams = append(errParams, "checkScoreHigh")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if c.GetString("beginTime") == "" {
		errParams = append(errParams, "beginTime")
	}
	params.MapData["beginTime"] = params.BeginTime
	if c.GetString("endTime") == "" {
		errParams = append(errParams, "endTime")
	}
	params.MapData["endTime"] = params.EndTime
	if c.GetString("isDesc") == "" {
		errParams = append(errParams, "isDesc")
	}
	params.MapData["isDesc"] = params.IsDesc
	if utils.TrimBlankChar(c.GetString("checkScoreLow")) != "" {
		params.MapData["checkScoreLow"] = params.CheckScoreLow
	}
	if utils.TrimBlankChar(c.GetString("checkScoreHigh")) != "" {
		params.MapData["checkScoreHigh"] = params.CheckScoreHigh
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreTotalScoreList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreTotalScoreList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreTotalScoreList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tKnowAddKnowledgeDepotParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Title		string
	Content		string
}

// func (c *KnowController) AddKnowledgeDepot() {
// 	c.callAddKnowledgeDepot(func(params *tKnowAddKnowledgeDepotParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *KnowController) callAddKnowledgeDepot(handler func(params *tKnowAddKnowledgeDepotParams) (interface{}, string, error)) {
	var err error
	params := &tKnowAddKnowledgeDepotParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Title = utils.TrimBlankChar(c.GetString("title"))
	params.Content = utils.TrimBlankChar(c.GetString("content"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("title")) != "" {
		params.MapData["title"] = params.Title
	}
	if utils.TrimBlankChar(c.GetString("content")) != "" {
		params.MapData["content"] = params.Content
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API KnowController.AddKnowledgeDepot, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API KnowController.AddKnowledgeDepot, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API KnowController.AddKnowledgeDepot error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreReorderBrandCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryID		int
	BrandID		int
	CategoryIDs		string
}

// func (c *StoreController) ReorderBrandCategories() {
// 	c.callReorderBrandCategories(func(params *tStoreReorderBrandCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callReorderBrandCategories(handler func(params *tStoreReorderBrandCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tStoreReorderBrandCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categoryID") == "" {
		errParams = append(errParams, "categoryID")
	}
	params.MapData["categoryID"] = params.CategoryID
	if c.GetString("brandID") == "" {
		errParams = append(errParams, "brandID")
	}
	params.MapData["brandID"] = params.BrandID
	if c.GetString("categoryIDs") == "" {
		errParams = append(errParams, "categoryIDs")
	}
	params.MapData["categoryIDs"] = params.CategoryIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.ReorderBrandCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.ReorderBrandCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.ReorderBrandCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsUpdatePlaceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Code		int
	Enabled		bool
	Name		string
	MtpsPrice		int
}

// func (c *CmsController) UpdatePlace() {
// 	c.callUpdatePlace(func(params *tCmsUpdatePlaceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callUpdatePlace(handler func(params *tCmsUpdatePlaceParams) (interface{}, string, error)) {
	var err error
	params := &tCmsUpdatePlaceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Code, err = c.GetInt("code", 0); err != nil {
		errParams = append(errParams, "code")
	}
	if params.Enabled, err = c.GetBool("enabled", false); err != nil {
		errParams = append(errParams, "enabled")
	}
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.MtpsPrice, err = c.GetInt("mtpsPrice", 0); err != nil {
		errParams = append(errParams, "mtpsPrice")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("code") == "" {
		errParams = append(errParams, "code")
	}
	params.MapData["code"] = params.Code
	if c.GetString("enabled") == "" {
		errParams = append(errParams, "enabled")
	}
	params.MapData["enabled"] = params.Enabled
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("mtpsPrice")) != "" {
		params.MapData["mtpsPrice"] = params.MtpsPrice
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.UpdatePlace, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.UpdatePlace, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.UpdatePlace error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetVendorOrgCodeInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *CmsController) GetVendorOrgCodeInfo() {
// 	c.callGetVendorOrgCodeInfo(func(params *tCmsGetVendorOrgCodeInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetVendorOrgCodeInfo(handler func(params *tCmsGetVendorOrgCodeInfoParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetVendorOrgCodeInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetVendorOrgCodeInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetVendorOrgCodeInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetVendorOrgCodeInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActPreCreateActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
	Type		int
	VendorIDs		string
	BeginAt		string
	EndAt		string
	PricePercentage		int
	Advertising		string
	ActStoreSkuList		string
	OverlapRule		int
	LimitDaily		int
	LimitUser		int
	LimitCount		int
	Remark		string
}

// func (c *ActController) PreCreateAct() {
// 	c.callPreCreateAct(func(params *tActPreCreateActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callPreCreateAct(handler func(params *tActPreCreateActParams) (interface{}, string, error)) {
	var err error
	params := &tActPreCreateActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.Type, err = c.GetInt("type", 0); err != nil {
		errParams = append(errParams, "type")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.BeginAt = utils.TrimBlankChar(c.GetString("beginAt"))
	params.EndAt = utils.TrimBlankChar(c.GetString("endAt"))
	if params.PricePercentage, err = c.GetInt("pricePercentage", 0); err != nil {
		errParams = append(errParams, "pricePercentage")
	}
	params.Advertising = utils.TrimBlankChar(c.GetString("advertising"))
	params.ActStoreSkuList = utils.TrimBlankChar(c.GetString("actStoreSkuList"))
	if params.OverlapRule, err = c.GetInt("overlapRule", 0); err != nil {
		errParams = append(errParams, "overlapRule")
	}
	if params.LimitDaily, err = c.GetInt("limitDaily", 0); err != nil {
		errParams = append(errParams, "limitDaily")
	}
	if params.LimitUser, err = c.GetInt("limitUser", 0); err != nil {
		errParams = append(errParams, "limitUser")
	}
	if params.LimitCount, err = c.GetInt("limitCount", 0); err != nil {
		errParams = append(errParams, "limitCount")
	}
	params.Remark = utils.TrimBlankChar(c.GetString("remark"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("name") == "" {
		errParams = append(errParams, "name")
	}
	params.MapData["name"] = params.Name
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("beginAt") == "" {
		errParams = append(errParams, "beginAt")
	}
	params.MapData["beginAt"] = params.BeginAt
	if c.GetString("endAt") == "" {
		errParams = append(errParams, "endAt")
	}
	params.MapData["endAt"] = params.EndAt
	if c.GetString("pricePercentage") == "" {
		errParams = append(errParams, "pricePercentage")
	}
	params.MapData["pricePercentage"] = params.PricePercentage
	if c.GetString("advertising") == "" {
		errParams = append(errParams, "advertising")
	}
	params.MapData["advertising"] = params.Advertising
	if c.GetString("actStoreSkuList") == "" {
		errParams = append(errParams, "actStoreSkuList")
	}
	params.MapData["actStoreSkuList"] = params.ActStoreSkuList
	if utils.TrimBlankChar(c.GetString("overlapRule")) != "" {
		params.MapData["overlapRule"] = params.OverlapRule
	}
	if utils.TrimBlankChar(c.GetString("limitDaily")) != "" {
		params.MapData["limitDaily"] = params.LimitDaily
	}
	if utils.TrimBlankChar(c.GetString("limitUser")) != "" {
		params.MapData["limitUser"] = params.LimitUser
	}
	if utils.TrimBlankChar(c.GetString("limitCount")) != "" {
		params.MapData["limitCount"] = params.LimitCount
	}
	if utils.TrimBlankChar(c.GetString("remark")) != "" {
		params.MapData["remark"] = params.Remark
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.PreCreateAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.PreCreateAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.PreCreateAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaUploadImgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	File		string
	ImgType		string
	Sourcechnl		string
}

// func (c *LaKaLaController) UploadImg() {
// 	c.callUploadImg(func(params *tLakalaUploadImgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callUploadImg(handler func(params *tLakalaUploadImgParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaUploadImgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.File = utils.TrimBlankChar(c.GetString("file"))
	params.ImgType = utils.TrimBlankChar(c.GetString("imgType"))
	params.Sourcechnl = utils.TrimBlankChar(c.GetString("sourcechnl"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("file") == "" {
		errParams = append(errParams, "file")
	}
	params.MapData["file"] = params.File
	if c.GetString("imgType") == "" {
		errParams = append(errParams, "imgType")
	}
	params.MapData["imgType"] = params.ImgType
	if c.GetString("sourcechnl") == "" {
		errParams = append(errParams, "sourcechnl")
	}
	params.MapData["sourcechnl"] = params.Sourcechnl
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.UploadImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.UploadImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.UploadImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuInsertSensitiveWordParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Word		string
	VendorID		int
}

// func (c *SkuController) InsertSensitiveWord() {
// 	c.callInsertSensitiveWord(func(params *tSkuInsertSensitiveWordParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callInsertSensitiveWord(handler func(params *tSkuInsertSensitiveWordParams) (interface{}, string, error)) {
	var err error
	params := &tSkuInsertSensitiveWordParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Word = utils.TrimBlankChar(c.GetString("word"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("word") == "" {
		errParams = append(errParams, "word")
	}
	params.MapData["word"] = params.Word
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.InsertSensitiveWord, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.InsertSensitiveWord, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.InsertSensitiveWord error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuSyncSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameID		int
	SkuID		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SkuController) SyncSku() {
// 	c.callSyncSku(func(params *tSkuSyncSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callSyncSku(handler func(params *tSkuSyncSkuParams) (interface{}, string, error)) {
	var err error
	params := &tSkuSyncSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.NameID, err = c.GetInt("nameID", 0); err != nil {
		errParams = append(errParams, "nameID")
	}
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("nameID") == "" {
		errParams = append(errParams, "nameID")
	}
	params.MapData["nameID"] = params.NameID
	if c.GetString("skuID") == "" {
		errParams = append(errParams, "skuID")
	}
	params.MapData["skuID"] = params.SkuID
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.SyncSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.SyncSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.SyncSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreDeleteStoreVendorMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
}

// func (c *StoreController) DeleteStoreVendorMap() {
// 	c.callDeleteStoreVendorMap(func(params *tStoreDeleteStoreVendorMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callDeleteStoreVendorMap(handler func(params *tStoreDeleteStoreVendorMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreDeleteStoreVendorMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.DeleteStoreVendorMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.DeleteStoreVendorMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.DeleteStoreVendorMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetHomePageByLocationParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Lng		float64
	Lat		float64
	NeedWalkDistance		bool
	BrandID		string
}

// func (c *StoreController) GetHomePageByLocation() {
// 	c.callGetHomePageByLocation(func(params *tStoreGetHomePageByLocationParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetHomePageByLocation(handler func(params *tStoreGetHomePageByLocationParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetHomePageByLocationParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if params.Lng, err = c.GetFloat("lng", 0); err != nil {
		errParams = append(errParams, "lng")
	}
	if params.Lat, err = c.GetFloat("lat", 0); err != nil {
		errParams = append(errParams, "lat")
	}
	if params.NeedWalkDistance, err = c.GetBool("needWalkDistance", false); err != nil {
		errParams = append(errParams, "needWalkDistance")
	}
	params.BrandID = utils.TrimBlankChar(c.GetString("brandID"))
	if c.GetString("lng") == "" {
		errParams = append(errParams, "lng")
	}
	params.MapData["lng"] = params.Lng
	if c.GetString("lat") == "" {
		errParams = append(errParams, "lat")
	}
	params.MapData["lat"] = params.Lat
	if utils.TrimBlankChar(c.GetString("needWalkDistance")) != "" {
		params.MapData["needWalkDistance"] = params.NeedWalkDistance
	}
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetHomePageByLocation, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetHomePageByLocation, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetHomePageByLocation error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerUpdateRoleMenuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RoleIDs		string
	MenuIDs		string
}

// func (c *PowerController) UpdateRoleMenu() {
// 	c.callUpdateRoleMenu(func(params *tPowerUpdateRoleMenuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callUpdateRoleMenu(handler func(params *tPowerUpdateRoleMenuParams) (interface{}, string, error)) {
	var err error
	params := &tPowerUpdateRoleMenuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.RoleIDs = utils.TrimBlankChar(c.GetString("roleIDs"))
	params.MenuIDs = utils.TrimBlankChar(c.GetString("menuIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("roleIDs") == "" {
		errParams = append(errParams, "roleIDs")
	}
	params.MapData["roleIDs"] = params.RoleIDs
	if c.GetString("menuIDs") == "" {
		errParams = append(errParams, "menuIDs")
	}
	params.MapData["menuIDs"] = params.MenuIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.UpdateRoleMenu, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.UpdateRoleMenu, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.UpdateRoleMenu error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaCreateSeparateParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *LaKaLaController) CreateSeparate() {
// 	c.callCreateSeparate(func(params *tLakalaCreateSeparateParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callCreateSeparate(handler func(params *tLakalaCreateSeparateParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaCreateSeparateParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.CreateSeparate, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.CreateSeparate, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.CreateSeparate error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderGetMyAfsOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	AfsOrderID		string
	UserID		string
	FromTime		string
	ToTime		string
	Offset		int
	PageSize		int
}

// func (c *JxOrderController) GetMyAfsOrders() {
// 	c.callGetMyAfsOrders(func(params *tJxorderGetMyAfsOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callGetMyAfsOrders(handler func(params *tJxorderGetMyAfsOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderGetMyAfsOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.AfsOrderID = utils.TrimBlankChar(c.GetString("afsOrderID"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("afsOrderID")) != "" {
		params.MapData["afsOrderID"] = params.AfsOrderID
	}
	if utils.TrimBlankChar(c.GetString("userID")) != "" {
		params.MapData["userID"] = params.UserID
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.GetMyAfsOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.GetMyAfsOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.GetMyAfsOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetDDScopeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorStoreID		string
}

// func (c *StoreController) GetDDScope() {
// 	c.callGetDDScope(func(params *tStoreGetDDScopeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetDDScope(handler func(params *tStoreGetDDScopeParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetDDScopeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetDDScope, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetDDScope, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetDDScope error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetSToURidingDistance2Params struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SLng		int
	SLat		int
	ULng		int
	ULat		int
	OrderId		string
}

// func (c *CmsController) GetSToURidingDistance2() {
// 	c.callGetSToURidingDistance2(func(params *tCmsGetSToURidingDistance2Params) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetSToURidingDistance2(handler func(params *tCmsGetSToURidingDistance2Params) (interface{}, string, error)) {
	var err error
	params := &tCmsGetSToURidingDistance2Params{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.SLng, err = c.GetInt("sLng", 0); err != nil {
		errParams = append(errParams, "sLng")
	}
	if params.SLat, err = c.GetInt("sLat", 0); err != nil {
		errParams = append(errParams, "sLat")
	}
	if params.ULng, err = c.GetInt("uLng", 0); err != nil {
		errParams = append(errParams, "uLng")
	}
	if params.ULat, err = c.GetInt("uLat", 0); err != nil {
		errParams = append(errParams, "uLat")
	}
	params.OrderId = utils.TrimBlankChar(c.GetString("orderId"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("sLng") == "" {
		errParams = append(errParams, "sLng")
	}
	params.MapData["sLng"] = params.SLng
	if c.GetString("sLat") == "" {
		errParams = append(errParams, "sLat")
	}
	params.MapData["sLat"] = params.SLat
	if c.GetString("uLng") == "" {
		errParams = append(errParams, "uLng")
	}
	params.MapData["uLng"] = params.ULng
	if c.GetString("uLat") == "" {
		errParams = append(errParams, "uLat")
	}
	params.MapData["uLat"] = params.ULat
	if c.GetString("orderId") == "" {
		errParams = append(errParams, "orderId")
	}
	params.MapData["orderId"] = params.OrderId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetSToURidingDistance2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetSToURidingDistance2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetSToURidingDistance2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetProductInfoByBarCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BarCode		string
}

// func (c *CmsController) GetProductInfoByBarCode() {
// 	c.callGetProductInfoByBarCode(func(params *tCmsGetProductInfoByBarCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetProductInfoByBarCode(handler func(params *tCmsGetProductInfoByBarCodeParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetProductInfoByBarCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.BarCode = utils.TrimBlankChar(c.GetString("barCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("barCode") == "" {
		errParams = append(errParams, "barCode")
	}
	params.MapData["barCode"] = params.BarCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetProductInfoByBarCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetProductInfoByBarCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetProductInfoByBarCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2DeleteMyDeliveryAddressParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Id		int
}

// func (c *User2Controller) DeleteMyDeliveryAddress() {
// 	c.callDeleteMyDeliveryAddress(func(params *tUser2DeleteMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callDeleteMyDeliveryAddress(handler func(params *tUser2DeleteMyDeliveryAddressParams) (interface{}, string, error)) {
	var err error
	params := &tUser2DeleteMyDeliveryAddressParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Id, err = c.GetInt("id", 0); err != nil {
		errParams = append(errParams, "id")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("id") == "" {
		errParams = append(errParams, "id")
	}
	params.MapData["id"] = params.Id
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.DeleteMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.DeleteMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.DeleteMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tInitdataInitPlaceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *InitDataController) InitPlace() {
// 	c.callInitPlace(func(params *tInitdataInitPlaceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *InitDataController) callInitPlace(handler func(params *tInitdataInitPlaceParams) (interface{}, string, error)) {
	var err error
	params := &tInitdataInitPlaceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API InitDataController.InitPlace, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API InitDataController.InitPlace, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API InitDataController.InitPlace error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2GetUserByMiniInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Data		string
	Iv		string
	JsCode		string
	AuthType		string
	AppID		string
}

// func (c *Auth2Controller) GetUserByMiniInfo() {
// 	c.callGetUserByMiniInfo(func(params *tAuth2GetUserByMiniInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callGetUserByMiniInfo(handler func(params *tAuth2GetUserByMiniInfoParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2GetUserByMiniInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Data = utils.TrimBlankChar(c.GetString("data"))
	params.Iv = utils.TrimBlankChar(c.GetString("iv"))
	params.JsCode = utils.TrimBlankChar(c.GetString("jsCode"))
	params.AuthType = utils.TrimBlankChar(c.GetString("authType"))
	params.AppID = utils.TrimBlankChar(c.GetString("appID"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("data") == "" {
		errParams = append(errParams, "data")
	}
	params.MapData["data"] = params.Data
	if c.GetString("iv") == "" {
		errParams = append(errParams, "iv")
	}
	params.MapData["iv"] = params.Iv
	if utils.TrimBlankChar(c.GetString("jsCode")) != "" {
		params.MapData["jsCode"] = params.JsCode
	}
	if utils.TrimBlankChar(c.GetString("authType")) != "" {
		params.MapData["authType"] = params.AuthType
	}
	if utils.TrimBlankChar(c.GetString("appID")) != "" {
		params.MapData["appID"] = params.AppID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.GetUserByMiniInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.GetUserByMiniInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.GetUserByMiniInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActQueryActsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CreatedAtFrom		string
	CreatedAtTo		string
	Keyword		string
	ActID		int
	Name		string
	CityCode		int
	BeginAt		string
	EndAt		string
	VendorID		int
	TypeList		string
	StatusList		string
	CreateTypeList		string
	StoreID		int
	SkuID		int
	SyncStatus		int
	Offset		int
	PageSize		int
}

// func (c *ActController) QueryActs() {
// 	c.callQueryActs(func(params *tActQueryActsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callQueryActs(handler func(params *tActQueryActsParams) (interface{}, string, error)) {
	var err error
	params := &tActQueryActsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CreatedAtFrom = utils.TrimBlankChar(c.GetString("createdAtFrom"))
	params.CreatedAtTo = utils.TrimBlankChar(c.GetString("createdAtTo"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.ActID, err = c.GetInt("actID", 0); err != nil {
		errParams = append(errParams, "actID")
	}
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	params.BeginAt = utils.TrimBlankChar(c.GetString("beginAt"))
	params.EndAt = utils.TrimBlankChar(c.GetString("endAt"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.TypeList = utils.TrimBlankChar(c.GetString("typeList"))
	params.StatusList = utils.TrimBlankChar(c.GetString("statusList"))
	params.CreateTypeList = utils.TrimBlankChar(c.GetString("createTypeList"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	if params.SyncStatus, err = c.GetInt("syncStatus", 0); err != nil {
		errParams = append(errParams, "syncStatus")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("createdAtFrom")) != "" {
		params.MapData["createdAtFrom"] = params.CreatedAtFrom
	}
	if utils.TrimBlankChar(c.GetString("createdAtTo")) != "" {
		params.MapData["createdAtTo"] = params.CreatedAtTo
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("actID")) != "" {
		params.MapData["actID"] = params.ActID
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("beginAt")) != "" {
		params.MapData["beginAt"] = params.BeginAt
	}
	if utils.TrimBlankChar(c.GetString("endAt")) != "" {
		params.MapData["endAt"] = params.EndAt
	}
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("typeList")) != "" {
		params.MapData["typeList"] = params.TypeList
	}
	if utils.TrimBlankChar(c.GetString("statusList")) != "" {
		params.MapData["statusList"] = params.StatusList
	}
	if utils.TrimBlankChar(c.GetString("createTypeList")) != "" {
		params.MapData["createTypeList"] = params.CreateTypeList
	}
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("skuID")) != "" {
		params.MapData["skuID"] = params.SkuID
	}
	if utils.TrimBlankChar(c.GetString("syncStatus")) != "" {
		params.MapData["syncStatus"] = params.SyncStatus
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.QueryActs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.QueryActs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.QueryActs error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindGetStoreBindStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PlatformId		string
	PlatformType		int
}

// func (c *BiddingController) GetStoreBindStatus() {
// 	c.callGetStoreBindStatus(func(params *tBindGetStoreBindStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callGetStoreBindStatus(handler func(params *tBindGetStoreBindStatusParams) (interface{}, string, error)) {
	var err error
	params := &tBindGetStoreBindStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PlatformId = utils.TrimBlankChar(c.GetString("platformId"))
	if params.PlatformType, err = c.GetInt("platformType", 0); err != nil {
		errParams = append(errParams, "platformType")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("platformId")) != "" {
		params.MapData["platformId"] = params.PlatformId
	}
	if utils.TrimBlankChar(c.GetString("platformType")) != "" {
		params.MapData["platformType"] = params.PlatformType
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.GetStoreBindStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.GetStoreBindStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.GetStoreBindStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindCreateSupermarketSignParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	SignObj		string
	Token		string
}

// func (c *BiddingController) CreateSupermarketSign() {
// 	c.callCreateSupermarketSign(func(params *tBindCreateSupermarketSignParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callCreateSupermarketSign(handler func(params *tBindCreateSupermarketSignParams) (interface{}, string, error)) {
	var err error
	params := &tBindCreateSupermarketSignParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.SignObj = utils.TrimBlankChar(c.GetString("signObj"))
	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if c.GetString("signObj") == "" {
		errParams = append(errParams, "signObj")
	}
	params.MapData["signObj"] = params.SignObj
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.CreateSupermarketSign, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.CreateSupermarketSign, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.CreateSupermarketSign error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaCheckIsUploadPhotoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CustomerNo		string
}

// func (c *LaKaLaController) CheckIsUploadPhoto() {
// 	c.callCheckIsUploadPhoto(func(params *tLakalaCheckIsUploadPhotoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callCheckIsUploadPhoto(handler func(params *tLakalaCheckIsUploadPhotoParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaCheckIsUploadPhotoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CustomerNo = utils.TrimBlankChar(c.GetString("customerNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("customerNo") == "" {
		errParams = append(errParams, "customerNo")
	}
	params.MapData["customerNo"] = params.CustomerNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.CheckIsUploadPhoto, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.CheckIsUploadPhoto, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.CheckIsUploadPhoto error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreStoreAuditParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	Status		int
}

// func (c *StoreController) StoreAudit() {
// 	c.callStoreAudit(func(params *tStoreStoreAuditParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callStoreAudit(handler func(params *tStoreStoreAuditParams) (interface{}, string, error)) {
	var err error
	params := &tStoreStoreAuditParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Status, err = c.GetInt("status", 0); err != nil {
		errParams = append(errParams, "status")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("status")) != "" {
		params.MapData["status"] = params.Status
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.StoreAudit, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.StoreAudit, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.StoreAudit error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetBrandSecretNumbersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandID		int
}

// func (c *StoreController) GetBrandSecretNumbers() {
// 	c.callGetBrandSecretNumbers(func(params *tStoreGetBrandSecretNumbersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetBrandSecretNumbers(handler func(params *tStoreGetBrandSecretNumbersParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetBrandSecretNumbersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("brandID") == "" {
		errParams = append(errParams, "brandID")
	}
	params.MapData["brandID"] = params.BrandID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetBrandSecretNumbers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetBrandSecretNumbers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetBrandSecretNumbers error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetCityBankBranchesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CityCode		int
	BankCode		string
}

// func (c *CmsController) GetCityBankBranches() {
// 	c.callGetCityBankBranches(func(params *tCmsGetCityBankBranchesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetCityBankBranches(handler func(params *tCmsGetCityBankBranchesParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetCityBankBranchesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	params.BankCode = utils.TrimBlankChar(c.GetString("bankCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("bankCode")) != "" {
		params.MapData["bankCode"] = params.BankCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetCityBankBranches, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetCityBankBranches, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetCityBankBranches error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tNetspiderQueryPageStoresParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Offset		int
	PageSize		int
	Keyword		string
	VendorStoreID		string
	VendorID		int
	CityCode		int
	DistrictCode		int
	Tel		string
	BrandName		string
	MinShopScore		float64
	MinRecentOrderNum		int
	MinSkuCount		int
	Radius		int
	Lng		string
	Lat		string
	Cat		string
}

// func (c *NetSpiderController) QueryPageStores() {
// 	c.callQueryPageStores(func(params *tNetspiderQueryPageStoresParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *NetSpiderController) callQueryPageStores(handler func(params *tNetspiderQueryPageStoresParams) (interface{}, string, error)) {
	var err error
	params := &tNetspiderQueryPageStoresParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	if params.DistrictCode, err = c.GetInt("districtCode", 0); err != nil {
		errParams = append(errParams, "districtCode")
	}
	params.Tel = utils.TrimBlankChar(c.GetString("tel"))
	params.BrandName = utils.TrimBlankChar(c.GetString("brandName"))
	if params.MinShopScore, err = c.GetFloat("minShopScore", 0); err != nil {
		errParams = append(errParams, "minShopScore")
	}
	if params.MinRecentOrderNum, err = c.GetInt("minRecentOrderNum", 0); err != nil {
		errParams = append(errParams, "minRecentOrderNum")
	}
	if params.MinSkuCount, err = c.GetInt("minSkuCount", 0); err != nil {
		errParams = append(errParams, "minSkuCount")
	}
	if params.Radius, err = c.GetInt("radius", 0); err != nil {
		errParams = append(errParams, "radius")
	}
	params.Lng = utils.TrimBlankChar(c.GetString("lng"))
	params.Lat = utils.TrimBlankChar(c.GetString("lat"))
	params.Cat = utils.TrimBlankChar(c.GetString("cat"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("vendorStoreID")) != "" {
		params.MapData["vendorStoreID"] = params.VendorStoreID
	}
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("districtCode")) != "" {
		params.MapData["districtCode"] = params.DistrictCode
	}
	if utils.TrimBlankChar(c.GetString("tel")) != "" {
		params.MapData["tel"] = params.Tel
	}
	if utils.TrimBlankChar(c.GetString("brandName")) != "" {
		params.MapData["brandName"] = params.BrandName
	}
	if utils.TrimBlankChar(c.GetString("minShopScore")) != "" {
		params.MapData["minShopScore"] = params.MinShopScore
	}
	if utils.TrimBlankChar(c.GetString("minRecentOrderNum")) != "" {
		params.MapData["minRecentOrderNum"] = params.MinRecentOrderNum
	}
	if utils.TrimBlankChar(c.GetString("minSkuCount")) != "" {
		params.MapData["minSkuCount"] = params.MinSkuCount
	}
	if utils.TrimBlankChar(c.GetString("radius")) != "" {
		params.MapData["radius"] = params.Radius
	}
	if utils.TrimBlankChar(c.GetString("lng")) != "" {
		params.MapData["lng"] = params.Lng
	}
	if utils.TrimBlankChar(c.GetString("lat")) != "" {
		params.MapData["lat"] = params.Lat
	}
	if utils.TrimBlankChar(c.GetString("cat")) != "" {
		params.MapData["cat"] = params.Cat
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API NetSpiderController.QueryPageStores, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API NetSpiderController.QueryPageStores, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API NetSpiderController.QueryPageStores error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tEventGetCheckVendorCookieParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
}

// func (c *EventController) GetCheckVendorCookie() {
// 	c.callGetCheckVendorCookie(func(params *tEventGetCheckVendorCookieParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *EventController) callGetCheckVendorCookie(handler func(params *tEventGetCheckVendorCookieParams) (interface{}, string, error)) {
	var err error
	params := &tEventGetCheckVendorCookieParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API EventController.GetCheckVendorCookie, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API EventController.GetCheckVendorCookie, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API EventController.GetCheckVendorCookie error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2DeletedTokenInfoWithoutParamParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *Auth2Controller) DeletedTokenInfoWithoutParam() {
// 	c.callDeletedTokenInfoWithoutParam(func(params *tAuth2DeletedTokenInfoWithoutParamParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callDeletedTokenInfoWithoutParam(handler func(params *tAuth2DeletedTokenInfoWithoutParamParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2DeletedTokenInfoWithoutParamParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.DeletedTokenInfoWithoutParam, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.DeletedTokenInfoWithoutParam, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.DeletedTokenInfoWithoutParam error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopCreateConsumerFromOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromDate		string
	VendorIDs		string
	ToDate		string
	IsForce		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *TempOpController) CreateConsumerFromOrders() {
// 	c.callCreateConsumerFromOrders(func(params *tTempopCreateConsumerFromOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callCreateConsumerFromOrders(handler func(params *tTempopCreateConsumerFromOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tTempopCreateConsumerFromOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("toDate")) != "" {
		params.MapData["toDate"] = params.ToDate
	}
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.CreateConsumerFromOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.CreateConsumerFromOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.CreateConsumerFromOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopPrintMsgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	Id1		string
	Id2		string
	MsgTitle		string
	MsgContent		string
}

// func (c *TempOpController) PrintMsg() {
// 	c.callPrintMsg(func(params *tTempopPrintMsgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callPrintMsg(handler func(params *tTempopPrintMsgParams) (interface{}, string, error)) {
	var err error
	params := &tTempopPrintMsgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Id1 = utils.TrimBlankChar(c.GetString("id1"))
	params.Id2 = utils.TrimBlankChar(c.GetString("id2"))
	params.MsgTitle = utils.TrimBlankChar(c.GetString("msgTitle"))
	params.MsgContent = utils.TrimBlankChar(c.GetString("msgContent"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("id1") == "" {
		errParams = append(errParams, "id1")
	}
	params.MapData["id1"] = params.Id1
	if utils.TrimBlankChar(c.GetString("id2")) != "" {
		params.MapData["id2"] = params.Id2
	}
	if utils.TrimBlankChar(c.GetString("msgTitle")) != "" {
		params.MapData["msgTitle"] = params.MsgTitle
	}
	if c.GetString("msgContent") == "" {
		errParams = append(errParams, "msgContent")
	}
	params.MapData["msgContent"] = params.MsgContent
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.PrintMsg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.PrintMsg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.PrintMsg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQuerySubMerInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerCupNo		string
	MerInnerNo		string
}

// func (c *LaKaLaController) QuerySubMerInfo() {
// 	c.callQuerySubMerInfo(func(params *tLakalaQuerySubMerInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQuerySubMerInfo(handler func(params *tLakalaQuerySubMerInfoParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQuerySubMerInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerCupNo = utils.TrimBlankChar(c.GetString("merCupNo"))
	params.MerInnerNo = utils.TrimBlankChar(c.GetString("merInnerNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("merCupNo")) != "" {
		params.MapData["merCupNo"] = params.MerCupNo
	}
	if utils.TrimBlankChar(c.GetString("merInnerNo")) != "" {
		params.MapData["merInnerNo"] = params.MerInnerNo
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QuerySubMerInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QuerySubMerInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QuerySubMerInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaEwalletSettleQueryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	OrgNo		string
}

// func (c *LaKaLaController) EwalletSettleQuery() {
// 	c.callEwalletSettleQuery(func(params *tLakalaEwalletSettleQueryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callEwalletSettleQuery(handler func(params *tLakalaEwalletSettleQueryParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaEwalletSettleQueryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.OrgNo = utils.TrimBlankChar(c.GetString("orgNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("orgNo") == "" {
		errParams = append(errParams, "orgNo")
	}
	params.MapData["orgNo"] = params.OrgNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.EwalletSettleQuery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.EwalletSettleQuery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.EwalletSettleQuery error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaGetMerchantParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
}

// func (c *LaKaLaController) GetMerchant() {
// 	c.callGetMerchant(func(params *tLakalaGetMerchantParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callGetMerchant(handler func(params *tLakalaGetMerchantParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaGetMerchantParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.GetMerchant, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.GetMerchant, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.GetMerchant error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateBrandCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ID		int
	CategoryID		int
	BrandCategroyName		string
	Level		int
	ParentID		int
	IsDelete		bool
}

// func (c *StoreController) UpdateBrandCategoryMap() {
// 	c.callUpdateBrandCategoryMap(func(params *tStoreUpdateBrandCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateBrandCategoryMap(handler func(params *tStoreUpdateBrandCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateBrandCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ID, err = c.GetInt("ID", 0); err != nil {
		errParams = append(errParams, "ID")
	}
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	params.BrandCategroyName = utils.TrimBlankChar(c.GetString("brandCategroyName"))
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if params.IsDelete, err = c.GetBool("isDelete", false); err != nil {
		errParams = append(errParams, "isDelete")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("ID") == "" {
		errParams = append(errParams, "ID")
	}
	params.MapData["ID"] = params.ID
	if utils.TrimBlankChar(c.GetString("categoryID")) != "" {
		params.MapData["categoryID"] = params.CategoryID
	}
	if utils.TrimBlankChar(c.GetString("brandCategroyName")) != "" {
		params.MapData["brandCategroyName"] = params.BrandCategroyName
	}
	if c.GetString("level") == "" {
		errParams = append(errParams, "level")
	}
	params.MapData["level"] = params.Level
	if c.GetString("parentID") == "" {
		errParams = append(errParams, "parentID")
	}
	params.MapData["parentID"] = params.ParentID
	if utils.TrimBlankChar(c.GetString("isDelete")) != "" {
		params.MapData["isDelete"] = params.IsDelete
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateBrandCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateBrandCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateBrandCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetStoreCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	ParentID		int
}

// func (c *StoreSkuController) GetStoreCategories() {
// 	c.callGetStoreCategories(func(params *tStoreSkuGetStoreCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetStoreCategories(handler func(params *tStoreSkuGetStoreCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetStoreCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("parentID")) != "" {
		params.MapData["parentID"] = params.ParentID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetStoreCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetStoreCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetStoreCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFoodrecipeDeleteRecipesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RecipeIDs		string
}

// func (c *FoodRecipeController) DeleteRecipes() {
// 	c.callDeleteRecipes(func(params *tFoodrecipeDeleteRecipesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FoodRecipeController) callDeleteRecipes(handler func(params *tFoodrecipeDeleteRecipesParams) (interface{}, string, error)) {
	var err error
	params := &tFoodrecipeDeleteRecipesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.RecipeIDs = utils.TrimBlankChar(c.GetString("recipeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("recipeIDs") == "" {
		errParams = append(errParams, "recipeIDs")
	}
	params.MapData["recipeIDs"] = params.RecipeIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FoodRecipeController.DeleteRecipes, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FoodRecipeController.DeleteRecipes, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FoodRecipeController.DeleteRecipes error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFoodrecipeCreateFoodRecipeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
	Description		string
	Img		string
	TimeInMinute		int
	RecipeItems		string
	RecipeSteps		string
	AuthorID		string
}

// func (c *FoodRecipeController) CreateFoodRecipe() {
// 	c.callCreateFoodRecipe(func(params *tFoodrecipeCreateFoodRecipeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FoodRecipeController) callCreateFoodRecipe(handler func(params *tFoodrecipeCreateFoodRecipeParams) (interface{}, string, error)) {
	var err error
	params := &tFoodrecipeCreateFoodRecipeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.Description = utils.TrimBlankChar(c.GetString("description"))
	params.Img = utils.TrimBlankChar(c.GetString("img"))
	if params.TimeInMinute, err = c.GetInt("timeInMinute", 0); err != nil {
		errParams = append(errParams, "timeInMinute")
	}
	params.RecipeItems = utils.TrimBlankChar(c.GetString("recipeItems"))
	params.RecipeSteps = utils.TrimBlankChar(c.GetString("recipeSteps"))
	params.AuthorID = utils.TrimBlankChar(c.GetString("authorID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("name") == "" {
		errParams = append(errParams, "name")
	}
	params.MapData["name"] = params.Name
	if c.GetString("description") == "" {
		errParams = append(errParams, "description")
	}
	params.MapData["description"] = params.Description
	if c.GetString("img") == "" {
		errParams = append(errParams, "img")
	}
	params.MapData["img"] = params.Img
	if c.GetString("timeInMinute") == "" {
		errParams = append(errParams, "timeInMinute")
	}
	params.MapData["timeInMinute"] = params.TimeInMinute
	if c.GetString("recipeItems") == "" {
		errParams = append(errParams, "recipeItems")
	}
	params.MapData["recipeItems"] = params.RecipeItems
	if c.GetString("recipeSteps") == "" {
		errParams = append(errParams, "recipeSteps")
	}
	params.MapData["recipeSteps"] = params.RecipeSteps
	if utils.TrimBlankChar(c.GetString("authorID")) != "" {
		params.MapData["authorID"] = params.AuthorID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FoodRecipeController.CreateFoodRecipe, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FoodRecipeController.CreateFoodRecipe, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FoodRecipeController.CreateFoodRecipe error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSeparateCancelParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	SeparateNo		string
}

// func (c *LaKaLaController) SeparateCancel() {
// 	c.callSeparateCancel(func(params *tLakalaSeparateCancelParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSeparateCancel(handler func(params *tLakalaSeparateCancelParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSeparateCancelParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.SeparateNo = utils.TrimBlankChar(c.GetString("separateNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("separateNo") == "" {
		errParams = append(errParams, "separateNo")
	}
	params.MapData["separateNo"] = params.SeparateNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SeparateCancel, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SeparateCancel, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SeparateCancel error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetSkuNamesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	NameIDs		string
	SkuIDs		string
	VendorSkuIDs		string
	Name		string
	Prefix		string
	PlaceCond		string
	PlaceCode		int
	IsGlobal		bool
	CategoryID		int
	SkuCategoryID		int
	Unit		string
	IsSpu		bool
	IsExd		bool
	FromStatus		int
	ToStatus		int
	Offset		int
	PageSize		int
	IsBySku		bool
	IsQueryMidPrice		bool
}

// func (c *SkuController) GetSkuNames() {
// 	c.callGetSkuNames(func(params *tSkuGetSkuNamesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetSkuNames(handler func(params *tSkuGetSkuNamesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetSkuNamesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	params.VendorSkuIDs = utils.TrimBlankChar(c.GetString("vendorSkuIDs"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.Prefix = utils.TrimBlankChar(c.GetString("prefix"))
	params.PlaceCond = utils.TrimBlankChar(c.GetString("placeCond"))
	if params.PlaceCode, err = c.GetInt("placeCode", 0); err != nil {
		errParams = append(errParams, "placeCode")
	}
	if params.IsGlobal, err = c.GetBool("isGlobal", false); err != nil {
		errParams = append(errParams, "isGlobal")
	}
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	if params.SkuCategoryID, err = c.GetInt("skuCategoryID", 0); err != nil {
		errParams = append(errParams, "skuCategoryID")
	}
	params.Unit = utils.TrimBlankChar(c.GetString("unit"))
	if params.IsSpu, err = c.GetBool("isSpu", false); err != nil {
		errParams = append(errParams, "isSpu")
	}
	if params.IsExd, err = c.GetBool("isExd", false); err != nil {
		errParams = append(errParams, "isExd")
	}
	if params.FromStatus, err = c.GetInt("fromStatus", 0); err != nil {
		errParams = append(errParams, "fromStatus")
	}
	if params.ToStatus, err = c.GetInt("toStatus", 0); err != nil {
		errParams = append(errParams, "toStatus")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.IsBySku, err = c.GetBool("isBySku", false); err != nil {
		errParams = append(errParams, "isBySku")
	}
	if params.IsQueryMidPrice, err = c.GetBool("isQueryMidPrice", false); err != nil {
		errParams = append(errParams, "isQueryMidPrice")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("nameIDs")) != "" {
		params.MapData["nameIDs"] = params.NameIDs
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorSkuIDs")) != "" {
		params.MapData["vendorSkuIDs"] = params.VendorSkuIDs
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("prefix")) != "" {
		params.MapData["prefix"] = params.Prefix
	}
	if utils.TrimBlankChar(c.GetString("placeCond")) != "" {
		params.MapData["placeCond"] = params.PlaceCond
	}
	if utils.TrimBlankChar(c.GetString("placeCode")) != "" {
		params.MapData["placeCode"] = params.PlaceCode
	}
	if utils.TrimBlankChar(c.GetString("isGlobal")) != "" {
		params.MapData["isGlobal"] = params.IsGlobal
	}
	if utils.TrimBlankChar(c.GetString("categoryID")) != "" {
		params.MapData["categoryID"] = params.CategoryID
	}
	if utils.TrimBlankChar(c.GetString("skuCategoryID")) != "" {
		params.MapData["skuCategoryID"] = params.SkuCategoryID
	}
	if utils.TrimBlankChar(c.GetString("unit")) != "" {
		params.MapData["unit"] = params.Unit
	}
	if utils.TrimBlankChar(c.GetString("isSpu")) != "" {
		params.MapData["isSpu"] = params.IsSpu
	}
	if utils.TrimBlankChar(c.GetString("isExd")) != "" {
		params.MapData["isExd"] = params.IsExd
	}
	if utils.TrimBlankChar(c.GetString("fromStatus")) != "" {
		params.MapData["fromStatus"] = params.FromStatus
	}
	if utils.TrimBlankChar(c.GetString("toStatus")) != "" {
		params.MapData["toStatus"] = params.ToStatus
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if utils.TrimBlankChar(c.GetString("isBySku")) != "" {
		params.MapData["isBySku"] = params.IsBySku
	}
	if utils.TrimBlankChar(c.GetString("isQueryMidPrice")) != "" {
		params.MapData["isQueryMidPrice"] = params.IsQueryMidPrice
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetSkuNames, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetSkuNames, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetSkuNames error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateFreeShipTemplatesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ShipFee		int
	Payload		string
}

// func (c *StoreController) CreateFreeShipTemplates() {
// 	c.callCreateFreeShipTemplates(func(params *tStoreCreateFreeShipTemplatesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateFreeShipTemplates(handler func(params *tStoreCreateFreeShipTemplatesParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateFreeShipTemplatesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ShipFee, err = c.GetInt("shipFee", 0); err != nil {
		errParams = append(errParams, "shipFee")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("shipFee") == "" {
		errParams = append(errParams, "shipFee")
	}
	params.MapData["shipFee"] = params.ShipFee
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateFreeShipTemplates, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateFreeShipTemplates, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateFreeShipTemplates error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreAlertListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	CityCode		int
	Keyword		string
	DateTime		string
	Offset		int
	PageSize		int
}

// func (c *StoreController) GetStoreAlertList() {
// 	c.callGetStoreAlertList(func(params *tStoreGetStoreAlertListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreAlertList(handler func(params *tStoreGetStoreAlertListParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreAlertListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.DateTime = utils.TrimBlankChar(c.GetString("dateTime"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if c.GetString("dateTime") == "" {
		errParams = append(errParams, "dateTime")
	}
	params.MapData["dateTime"] = params.DateTime
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreAlertList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreAlertList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreAlertList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetSkuNamesNewParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	NameIDs		string
	SkuIDs		string
	CategoryID		int
	Status		int
	IsBySku		bool
	BestSeller		int
	MinPrice		int
	MaxPrice		int
	Offset		int
	PageSize		int
}

// func (c *SkuController) GetSkuNamesNew() {
// 	c.callGetSkuNamesNew(func(params *tSkuGetSkuNamesNewParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetSkuNamesNew(handler func(params *tSkuGetSkuNamesNewParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetSkuNamesNewParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	if params.Status, err = c.GetInt("status", 0); err != nil {
		errParams = append(errParams, "status")
	}
	if params.IsBySku, err = c.GetBool("isBySku", false); err != nil {
		errParams = append(errParams, "isBySku")
	}
	if params.BestSeller, err = c.GetInt("bestSeller", 0); err != nil {
		errParams = append(errParams, "bestSeller")
	}
	if params.MinPrice, err = c.GetInt("minPrice", 0); err != nil {
		errParams = append(errParams, "minPrice")
	}
	if params.MaxPrice, err = c.GetInt("maxPrice", 0); err != nil {
		errParams = append(errParams, "maxPrice")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("nameIDs")) != "" {
		params.MapData["nameIDs"] = params.NameIDs
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("categoryID")) != "" {
		params.MapData["categoryID"] = params.CategoryID
	}
	if utils.TrimBlankChar(c.GetString("status")) != "" {
		params.MapData["status"] = params.Status
	}
	if utils.TrimBlankChar(c.GetString("isBySku")) != "" {
		params.MapData["isBySku"] = params.IsBySku
	}
	if utils.TrimBlankChar(c.GetString("bestSeller")) != "" {
		params.MapData["bestSeller"] = params.BestSeller
	}
	if utils.TrimBlankChar(c.GetString("minPrice")) != "" {
		params.MapData["minPrice"] = params.MinPrice
	}
	if utils.TrimBlankChar(c.GetString("maxPrice")) != "" {
		params.MapData["maxPrice"] = params.MaxPrice
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetSkuNamesNew, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetSkuNamesNew, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetSkuNamesNew error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateVendorSkuImgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ExPrefix		string
	FromDate		string
	ToDate		string
	ImgWaterMark		string
	VendorID		int
	StoreId		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SkuController) UpdateVendorSkuImg() {
// 	c.callUpdateVendorSkuImg(func(params *tSkuUpdateVendorSkuImgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateVendorSkuImg(handler func(params *tSkuUpdateVendorSkuImgParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateVendorSkuImgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.ExPrefix = utils.TrimBlankChar(c.GetString("exPrefix"))
	params.FromDate = utils.TrimBlankChar(c.GetString("fromDate"))
	params.ToDate = utils.TrimBlankChar(c.GetString("toDate"))
	params.ImgWaterMark = utils.TrimBlankChar(c.GetString("imgWaterMark"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("exPrefix")) != "" {
		params.MapData["exPrefix"] = params.ExPrefix
	}
	if c.GetString("fromDate") == "" {
		errParams = append(errParams, "fromDate")
	}
	params.MapData["fromDate"] = params.FromDate
	if c.GetString("toDate") == "" {
		errParams = append(errParams, "toDate")
	}
	params.MapData["toDate"] = params.ToDate
	if utils.TrimBlankChar(c.GetString("imgWaterMark")) != "" {
		params.MapData["imgWaterMark"] = params.ImgWaterMark
	}
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("storeId") == "" {
		errParams = append(errParams, "storeId")
	}
	params.MapData["storeId"] = params.StoreId
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateVendorSkuImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateVendorSkuImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateVendorSkuImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuSyncCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryID		int
	IsAsync		bool
}

// func (c *SkuController) SyncCategory() {
// 	c.callSyncCategory(func(params *tSkuSyncCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callSyncCategory(handler func(params *tSkuSyncCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tSkuSyncCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categoryID") == "" {
		errParams = append(errParams, "categoryID")
	}
	params.MapData["categoryID"] = params.CategoryID
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.SyncCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.SyncCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.SyncCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetOrderID4CommentParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	VendorID		int
	UserName		string
	AppOrgCode		string
	FromTime		string
	ToTime		string
}

// func (c *StoreController) GetOrderID4Comment() {
// 	c.callGetOrderID4Comment(func(params *tStoreGetOrderID4CommentParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetOrderID4Comment(handler func(params *tStoreGetOrderID4CommentParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetOrderID4CommentParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.UserName = utils.TrimBlankChar(c.GetString("userName"))
	params.AppOrgCode = utils.TrimBlankChar(c.GetString("appOrgCode"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if c.GetString("userName") == "" {
		errParams = append(errParams, "userName")
	}
	params.MapData["userName"] = params.UserName
	if c.GetString("appOrgCode") == "" {
		errParams = append(errParams, "appOrgCode")
	}
	params.MapData["appOrgCode"] = params.AppOrgCode
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetOrderID4Comment, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetOrderID4Comment, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetOrderID4Comment error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActDeleteSkusFromActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SkuIDs		string
	VendorID		int
	Types		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *ActController) DeleteSkusFromAct() {
// 	c.callDeleteSkusFromAct(func(params *tActDeleteSkusFromActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callDeleteSkusFromAct(handler func(params *tActDeleteSkusFromActParams) (interface{}, string, error)) {
	var err error
	params := &tActDeleteSkusFromActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Types = utils.TrimBlankChar(c.GetString("types"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("skuIDs") == "" {
		errParams = append(errParams, "skuIDs")
	}
	params.MapData["skuIDs"] = params.SkuIDs
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("types")) != "" {
		params.MapData["types"] = params.Types
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.DeleteSkusFromAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.DeleteSkusFromAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.DeleteSkusFromAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActCreateActParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
	Type		int
	VendorIDs		string
	VendorOrgCode		string
	BeginAt		string
	EndAt		string
	PricePercentage		int
	Advertising		string
	ActStoreSkuList		string
	OverlapRule		int
	DiscountType		int
	DiscountValue1		int
	DiscountValue2		int
	LimitDaily		int
	LimitUser		int
	LimitCount		int
	Remark		string
	IsAsync		bool
}

// func (c *ActController) CreateAct() {
// 	c.callCreateAct(func(params *tActCreateActParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callCreateAct(handler func(params *tActCreateActParams) (interface{}, string, error)) {
	var err error
	params := &tActCreateActParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.Type, err = c.GetInt("type", 0); err != nil {
		errParams = append(errParams, "type")
	}
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.BeginAt = utils.TrimBlankChar(c.GetString("beginAt"))
	params.EndAt = utils.TrimBlankChar(c.GetString("endAt"))
	if params.PricePercentage, err = c.GetInt("pricePercentage", 0); err != nil {
		errParams = append(errParams, "pricePercentage")
	}
	params.Advertising = utils.TrimBlankChar(c.GetString("advertising"))
	params.ActStoreSkuList = utils.TrimBlankChar(c.GetString("actStoreSkuList"))
	if params.OverlapRule, err = c.GetInt("overlapRule", 0); err != nil {
		errParams = append(errParams, "overlapRule")
	}
	if params.DiscountType, err = c.GetInt("discountType", 0); err != nil {
		errParams = append(errParams, "discountType")
	}
	if params.DiscountValue1, err = c.GetInt("discountValue1", 0); err != nil {
		errParams = append(errParams, "discountValue1")
	}
	if params.DiscountValue2, err = c.GetInt("discountValue2", 0); err != nil {
		errParams = append(errParams, "discountValue2")
	}
	if params.LimitDaily, err = c.GetInt("limitDaily", 0); err != nil {
		errParams = append(errParams, "limitDaily")
	}
	if params.LimitUser, err = c.GetInt("limitUser", 0); err != nil {
		errParams = append(errParams, "limitUser")
	}
	if params.LimitCount, err = c.GetInt("limitCount", 0); err != nil {
		errParams = append(errParams, "limitCount")
	}
	params.Remark = utils.TrimBlankChar(c.GetString("remark"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("name") == "" {
		errParams = append(errParams, "name")
	}
	params.MapData["name"] = params.Name
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if c.GetString("beginAt") == "" {
		errParams = append(errParams, "beginAt")
	}
	params.MapData["beginAt"] = params.BeginAt
	if c.GetString("endAt") == "" {
		errParams = append(errParams, "endAt")
	}
	params.MapData["endAt"] = params.EndAt
	if c.GetString("pricePercentage") == "" {
		errParams = append(errParams, "pricePercentage")
	}
	params.MapData["pricePercentage"] = params.PricePercentage
	if c.GetString("advertising") == "" {
		errParams = append(errParams, "advertising")
	}
	params.MapData["advertising"] = params.Advertising
	if c.GetString("actStoreSkuList") == "" {
		errParams = append(errParams, "actStoreSkuList")
	}
	params.MapData["actStoreSkuList"] = params.ActStoreSkuList
	if utils.TrimBlankChar(c.GetString("overlapRule")) != "" {
		params.MapData["overlapRule"] = params.OverlapRule
	}
	if utils.TrimBlankChar(c.GetString("discountType")) != "" {
		params.MapData["discountType"] = params.DiscountType
	}
	if utils.TrimBlankChar(c.GetString("discountValue1")) != "" {
		params.MapData["discountValue1"] = params.DiscountValue1
	}
	if utils.TrimBlankChar(c.GetString("discountValue2")) != "" {
		params.MapData["discountValue2"] = params.DiscountValue2
	}
	if utils.TrimBlankChar(c.GetString("limitDaily")) != "" {
		params.MapData["limitDaily"] = params.LimitDaily
	}
	if utils.TrimBlankChar(c.GetString("limitUser")) != "" {
		params.MapData["limitUser"] = params.LimitUser
	}
	if utils.TrimBlankChar(c.GetString("limitCount")) != "" {
		params.MapData["limitCount"] = params.LimitCount
	}
	if utils.TrimBlankChar(c.GetString("remark")) != "" {
		params.MapData["remark"] = params.Remark
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.CreateAct, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.CreateAct, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.CreateAct error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderStaleIndexInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
	BrandIds		string
	VendorIds		string
	StoreID		int
	OperatorNumber		string
	BrandOperator		string
}

// func (c *OrderController) StaleIndexInfo() {
// 	c.callStaleIndexInfo(func(params *tOrderStaleIndexInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callStaleIndexInfo(handler func(params *tOrderStaleIndexInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderStaleIndexInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.BrandIds = utils.TrimBlankChar(c.GetString("brandIds"))
	params.VendorIds = utils.TrimBlankChar(c.GetString("vendorIds"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.OperatorNumber = utils.TrimBlankChar(c.GetString("operatorNumber"))
	params.BrandOperator = utils.TrimBlankChar(c.GetString("brandOperator"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if utils.TrimBlankChar(c.GetString("brandIds")) != "" {
		params.MapData["brandIds"] = params.BrandIds
	}
	if utils.TrimBlankChar(c.GetString("vendorIds")) != "" {
		params.MapData["vendorIds"] = params.VendorIds
	}
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("operatorNumber")) != "" {
		params.MapData["operatorNumber"] = params.OperatorNumber
	}
	if utils.TrimBlankChar(c.GetString("brandOperator")) != "" {
		params.MapData["brandOperator"] = params.BrandOperator
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.StaleIndexInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.StaleIndexInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.StaleIndexInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderBathUpdateInvoiceSettingParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorId		string
	VendorStoreID		string
	Payload		string
}

// func (c *OrderController) BathUpdateInvoiceSetting() {
// 	c.callBathUpdateInvoiceSetting(func(params *tOrderBathUpdateInvoiceSettingParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callBathUpdateInvoiceSetting(handler func(params *tOrderBathUpdateInvoiceSettingParams) (interface{}, string, error)) {
	var err error
	params := &tOrderBathUpdateInvoiceSettingParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorId = utils.TrimBlankChar(c.GetString("vendorId"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorId") == "" {
		errParams = append(errParams, "vendorId")
	}
	params.MapData["vendorId"] = params.VendorId
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.BathUpdateInvoiceSetting, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.BathUpdateInvoiceSetting, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.BathUpdateInvoiceSetting error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuDeleteSkuNamePlaceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameID		int
	PlaceCode		int
}

// func (c *SkuController) DeleteSkuNamePlace() {
// 	c.callDeleteSkuNamePlace(func(params *tSkuDeleteSkuNamePlaceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callDeleteSkuNamePlace(handler func(params *tSkuDeleteSkuNamePlaceParams) (interface{}, string, error)) {
	var err error
	params := &tSkuDeleteSkuNamePlaceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.NameID, err = c.GetInt("nameID", 0); err != nil {
		errParams = append(errParams, "nameID")
	}
	if params.PlaceCode, err = c.GetInt("placeCode", 0); err != nil {
		errParams = append(errParams, "placeCode")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("nameID") == "" {
		errParams = append(errParams, "nameID")
	}
	params.MapData["nameID"] = params.NameID
	if c.GetString("placeCode") == "" {
		errParams = append(errParams, "placeCode")
	}
	params.MapData["placeCode"] = params.PlaceCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.DeleteSkuNamePlace, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.DeleteSkuNamePlace, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.DeleteSkuNamePlace error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuSyncStoresSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	StoreIDs		string
	SkuIDs		string
	IsForce		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) SyncStoresSkus() {
// 	c.callSyncStoresSkus(func(params *tStoreSkuSyncStoresSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callSyncStoresSkus(handler func(params *tStoreSkuSyncStoresSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuSyncStoresSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.SyncStoresSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.SyncStoresSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.SyncStoresSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetMatterStoreOrderCountParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *OrderController) GetMatterStoreOrderCount() {
// 	c.callGetMatterStoreOrderCount(func(params *tOrderGetMatterStoreOrderCountParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetMatterStoreOrderCount(handler func(params *tOrderGetMatterStoreOrderCountParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetMatterStoreOrderCountParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetMatterStoreOrderCount, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetMatterStoreOrderCount, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetMatterStoreOrderCount error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderConfirmReceivedReturnGoodsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	AfsOrderID		string
	VendorID		int
}

// func (c *OrderController) ConfirmReceivedReturnGoods() {
// 	c.callConfirmReceivedReturnGoods(func(params *tOrderConfirmReceivedReturnGoodsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callConfirmReceivedReturnGoods(handler func(params *tOrderConfirmReceivedReturnGoodsParams) (interface{}, string, error)) {
	var err error
	params := &tOrderConfirmReceivedReturnGoodsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.AfsOrderID = utils.TrimBlankChar(c.GetString("afsOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("afsOrderID") == "" {
		errParams = append(errParams, "afsOrderID")
	}
	params.MapData["afsOrderID"] = params.AfsOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ConfirmReceivedReturnGoods, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ConfirmReceivedReturnGoods, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ConfirmReceivedReturnGoods error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateStoreCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ID		int
	CategoryID		int
	StoreCategroyName		string
	Level		int
	ParentID		int
	IsHidden		int
	IsDelete		bool
}

// func (c *StoreController) UpdateStoreCategoryMap() {
// 	c.callUpdateStoreCategoryMap(func(params *tStoreUpdateStoreCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateStoreCategoryMap(handler func(params *tStoreUpdateStoreCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateStoreCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.ID, err = c.GetInt("ID", 0); err != nil {
		errParams = append(errParams, "ID")
	}
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	params.StoreCategroyName = utils.TrimBlankChar(c.GetString("storeCategroyName"))
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	if params.IsHidden, err = c.GetInt("isHidden", 0); err != nil {
		errParams = append(errParams, "isHidden")
	}
	if params.IsDelete, err = c.GetBool("isDelete", false); err != nil {
		errParams = append(errParams, "isDelete")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("ID") == "" {
		errParams = append(errParams, "ID")
	}
	params.MapData["ID"] = params.ID
	if utils.TrimBlankChar(c.GetString("categoryID")) != "" {
		params.MapData["categoryID"] = params.CategoryID
	}
	if utils.TrimBlankChar(c.GetString("storeCategroyName")) != "" {
		params.MapData["storeCategroyName"] = params.StoreCategroyName
	}
	if c.GetString("level") == "" {
		errParams = append(errParams, "level")
	}
	params.MapData["level"] = params.Level
	if c.GetString("parentID") == "" {
		errParams = append(errParams, "parentID")
	}
	params.MapData["parentID"] = params.ParentID
	if c.GetString("isHidden") == "" {
		errParams = append(errParams, "isHidden")
	}
	params.MapData["isHidden"] = params.IsHidden
	if utils.TrimBlankChar(c.GetString("isDelete")) != "" {
		params.MapData["isDelete"] = params.IsDelete
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateStoreCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateStoreCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateStoreCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetSToURidingDistanceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SLng		int
	SLat		int
	ULng		int
	ULat		int
	OrderId		string
}

// func (c *CmsController) GetSToURidingDistance() {
// 	c.callGetSToURidingDistance(func(params *tCmsGetSToURidingDistanceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetSToURidingDistance(handler func(params *tCmsGetSToURidingDistanceParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetSToURidingDistanceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.SLng, err = c.GetInt("sLng", 0); err != nil {
		errParams = append(errParams, "sLng")
	}
	if params.SLat, err = c.GetInt("sLat", 0); err != nil {
		errParams = append(errParams, "sLat")
	}
	if params.ULng, err = c.GetInt("uLng", 0); err != nil {
		errParams = append(errParams, "uLng")
	}
	if params.ULat, err = c.GetInt("uLat", 0); err != nil {
		errParams = append(errParams, "uLat")
	}
	params.OrderId = utils.TrimBlankChar(c.GetString("orderId"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("sLng") == "" {
		errParams = append(errParams, "sLng")
	}
	params.MapData["sLng"] = params.SLng
	if c.GetString("sLat") == "" {
		errParams = append(errParams, "sLat")
	}
	params.MapData["sLat"] = params.SLat
	if c.GetString("uLng") == "" {
		errParams = append(errParams, "uLng")
	}
	params.MapData["uLng"] = params.ULng
	if c.GetString("uLat") == "" {
		errParams = append(errParams, "uLat")
	}
	params.MapData["uLat"] = params.ULat
	if utils.TrimBlankChar(c.GetString("orderId")) != "" {
		params.MapData["orderId"] = params.OrderId
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetSToURidingDistance, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetSToURidingDistance, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetSToURidingDistance error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsDeleteConfigParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Type		string
	Key		string
}

// func (c *CmsController) DeleteConfig() {
// 	c.callDeleteConfig(func(params *tCmsDeleteConfigParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callDeleteConfig(handler func(params *tCmsDeleteConfigParams) (interface{}, string, error)) {
	var err error
	params := &tCmsDeleteConfigParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Type = utils.TrimBlankChar(c.GetString("type"))
	params.Key = utils.TrimBlankChar(c.GetString("key"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if c.GetString("key") == "" {
		errParams = append(errParams, "key")
	}
	params.MapData["key"] = params.Key
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.DeleteConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.DeleteConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.DeleteConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindDownSupermarketSignParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	StoreID		string
	StoreName		string
	StartTime		int
	EndTime		int
	ExpirationStart		int
	ExpirationEnd		int
	CityName		string
	StoreType		string
	SignPeople		string
	Token		string
}

// func (c *BiddingController) DownSupermarketSign() {
// 	c.callDownSupermarketSign(func(params *tBindDownSupermarketSignParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callDownSupermarketSign(handler func(params *tBindDownSupermarketSignParams) (interface{}, string, error)) {
	var err error
	params := &tBindDownSupermarketSignParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.StoreID = utils.TrimBlankChar(c.GetString("storeID"))
	params.StoreName = utils.TrimBlankChar(c.GetString("storeName"))
	if params.StartTime, err = c.GetInt("startTime", 0); err != nil {
		errParams = append(errParams, "startTime")
	}
	if params.EndTime, err = c.GetInt("endTime", 0); err != nil {
		errParams = append(errParams, "endTime")
	}
	if params.ExpirationStart, err = c.GetInt("expirationStart", 0); err != nil {
		errParams = append(errParams, "expirationStart")
	}
	if params.ExpirationEnd, err = c.GetInt("expirationEnd", 0); err != nil {
		errParams = append(errParams, "expirationEnd")
	}
	params.CityName = utils.TrimBlankChar(c.GetString("cityName"))
	params.StoreType = utils.TrimBlankChar(c.GetString("storeType"))
	params.SignPeople = utils.TrimBlankChar(c.GetString("signPeople"))
	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("storeName")) != "" {
		params.MapData["storeName"] = params.StoreName
	}
	if utils.TrimBlankChar(c.GetString("startTime")) != "" {
		params.MapData["startTime"] = params.StartTime
	}
	if utils.TrimBlankChar(c.GetString("endTime")) != "" {
		params.MapData["endTime"] = params.EndTime
	}
	if utils.TrimBlankChar(c.GetString("expirationStart")) != "" {
		params.MapData["expirationStart"] = params.ExpirationStart
	}
	if utils.TrimBlankChar(c.GetString("expirationEnd")) != "" {
		params.MapData["expirationEnd"] = params.ExpirationEnd
	}
	if utils.TrimBlankChar(c.GetString("cityName")) != "" {
		params.MapData["cityName"] = params.CityName
	}
	if utils.TrimBlankChar(c.GetString("storeType")) != "" {
		params.MapData["storeType"] = params.StoreType
	}
	if utils.TrimBlankChar(c.GetString("signPeople")) != "" {
		params.MapData["signPeople"] = params.SignPeople
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.DownSupermarketSign, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.DownSupermarketSign, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.DownSupermarketSign error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindGetRefundOrderListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandId		int
	Start		string
}

// func (c *BiddingController) GetRefundOrderList() {
// 	c.callGetRefundOrderList(func(params *tBindGetRefundOrderListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callGetRefundOrderList(handler func(params *tBindGetRefundOrderListParams) (interface{}, string, error)) {
	var err error
	params := &tBindGetRefundOrderListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandId, err = c.GetInt("brandId", 0); err != nil {
		errParams = append(errParams, "brandId")
	}
	params.Start = utils.TrimBlankChar(c.GetString("start"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("brandId") == "" {
		errParams = append(errParams, "brandId")
	}
	params.MapData["brandId"] = params.BrandId
	if c.GetString("start") == "" {
		errParams = append(errParams, "start")
	}
	params.MapData["start"] = params.Start
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.GetRefundOrderList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.GetRefundOrderList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.GetRefundOrderList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuUpdateSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	SkuID		int
	Payload		string
}

// func (c *SkuController) UpdateSku() {
// 	c.callUpdateSku(func(params *tSkuUpdateSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callUpdateSku(handler func(params *tSkuUpdateSkuParams) (interface{}, string, error)) {
	var err error
	params := &tSkuUpdateSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("skuID") == "" {
		errParams = append(errParams, "skuID")
	}
	params.MapData["skuID"] = params.SkuID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.UpdateSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.UpdateSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.UpdateSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuReorderCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryID		int
	CategoryIDs		string
	IsExd		bool
	OnlySort		int
}

// func (c *SkuController) ReorderCategories() {
// 	c.callReorderCategories(func(params *tSkuReorderCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callReorderCategories(handler func(params *tSkuReorderCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuReorderCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs"))
	if params.IsExd, err = c.GetBool("isExd", false); err != nil {
		errParams = append(errParams, "isExd")
	}
	if params.OnlySort, err = c.GetInt("onlySort", 0); err != nil {
		errParams = append(errParams, "onlySort")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categoryID") == "" {
		errParams = append(errParams, "categoryID")
	}
	params.MapData["categoryID"] = params.CategoryID
	if c.GetString("categoryIDs") == "" {
		errParams = append(errParams, "categoryIDs")
	}
	params.MapData["categoryIDs"] = params.CategoryIDs
	if utils.TrimBlankChar(c.GetString("isExd")) != "" {
		params.MapData["isExd"] = params.IsExd
	}
	if utils.TrimBlankChar(c.GetString("onlySort")) != "" {
		params.MapData["onlySort"] = params.OnlySort
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.ReorderCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.ReorderCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.ReorderCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuDeleteVendorSkuImgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
}

// func (c *SkuController) DeleteVendorSkuImg() {
// 	c.callDeleteVendorSkuImg(func(params *tSkuDeleteVendorSkuImgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callDeleteVendorSkuImg(handler func(params *tSkuDeleteVendorSkuImgParams) (interface{}, string, error)) {
	var err error
	params := &tSkuDeleteVendorSkuImgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("name") == "" {
		errParams = append(errParams, "name")
	}
	params.MapData["name"] = params.Name
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.DeleteVendorSkuImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.DeleteVendorSkuImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.DeleteVendorSkuImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuSendSeckillSkusCountMsgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) SendSeckillSkusCountMsg() {
// 	c.callSendSeckillSkusCountMsg(func(params *tStoreSkuSendSeckillSkusCountMsgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callSendSeckillSkusCountMsg(handler func(params *tStoreSkuSendSeckillSkusCountMsgParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuSendSeckillSkusCountMsgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.SendSeckillSkusCountMsg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.SendSeckillSkusCountMsg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.SendSeckillSkusCountMsg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2ChangePasswordParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OldPwd		string
	NewPwd		string
}

// func (c *Auth2Controller) ChangePassword() {
// 	c.callChangePassword(func(params *tAuth2ChangePasswordParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callChangePassword(handler func(params *tAuth2ChangePasswordParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2ChangePasswordParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OldPwd = utils.TrimBlankChar(c.GetString("oldPwd"))
	params.NewPwd = utils.TrimBlankChar(c.GetString("newPwd"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("oldPwd")) != "" {
		params.MapData["oldPwd"] = params.OldPwd
	}
	if c.GetString("newPwd") == "" {
		errParams = append(errParams, "newPwd")
	}
	params.MapData["newPwd"] = params.NewPwd
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.ChangePassword, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.ChangePassword, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.ChangePassword error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tNetspiderGetPageBrandsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *NetSpiderController) GetPageBrands() {
// 	c.callGetPageBrands(func(params *tNetspiderGetPageBrandsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *NetSpiderController) callGetPageBrands(handler func(params *tNetspiderGetPageBrandsParams) (interface{}, string, error)) {
	var err error
	params := &tNetspiderGetPageBrandsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API NetSpiderController.GetPageBrands, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API NetSpiderController.GetPageBrands, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API NetSpiderController.GetPageBrands error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActRefreshPageActsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	CreatedFrom		string
	IsAsync		bool
}

// func (c *ActController) RefreshPageActs() {
// 	c.callRefreshPageActs(func(params *tActRefreshPageActsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callRefreshPageActs(handler func(params *tActRefreshPageActsParams) (interface{}, string, error)) {
	var err error
	params := &tActRefreshPageActsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.CreatedFrom = utils.TrimBlankChar(c.GetString("createdFrom"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("createdFrom") == "" {
		errParams = append(errParams, "createdFrom")
	}
	params.MapData["createdFrom"] = params.CreatedFrom
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.RefreshPageActs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.RefreshPageActs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.RefreshPageActs error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsSendMsg2SomebodyParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	MsgType		string
	MsgContent		string
	Mobile		string
	VerifyCode		string
}

// func (c *CmsController) SendMsg2Somebody() {
// 	c.callSendMsg2Somebody(func(params *tCmsSendMsg2SomebodyParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callSendMsg2Somebody(handler func(params *tCmsSendMsg2SomebodyParams) (interface{}, string, error)) {
	var err error
	params := &tCmsSendMsg2SomebodyParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.MsgType = utils.TrimBlankChar(c.GetString("msgType"))
	params.MsgContent = utils.TrimBlankChar(c.GetString("msgContent"))
	params.Mobile = utils.TrimBlankChar(c.GetString("mobile"))
	params.VerifyCode = utils.TrimBlankChar(c.GetString("verifyCode"))
	if c.GetString("msgType") == "" {
		errParams = append(errParams, "msgType")
	}
	params.MapData["msgType"] = params.MsgType
	if c.GetString("msgContent") == "" {
		errParams = append(errParams, "msgContent")
	}
	params.MapData["msgContent"] = params.MsgContent
	if utils.TrimBlankChar(c.GetString("mobile")) != "" {
		params.MapData["mobile"] = params.Mobile
	}
	if utils.TrimBlankChar(c.GetString("verifyCode")) != "" {
		params.MapData["verifyCode"] = params.VerifyCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.SendMsg2Somebody, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.SendMsg2Somebody, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.SendMsg2Somebody error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopFixMtwmCategoryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MtwmStoreIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *TempOpController) FixMtwmCategory() {
// 	c.callFixMtwmCategory(func(params *tTempopFixMtwmCategoryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callFixMtwmCategory(handler func(params *tTempopFixMtwmCategoryParams) (interface{}, string, error)) {
	var err error
	params := &tTempopFixMtwmCategoryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MtwmStoreIDs = utils.TrimBlankChar(c.GetString("mtwmStoreIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("mtwmStoreIDs")) != "" {
		params.MapData["mtwmStoreIDs"] = params.MtwmStoreIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.FixMtwmCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.FixMtwmCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.FixMtwmCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaGetCardBinParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	OrgCode		string
	CardNo		string
}

// func (c *LaKaLaController) GetCardBin() {
// 	c.callGetCardBin(func(params *tLakalaGetCardBinParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callGetCardBin(handler func(params *tLakalaGetCardBinParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaGetCardBinParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.OrgCode = utils.TrimBlankChar(c.GetString("orgCode"))
	params.CardNo = utils.TrimBlankChar(c.GetString("cardNo"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("orgCode") == "" {
		errParams = append(errParams, "orgCode")
	}
	params.MapData["orgCode"] = params.OrgCode
	if c.GetString("cardNo") == "" {
		errParams = append(errParams, "cardNo")
	}
	params.MapData["cardNo"] = params.CardNo
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.GetCardBin, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.GetCardBin, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.GetCardBin error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderUpdateMTOrderSettleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StartTime		int
	EndTime		int
	StoreId		int
}

// func (c *OrderController) UpdateMTOrderSettle() {
// 	c.callUpdateMTOrderSettle(func(params *tOrderUpdateMTOrderSettleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callUpdateMTOrderSettle(handler func(params *tOrderUpdateMTOrderSettleParams) (interface{}, string, error)) {
	var err error
	params := &tOrderUpdateMTOrderSettleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StartTime, err = c.GetInt("startTime", 0); err != nil {
		errParams = append(errParams, "startTime")
	}
	if params.EndTime, err = c.GetInt("endTime", 0); err != nil {
		errParams = append(errParams, "endTime")
	}
	if params.StoreId, err = c.GetInt("storeId", 0); err != nil {
		errParams = append(errParams, "storeId")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("startTime") == "" {
		errParams = append(errParams, "startTime")
	}
	params.MapData["startTime"] = params.StartTime
	if c.GetString("endTime") == "" {
		errParams = append(errParams, "endTime")
	}
	params.MapData["endTime"] = params.EndTime
	if c.GetString("storeId") == "" {
		errParams = append(errParams, "storeId")
	}
	params.MapData["storeId"] = params.StoreId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.UpdateMTOrderSettle, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.UpdateMTOrderSettle, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.UpdateMTOrderSettle error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderLoadingLogisticsStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Data		string
}

// func (c *OrderController) LoadingLogisticsStatus() {
// 	c.callLoadingLogisticsStatus(func(params *tOrderLoadingLogisticsStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callLoadingLogisticsStatus(handler func(params *tOrderLoadingLogisticsStatusParams) (interface{}, string, error)) {
	var err error
	params := &tOrderLoadingLogisticsStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Data = utils.TrimBlankChar(c.GetString("data"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("data") == "" {
		errParams = append(errParams, "data")
	}
	params.MapData["data"] = params.Data
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.LoadingLogisticsStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.LoadingLogisticsStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.LoadingLogisticsStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetMissingStoreSkuFromOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
}

// func (c *StoreSkuController) GetMissingStoreSkuFromOrder() {
// 	c.callGetMissingStoreSkuFromOrder(func(params *tStoreSkuGetMissingStoreSkuFromOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetMissingStoreSkuFromOrder(handler func(params *tStoreSkuGetMissingStoreSkuFromOrderParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetMissingStoreSkuFromOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetMissingStoreSkuFromOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetMissingStoreSkuFromOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetMissingStoreSkuFromOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportOrderNotifyReportParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	BrandIDs		string
	VendorID		int
	NotifyType		int
	Keyword		string
	FromTime		string
	ToTime		string
	IsFinished		bool
	Offset		int
	PageSize		int
}

// func (c *ReportController) OrderNotifyReport() {
// 	c.callOrderNotifyReport(func(params *tReportOrderNotifyReportParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callOrderNotifyReport(handler func(params *tReportOrderNotifyReportParams) (interface{}, string, error)) {
	var err error
	params := &tReportOrderNotifyReportParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.BrandIDs = utils.TrimBlankChar(c.GetString("brandIDs"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.NotifyType, err = c.GetInt("notifyType", 0); err != nil {
		errParams = append(errParams, "notifyType")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.IsFinished, err = c.GetBool("isFinished", false); err != nil {
		errParams = append(errParams, "isFinished")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("brandIDs")) != "" {
		params.MapData["brandIDs"] = params.BrandIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("notifyType")) != "" {
		params.MapData["notifyType"] = params.NotifyType
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if c.GetString("toTime") == "" {
		errParams = append(errParams, "toTime")
	}
	params.MapData["toTime"] = params.ToTime
	if utils.TrimBlankChar(c.GetString("isFinished")) != "" {
		params.MapData["isFinished"] = params.IsFinished
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.OrderNotifyReport, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.OrderNotifyReport, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.OrderNotifyReport error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderDelOrderSkuInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	ID		int
}

// func (c *OrderController) DelOrderSkuInfo() {
// 	c.callDelOrderSkuInfo(func(params *tOrderDelOrderSkuInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callDelOrderSkuInfo(handler func(params *tOrderDelOrderSkuInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderDelOrderSkuInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.ID, err = c.GetInt("ID", 0); err != nil {
		errParams = append(errParams, "ID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("ID") == "" {
		errParams = append(errParams, "ID")
	}
	params.MapData["ID"] = params.ID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.DelOrderSkuInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.DelOrderSkuInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.DelOrderSkuInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuGetJdUpcCodeByNameParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
	UpcCode		string
}

// func (c *SkuController) GetJdUpcCodeByName() {
// 	c.callGetJdUpcCodeByName(func(params *tSkuGetJdUpcCodeByNameParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callGetJdUpcCodeByName(handler func(params *tSkuGetJdUpcCodeByNameParams) (interface{}, string, error)) {
	var err error
	params := &tSkuGetJdUpcCodeByNameParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.UpcCode = utils.TrimBlankChar(c.GetString("upcCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("upcCode")) != "" {
		params.MapData["upcCode"] = params.UpcCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.GetJdUpcCodeByName, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.GetJdUpcCodeByName, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.GetJdUpcCodeByName error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateBrandUserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandID		int
	UserID		string
	IsDel		bool
}

// func (c *StoreController) UpdateBrandUser() {
// 	c.callUpdateBrandUser(func(params *tStoreUpdateBrandUserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateBrandUser(handler func(params *tStoreUpdateBrandUserParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateBrandUserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	if params.IsDel, err = c.GetBool("isDel", false); err != nil {
		errParams = append(errParams, "isDel")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("brandID") == "" {
		errParams = append(errParams, "brandID")
	}
	params.MapData["brandID"] = params.BrandID
	if c.GetString("userID") == "" {
		errParams = append(errParams, "userID")
	}
	params.MapData["userID"] = params.UserID
	if c.GetString("isDel") == "" {
		errParams = append(errParams, "isDel")
	}
	params.MapData["isDel"] = params.IsDel
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateBrandUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateBrandUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateBrandUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateSecretBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PoolKey		string
	SubsID		string
	SecretNumber		string
	NumberA		string
	NumberB		string
	Expiration		string
}

// func (c *StoreController) UpdateSecretBind() {
// 	c.callUpdateSecretBind(func(params *tStoreUpdateSecretBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateSecretBind(handler func(params *tStoreUpdateSecretBindParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateSecretBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PoolKey = utils.TrimBlankChar(c.GetString("poolKey"))
	params.SubsID = utils.TrimBlankChar(c.GetString("subsID"))
	params.SecretNumber = utils.TrimBlankChar(c.GetString("secretNumber"))
	params.NumberA = utils.TrimBlankChar(c.GetString("numberA"))
	params.NumberB = utils.TrimBlankChar(c.GetString("numberB"))
	params.Expiration = utils.TrimBlankChar(c.GetString("expiration"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("poolKey") == "" {
		errParams = append(errParams, "poolKey")
	}
	params.MapData["poolKey"] = params.PoolKey
	if c.GetString("subsID") == "" {
		errParams = append(errParams, "subsID")
	}
	params.MapData["subsID"] = params.SubsID
	if c.GetString("secretNumber") == "" {
		errParams = append(errParams, "secretNumber")
	}
	params.MapData["secretNumber"] = params.SecretNumber
	if utils.TrimBlankChar(c.GetString("numberA")) != "" {
		params.MapData["numberA"] = params.NumberA
	}
	if utils.TrimBlankChar(c.GetString("numberB")) != "" {
		params.MapData["numberB"] = params.NumberB
	}
	if utils.TrimBlankChar(c.GetString("expiration")) != "" {
		params.MapData["expiration"] = params.Expiration
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateSecretBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateSecretBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateSecretBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuRefershStoreSkusMidPriceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsCountry		bool
	StoreIDs		string
}

// func (c *StoreSkuController) RefershStoreSkusMidPrice() {
// 	c.callRefershStoreSkusMidPrice(func(params *tStoreSkuRefershStoreSkusMidPriceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callRefershStoreSkusMidPrice(handler func(params *tStoreSkuRefershStoreSkusMidPriceParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuRefershStoreSkusMidPriceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsCountry, err = c.GetBool("isCountry", false); err != nil {
		errParams = append(errParams, "isCountry")
	}
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("isCountry") == "" {
		errParams = append(errParams, "isCountry")
	}
	params.MapData["isCountry"] = params.IsCountry
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.RefershStoreSkusMidPrice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.RefershStoreSkusMidPrice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.RefershStoreSkusMidPrice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindStoreOrderListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StartTime		string
	EndTime		string
	StoreIDs		string
	VendorId		string
	Offset		int
	PageSize		int
}

// func (c *BiddingController) StoreOrderList() {
// 	c.callStoreOrderList(func(params *tBindStoreOrderListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callStoreOrderList(handler func(params *tBindStoreOrderListParams) (interface{}, string, error)) {
	var err error
	params := &tBindStoreOrderListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StartTime = utils.TrimBlankChar(c.GetString("startTime"))
	params.EndTime = utils.TrimBlankChar(c.GetString("endTime"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorId = utils.TrimBlankChar(c.GetString("vendorId"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("startTime") == "" {
		errParams = append(errParams, "startTime")
	}
	params.MapData["startTime"] = params.StartTime
	if c.GetString("endTime") == "" {
		errParams = append(errParams, "endTime")
	}
	params.MapData["endTime"] = params.EndTime
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorId")) != "" {
		params.MapData["vendorId"] = params.VendorId
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.StoreOrderList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.StoreOrderList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.StoreOrderList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImGetPoiIMStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Data		string
}

// func (c *IMController) GetPoiIMStatus() {
// 	c.callGetPoiIMStatus(func(params *tImGetPoiIMStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callGetPoiIMStatus(handler func(params *tImGetPoiIMStatusParams) (interface{}, string, error)) {
	var err error
	params := &tImGetPoiIMStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Data = utils.TrimBlankChar(c.GetString("data"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("data") == "" {
		errParams = append(errParams, "data")
	}
	params.MapData["data"] = params.Data
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.GetPoiIMStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.GetPoiIMStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.GetPoiIMStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderAcceptOrRefuseFailedGetOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	AcceptIt		bool
	Reason		string
}

// func (c *OrderController) AcceptOrRefuseFailedGetOrder() {
// 	c.callAcceptOrRefuseFailedGetOrder(func(params *tOrderAcceptOrRefuseFailedGetOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callAcceptOrRefuseFailedGetOrder(handler func(params *tOrderAcceptOrRefuseFailedGetOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderAcceptOrRefuseFailedGetOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.AcceptIt, err = c.GetBool("acceptIt", false); err != nil {
		errParams = append(errParams, "acceptIt")
	}
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("acceptIt") == "" {
		errParams = append(errParams, "acceptIt")
	}
	params.MapData["acceptIt"] = params.AcceptIt
	if utils.TrimBlankChar(c.GetString("reason")) != "" {
		params.MapData["reason"] = params.Reason
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.AcceptOrRefuseFailedGetOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.AcceptOrRefuseFailedGetOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.AcceptOrRefuseFailedGetOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetStoresSkusForStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	IsFocus		bool
	Stock		int
	LocationCode		bool
	Keyword		string
	CategoryID		int
	Status		int
	Offset		int
	PageSize		int
	IsAct		bool
}

// func (c *StoreSkuController) GetStoresSkusForStore() {
// 	c.callGetStoresSkusForStore(func(params *tStoreSkuGetStoresSkusForStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetStoresSkusForStore(handler func(params *tStoreSkuGetStoresSkusForStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetStoresSkusForStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.IsFocus, err = c.GetBool("isFocus", false); err != nil {
		errParams = append(errParams, "isFocus")
	}
	if params.Stock, err = c.GetInt("stock", 0); err != nil {
		errParams = append(errParams, "stock")
	}
	if params.LocationCode, err = c.GetBool("locationCode", false); err != nil {
		errParams = append(errParams, "locationCode")
	}
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	if params.Status, err = c.GetInt("status", 0); err != nil {
		errParams = append(errParams, "status")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.IsAct, err = c.GetBool("isAct", false); err != nil {
		errParams = append(errParams, "isAct")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("isFocus") == "" {
		errParams = append(errParams, "isFocus")
	}
	params.MapData["isFocus"] = params.IsFocus
	if utils.TrimBlankChar(c.GetString("stock")) != "" {
		params.MapData["stock"] = params.Stock
	}
	if utils.TrimBlankChar(c.GetString("locationCode")) != "" {
		params.MapData["locationCode"] = params.LocationCode
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("categoryID")) != "" {
		params.MapData["categoryID"] = params.CategoryID
	}
	if utils.TrimBlankChar(c.GetString("status")) != "" {
		params.MapData["status"] = params.Status
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if utils.TrimBlankChar(c.GetString("isAct")) != "" {
		params.MapData["isAct"] = params.IsAct
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetStoresSkusForStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetStoresSkusForStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetStoresSkusForStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetBindAuthInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *User2Controller) GetBindAuthInfo() {
// 	c.callGetBindAuthInfo(func(params *tUser2GetBindAuthInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetBindAuthInfo(handler func(params *tUser2GetBindAuthInfoParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetBindAuthInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetBindAuthInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetBindAuthInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetBindAuthInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefreshOrderRealMobileParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	FromTime		string
	ToTime		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *OrderController) RefreshOrderRealMobile() {
// 	c.callRefreshOrderRealMobile(func(params *tOrderRefreshOrderRealMobileParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefreshOrderRealMobile(handler func(params *tOrderRefreshOrderRealMobileParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefreshOrderRealMobileParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefreshOrderRealMobile, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefreshOrderRealMobile, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefreshOrderRealMobile error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefundOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	Reason		string
}

// func (c *OrderController) RefundOrder() {
// 	c.callRefundOrder(func(params *tOrderRefundOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefundOrder(handler func(params *tOrderRefundOrderParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefundOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Reason = utils.TrimBlankChar(c.GetString("reason"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("reason")) != "" {
		params.MapData["reason"] = params.Reason
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefundOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefundOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefundOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetVendorStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorStoreID		string
	VendorID		int
	VendorOrgCode		string
}

// func (c *StoreController) GetVendorStore() {
// 	c.callGetVendorStore(func(params *tStoreGetVendorStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetVendorStore(handler func(params *tStoreGetVendorStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetVendorStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetVendorStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetVendorStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetVendorStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2DeleteRoles4UserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserID		string
	RoleList		string
}

// func (c *User2Controller) DeleteRoles4User() {
// 	c.callDeleteRoles4User(func(params *tUser2DeleteRoles4UserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callDeleteRoles4User(handler func(params *tUser2DeleteRoles4UserParams) (interface{}, string, error)) {
	var err error
	params := &tUser2DeleteRoles4UserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserID = utils.TrimBlankChar(c.GetString("userID"))
	params.RoleList = utils.TrimBlankChar(c.GetString("roleList"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("userID") == "" {
		errParams = append(errParams, "userID")
	}
	params.MapData["userID"] = params.UserID
	if c.GetString("roleList") == "" {
		errParams = append(errParams, "roleList")
	}
	params.MapData["roleList"] = params.RoleList
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.DeleteRoles4User, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.DeleteRoles4User, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.DeleteRoles4User error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSeparateQueryParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerInnerNo		string
	OrgCode		string
}

// func (c *LaKaLaController) SeparateQuery() {
// 	c.callSeparateQuery(func(params *tLakalaSeparateQueryParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSeparateQuery(handler func(params *tLakalaSeparateQueryParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSeparateQueryParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerInnerNo = utils.TrimBlankChar(c.GetString("merInnerNo"))
	params.OrgCode = utils.TrimBlankChar(c.GetString("orgCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merInnerNo") == "" {
		errParams = append(errParams, "merInnerNo")
	}
	params.MapData["merInnerNo"] = params.MerInnerNo
	if c.GetString("orgCode") == "" {
		errParams = append(errParams, "orgCode")
	}
	params.MapData["orgCode"] = params.OrgCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SeparateQuery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SeparateQuery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SeparateQuery error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImSetPoiIMStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Data		string
}

// func (c *IMController) SetPoiIMStatus() {
// 	c.callSetPoiIMStatus(func(params *tImSetPoiIMStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callSetPoiIMStatus(handler func(params *tImSetPoiIMStatusParams) (interface{}, string, error)) {
	var err error
	params := &tImSetPoiIMStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Data = utils.TrimBlankChar(c.GetString("data"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("data") == "" {
		errParams = append(errParams, "data")
	}
	params.MapData["data"] = params.Data
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.SetPoiIMStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.SetPoiIMStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.SetPoiIMStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderQueryOrderWaybillFeeInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
}

// func (c *OrderController) QueryOrderWaybillFeeInfo() {
// 	c.callQueryOrderWaybillFeeInfo(func(params *tOrderQueryOrderWaybillFeeInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callQueryOrderWaybillFeeInfo(handler func(params *tOrderQueryOrderWaybillFeeInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderQueryOrderWaybillFeeInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.QueryOrderWaybillFeeInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.QueryOrderWaybillFeeInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.QueryOrderWaybillFeeInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tMsgGetStoreMessageStatusesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	MsgIDs		string
	StoreIDs		string
	FromTime		string
	ToTime		string
	ConfirmStatuss		string
	FromReadCount		int
	ToReadCount		int
	Offset		int
	PageSize		int
}

// func (c *MsgController) GetStoreMessageStatuses() {
// 	c.callGetStoreMessageStatuses(func(params *tMsgGetStoreMessageStatusesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *MsgController) callGetStoreMessageStatuses(handler func(params *tMsgGetStoreMessageStatusesParams) (interface{}, string, error)) {
	var err error
	params := &tMsgGetStoreMessageStatusesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.MsgIDs = utils.TrimBlankChar(c.GetString("msgIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.ConfirmStatuss = utils.TrimBlankChar(c.GetString("confirmStatuss"))
	if params.FromReadCount, err = c.GetInt("fromReadCount", 0); err != nil {
		errParams = append(errParams, "fromReadCount")
	}
	if params.ToReadCount, err = c.GetInt("toReadCount", 0); err != nil {
		errParams = append(errParams, "toReadCount")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("msgIDs")) != "" {
		params.MapData["msgIDs"] = params.MsgIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("confirmStatuss")) != "" {
		params.MapData["confirmStatuss"] = params.ConfirmStatuss
	}
	if utils.TrimBlankChar(c.GetString("fromReadCount")) != "" {
		params.MapData["fromReadCount"] = params.FromReadCount
	}
	if utils.TrimBlankChar(c.GetString("toReadCount")) != "" {
		params.MapData["toReadCount"] = params.ToReadCount
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API MsgController.GetStoreMessageStatuses, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API MsgController.GetStoreMessageStatuses, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API MsgController.GetStoreMessageStatuses error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopRefreshJXPriceChangeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *TempOpController) RefreshJXPriceChange() {
// 	c.callRefreshJXPriceChange(func(params *tTempopRefreshJXPriceChangeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callRefreshJXPriceChange(handler func(params *tTempopRefreshJXPriceChangeParams) (interface{}, string, error)) {
	var err error
	params := &tTempopRefreshJXPriceChangeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.RefreshJXPriceChange, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.RefreshJXPriceChange, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.RefreshJXPriceChange error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefreshHistoryOrdersEarningPriceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
	VendorOrderID		string
	VendorIDs		string
	ActID		int
	StoreID		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *OrderController) RefreshHistoryOrdersEarningPrice() {
// 	c.callRefreshHistoryOrdersEarningPrice(func(params *tOrderRefreshHistoryOrdersEarningPriceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefreshHistoryOrdersEarningPrice(handler func(params *tOrderRefreshHistoryOrdersEarningPriceParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefreshHistoryOrdersEarningPriceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.ActID, err = c.GetInt("actID", 0); err != nil {
		errParams = append(errParams, "actID")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("vendorOrderID")) != "" {
		params.MapData["vendorOrderID"] = params.VendorOrderID
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("actID")) != "" {
		params.MapData["actID"] = params.ActID
	}
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefreshHistoryOrdersEarningPrice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefreshHistoryOrdersEarningPrice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefreshHistoryOrdersEarningPrice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tReportGetManageStateParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CityCodes		string
	VendorID		int
}

// func (c *ReportController) GetManageState() {
// 	c.callGetManageState(func(params *tReportGetManageStateParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ReportController) callGetManageState(handler func(params *tReportGetManageStateParams) (interface{}, string, error)) {
	var err error
	params := &tReportGetManageStateParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("cityCodes")) != "" {
		params.MapData["cityCodes"] = params.CityCodes
	}
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ReportController.GetManageState, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ReportController.GetManageState, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ReportController.GetManageState error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetNewOrderMsgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	LastOrderTime		string
	LastOrderSeqID		string
	WaitingSecond		int
}

// func (c *CmsController) GetNewOrderMsg() {
// 	c.callGetNewOrderMsg(func(params *tCmsGetNewOrderMsgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetNewOrderMsg(handler func(params *tCmsGetNewOrderMsgParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetNewOrderMsgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.LastOrderTime = utils.TrimBlankChar(c.GetString("lastOrderTime"))
	params.LastOrderSeqID = utils.TrimBlankChar(c.GetString("lastOrderSeqID"))
	if params.WaitingSecond, err = c.GetInt("waitingSecond", 0); err != nil {
		errParams = append(errParams, "waitingSecond")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if utils.TrimBlankChar(c.GetString("lastOrderTime")) != "" {
		params.MapData["lastOrderTime"] = params.LastOrderTime
	}
	if utils.TrimBlankChar(c.GetString("lastOrderSeqID")) != "" {
		params.MapData["lastOrderSeqID"] = params.LastOrderSeqID
	}
	if utils.TrimBlankChar(c.GetString("waitingSecond")) != "" {
		params.MapData["waitingSecond"] = params.WaitingSecond
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetNewOrderMsg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetNewOrderMsg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetNewOrderMsg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopStoreSkuCheckDiffParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	StoreIDs		string
}

// func (c *TempOpController) StoreSkuCheckDiff() {
// 	c.callStoreSkuCheckDiff(func(params *tTempopStoreSkuCheckDiffParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callStoreSkuCheckDiff(handler func(params *tTempopStoreSkuCheckDiffParams) (interface{}, string, error)) {
	var err error
	params := &tTempopStoreSkuCheckDiffParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.StoreSkuCheckDiff, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.StoreSkuCheckDiff, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.StoreSkuCheckDiff error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tPowerUpdateUserRoleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	UserIDs		string
	RoleIDs		string
}

// func (c *PowerController) UpdateUserRole() {
// 	c.callUpdateUserRole(func(params *tPowerUpdateUserRoleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *PowerController) callUpdateUserRole(handler func(params *tPowerUpdateUserRoleParams) (interface{}, string, error)) {
	var err error
	params := &tPowerUpdateUserRoleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.UserIDs = utils.TrimBlankChar(c.GetString("userIDs"))
	params.RoleIDs = utils.TrimBlankChar(c.GetString("roleIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("userIDs") == "" {
		errParams = append(errParams, "userIDs")
	}
	params.MapData["userIDs"] = params.UserIDs
	if c.GetString("roleIDs") == "" {
		errParams = append(errParams, "roleIDs")
	}
	params.MapData["roleIDs"] = params.RoleIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API PowerController.UpdateUserRole, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API PowerController.UpdateUserRole, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API PowerController.UpdateUserRole error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTaskUnmanageTasksParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	TaskIDs		string
}

// func (c *TaskController) UnmanageTasks() {
// 	c.callUnmanageTasks(func(params *tTaskUnmanageTasksParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TaskController) callUnmanageTasks(handler func(params *tTaskUnmanageTasksParams) (interface{}, string, error)) {
	var err error
	params := &tTaskUnmanageTasksParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.TaskIDs = utils.TrimBlankChar(c.GetString("taskIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("taskIDs")) != "" {
		params.MapData["taskIDs"] = params.TaskIDs
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TaskController.UnmanageTasks, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TaskController.UnmanageTasks, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TaskController.UnmanageTasks error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncSyncSkuNamesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	NameIDs		string
	IsForce		bool
	VendorID		int
	VendorOrgCode		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) SyncSkuNames() {
// 	c.callSyncSkuNames(func(params *tSyncSyncSkuNamesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callSyncSkuNames(handler func(params *tSyncSyncSkuNamesParams) (interface{}, string, error)) {
	var err error
	params := &tSyncSyncSkuNamesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.NameIDs = utils.TrimBlankChar(c.GetString("nameIDs"))
	if params.IsForce, err = c.GetBool("isForce", false); err != nil {
		errParams = append(errParams, "isForce")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("nameIDs")) != "" {
		params.MapData["nameIDs"] = params.NameIDs
	}
	if utils.TrimBlankChar(c.GetString("isForce")) != "" {
		params.MapData["isForce"] = params.IsForce
	}
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.SyncSkuNames, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.SyncSkuNames, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.SyncSkuNames error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2DingDingOAuth2Params struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Code		string
	Block		string
	State		string
}

// func (c *Auth2Controller) DingDingOAuth2() {
// 	c.callDingDingOAuth2(func(params *tAuth2DingDingOAuth2Params) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callDingDingOAuth2(handler func(params *tAuth2DingDingOAuth2Params) (interface{}, string, error)) {
	var err error
	params := &tAuth2DingDingOAuth2Params{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Code = utils.TrimBlankChar(c.GetString("code"))
	params.Block = utils.TrimBlankChar(c.GetString("block"))
	params.State = utils.TrimBlankChar(c.GetString("state"))
	if c.GetString("code") == "" {
		errParams = append(errParams, "code")
	}
	params.MapData["code"] = params.Code
	if utils.TrimBlankChar(c.GetString("block")) != "" {
		params.MapData["block"] = params.Block
	}
	if utils.TrimBlankChar(c.GetString("state")) != "" {
		params.MapData["state"] = params.State
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.DingDingOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.DingDingOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.DingDingOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderSelfDeliveringParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	CourierName		string
	CourierMobile		string
}

// func (c *OrderController) SelfDelivering() {
// 	c.callSelfDelivering(func(params *tOrderSelfDeliveringParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callSelfDelivering(handler func(params *tOrderSelfDeliveringParams) (interface{}, string, error)) {
	var err error
	params := &tOrderSelfDeliveringParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.CourierName = utils.TrimBlankChar(c.GetString("courierName"))
	params.CourierMobile = utils.TrimBlankChar(c.GetString("courierMobile"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("courierName")) != "" {
		params.MapData["courierName"] = params.CourierName
	}
	if utils.TrimBlankChar(c.GetString("courierMobile")) != "" {
		params.MapData["courierMobile"] = params.CourierMobile
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.SelfDelivering, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.SelfDelivering, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.SelfDelivering error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateStoreByUserParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Mobile		string
}

// func (c *StoreController) CreateStoreByUser() {
// 	c.callCreateStoreByUser(func(params *tStoreCreateStoreByUserParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateStoreByUser(handler func(params *tStoreCreateStoreByUserParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateStoreByUserParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Mobile = utils.TrimBlankChar(c.GetString("mobile"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("mobile") == "" {
		errParams = append(errParams, "mobile")
	}
	params.MapData["mobile"] = params.Mobile
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateStoreByUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateStoreByUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateStoreByUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryCityCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ParentCode		string
}

// func (c *LaKaLaController) QueryCityCode() {
// 	c.callQueryCityCode(func(params *tLakalaQueryCityCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryCityCode(handler func(params *tLakalaQueryCityCodeParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryCityCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.ParentCode = utils.TrimBlankChar(c.GetString("parentCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("parentCode") == "" {
		errParams = append(errParams, "parentCode")
	}
	params.MapData["parentCode"] = params.ParentCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryCityCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryCityCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryCityCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrderInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	Refresh		bool
}

// func (c *OrderController) GetOrderInfo() {
// 	c.callGetOrderInfo(func(params *tOrderGetOrderInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrderInfo(handler func(params *tOrderGetOrderInfoParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrderInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Refresh, err = c.GetBool("refresh", false); err != nil {
		errParams = append(errParams, "refresh")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("refresh")) != "" {
		params.MapData["refresh"] = params.Refresh
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrderInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrderInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrderInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreCreateStoreAuditParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *StoreController) CreateStoreAudit() {
// 	c.callCreateStoreAudit(func(params *tStoreCreateStoreAuditParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callCreateStoreAudit(handler func(params *tStoreCreateStoreAuditParams) (interface{}, string, error)) {
	var err error
	params := &tStoreCreateStoreAuditParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.CreateStoreAudit, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.CreateStoreAudit, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.CreateStoreAudit error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetQiniuUploadTokenParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Suffix		string
	HashCode		string
}

// func (c *CmsController) GetQiniuUploadToken() {
// 	c.callGetQiniuUploadToken(func(params *tCmsGetQiniuUploadTokenParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetQiniuUploadToken(handler func(params *tCmsGetQiniuUploadTokenParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetQiniuUploadTokenParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Suffix = utils.TrimBlankChar(c.GetString("suffix"))
	params.HashCode = utils.TrimBlankChar(c.GetString("hashCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("suffix") == "" {
		errParams = append(errParams, "suffix")
	}
	params.MapData["suffix"] = params.Suffix
	if utils.TrimBlankChar(c.GetString("hashCode")) != "" {
		params.MapData["hashCode"] = params.HashCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetQiniuUploadToken, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetQiniuUploadToken, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetQiniuUploadToken error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tCmsGetCoordinateCityInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Lng		float64
	Lat		float64
}

// func (c *CmsController) GetCoordinateCityInfo() {
// 	c.callGetCoordinateCityInfo(func(params *tCmsGetCoordinateCityInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *CmsController) callGetCoordinateCityInfo(handler func(params *tCmsGetCoordinateCityInfoParams) (interface{}, string, error)) {
	var err error
	params := &tCmsGetCoordinateCityInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Lng, err = c.GetFloat("lng", 0); err != nil {
		errParams = append(errParams, "lng")
	}
	if params.Lat, err = c.GetFloat("lat", 0); err != nil {
		errParams = append(errParams, "lat")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("lng") == "" {
		errParams = append(errParams, "lng")
	}
	params.MapData["lng"] = params.Lng
	if c.GetString("lat") == "" {
		errParams = append(errParams, "lat")
	}
	params.MapData["lat"] = params.Lat
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API CmsController.GetCoordinateCityInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API CmsController.GetCoordinateCityInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API CmsController.GetCoordinateCityInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2DeleteUsers4RoleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	RoleName		string
	StoreID		int
	UserIDs		string
}

// func (c *User2Controller) DeleteUsers4Role() {
// 	c.callDeleteUsers4Role(func(params *tUser2DeleteUsers4RoleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callDeleteUsers4Role(handler func(params *tUser2DeleteUsers4RoleParams) (interface{}, string, error)) {
	var err error
	params := &tUser2DeleteUsers4RoleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.RoleName = utils.TrimBlankChar(c.GetString("roleName"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	params.UserIDs = utils.TrimBlankChar(c.GetString("userIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("roleName") == "" {
		errParams = append(errParams, "roleName")
	}
	params.MapData["roleName"] = params.RoleName
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if c.GetString("userIDs") == "" {
		errParams = append(errParams, "userIDs")
	}
	params.MapData["userIDs"] = params.UserIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.DeleteUsers4Role, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.DeleteUsers4Role, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.DeleteUsers4Role error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuFocusStoreSkusByExcelParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) FocusStoreSkusByExcel() {
// 	c.callFocusStoreSkusByExcel(func(params *tStoreSkuFocusStoreSkusByExcelParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callFocusStoreSkusByExcel(handler func(params *tStoreSkuFocusStoreSkusByExcelParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuFocusStoreSkusByExcelParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.FocusStoreSkusByExcel, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.FocusStoreSkusByExcel, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.FocusStoreSkusByExcel error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetVendorStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	StoreID		int
}

// func (c *StoreSkuController) GetVendorStoreSkus() {
// 	c.callGetVendorStoreSkus(func(params *tStoreSkuGetVendorStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetVendorStoreSkus(handler func(params *tStoreSkuGetVendorStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetVendorStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetVendorStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetVendorStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetVendorStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncFullSyncVendorStuffParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	VendorOrgCode		string
	StoreID		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) FullSyncVendorStuff() {
// 	c.callFullSyncVendorStuff(func(params *tSyncFullSyncVendorStuffParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callFullSyncVendorStuff(handler func(params *tSyncFullSyncVendorStuffParams) (interface{}, string, error)) {
	var err error
	params := &tSyncFullSyncVendorStuffParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.FullSyncVendorStuff, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.FullSyncVendorStuff, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.FullSyncVendorStuff error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderCancelAll3rdWaybillsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	IsStopSchedule		bool
}

// func (c *OrderController) CancelAll3rdWaybills() {
// 	c.callCancelAll3rdWaybills(func(params *tOrderCancelAll3rdWaybillsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callCancelAll3rdWaybills(handler func(params *tOrderCancelAll3rdWaybillsParams) (interface{}, string, error)) {
	var err error
	params := &tOrderCancelAll3rdWaybillsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.IsStopSchedule, err = c.GetBool("isStopSchedule", false); err != nil {
		errParams = append(errParams, "isStopSchedule")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("isStopSchedule")) != "" {
		params.MapData["isStopSchedule"] = params.IsStopSchedule
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.CancelAll3rdWaybills, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.CancelAll3rdWaybills, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.CancelAll3rdWaybills error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderRefreshOrderFinancialParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromTime		string
	ToTime		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *OrderController) RefreshOrderFinancial() {
// 	c.callRefreshOrderFinancial(func(params *tOrderRefreshOrderFinancialParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callRefreshOrderFinancial(handler func(params *tOrderRefreshOrderFinancialParams) (interface{}, string, error)) {
	var err error
	params := &tOrderRefreshOrderFinancialParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromTime") == "" {
		errParams = append(errParams, "fromTime")
	}
	params.MapData["fromTime"] = params.FromTime
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.RefreshOrderFinancial, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.RefreshOrderFinancial, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.RefreshOrderFinancial error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuCopyMtToJdParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MtStoreID		string
	MtOrgCode		string
	JdStoreID		string
	JdOrgCode		string
}

// func (c *StoreSkuController) CopyMtToJd() {
// 	c.callCopyMtToJd(func(params *tStoreSkuCopyMtToJdParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callCopyMtToJd(handler func(params *tStoreSkuCopyMtToJdParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuCopyMtToJdParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MtStoreID = utils.TrimBlankChar(c.GetString("mtStoreID"))
	params.MtOrgCode = utils.TrimBlankChar(c.GetString("mtOrgCode"))
	params.JdStoreID = utils.TrimBlankChar(c.GetString("jdStoreID"))
	params.JdOrgCode = utils.TrimBlankChar(c.GetString("jdOrgCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("mtStoreID") == "" {
		errParams = append(errParams, "mtStoreID")
	}
	params.MapData["mtStoreID"] = params.MtStoreID
	if c.GetString("mtOrgCode") == "" {
		errParams = append(errParams, "mtOrgCode")
	}
	params.MapData["mtOrgCode"] = params.MtOrgCode
	if c.GetString("jdStoreID") == "" {
		errParams = append(errParams, "jdStoreID")
	}
	params.MapData["jdStoreID"] = params.JdStoreID
	if c.GetString("jdOrgCode") == "" {
		errParams = append(errParams, "jdOrgCode")
	}
	params.MapData["jdOrgCode"] = params.JdOrgCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.CopyMtToJd, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.CopyMtToJd, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.CopyMtToJd error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tBindJXPrintAfsOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	OrderId		string
}

// func (c *BiddingController) JXPrintAfsOrder() {
// 	c.callJXPrintAfsOrder(func(params *tBindJXPrintAfsOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *BiddingController) callJXPrintAfsOrder(handler func(params *tBindJXPrintAfsOrderParams) (interface{}, string, error)) {
	var err error
	params := &tBindJXPrintAfsOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.OrderId = utils.TrimBlankChar(c.GetString("orderId"))
	if c.GetString("orderId") == "" {
		errParams = append(errParams, "orderId")
	}
	params.MapData["orderId"] = params.OrderId
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API BiddingController.JXPrintAfsOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API BiddingController.JXPrintAfsOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API BiddingController.JXPrintAfsOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreInsertStoreCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *StoreController) InsertStoreCategories() {
// 	c.callInsertStoreCategories(func(params *tStoreInsertStoreCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callInsertStoreCategories(handler func(params *tStoreInsertStoreCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tStoreInsertStoreCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.InsertStoreCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.InsertStoreCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.InsertStoreCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderRefreshPayStatusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	PayType		string
}

// func (c *JxOrderController) RefreshPayStatus() {
// 	c.callRefreshPayStatus(func(params *tJxorderRefreshPayStatusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callRefreshPayStatus(handler func(params *tJxorderRefreshPayStatusParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderRefreshPayStatusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.PayType = utils.TrimBlankChar(c.GetString("payType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.RefreshPayStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.RefreshPayStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.RefreshPayStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetJdDeliveryAreaParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
}

// func (c *StoreController) GetJdDeliveryArea() {
// 	c.callGetJdDeliveryArea(func(params *tStoreGetJdDeliveryAreaParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetJdDeliveryArea(handler func(params *tStoreGetJdDeliveryAreaParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetJdDeliveryAreaParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetJdDeliveryArea, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetJdDeliveryArea, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetJdDeliveryArea error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetMyStoreListParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Version		string
}

// func (c *User2Controller) GetMyStoreList() {
// 	c.callGetMyStoreList(func(params *tUser2GetMyStoreListParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetMyStoreList(handler func(params *tUser2GetMyStoreListParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetMyStoreListParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Version = utils.TrimBlankChar(c.GetString("version"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("version")) != "" {
		params.MapData["version"] = params.Version
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetMyStoreList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetMyStoreList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetMyStoreList error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysGetWXTokenParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	AccessKey		string
	OldToken		string
	WaitSecond		int
}

// func (c *SysController) GetWXToken() {
// 	c.callGetWXToken(func(params *tSysGetWXTokenParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callGetWXToken(handler func(params *tSysGetWXTokenParams) (interface{}, string, error)) {
	var err error
	params := &tSysGetWXTokenParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.AccessKey = utils.TrimBlankChar(c.GetString("accessKey"))
	params.OldToken = utils.TrimBlankChar(c.GetString("oldToken"))
	if params.WaitSecond, err = c.GetInt("waitSecond", 0); err != nil {
		errParams = append(errParams, "waitSecond")
	}
	if c.GetString("accessKey") == "" {
		errParams = append(errParams, "accessKey")
	}
	params.MapData["accessKey"] = params.AccessKey
	if utils.TrimBlankChar(c.GetString("oldToken")) != "" {
		params.MapData["oldToken"] = params.OldToken
	}
	if utils.TrimBlankChar(c.GetString("waitSecond")) != "" {
		params.MapData["waitSecond"] = params.WaitSecond
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.GetWXToken, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.GetWXToken, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.GetWXToken error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysGetVendorOrgCodeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	VendorOrgCode		string
	VendorType		string
}

// func (c *SysController) GetVendorOrgCode() {
// 	c.callGetVendorOrgCode(func(params *tSysGetVendorOrgCodeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callGetVendorOrgCode(handler func(params *tSysGetVendorOrgCodeParams) (interface{}, string, error)) {
	var err error
	params := &tSysGetVendorOrgCodeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.VendorType = utils.TrimBlankChar(c.GetString("vendorType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorID")) != "" {
		params.MapData["vendorID"] = params.VendorID
	}
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if utils.TrimBlankChar(c.GetString("vendorType")) != "" {
		params.MapData["vendorType"] = params.VendorType
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.GetVendorOrgCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.GetVendorOrgCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.GetVendorOrgCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaApplyBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *LaKaLaController) ApplyBind() {
// 	c.callApplyBind(func(params *tLakalaApplyBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callApplyBind(handler func(params *tLakalaApplyBindParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaApplyBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.ApplyBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.ApplyBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.ApplyBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaCreateOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	VendorOrderId		string
	VendorId		int
	CallbackUrl		string
}

// func (c *LaKaLaController) CreateOrder() {
// 	c.callCreateOrder(func(params *tLakalaCreateOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callCreateOrder(handler func(params *tLakalaCreateOrderParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaCreateOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	params.VendorOrderId = utils.TrimBlankChar(c.GetString("vendorOrderId"))
	if params.VendorId, err = c.GetInt("vendorId", 0); err != nil {
		errParams = append(errParams, "vendorId")
	}
	params.CallbackUrl = utils.TrimBlankChar(c.GetString("callbackUrl"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("merchantNo") == "" {
		errParams = append(errParams, "merchantNo")
	}
	params.MapData["merchantNo"] = params.MerchantNo
	if c.GetString("vendorOrderId") == "" {
		errParams = append(errParams, "vendorOrderId")
	}
	params.MapData["vendorOrderId"] = params.VendorOrderId
	if c.GetString("vendorId") == "" {
		errParams = append(errParams, "vendorId")
	}
	params.MapData["vendorId"] = params.VendorId
	if utils.TrimBlankChar(c.GetString("callbackUrl")) != "" {
		params.MapData["callbackUrl"] = params.CallbackUrl
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.CreateOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.CreateOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.CreateOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuReorderVendorCategoriesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	CategoryID		int
	VendorID		int
	VendorOrgCode		string
	CategoryIDs		string
}

// func (c *SkuController) ReorderVendorCategories() {
// 	c.callReorderVendorCategories(func(params *tSkuReorderVendorCategoriesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callReorderVendorCategories(handler func(params *tSkuReorderVendorCategoriesParams) (interface{}, string, error)) {
	var err error
	params := &tSkuReorderVendorCategoriesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.CategoryID, err = c.GetInt("categoryID", 0); err != nil {
		errParams = append(errParams, "categoryID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("categoryID") == "" {
		errParams = append(errParams, "categoryID")
	}
	params.MapData["categoryID"] = params.CategoryID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if c.GetString("categoryIDs") == "" {
		errParams = append(errParams, "categoryIDs")
	}
	params.MapData["categoryIDs"] = params.CategoryIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.ReorderVendorCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.ReorderVendorCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.ReorderVendorCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateOrCreateCourierStoresParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	IsForceUpdate		bool
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreController) UpdateOrCreateCourierStores() {
// 	c.callUpdateOrCreateCourierStores(func(params *tStoreUpdateOrCreateCourierStoresParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateOrCreateCourierStores(handler func(params *tStoreUpdateOrCreateCourierStoresParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateOrCreateCourierStoresParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.IsForceUpdate, err = c.GetBool("isForceUpdate", false); err != nil {
		errParams = append(errParams, "isForceUpdate")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("isForceUpdate")) != "" {
		params.MapData["isForceUpdate"] = params.IsForceUpdate
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateOrCreateCourierStores, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateOrCreateCourierStores, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateOrCreateCourierStores error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuCopyStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromStoreID		int
	ToStoreID		int
	ToStoreIDs		string
	CopyMode		string
	PricePercentage		int
	CategoryIDs		string
	SkuIDs		string
	IsScale		bool
}

// func (c *StoreSkuController) CopyStoreSkus() {
// 	c.callCopyStoreSkus(func(params *tStoreSkuCopyStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callCopyStoreSkus(handler func(params *tStoreSkuCopyStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuCopyStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.FromStoreID, err = c.GetInt("fromStoreID", 0); err != nil {
		errParams = append(errParams, "fromStoreID")
	}
	if params.ToStoreID, err = c.GetInt("toStoreID", 0); err != nil {
		errParams = append(errParams, "toStoreID")
	}
	params.ToStoreIDs = utils.TrimBlankChar(c.GetString("toStoreIDs"))
	params.CopyMode = utils.TrimBlankChar(c.GetString("copyMode"))
	if params.PricePercentage, err = c.GetInt("pricePercentage", 0); err != nil {
		errParams = append(errParams, "pricePercentage")
	}
	params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.IsScale, err = c.GetBool("isScale", false); err != nil {
		errParams = append(errParams, "isScale")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromStoreID") == "" {
		errParams = append(errParams, "fromStoreID")
	}
	params.MapData["fromStoreID"] = params.FromStoreID
	if utils.TrimBlankChar(c.GetString("toStoreID")) != "" {
		params.MapData["toStoreID"] = params.ToStoreID
	}
	if utils.TrimBlankChar(c.GetString("toStoreIDs")) != "" {
		params.MapData["toStoreIDs"] = params.ToStoreIDs
	}
	if c.GetString("copyMode") == "" {
		errParams = append(errParams, "copyMode")
	}
	params.MapData["copyMode"] = params.CopyMode
	if utils.TrimBlankChar(c.GetString("pricePercentage")) != "" {
		params.MapData["pricePercentage"] = params.PricePercentage
	}
	if utils.TrimBlankChar(c.GetString("categoryIDs")) != "" {
		params.MapData["categoryIDs"] = params.CategoryIDs
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("isScale")) != "" {
		params.MapData["isScale"] = params.IsScale
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.CopyStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.CopyStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.CopyStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuStoreSkuPriceAuditParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	Status		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreSkuController) StoreSkuPriceAudit() {
// 	c.callStoreSkuPriceAudit(func(params *tStoreSkuStoreSkuPriceAuditParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callStoreSkuPriceAudit(handler func(params *tStoreSkuStoreSkuPriceAuditParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuStoreSkuPriceAuditParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Status, err = c.GetInt("status", 0); err != nil {
		errParams = append(errParams, "status")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if utils.TrimBlankChar(c.GetString("status")) != "" {
		params.MapData["status"] = params.Status
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.StoreSkuPriceAudit, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.StoreSkuPriceAudit, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.StoreSkuPriceAudit error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2TransferLegacyWeixinsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Mobile		string
}

// func (c *User2Controller) TransferLegacyWeixins() {
// 	c.callTransferLegacyWeixins(func(params *tUser2TransferLegacyWeixinsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callTransferLegacyWeixins(handler func(params *tUser2TransferLegacyWeixinsParams) (interface{}, string, error)) {
	var err error
	params := &tUser2TransferLegacyWeixinsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Mobile = utils.TrimBlankChar(c.GetString("mobile"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("mobile")) != "" {
		params.MapData["mobile"] = params.Mobile
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.TransferLegacyWeixins, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.TransferLegacyWeixins, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.TransferLegacyWeixins error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2AddMyDeliveryAddressParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ConsigneeName		string
	ConsigneeMobile		string
	Address		string
	DetailAddress		string
	Lng		float64
	Lat		float64
	Tag		string
	Remark		string
	IsDefault		int
	CityCode		int
	DistrictCode		int
}

// func (c *User2Controller) AddMyDeliveryAddress() {
// 	c.callAddMyDeliveryAddress(func(params *tUser2AddMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callAddMyDeliveryAddress(handler func(params *tUser2AddMyDeliveryAddressParams) (interface{}, string, error)) {
	var err error
	params := &tUser2AddMyDeliveryAddressParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.ConsigneeName = utils.TrimBlankChar(c.GetString("consigneeName"))
	params.ConsigneeMobile = utils.TrimBlankChar(c.GetString("consigneeMobile"))
	params.Address = utils.TrimBlankChar(c.GetString("address"))
	params.DetailAddress = utils.TrimBlankChar(c.GetString("detailAddress"))
	if params.Lng, err = c.GetFloat("lng", 0); err != nil {
		errParams = append(errParams, "lng")
	}
	if params.Lat, err = c.GetFloat("lat", 0); err != nil {
		errParams = append(errParams, "lat")
	}
	params.Tag = utils.TrimBlankChar(c.GetString("tag"))
	params.Remark = utils.TrimBlankChar(c.GetString("remark"))
	if params.IsDefault, err = c.GetInt("isDefault", 0); err != nil {
		errParams = append(errParams, "isDefault")
	}
	if params.CityCode, err = c.GetInt("cityCode", 0); err != nil {
		errParams = append(errParams, "cityCode")
	}
	if params.DistrictCode, err = c.GetInt("districtCode", 0); err != nil {
		errParams = append(errParams, "districtCode")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("consigneeName") == "" {
		errParams = append(errParams, "consigneeName")
	}
	params.MapData["consigneeName"] = params.ConsigneeName
	if c.GetString("consigneeMobile") == "" {
		errParams = append(errParams, "consigneeMobile")
	}
	params.MapData["consigneeMobile"] = params.ConsigneeMobile
	if utils.TrimBlankChar(c.GetString("address")) != "" {
		params.MapData["address"] = params.Address
	}
	if utils.TrimBlankChar(c.GetString("detailAddress")) != "" {
		params.MapData["detailAddress"] = params.DetailAddress
	}
	if c.GetString("lng") == "" {
		errParams = append(errParams, "lng")
	}
	params.MapData["lng"] = params.Lng
	if c.GetString("lat") == "" {
		errParams = append(errParams, "lat")
	}
	params.MapData["lat"] = params.Lat
	if utils.TrimBlankChar(c.GetString("tag")) != "" {
		params.MapData["tag"] = params.Tag
	}
	if utils.TrimBlankChar(c.GetString("remark")) != "" {
		params.MapData["remark"] = params.Remark
	}
	if utils.TrimBlankChar(c.GetString("isDefault")) != "" {
		params.MapData["isDefault"] = params.IsDefault
	}
	if utils.TrimBlankChar(c.GetString("cityCode")) != "" {
		params.MapData["cityCode"] = params.CityCode
	}
	if utils.TrimBlankChar(c.GetString("districtCode")) != "" {
		params.MapData["districtCode"] = params.DistrictCode
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.AddMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.AddMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.AddMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tYonghuiGetWeimobOrdersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	FromTime		string
	ToTime		string
}

// func (c *YongHuiController) GetWeimobOrders() {
// 	c.callGetWeimobOrders(func(params *tYonghuiGetWeimobOrdersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *YongHuiController) callGetWeimobOrders(handler func(params *tYonghuiGetWeimobOrdersParams) (interface{}, string, error)) {
	var err error
	params := &tYonghuiGetWeimobOrdersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API YongHuiController.GetWeimobOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API YongHuiController.GetWeimobOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API YongHuiController.GetWeimobOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuBatchGetChannelCategoryMappingParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *SkuController) BatchGetChannelCategoryMapping() {
// 	c.callBatchGetChannelCategoryMapping(func(params *tSkuBatchGetChannelCategoryMappingParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callBatchGetChannelCategoryMapping(handler func(params *tSkuBatchGetChannelCategoryMappingParams) (interface{}, string, error)) {
	var err error
	params := &tSkuBatchGetChannelCategoryMappingParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.BatchGetChannelCategoryMapping, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.BatchGetChannelCategoryMapping, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.BatchGetChannelCategoryMapping error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreUpdateStoreCourierMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
	Payload		string
}

// func (c *StoreController) UpdateStoreCourierMap() {
// 	c.callUpdateStoreCourierMap(func(params *tStoreUpdateStoreCourierMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callUpdateStoreCourierMap(handler func(params *tStoreUpdateStoreCourierMapParams) (interface{}, string, error)) {
	var err error
	params := &tStoreUpdateStoreCourierMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.UpdateStoreCourierMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.UpdateStoreCourierMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.UpdateStoreCourierMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysGetEbaiRTFDetailParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	ImgListStr		string
}

// func (c *SysController) GetEbaiRTFDetail() {
// 	c.callGetEbaiRTFDetail(func(params *tSysGetEbaiRTFDetailParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callGetEbaiRTFDetail(handler func(params *tSysGetEbaiRTFDetailParams) (interface{}, string, error)) {
	var err error
	params := &tSysGetEbaiRTFDetailParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.ImgListStr = utils.TrimBlankChar(c.GetString("imgListStr"))
	if c.GetString("imgListStr") == "" {
		errParams = append(errParams, "imgListStr")
	}
	params.MapData["imgListStr"] = params.ImgListStr
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.GetEbaiRTFDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.GetEbaiRTFDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.GetEbaiRTFDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSkuAddVendorCategoryMapParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	VendorOrgCode		string
	CategroyID		int
	Level		int
	ParentID		int
	VendorCategoryName		string
	VendorCategorySeq		int
}

// func (c *SkuController) AddVendorCategoryMap() {
// 	c.callAddVendorCategoryMap(func(params *tSkuAddVendorCategoryMapParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SkuController) callAddVendorCategoryMap(handler func(params *tSkuAddVendorCategoryMapParams) (interface{}, string, error)) {
	var err error
	params := &tSkuAddVendorCategoryMapParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	if params.CategroyID, err = c.GetInt("categroyID", 0); err != nil {
		errParams = append(errParams, "categroyID")
	}
	if params.Level, err = c.GetInt("level", 0); err != nil {
		errParams = append(errParams, "level")
	}
	if params.ParentID, err = c.GetInt("parentID", 0); err != nil {
		errParams = append(errParams, "parentID")
	}
	params.VendorCategoryName = utils.TrimBlankChar(c.GetString("vendorCategoryName"))
	if params.VendorCategorySeq, err = c.GetInt("vendorCategorySeq", 0); err != nil {
		errParams = append(errParams, "vendorCategorySeq")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("vendorOrgCode") == "" {
		errParams = append(errParams, "vendorOrgCode")
	}
	params.MapData["vendorOrgCode"] = params.VendorOrgCode
	if utils.TrimBlankChar(c.GetString("categroyID")) != "" {
		params.MapData["categroyID"] = params.CategroyID
	}
	if c.GetString("level") == "" {
		errParams = append(errParams, "level")
	}
	params.MapData["level"] = params.Level
	if c.GetString("parentID") == "" {
		errParams = append(errParams, "parentID")
	}
	params.MapData["parentID"] = params.ParentID
	if c.GetString("vendorCategoryName") == "" {
		errParams = append(errParams, "vendorCategoryName")
	}
	params.MapData["vendorCategoryName"] = params.VendorCategoryName
	if c.GetString("vendorCategorySeq") == "" {
		errParams = append(errParams, "vendorCategorySeq")
	}
	params.MapData["vendorCategorySeq"] = params.VendorCategorySeq
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SkuController.AddVendorCategoryMap, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SkuController.AddVendorCategoryMap, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SkuController.AddVendorCategoryMap error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreDeleteStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
}

// func (c *StoreController) DeleteStore() {
// 	c.callDeleteStore(func(params *tStoreDeleteStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callDeleteStore(handler func(params *tStoreDeleteStoreParams) (interface{}, string, error)) {
	var err error
	params := &tStoreDeleteStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.DeleteStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.DeleteStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.DeleteStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaGetPosTerminalInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PosSN		string
}

// func (c *LaKaLaController) GetPosTerminalInfo() {
// 	c.callGetPosTerminalInfo(func(params *tLakalaGetPosTerminalInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callGetPosTerminalInfo(handler func(params *tLakalaGetPosTerminalInfoParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaGetPosTerminalInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PosSN = utils.TrimBlankChar(c.GetString("posSN"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("posSN") == "" {
		errParams = append(errParams, "posSN")
	}
	params.MapData["posSN"] = params.PosSN
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.GetPosTerminalInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.GetPosTerminalInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.GetPosTerminalInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderConfirmSelfTakeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	SelfTakeCode		string
}

// func (c *OrderController) ConfirmSelfTake() {
// 	c.callConfirmSelfTake(func(params *tOrderConfirmSelfTakeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callConfirmSelfTake(handler func(params *tOrderConfirmSelfTakeParams) (interface{}, string, error)) {
	var err error
	params := &tOrderConfirmSelfTakeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.SelfTakeCode = utils.TrimBlankChar(c.GetString("selfTakeCode"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("selfTakeCode") == "" {
		errParams = append(errParams, "selfTakeCode")
	}
	params.MapData["selfTakeCode"] = params.SelfTakeCode
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.ConfirmSelfTake, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.ConfirmSelfTake, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.ConfirmSelfTake error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuGetSpecialtyStoreSkusParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	StoreIDs		string
}

// func (c *StoreSkuController) GetSpecialtyStoreSkus() {
// 	c.callGetSpecialtyStoreSkus(func(params *tStoreSkuGetSpecialtyStoreSkusParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callGetSpecialtyStoreSkus(handler func(params *tStoreSkuGetSpecialtyStoreSkusParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuGetSpecialtyStoreSkusParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorIDs") == "" {
		errParams = append(errParams, "vendorIDs")
	}
	params.MapData["vendorIDs"] = params.VendorIDs
	if c.GetString("storeIDs") == "" {
		errParams = append(errParams, "storeIDs")
	}
	params.MapData["storeIDs"] = params.StoreIDs
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.GetSpecialtyStoreSkus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.GetSpecialtyStoreSkus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.GetSpecialtyStoreSkus error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopTestStartOrEndOpStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorIDs		string
	StoreIDs		string
	StartOrEndStore		bool
	StartTime		int
	EndTime		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *TempOpController) TestStartOrEndOpStore() {
// 	c.callTestStartOrEndOpStore(func(params *tTempopTestStartOrEndOpStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callTestStartOrEndOpStore(handler func(params *tTempopTestStartOrEndOpStoreParams) (interface{}, string, error)) {
	var err error
	params := &tTempopTestStartOrEndOpStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	if params.StartOrEndStore, err = c.GetBool("startOrEndStore", false); err != nil {
		errParams = append(errParams, "startOrEndStore")
	}
	if params.StartTime, err = c.GetInt("startTime", 0); err != nil {
		errParams = append(errParams, "startTime")
	}
	if params.EndTime, err = c.GetInt("endTime", 0); err != nil {
		errParams = append(errParams, "endTime")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if c.GetString("startOrEndStore") == "" {
		errParams = append(errParams, "startOrEndStore")
	}
	params.MapData["startOrEndStore"] = params.StartOrEndStore
	if utils.TrimBlankChar(c.GetString("startTime")) != "" {
		params.MapData["startTime"] = params.StartTime
	}
	if utils.TrimBlankChar(c.GetString("endTime")) != "" {
		params.MapData["endTime"] = params.EndTime
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.TestStartOrEndOpStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.TestStartOrEndOpStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.TestStartOrEndOpStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActGetVendorPopActsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	StoreID		int
}

// func (c *ActController) GetVendorPopActs() {
// 	c.callGetVendorPopActs(func(params *tActGetVendorPopActsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callGetVendorPopActs(handler func(params *tActGetVendorPopActsParams) (interface{}, string, error)) {
	var err error
	params := &tActGetVendorPopActsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.GetVendorPopActs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.GetVendorPopActs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.GetVendorPopActs error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tYonghuiLoadExcelByYongHuiParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *YongHuiController) LoadExcelByYongHui() {
// 	c.callLoadExcelByYongHui(func(params *tYonghuiLoadExcelByYongHuiParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *YongHuiController) callLoadExcelByYongHui(handler func(params *tYonghuiLoadExcelByYongHuiParams) (interface{}, string, error)) {
	var err error
	params := &tYonghuiLoadExcelByYongHuiParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if c.GetString("isContinueWhenError") == "" {
		errParams = append(errParams, "isContinueWhenError")
	}
	params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API YongHuiController.LoadExcelByYongHui, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API YongHuiController.LoadExcelByYongHui, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API YongHuiController.LoadExcelByYongHui error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderGetOrderUserBuyFirstParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
}

// func (c *OrderController) GetOrderUserBuyFirst() {
// 	c.callGetOrderUserBuyFirst(func(params *tOrderGetOrderUserBuyFirstParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callGetOrderUserBuyFirst(handler func(params *tOrderGetOrderUserBuyFirstParams) (interface{}, string, error)) {
	var err error
	params := &tOrderGetOrderUserBuyFirstParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.GetOrderUserBuyFirst, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.GetOrderUserBuyFirst, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.GetOrderUserBuyFirst error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tJxorderRefundOnlineOrderParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	SkuIds		string
	Reason		string
	PayType		string
}

// func (c *JxOrderController) RefundOnlineOrder() {
// 	c.callRefundOnlineOrder(func(params *tJxorderRefundOnlineOrderParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *JxOrderController) callRefundOnlineOrder(handler func(params *tJxorderRefundOnlineOrderParams) (interface{}, string, error)) {
	var err error
	params := &tJxorderRefundOnlineOrderParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	params.SkuIds = utils.TrimBlankChar(c.GetString("skuIds"))
	params.Reason = utils.TrimBlankChar(c.GetString("Reason"))
	params.PayType = utils.TrimBlankChar(c.GetString("payType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("skuIds") == "" {
		errParams = append(errParams, "skuIds")
	}
	params.MapData["skuIds"] = params.SkuIds
	if utils.TrimBlankChar(c.GetString("Reason")) != "" {
		params.MapData["Reason"] = params.Reason
	}
	if c.GetString("payType") == "" {
		errParams = append(errParams, "payType")
	}
	params.MapData["payType"] = params.PayType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API JxOrderController.RefundOnlineOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API JxOrderController.RefundOnlineOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API JxOrderController.RefundOnlineOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreBalanceRechargeParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
	Amount		int
	Category		string
	NotifyUrl		string
}

// func (c *StoreController) BalanceRecharge() {
// 	c.callBalanceRecharge(func(params *tStoreBalanceRechargeParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callBalanceRecharge(handler func(params *tStoreBalanceRechargeParams) (interface{}, string, error)) {
	var err error
	params := &tStoreBalanceRechargeParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Amount, err = c.GetInt("amount", 0); err != nil {
		errParams = append(errParams, "amount")
	}
	params.Category = utils.TrimBlankChar(c.GetString("category"))
	params.NotifyUrl = utils.TrimBlankChar(c.GetString("notifyUrl"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("amount") == "" {
		errParams = append(errParams, "amount")
	}
	params.MapData["amount"] = params.Amount
	if c.GetString("category") == "" {
		errParams = append(errParams, "category")
	}
	params.MapData["category"] = params.Category
	if utils.TrimBlankChar(c.GetString("notifyUrl")) != "" {
		params.MapData["notifyUrl"] = params.NotifyUrl
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.BalanceRecharge, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.BalanceRecharge, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.BalanceRecharge error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreQueryPlatformBalanceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorID		int
}

// func (c *StoreController) QueryPlatformBalance() {
// 	c.callQueryPlatformBalance(func(params *tStoreQueryPlatformBalanceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callQueryPlatformBalance(handler func(params *tStoreQueryPlatformBalanceParams) (interface{}, string, error)) {
	var err error
	params := &tStoreQueryPlatformBalanceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.QueryPlatformBalance, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.QueryPlatformBalance, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.QueryPlatformBalance error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSaveAuthenticationParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
	AuthType		string
}

// func (c *LaKaLaController) SaveAuthentication() {
// 	c.callSaveAuthentication(func(params *tLakalaSaveAuthenticationParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSaveAuthentication(handler func(params *tLakalaSaveAuthenticationParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSaveAuthenticationParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	params.AuthType = utils.TrimBlankChar(c.GetString("authType"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("authType") == "" {
		errParams = append(errParams, "authType")
	}
	params.MapData["authType"] = params.AuthType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SaveAuthentication, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SaveAuthentication, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SaveAuthentication error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderAdjustJdsOrderSimpleParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	SkuID		int
}

// func (c *OrderController) AdjustJdsOrderSimple() {
// 	c.callAdjustJdsOrderSimple(func(params *tOrderAdjustJdsOrderSimpleParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callAdjustJdsOrderSimple(handler func(params *tOrderAdjustJdsOrderSimpleParams) (interface{}, string, error)) {
	var err error
	params := &tOrderAdjustJdsOrderSimpleParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.SkuID, err = c.GetInt("skuID", 0); err != nil {
		errParams = append(errParams, "skuID")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("skuID") == "" {
		errParams = append(errParams, "skuID")
	}
	params.MapData["skuID"] = params.SkuID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.AdjustJdsOrderSimple, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.AdjustJdsOrderSimple, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.AdjustJdsOrderSimple error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetBrandsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BrandID		int
	Name		string
	IsManage		bool
}

// func (c *StoreController) GetBrands() {
// 	c.callGetBrands(func(params *tStoreGetBrandsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetBrands(handler func(params *tStoreGetBrandsParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetBrandsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BrandID, err = c.GetInt("brandID", 0); err != nil {
		errParams = append(errParams, "brandID")
	}
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	if params.IsManage, err = c.GetBool("isManage", false); err != nil {
		errParams = append(errParams, "isManage")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("brandID")) != "" {
		params.MapData["brandID"] = params.BrandID
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("isManage")) != "" {
		params.MapData["isManage"] = params.IsManage
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetBrands, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetBrands, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetBrands error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFoodrecipeQueryFoodRecipesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	AuthorID		string
	SkuIDs		string
	Offset		int
	PageSize		int
}

// func (c *FoodRecipeController) QueryFoodRecipes() {
// 	c.callQueryFoodRecipes(func(params *tFoodrecipeQueryFoodRecipesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FoodRecipeController) callQueryFoodRecipes(handler func(params *tFoodrecipeQueryFoodRecipesParams) (interface{}, string, error)) {
	var err error
	params := &tFoodrecipeQueryFoodRecipesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	params.AuthorID = utils.TrimBlankChar(c.GetString("authorID"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("authorID")) != "" {
		params.MapData["authorID"] = params.AuthorID
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FoodRecipeController.QueryFoodRecipes, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FoodRecipeController.QueryFoodRecipes, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FoodRecipeController.QueryFoodRecipes error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tFoodrecipeGetRecommendFoodRecipesParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Keyword		string
	Offset		int
	PageSize		int
}

// func (c *FoodRecipeController) GetRecommendFoodRecipes() {
// 	c.callGetRecommendFoodRecipes(func(params *tFoodrecipeGetRecommendFoodRecipesParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *FoodRecipeController) callGetRecommendFoodRecipes(handler func(params *tFoodrecipeGetRecommendFoodRecipesParams) (interface{}, string, error)) {
	var err error
	params := &tFoodrecipeGetRecommendFoodRecipesParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API FoodRecipeController.GetRecommendFoodRecipes, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API FoodRecipeController.GetRecommendFoodRecipes, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API FoodRecipeController.GetRecommendFoodRecipes error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderQueryInvoiceSettingParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorId		string
	VendorStoreID		string
}

// func (c *OrderController) QueryInvoiceSetting() {
// 	c.callQueryInvoiceSetting(func(params *tOrderQueryInvoiceSettingParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callQueryInvoiceSetting(handler func(params *tOrderQueryInvoiceSettingParams) (interface{}, string, error)) {
	var err error
	params := &tOrderQueryInvoiceSettingParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorId = utils.TrimBlankChar(c.GetString("vendorId"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorId") == "" {
		errParams = append(errParams, "vendorId")
	}
	params.MapData["vendorId"] = params.VendorId
	if c.GetString("vendorStoreID") == "" {
		errParams = append(errParams, "vendorStoreID")
	}
	params.MapData["vendorStoreID"] = params.VendorStoreID
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.QueryInvoiceSetting, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.QueryInvoiceSetting, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.QueryInvoiceSetting error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreGetStoreSettlementInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIds		string
	Start		string
	End		string
	Size		int
	Offset		int
	Ranke		string
}

// func (c *StoreController) GetStoreSettlementInfo() {
// 	c.callGetStoreSettlementInfo(func(params *tStoreGetStoreSettlementInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callGetStoreSettlementInfo(handler func(params *tStoreGetStoreSettlementInfoParams) (interface{}, string, error)) {
	var err error
	params := &tStoreGetStoreSettlementInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIds = utils.TrimBlankChar(c.GetString("vendorIds"))
	params.Start = utils.TrimBlankChar(c.GetString("start"))
	params.End = utils.TrimBlankChar(c.GetString("end"))
	if params.Size, err = c.GetInt("size", 0); err != nil {
		errParams = append(errParams, "size")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	params.Ranke = utils.TrimBlankChar(c.GetString("ranke"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorIds")) != "" {
		params.MapData["vendorIds"] = params.VendorIds
	}
	if c.GetString("start") == "" {
		errParams = append(errParams, "start")
	}
	params.MapData["start"] = params.Start
	if c.GetString("end") == "" {
		errParams = append(errParams, "end")
	}
	params.MapData["end"] = params.End
	if c.GetString("size") == "" {
		errParams = append(errParams, "size")
	}
	params.MapData["size"] = params.Size
	if c.GetString("offset") == "" {
		errParams = append(errParams, "offset")
	}
	params.MapData["offset"] = params.Offset
	if utils.TrimBlankChar(c.GetString("ranke")) != "" {
		params.MapData["ranke"] = params.Ranke
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.GetStoreSettlementInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.GetStoreSettlementInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.GetStoreSettlementInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tTempopBuildSkuFromEbaiStoreParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	BaiduShopID		int
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *TempOpController) BuildSkuFromEbaiStore() {
// 	c.callBuildSkuFromEbaiStore(func(params *tTempopBuildSkuFromEbaiStoreParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *TempOpController) callBuildSkuFromEbaiStore(handler func(params *tTempopBuildSkuFromEbaiStoreParams) (interface{}, string, error)) {
	var err error
	params := &tTempopBuildSkuFromEbaiStoreParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.BaiduShopID, err = c.GetInt("baiduShopID", 0); err != nil {
		errParams = append(errParams, "baiduShopID")
	}
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("baiduShopID") == "" {
		errParams = append(errParams, "baiduShopID")
	}
	params.MapData["baiduShopID"] = params.BaiduShopID
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API TempOpController.BuildSkuFromEbaiStore, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API TempOpController.BuildSkuFromEbaiStore, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API TempOpController.BuildSkuFromEbaiStore error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tEventTestWebsocketParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
}

// func (c *EventController) TestWebsocket() {
// 	c.callTestWebsocket(func(params *tEventTestWebsocketParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *EventController) callTestWebsocket(handler func(params *tEventTestWebsocketParams) (interface{}, string, error)) {
	var err error
	params := &tEventTestWebsocketParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API EventController.TestWebsocket, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API EventController.TestWebsocket, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API EventController.TestWebsocket error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tEventGetOperateEventsParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	ApiFunctions		string
	Name		string
	OperateTypes		string
	SkuIDs		string
	StoreIDs		string
	FromTime		string
	ToTime		string
	Keyword		string
	ErrType		int
	Offset		int
	PageSize		int
}

// func (c *EventController) GetOperateEvents() {
// 	c.callGetOperateEvents(func(params *tEventGetOperateEventsParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *EventController) callGetOperateEvents(handler func(params *tEventGetOperateEventsParams) (interface{}, string, error)) {
	var err error
	params := &tEventGetOperateEventsParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.ApiFunctions = utils.TrimBlankChar(c.GetString("apiFunctions"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.OperateTypes = utils.TrimBlankChar(c.GetString("operateTypes"))
	params.SkuIDs = utils.TrimBlankChar(c.GetString("skuIDs"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.FromTime = utils.TrimBlankChar(c.GetString("fromTime"))
	params.ToTime = utils.TrimBlankChar(c.GetString("toTime"))
	params.Keyword = utils.TrimBlankChar(c.GetString("keyword"))
	if params.ErrType, err = c.GetInt("errType", 0); err != nil {
		errParams = append(errParams, "errType")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("apiFunctions")) != "" {
		params.MapData["apiFunctions"] = params.ApiFunctions
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("operateTypes")) != "" {
		params.MapData["operateTypes"] = params.OperateTypes
	}
	if utils.TrimBlankChar(c.GetString("skuIDs")) != "" {
		params.MapData["skuIDs"] = params.SkuIDs
	}
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("fromTime")) != "" {
		params.MapData["fromTime"] = params.FromTime
	}
	if utils.TrimBlankChar(c.GetString("toTime")) != "" {
		params.MapData["toTime"] = params.ToTime
	}
	if utils.TrimBlankChar(c.GetString("keyword")) != "" {
		params.MapData["keyword"] = params.Keyword
	}
	if utils.TrimBlankChar(c.GetString("errType")) != "" {
		params.MapData["errType"] = params.ErrType
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API EventController.GetOperateEvents, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API EventController.GetOperateEvents, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API EventController.GetOperateEvents error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreAddStoreMapAuditParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreID		int
	VendorID		int
	VendorOrgCode		string
	VendorStoreID		string
	VendorStoreName		string
	VendorAccount		string
	VendorPasswaord		string
}

// func (c *StoreController) AddStoreMapAudit() {
// 	c.callAddStoreMapAudit(func(params *tStoreAddStoreMapAuditParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callAddStoreMapAudit(handler func(params *tStoreAddStoreMapAuditParams) (interface{}, string, error)) {
	var err error
	params := &tStoreAddStoreMapAuditParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.VendorOrgCode = utils.TrimBlankChar(c.GetString("vendorOrgCode"))
	params.VendorStoreID = utils.TrimBlankChar(c.GetString("vendorStoreID"))
	params.VendorStoreName = utils.TrimBlankChar(c.GetString("vendorStoreName"))
	params.VendorAccount = utils.TrimBlankChar(c.GetString("vendorAccount"))
	params.VendorPasswaord = utils.TrimBlankChar(c.GetString("vendorPasswaord"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("storeID") == "" {
		errParams = append(errParams, "storeID")
	}
	params.MapData["storeID"] = params.StoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("vendorOrgCode")) != "" {
		params.MapData["vendorOrgCode"] = params.VendorOrgCode
	}
	if utils.TrimBlankChar(c.GetString("vendorStoreID")) != "" {
		params.MapData["vendorStoreID"] = params.VendorStoreID
	}
	if utils.TrimBlankChar(c.GetString("vendorStoreName")) != "" {
		params.MapData["vendorStoreName"] = params.VendorStoreName
	}
	if c.GetString("vendorAccount") == "" {
		errParams = append(errParams, "vendorAccount")
	}
	params.MapData["vendorAccount"] = params.VendorAccount
	if utils.TrimBlankChar(c.GetString("vendorPasswaord")) != "" {
		params.MapData["vendorPasswaord"] = params.VendorPasswaord
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.AddStoreMapAudit, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.AddStoreMapAudit, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.AddStoreMapAudit error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuCopyMtToMtParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	FromStoreID		string
	ToStoreID		string
	VendorID		int
	OffSet		int
	SyncType		int
}

// func (c *StoreSkuController) CopyMtToMt() {
// 	c.callCopyMtToMt(func(params *tStoreSkuCopyMtToMtParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callCopyMtToMt(handler func(params *tStoreSkuCopyMtToMtParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuCopyMtToMtParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.FromStoreID = utils.TrimBlankChar(c.GetString("fromStoreID"))
	params.ToStoreID = utils.TrimBlankChar(c.GetString("toStoreID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	if params.OffSet, err = c.GetInt("offSet", 0); err != nil {
		errParams = append(errParams, "offSet")
	}
	if params.SyncType, err = c.GetInt("syncType", 0); err != nil {
		errParams = append(errParams, "syncType")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("fromStoreID") == "" {
		errParams = append(errParams, "fromStoreID")
	}
	params.MapData["fromStoreID"] = params.FromStoreID
	if c.GetString("toStoreID") == "" {
		errParams = append(errParams, "toStoreID")
	}
	params.MapData["toStoreID"] = params.ToStoreID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("offSet")) != "" {
		params.MapData["offSet"] = params.OffSet
	}
	if c.GetString("syncType") == "" {
		errParams = append(errParams, "syncType")
	}
	params.MapData["syncType"] = params.SyncType
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.CopyMtToMt, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.CopyMtToMt, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.CopyMtToMt error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tAuth2GetTokenInfoParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
}

// func (c *Auth2Controller) GetTokenInfo() {
// 	c.callGetTokenInfo(func(params *tAuth2GetTokenInfoParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *Auth2Controller) callGetTokenInfo(handler func(params *tAuth2GetTokenInfoParams) (interface{}, string, error)) {
	var err error
	params := &tAuth2GetTokenInfoParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API Auth2Controller.GetTokenInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API Auth2Controller.GetTokenInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API Auth2Controller.GetTokenInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tActForceUpdateVendorPriceParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Type		int
	VendorID		int
	ActStoreSkuList		string
	LockTime		string
	IsAsync		bool
}

// func (c *ActController) ForceUpdateVendorPrice() {
// 	c.callForceUpdateVendorPrice(func(params *tActForceUpdateVendorPriceParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *ActController) callForceUpdateVendorPrice(handler func(params *tActForceUpdateVendorPriceParams) (interface{}, string, error)) {
	var err error
	params := &tActForceUpdateVendorPriceParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.Type, err = c.GetInt("type", 0); err != nil {
		errParams = append(errParams, "type")
	}
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.ActStoreSkuList = utils.TrimBlankChar(c.GetString("actStoreSkuList"))
	params.LockTime = utils.TrimBlankChar(c.GetString("lockTime"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("type") == "" {
		errParams = append(errParams, "type")
	}
	params.MapData["type"] = params.Type
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if c.GetString("actStoreSkuList") == "" {
		errParams = append(errParams, "actStoreSkuList")
	}
	params.MapData["actStoreSkuList"] = params.ActStoreSkuList
	if utils.TrimBlankChar(c.GetString("lockTime")) != "" {
		params.MapData["lockTime"] = params.LockTime
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API ActController.ForceUpdateVendorPrice, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API ActController.ForceUpdateVendorPrice, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API ActController.ForceUpdateVendorPrice error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tKnowSNSUploadImgParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsThumb		bool
}

// func (c *KnowController) SNSUploadImg() {
// 	c.callSNSUploadImg(func(params *tKnowSNSUploadImgParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *KnowController) callSNSUploadImg(handler func(params *tKnowSNSUploadImgParams) (interface{}, string, error)) {
	var err error
	params := &tKnowSNSUploadImgParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsThumb, err = c.GetBool("isThumb", false); err != nil {
		errParams = append(errParams, "isThumb")
	}
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("isThumb")) != "" {
		params.MapData["isThumb"] = params.IsThumb
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API KnowController.SNSUploadImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API KnowController.SNSUploadImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API KnowController.SNSUploadImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tImGetImChatDetailParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	PayLoad		string
}

// func (c *IMController) GetImChatDetail() {
// 	c.callGetImChatDetail(func(params *tImGetImChatDetailParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *IMController) callGetImChatDetail(handler func(params *tImGetImChatDetailParams) (interface{}, string, error)) {
	var err error
	params := &tImGetImChatDetailParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.PayLoad = utils.TrimBlankChar(c.GetString("payLoad"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payLoad") == "" {
		errParams = append(errParams, "payLoad")
	}
	params.MapData["payLoad"] = params.PayLoad
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API IMController.GetImChatDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API IMController.GetImChatDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API IMController.GetImChatDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tOrderCreateWaybillOnProvidersParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	VendorOrderID		string
	VendorID		int
	CourierVendorIDs		string
	MaxAddFee		int
	ForceCreate		bool
}

// func (c *OrderController) CreateWaybillOnProviders() {
// 	c.callCreateWaybillOnProviders(func(params *tOrderCreateWaybillOnProvidersParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *OrderController) callCreateWaybillOnProviders(handler func(params *tOrderCreateWaybillOnProvidersParams) (interface{}, string, error)) {
	var err error
	params := &tOrderCreateWaybillOnProvidersParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID"))
	if params.VendorID, err = c.GetInt("vendorID", 0); err != nil {
		errParams = append(errParams, "vendorID")
	}
	params.CourierVendorIDs = utils.TrimBlankChar(c.GetString("courierVendorIDs"))
	if params.MaxAddFee, err = c.GetInt("maxAddFee", 0); err != nil {
		errParams = append(errParams, "maxAddFee")
	}
	if params.ForceCreate, err = c.GetBool("forceCreate", false); err != nil {
		errParams = append(errParams, "forceCreate")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("vendorOrderID") == "" {
		errParams = append(errParams, "vendorOrderID")
	}
	params.MapData["vendorOrderID"] = params.VendorOrderID
	if c.GetString("vendorID") == "" {
		errParams = append(errParams, "vendorID")
	}
	params.MapData["vendorID"] = params.VendorID
	if utils.TrimBlankChar(c.GetString("courierVendorIDs")) != "" {
		params.MapData["courierVendorIDs"] = params.CourierVendorIDs
	}
	if utils.TrimBlankChar(c.GetString("maxAddFee")) != "" {
		params.MapData["maxAddFee"] = params.MaxAddFee
	}
	if utils.TrimBlankChar(c.GetString("forceCreate")) != "" {
		params.MapData["forceCreate"] = params.ForceCreate
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API OrderController.CreateWaybillOnProviders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API OrderController.CreateWaybillOnProviders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API OrderController.CreateWaybillOnProviders error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreEnableHaveRestStoresParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *StoreController) EnableHaveRestStores() {
// 	c.callEnableHaveRestStores(func(params *tStoreEnableHaveRestStoresParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreController) callEnableHaveRestStores(handler func(params *tStoreEnableHaveRestStoresParams) (interface{}, string, error)) {
	var err error
	params := &tStoreEnableHaveRestStoresParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("isAsync") == "" {
		errParams = append(errParams, "isAsync")
	}
	params.MapData["isAsync"] = params.IsAsync
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreController.EnableHaveRestStores, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreController.EnableHaveRestStores, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreController.EnableHaveRestStores error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tStoreSkuUpdateStoresSkusWithoutSyncParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	Payload		string
	IsRefreshHigh		bool
}

// func (c *StoreSkuController) UpdateStoresSkusWithoutSync() {
// 	c.callUpdateStoresSkusWithoutSync(func(params *tStoreSkuUpdateStoresSkusWithoutSyncParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *StoreSkuController) callUpdateStoresSkusWithoutSync(handler func(params *tStoreSkuUpdateStoresSkusWithoutSyncParams) (interface{}, string, error)) {
	var err error
	params := &tStoreSkuUpdateStoresSkusWithoutSyncParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.IsRefreshHigh, err = c.GetBool("isRefreshHigh", false); err != nil {
		errParams = append(errParams, "isRefreshHigh")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if c.GetString("isRefreshHigh") == "" {
		errParams = append(errParams, "isRefreshHigh")
	}
	params.MapData["isRefreshHigh"] = params.IsRefreshHigh
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API StoreSkuController.UpdateStoresSkusWithoutSync, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API StoreSkuController.UpdateStoresSkusWithoutSync, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API StoreSkuController.UpdateStoresSkusWithoutSync error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSyncAddCreateFlagForJxStoreSkuParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	StoreIDs		string
	VendorIDs		string
	IsAsync		bool
	IsContinueWhenError		bool
}

// func (c *SyncController) AddCreateFlagForJxStoreSku() {
// 	c.callAddCreateFlagForJxStoreSku(func(params *tSyncAddCreateFlagForJxStoreSkuParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SyncController) callAddCreateFlagForJxStoreSku(handler func(params *tSyncAddCreateFlagForJxStoreSkuParams) (interface{}, string, error)) {
	var err error
	params := &tSyncAddCreateFlagForJxStoreSkuParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.StoreIDs = utils.TrimBlankChar(c.GetString("storeIDs"))
	params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs"))
	if params.IsAsync, err = c.GetBool("isAsync", false); err != nil {
		errParams = append(errParams, "isAsync")
	}
	if params.IsContinueWhenError, err = c.GetBool("isContinueWhenError", false); err != nil {
		errParams = append(errParams, "isContinueWhenError")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("storeIDs")) != "" {
		params.MapData["storeIDs"] = params.StoreIDs
	}
	if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" {
		params.MapData["vendorIDs"] = params.VendorIDs
	}
	if utils.TrimBlankChar(c.GetString("isAsync")) != "" {
		params.MapData["isAsync"] = params.IsAsync
	}
	if utils.TrimBlankChar(c.GetString("isContinueWhenError")) != "" {
		params.MapData["isContinueWhenError"] = params.IsContinueWhenError
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SyncController.AddCreateFlagForJxStoreSku, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SyncController.AddCreateFlagForJxStoreSku, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SyncController.AddCreateFlagForJxStoreSku error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tUser2GetUserAgreementParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Name		string
	IdNumber		string
	BankNumber		string
	Mobile		string
}

// func (c *User2Controller) GetUserAgreement() {
// 	c.callGetUserAgreement(func(params *tUser2GetUserAgreementParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *User2Controller) callGetUserAgreement(handler func(params *tUser2GetUserAgreementParams) (interface{}, string, error)) {
	var err error
	params := &tUser2GetUserAgreementParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Name = utils.TrimBlankChar(c.GetString("name"))
	params.IdNumber = utils.TrimBlankChar(c.GetString("idNumber"))
	params.BankNumber = utils.TrimBlankChar(c.GetString("bankNumber"))
	params.Mobile = utils.TrimBlankChar(c.GetString("mobile"))
	if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" {
		params.MapData["token"] = params.Token
	}
	if utils.TrimBlankChar(c.GetString("name")) != "" {
		params.MapData["name"] = params.Name
	}
	if utils.TrimBlankChar(c.GetString("idNumber")) != "" {
		params.MapData["idNumber"] = params.IdNumber
	}
	if utils.TrimBlankChar(c.GetString("bankNumber")) != "" {
		params.MapData["bankNumber"] = params.BankNumber
	}
	if utils.TrimBlankChar(c.GetString("mobile")) != "" {
		params.MapData["mobile"] = params.Mobile
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API User2Controller.GetUserAgreement, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API User2Controller.GetUserAgreement, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API User2Controller.GetUserAgreement error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tSysGetWeimobTokenParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	AccessKey		string
	OldToken		string
	WaitSecond		int
}

// func (c *SysController) GetWeimobToken() {
// 	c.callGetWeimobToken(func(params *tSysGetWeimobTokenParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *SysController) callGetWeimobToken(handler func(params *tSysGetWeimobTokenParams) (interface{}, string, error)) {
	var err error
	params := &tSysGetWeimobTokenParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.AccessKey = utils.TrimBlankChar(c.GetString("accessKey"))
	params.OldToken = utils.TrimBlankChar(c.GetString("oldToken"))
	if params.WaitSecond, err = c.GetInt("waitSecond", 0); err != nil {
		errParams = append(errParams, "waitSecond")
	}
	if c.GetString("accessKey") == "" {
		errParams = append(errParams, "accessKey")
	}
	params.MapData["accessKey"] = params.AccessKey
	if utils.TrimBlankChar(c.GetString("oldToken")) != "" {
		params.MapData["oldToken"] = params.OldToken
	}
	if utils.TrimBlankChar(c.GetString("waitSecond")) != "" {
		params.MapData["waitSecond"] = params.WaitSecond
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API SysController.GetWeimobToken, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API SysController.GetWeimobToken, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API SysController.GetWeimobToken error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaQueryIncomingParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	MerchantNo		string
	StoreID		int
	Offset		int
	PageSize		int
}

// func (c *LaKaLaController) QueryIncoming() {
// 	c.callQueryIncoming(func(params *tLakalaQueryIncomingParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callQueryIncoming(handler func(params *tLakalaQueryIncomingParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaQueryIncomingParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.MerchantNo = utils.TrimBlankChar(c.GetString("merchantNo"))
	if params.StoreID, err = c.GetInt("storeID", 0); err != nil {
		errParams = append(errParams, "storeID")
	}
	if params.Offset, err = c.GetInt("offset", 0); err != nil {
		errParams = append(errParams, "offset")
	}
	if params.PageSize, err = c.GetInt("pageSize", 0); err != nil {
		errParams = append(errParams, "pageSize")
	}
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if utils.TrimBlankChar(c.GetString("merchantNo")) != "" {
		params.MapData["merchantNo"] = params.MerchantNo
	}
	if utils.TrimBlankChar(c.GetString("storeID")) != "" {
		params.MapData["storeID"] = params.StoreID
	}
	if utils.TrimBlankChar(c.GetString("offset")) != "" {
		params.MapData["offset"] = params.Offset
	}
	if utils.TrimBlankChar(c.GetString("pageSize")) != "" {
		params.MapData["pageSize"] = params.PageSize
	}
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.QueryIncoming, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.QueryIncoming, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.QueryIncoming error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSupplementBusinessLicenseParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *LaKaLaController) SupplementBusinessLicense() {
// 	c.callSupplementBusinessLicense(func(params *tLakalaSupplementBusinessLicenseParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSupplementBusinessLicense(handler func(params *tLakalaSupplementBusinessLicenseParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSupplementBusinessLicenseParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SupplementBusinessLicense, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SupplementBusinessLicense, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SupplementBusinessLicense error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}

type tLakalaSeparateUnBindParams struct {
	MapData	map[string]interface{}
	Ctx		*jxcontext.Context
	Token		string
	Payload		string
}

// func (c *LaKaLaController) SeparateUnBind() {
// 	c.callSeparateUnBind(func(params *tLakalaSeparateUnBindParams) (retVal interface{}, errCode string, err error) {
// 		return retVal, "", err
// 	})
// }
func (c *LaKaLaController) callSeparateUnBind(handler func(params *tLakalaSeparateUnBindParams) (interface{}, string, error)) {
	var err error
	params := &tLakalaSeparateUnBindParams{
		MapData : make(map[string]interface{}),
	}
	errParams := []string{}
	token	:= c.Ctx.Input.Header("token")
	errCode := model.ErrCodeGeneralFailed

	params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token"))
	params.Payload = utils.TrimBlankChar(c.GetString("payload"))
	if params.Token == "" {
		errCode = model.ErrCodeTokenIsInvalid
		err = model.ErrTokenIsInvalid
	}
	params.MapData["token"] = params.Token
	if c.GetString("payload") == "" {
		errParams = append(errParams, "payload")
	}
	params.MapData["payload"] = params.Payload
	if len(errParams) > 0 && err == nil {
		err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ","))
	}

	if err == nil {
		var (
			errCode2	string
			err2		error
			result interface{}
		)
		params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request)
		if err = err2; err == nil {
			globals.SugarLogger.Debugf("Begin API LaKaLaController.SeparateUnBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true))
			beginTime := time.Now()
			result, errCode2, err2 = handler(params)
			resultStr := ""
			if err = err2; err == nil {
				if globals.OutputDebugMsgLevel > 0 {
					resultStr = utils.Format4Output(result, true)
				}
				if len(resultStr) > 2000000 {
					resultStr = fmt.Sprintf("result len is:%d", len(resultStr))
				}
				if errCode2 != model.ErrorCodeIgnore {
					resultMarshal, _ := json.Marshal(result)
					c.Data["json"] = &CallResult{
						Code: model.ErrCodeSuccess,
						Data: string(resultMarshal),
					}
				} else {
					errCode = errCode2
				}
			}else {
				if errSync, ok := err2.(*cms.SyncError); ok {
					if _,ok := errSync.Original.(*cms.SpecSyncError);ok{
						errCode2 = model.ErrCodeJsonSyncErr
						errCode = errCode2
					}
				}
			}
			if globals.IsAddEvent {
				if params.Ctx != nil {
					if params.Ctx.GetRequest().Method != http.MethodGet{
						var (
							errMsg string
							errCodeEvent string
						)
						if err2 != nil {
							errMsg = err2.Error()
							errCodeEvent = errCode
						}else {
							errMsg = ""
							errCodeEvent = model.ErrCodeSuccess
						}
						event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "")
					}
				}
			}
			globals.SugarLogger.Debugf("End API LaKaLaController.SeparateUnBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n",
				params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond),
				utils.Format4Output(params.MapData, true), err, errCode2, resultStr)
		}
		if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" {
			errCode = errCode2
		}
		if err != nil {
			globals.SugarLogger.Debugf("API LaKaLaController.SeparateUnBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true))
		}
	}
	if errCode != model.ErrorCodeIgnore {
		if err != nil {
			if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) {
				errCode = err.(*jsonerr.Error).ErrCode()
			}
			c.Data["json"] = &CallResult{
				Code: errCode,
				Desc: err.Error(),
			}
		}
		c.ServeJSON()
	}
}
