|
@@ -78,6 +78,13 @@ func siteRouters() {
|
78
|
78
|
beego.Router("/api/site/addmagicnavi",&Microwebsite{},"Post:AddMagicNavi")
|
79
|
79
|
beego.Router("/api/site/getmagicimages",&Microwebsite{},"Post:GetMagicImages")
|
80
|
80
|
beego.Router("/api/site/addmarginchart",&Microwebsite{},"Post:AddMarginChart")
|
|
81
|
+ beego.Router("/api/site/deleteRotations",&Microwebsite{},"Post:DeleteRotations")
|
|
82
|
+ beego.Router("/api/site/editRotationImages",&Microwebsite{},"Post:EditRotationImages")
|
|
83
|
+ beego.Router("/api/site/updaterotaionimages",&Microwebsite{},"Post:SaveRotationImages")
|
|
84
|
+ beego.Router("/api/site/editnavigation",&Microwebsite{},"Post:EditNavigation")
|
|
85
|
+ beego.Router("/api/site/savenavigation",&Microwebsite{},"Post:SaveNavigation")
|
|
86
|
+ beego.Router("/api/site/addhospital",&Microwebsite{},"Post:AddHospital")
|
|
87
|
+ beego.Router("/api/site/deletimages",&Microwebsite{},"Post:DeleteImages")
|
81
|
88
|
}
|
82
|
89
|
|
83
|
90
|
type Microwebsite struct {
|
|
@@ -1836,9 +1843,11 @@ func (this *Microwebsite) GetShareInfo() {
|
1836
|
1843
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
1837
|
1844
|
return
|
1838
|
1845
|
}
|
|
1846
|
+ fmt.Println("错误是什么?",err)
|
1839
|
1847
|
this.ServeSuccessJSON(map[string]interface{}{
|
1840
|
1848
|
"share":share,
|
1841
|
1849
|
})
|
|
1850
|
+ fmt.Println("share是什么",share)
|
1842
|
1851
|
}
|
1843
|
1852
|
|
1844
|
1853
|
func (this *Microwebsite) DeleteNavition() {
|
|
@@ -2209,4 +2218,242 @@ func (this *Microwebsite) AddMarginChart() {
|
2209
|
2218
|
this.ServeSuccessJSON(map[string]interface{}{
|
2210
|
2219
|
"macnavigation":macnavigation,
|
2211
|
2220
|
})
|
|
2221
|
+}
|
|
2222
|
+
|
|
2223
|
+func (this *Microwebsite) DeleteRotations(){
|
|
2224
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2225
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2226
|
+ //fmt.Println("机构ID",userOrgID)
|
|
2227
|
+ id, _ := this.GetInt64("id")
|
|
2228
|
+ //fmt.Println("id是什么",id)
|
|
2229
|
+ err := site_service.DeleteRotations(id, userOrgID)
|
|
2230
|
+ if err !=nil{
|
|
2231
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除图片失败")
|
|
2232
|
+ return
|
|
2233
|
+ }
|
|
2234
|
+ returnData := make(map[string]interface{}, 0)
|
|
2235
|
+ returnData["msg"] = "ok"
|
|
2236
|
+ this.ServeSuccessJSON(returnData)
|
|
2237
|
+ return
|
|
2238
|
+}
|
|
2239
|
+
|
|
2240
|
+func (this *Microwebsite) EditRotationImages() {
|
|
2241
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2242
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2243
|
+ fmt.Println(userOrgID)
|
|
2244
|
+ id, _ := this.GetInt64("id")
|
|
2245
|
+ //fmt.Println("id是什么",id)
|
|
2246
|
+ editpiclink, err := site_service.UpdateRotationImages(userOrgID, id)
|
|
2247
|
+ if err !=nil{
|
|
2248
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2249
|
+ return
|
|
2250
|
+ }
|
|
2251
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2252
|
+ "editpiclink":editpiclink,
|
|
2253
|
+ })
|
|
2254
|
+}
|
|
2255
|
+
|
|
2256
|
+func (this *Microwebsite) SaveRotationImages() {
|
|
2257
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2258
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2259
|
+ fmt.Println("",userOrgID)
|
|
2260
|
+ id, _ := this.GetInt64("id")
|
|
2261
|
+ fmt.Println("id是什么",id)
|
|
2262
|
+
|
|
2263
|
+ dataBody := make(map[string]interface{}, 0)
|
|
2264
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
2265
|
+ if err != nil {
|
|
2266
|
+ utils.ErrorLog(err.Error())
|
|
2267
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
2268
|
+ return
|
|
2269
|
+ }
|
|
2270
|
+ images := dataBody["images"].(string)
|
|
2271
|
+ fmt.Println("图片编辑",images)
|
|
2272
|
+ if len(images) == 0 {
|
|
2273
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2274
|
+ return
|
|
2275
|
+ }
|
|
2276
|
+ sort :=int64(dataBody["sort"].(float64))
|
|
2277
|
+ fmt.Println("排序",sort)
|
|
2278
|
+ if(sort<=0){
|
|
2279
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong,"排序不能为空")
|
|
2280
|
+ return
|
|
2281
|
+ }
|
|
2282
|
+ piclink :=int64(dataBody["piclink"].(float64))
|
|
2283
|
+ fmt.Println("图片链接",piclink)
|
|
2284
|
+ if (piclink <= 0) {
|
|
2285
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2286
|
+ return
|
|
2287
|
+ }
|
|
2288
|
+ linkaddress := dataBody["linkaddress"].(string)
|
|
2289
|
+ if len(linkaddress) == 0 {
|
|
2290
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2291
|
+ return
|
|
2292
|
+ }
|
|
2293
|
+ fmt.Println("链接地址",linkaddress)
|
|
2294
|
+
|
|
2295
|
+ editpiclink := models.SgjPatientEditpiclink{
|
|
2296
|
+ Images: images,
|
|
2297
|
+ Sort: sort,
|
|
2298
|
+ Piclink: piclink,
|
|
2299
|
+ Linkaddress: linkaddress,
|
|
2300
|
+ }
|
|
2301
|
+ err = site_service.SaveRotationImages(id, userOrgID, editpiclink)
|
|
2302
|
+ fmt.Println("错误",err)
|
|
2303
|
+ if err !=nil{
|
|
2304
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2305
|
+ return
|
|
2306
|
+ }
|
|
2307
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2308
|
+ "editpiclink":editpiclink,
|
|
2309
|
+ })
|
|
2310
|
+}
|
|
2311
|
+
|
|
2312
|
+func (this *Microwebsite) EditNavigation() {
|
|
2313
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2314
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2315
|
+ fmt.Println("",userOrgID)
|
|
2316
|
+ id, _ := this.GetInt64("id")
|
|
2317
|
+ //fmt.Println("id是什么",id)
|
|
2318
|
+ navigation, err := site_service.EditNavigation(userOrgID,id)
|
|
2319
|
+ if err !=nil{
|
|
2320
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2321
|
+ return
|
|
2322
|
+ }
|
|
2323
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2324
|
+ "navigation":navigation,
|
|
2325
|
+ })
|
|
2326
|
+}
|
|
2327
|
+
|
|
2328
|
+func (this *Microwebsite) SaveNavigation() {
|
|
2329
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2330
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2331
|
+ fmt.Println("",userOrgID)
|
|
2332
|
+ id, _ := this.GetInt64("id")
|
|
2333
|
+ fmt.Println("id是多少呢",id)
|
|
2334
|
+ dataBody := make(map[string]interface{}, 0)
|
|
2335
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
2336
|
+ if err != nil {
|
|
2337
|
+ utils.ErrorLog(err.Error())
|
|
2338
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
2339
|
+ return
|
|
2340
|
+ }
|
|
2341
|
+ navtitle := dataBody["navtitle"].(string)
|
|
2342
|
+ fmt.Println("导航标题",navtitle)
|
|
2343
|
+ if len(navtitle) == 0 {
|
|
2344
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2345
|
+ return
|
|
2346
|
+ }
|
|
2347
|
+ navimages := dataBody["navimages"].(string)
|
|
2348
|
+ fmt.Println("导航图标选中",navimages)
|
|
2349
|
+ if len(navimages) == 0 {
|
|
2350
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2351
|
+ return
|
|
2352
|
+ }
|
|
2353
|
+
|
|
2354
|
+ //noCheckImages := dataBody["noCheckImages"].(string)
|
|
2355
|
+ //fmt.Println("导航图标选中",navimages)
|
|
2356
|
+ //if len(navimages) == 0 {
|
|
2357
|
+ // this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2358
|
+ // return
|
|
2359
|
+ //}
|
|
2360
|
+ jumpset := int64(dataBody["jumpset"].(float64))
|
|
2361
|
+ fmt.Println("跳转设置",jumpset)
|
|
2362
|
+ if jumpset <= 0 {
|
|
2363
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2364
|
+ return
|
|
2365
|
+ }
|
|
2366
|
+ navaddress := dataBody["navaddress"].(string)
|
|
2367
|
+ fmt.Println("链接地址",navaddress)
|
|
2368
|
+ navigation := models.SgjPatientNavigation{
|
|
2369
|
+ Navtitle: navtitle,
|
|
2370
|
+ Navimages: navimages,
|
|
2371
|
+ Jumpset: jumpset,
|
|
2372
|
+ Navaddress: navaddress,
|
|
2373
|
+ }
|
|
2374
|
+ err = site_service.UpdateNavtion(id, userOrgID, navigation)
|
|
2375
|
+ fmt.Println("err是什么",err)
|
|
2376
|
+ if err !=nil{
|
|
2377
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
|
2378
|
+ return
|
|
2379
|
+ }
|
|
2380
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2381
|
+ "navigation":navigation,
|
|
2382
|
+ })
|
|
2383
|
+}
|
|
2384
|
+
|
|
2385
|
+func (this *Microwebsite) AddHospital() {
|
|
2386
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2387
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2388
|
+ fmt.Println("机构ID",userOrgID)
|
|
2389
|
+ dataBody := make(map[string]interface{}, 0)
|
|
2390
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
2391
|
+ if err != nil {
|
|
2392
|
+ utils.ErrorLog(err.Error())
|
|
2393
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
2394
|
+ return
|
|
2395
|
+ }
|
|
2396
|
+ title := dataBody["title"].(string)
|
|
2397
|
+ fmt.Println("导航标题",title)
|
|
2398
|
+ if len(title) == 0 {
|
|
2399
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "标题不能为空")
|
|
2400
|
+ return
|
|
2401
|
+ }
|
|
2402
|
+ sort := int64(dataBody["sort"].(float64))
|
|
2403
|
+ if sort<=0{
|
|
2404
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong,"排序不能为空")
|
|
2405
|
+ return
|
|
2406
|
+ }
|
|
2407
|
+ fmt.Println("排序",sort)
|
|
2408
|
+ address :=dataBody["address"].(string)
|
|
2409
|
+ fmt.Println("医院地址",address)
|
|
2410
|
+ if len(address) == 0 {
|
|
2411
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "标题不能为空")
|
|
2412
|
+ return
|
|
2413
|
+ }
|
|
2414
|
+ patientOrdmodel := models.SgjPatientOrdmodel{
|
|
2415
|
+ Title: title,
|
|
2416
|
+ Sort: sort,
|
|
2417
|
+ UserOrgId: userOrgID,
|
|
2418
|
+ Status: 1,
|
|
2419
|
+ Ctime: time.Now().Unix(),
|
|
2420
|
+ ModeType: 2,
|
|
2421
|
+ }
|
|
2422
|
+ site_service.AddOrdModel(&patientOrdmodel)
|
|
2423
|
+ ordmodel, err := site_service.QueryOrdeModelByID(userOrgID)
|
|
2424
|
+
|
|
2425
|
+ hosaddress := models.SgjPatientHosaddress{
|
|
2426
|
+ Title: title,
|
|
2427
|
+ Sort: sort,
|
|
2428
|
+ Address: address,
|
|
2429
|
+ UserOrgId: userOrgID,
|
|
2430
|
+ Status: 1,
|
|
2431
|
+ Ctime: time.Now().Unix(),
|
|
2432
|
+ Modeid: ordmodel.ID,
|
|
2433
|
+ }
|
|
2434
|
+ err = site_service.AddHosAddress(&hosaddress)
|
|
2435
|
+ if err !=nil{
|
|
2436
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
|
2437
|
+ return
|
|
2438
|
+ }
|
|
2439
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2440
|
+ "hosaddress":hosaddress,
|
|
2441
|
+ })
|
|
2442
|
+}
|
|
2443
|
+
|
|
2444
|
+func (this *Microwebsite) DeleteImages() {
|
|
2445
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2446
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2447
|
+ fmt.Println("机构ID",userOrgID)
|
|
2448
|
+ id, _:= this.GetInt64("id")
|
|
2449
|
+ fmt.Println("id是神么",id)
|
|
2450
|
+ err := site_service.DeleteImages(id, userOrgID)
|
|
2451
|
+ if err !=nil{
|
|
2452
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2453
|
+ return
|
|
2454
|
+ }
|
|
2455
|
+ returnData := make(map[string]interface{}, 0)
|
|
2456
|
+ returnData["msg"] = "ok"
|
|
2457
|
+ this.ServeSuccessJSON(returnData)
|
|
2458
|
+ return
|
2212
|
2459
|
}
|