Ver código fonte

更新代码

XMLWAN 4 anos atrás
pai
commit
aae130f404

+ 1 - 1
conf/app.conf Ver arquivo

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9529
2
+httpport = 9531
3 3
 runmode = dev
4 4
 
5 5
 

+ 68 - 5
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Ver arquivo

@@ -2254,8 +2254,8 @@ func (this *NewDialysisApiController) GetMyInformationFour() {
2254 2254
 	//OrgId, _ := service.GetCreatByOrgId(orgid)
2255 2255
 	//fmt.Println("创建者ID", OrgId.Creator)
2256 2256
 	creatId := adminUserInfo.AdminUser.Id
2257
-	fmt.Println("creatid-----------------------------", creatId)
2258
-	fmt.Println("当前机构ID信息---------------------", orgid)
2257
+	fmt.Println("creatid", creatId)
2258
+	fmt.Println("当前机构ID信息", orgid)
2259 2259
 	Username, err := service.GetMyOrgInformationFour(creatId, orgid)
2260 2260
 	if err != nil {
2261 2261
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
@@ -2371,7 +2371,6 @@ func (this *NewDialysisApiController) GetMyOrgInformation() {
2371 2371
 	fmt.Println("cretor", creator)
2372 2372
 	adminInfo := this.GetMobileAdminUserInfo()
2373 2373
 	appId := adminInfo.App.Id
2374
-	//fmt.Println("appid------------------------------------",appId)
2375 2374
 	information, err := service.GetMyOrgInformation(creator, appId)
2376 2375
 	if err != nil {
2377 2376
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
@@ -2386,12 +2385,11 @@ func (this *NewDialysisApiController) SaveNameTwo() {
2386 2385
 	id, _ := this.GetInt64("id")
2387 2386
 	name := this.GetString("name")
2388 2387
 	orgid, _ := this.GetInt64("orgid")
2389
-	fmt.Println("name------------------", name)
2390 2388
 	role := models.SgjUserAdminRole{
2391 2389
 		UserName: name,
2392 2390
 	}
2393 2391
 	err := service.SaveNameTwo(id, orgid, &role)
2394
-	fmt.Println("err----------------------------------", err)
2392
+	fmt.Println("err", err)
2395 2393
 	if err != nil {
2396 2394
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2397 2395
 		return
@@ -2440,3 +2438,68 @@ func (this *NewDialysisApiController) GetMyMobile() {
2440 2438
 		"mobile": mobile,
2441 2439
 	})
2442 2440
 }
2441
+
2442
+func (this *NewDialysisApiController) SumitForm() {
2443
+
2444
+	name := this.GetString("name")
2445
+	fmt.Println("姓名", name)
2446
+	mobile := this.GetString("mobile")
2447
+	fmt.Println("mobile", mobile)
2448
+	address := this.GetString("address")
2449
+	fmt.Println("address", address)
2450
+	positon := this.GetString("position")
2451
+	fmt.Println("职位", positon)
2452
+	hospitalName := this.GetString("hospitalName")
2453
+	fmt.Println("医院名称", hospitalName)
2454
+	systemName := this.GetString("systemName")
2455
+	fmt.Println("系统名称", systemName)
2456
+	isUser, _ := this.GetInt64("isUser")
2457
+	fmt.Println("是否使用", isUser)
2458
+	isThink, _ := this.GetInt64("isThink")
2459
+	fmt.Println("是否考虑", isThink)
2460
+	result := this.GetString("result")
2461
+	fmt.Println("result", result)
2462
+	otherRemark := this.GetString("otherRemark")
2463
+	fmt.Println("result", otherRemark)
2464
+	otherMessage := this.GetString("otherMessage")
2465
+	fmt.Println("otherMessage", otherMessage)
2466
+	gift, _ := this.GetInt64("gift")
2467
+	fmt.Println("gift", gift)
2468
+	admininfo := this.GetMobileAdminUserInfo()
2469
+	creator := admininfo.AdminUser.Id
2470
+	fmt.Println("创建者", creator)
2471
+	_, errcode := service.GetActivtyCreator(creator)
2472
+	if errcode == gorm.ErrRecordNotFound {
2473
+		table := models.KyActivityTable{
2474
+			Name:         name,
2475
+			Phone:        mobile,
2476
+			Address:      address,
2477
+			Position:     positon,
2478
+			HospitalName: hospitalName,
2479
+			SystemName:   systemName,
2480
+			IsUser:       isUser,
2481
+			IsThink:      isThink,
2482
+			OtherMode:    result,
2483
+			OtherRemark:  otherRemark,
2484
+			OtherMessage: otherMessage,
2485
+			Gift:         gift,
2486
+			AdminUserId:  creator,
2487
+			Status:       1,
2488
+			Ctime:        time.Now().Unix(),
2489
+		}
2490
+		err := service.CreateTable(&table)
2491
+		if err != nil {
2492
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2493
+			return
2494
+		}
2495
+		this.ServeSuccessJSON(map[string]interface{}{
2496
+			"table": table,
2497
+		})
2498
+	} else if errcode == nil {
2499
+		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2500
+		this.ServeJSON()
2501
+		return
2502
+	} else {
2503
+		return
2504
+	}
2505
+}

+ 1 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go Ver arquivo

@@ -150,4 +150,5 @@ func NewMobileAPIControllersRegisterRouters() {
150 150
 	beego.Router("/m/api/patient/getcurrentorg", &NewDialysisApiController{}, "Get:GetCurrentOrg")
151 151
 	beego.Router("/m/api/patient/getmyinformationfour", &NewDialysisApiController{}, "Get:GetMyInformationFour")
152 152
 	beego.Router("/m/api/org/getMyMobile", &NewDialysisApiController{}, "Get:GetMyMobile")
153
+	beego.Router("/m/api/patient/sumitform", &NewDialysisApiController{}, "Get:SumitForm")
153 154
 }

+ 26 - 0
models/patient_models.go Ver arquivo

@@ -813,3 +813,29 @@ func (SgjUserAdminLoginLog) TableName() string {
813 813
 
814 814
 	return "sgj_user_admin_login_log"
815 815
 }
816
+
817
+type KyActivityTable struct {
818
+	ID           int64  `gorm:"column:id" json:"id" form:"id"`
819
+	Name         string `gorm:"column:name" json:"name" form:"name"`
820
+	Phone        string `gorm:"column:phone" json:"phone" form:"phone"`
821
+	Address      string `gorm:"column:address" json:"address" form:"address"`
822
+	Position     string `gorm:"column:position" json:"position" form:"position"`
823
+	HospitalName string `gorm:"column:hospital_name" json:"hospital_name" form:"hospital_name"`
824
+	IsUser       int64  `gorm:"column:is_user" json:"is_user" form:"is_user"`
825
+	IsThink      int64  `gorm:"column:is_think" json:"is_think" form:"is_think"`
826
+	OtherMode    string `gorm:"column:other_mode" json:"other_mode" form:"other_mode"`
827
+	OtherRemark  string `gorm:"column:other_remark" json:"other_remark" form:"other_remark"`
828
+	Gift         int64  `gorm:"column:gift" json:"gift" form:"gift"`
829
+	OtherMessage string `gorm:"column:other_message" json:"other_message" form:"other_message"`
830
+	UserOrgId    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
831
+	Status       int64  `gorm:"column:status" json:"status" form:"status"`
832
+	Ctime        int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
833
+	Mtime        int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
834
+	SystemName   string `gorm:"column:system_name" json:"system_name" form:"system_name"`
835
+	AdminUserId  int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
836
+}
837
+
838
+func (KyActivityTable) TableName() string {
839
+
840
+	return "ky_activity_table"
841
+}

+ 18 - 0
service/manage_service.go Ver arquivo

@@ -1068,3 +1068,21 @@ func DeleteImages(id int64) error {
1068 1068
 	err := UserWriteDB().Model(&repair).Where("id=?", id).Update(map[string]interface{}{"images": "", "image_name": ""}).Error
1069 1069
 	return err
1070 1070
 }
1071
+
1072
+func GetActivtyCreator(creator int64) (*models.KyActivityTable, error) {
1073
+	table := models.KyActivityTable{}
1074
+	err := UserReadDB().Model(&table).Where("admin_user_id = ? and status =1", creator).Find(&table).Error
1075
+	if err == gorm.ErrRecordNotFound {
1076
+		return nil, err
1077
+	}
1078
+	if err != nil {
1079
+		return nil, err
1080
+	}
1081
+	return &table, nil
1082
+}
1083
+
1084
+func CreateTable(table *models.KyActivityTable) error {
1085
+
1086
+	err := UserWriteDB().Model(&table).Create(&table).Error
1087
+	return err
1088
+}