aa
This commit is contained in:
@@ -1214,6 +1214,37 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CreateStoreByUser(ctx *jxcontext.Context, mobile string) (id int, err error) {
|
||||||
|
store := &model.Store{}
|
||||||
|
db := dao.GetDB()
|
||||||
|
store.Lng = jxutils.StandardCoordinate2Int(104.3975)
|
||||||
|
store.Lat = jxutils.StandardCoordinate2Int(30.504679)
|
||||||
|
store.Address = "成都市简阳市简阳市"
|
||||||
|
store.Name = "无名称" + utils.Int64ToStr(time.Now().Unix())
|
||||||
|
store.DeliveryRangeType = model.DeliveryRangeTypeRadius
|
||||||
|
store.DeliveryRange = "3000"
|
||||||
|
store.PayPercentage = 100
|
||||||
|
store.Status = model.StoreStatusClosed
|
||||||
|
store.OpenTime1 = 700
|
||||||
|
store.CloseTime1 = 1900
|
||||||
|
store.Tel1 = mobile
|
||||||
|
store.CityCode = 510100
|
||||||
|
store.DistrictCode = 510185
|
||||||
|
store.BrandID = 1
|
||||||
|
if store.StoreLevel == "" {
|
||||||
|
store.StoreLevel = "C"
|
||||||
|
}
|
||||||
|
dao.WrapAddIDCULDEntity(store, ctx.GetUserName())
|
||||||
|
if err = dao.CreateEntity(db, store); err == nil {
|
||||||
|
if globals.IsAddEvent {
|
||||||
|
err = AddEventDetail(db, ctx, model.OperateAdd, store.ID, model.ThingTypeStore, store.ID, "", "")
|
||||||
|
}
|
||||||
|
TryAddStoreBossRole4StoreByMobile(ctx, store.ID, []string{mobile})
|
||||||
|
return store.ID, err
|
||||||
|
}
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
func GetStoreVendorMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, vendorID int) (storeMaps []*model.StoreMap, err error) {
|
func GetStoreVendorMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, vendorID int) (storeMaps []*model.StoreMap, err error) {
|
||||||
cond := map[string]interface{}{
|
cond := map[string]interface{}{
|
||||||
model.FieldStoreID: storeID,
|
model.FieldStoreID: storeID,
|
||||||
|
|||||||
@@ -143,6 +143,20 @@ func (c *StoreController) CreateStore() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Title 商户创建京西门店
|
||||||
|
// @Description 商户创建京西门店
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param mobile formData string true "电话"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /CreateStoreByUser [post]
|
||||||
|
func (c *StoreController) CreateStoreByUser() {
|
||||||
|
c.callCreateStoreByUser(func(params *tStoreCreateStoreByUserParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
retVal, err = cms.CreateStoreByUser(params.Ctx, params.Mobile)
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// @Title 得到门店映射信息
|
// @Title 得到门店映射信息
|
||||||
// @Description 得到门店映射信息
|
// @Description 得到门店映射信息
|
||||||
// @Param token header string false "认证token"
|
// @Param token header string false "认证token"
|
||||||
|
|||||||
@@ -2142,6 +2142,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
||||||
|
web.ControllerComments{
|
||||||
|
Method: "CreateStoreByUser",
|
||||||
|
Router: `/CreateStoreByUser`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
||||||
web.ControllerComments{
|
web.ControllerComments{
|
||||||
Method: "CreateStoreAudit",
|
Method: "CreateStoreAudit",
|
||||||
|
|||||||
Reference in New Issue
Block a user