瀏覽代碼

Merge branch 'master' of http://git.shengws.com/csx/XT_New

See999 5 年之前
父節點
當前提交
d222cb44ae

+ 3 - 2
controllers/dialysis_api_controller.go 查看文件

2885
 	psychological_assessment_other := c.GetString("psychological_assessment_other")
2885
 	psychological_assessment_other := c.GetString("psychological_assessment_other")
2886
 	sick_condition_other := c.GetString("sick_condition_other")
2886
 	sick_condition_other := c.GetString("sick_condition_other")
2887
 
2887
 
2888
-	precaution, _ := c.GetInt64("precaution", 0)
2888
+	//precaution, _ := c.GetInt64("precaution", 0)
2889
+	precaution := c.GetString("precaution")
2889
 	precaution_other := c.GetString("precaution_other")
2890
 	precaution_other := c.GetString("precaution_other")
2890
 	psychological_other := c.GetString("psychological_other")
2891
 	psychological_other := c.GetString("psychological_other")
2891
 	admission_number := c.GetString("admission_number")
2892
 	admission_number := c.GetString("admission_number")
3066
 	assessment.Dialyzer = data.Dialyzer
3067
 	assessment.Dialyzer = data.Dialyzer
3067
 	assessment.IsEat = data.IsEat
3068
 	assessment.IsEat = data.IsEat
3068
 	assessment.CvcA = data.CvcA
3069
 	assessment.CvcA = data.CvcA
3069
-	assessment.CvcB = data.CvcB
3070
+	assessment.CvcV = data.CvcV
3070
 	assessment.Channel = data.Channel
3071
 	assessment.Channel = data.Channel
3071
 
3072
 
3072
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
3073
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)

+ 31 - 31
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

637
 	score := c.GetString("score")
637
 	score := c.GetString("score")
638
 	sick_condition_other := c.GetString("sick_condition_other")
638
 	sick_condition_other := c.GetString("sick_condition_other")
639
 
639
 
640
-	precaution, _ := c.GetInt64("precaution", 0)
640
+	//precaution, _ := c.GetInt64("precaution", 0)
641
+	precaution := c.GetString("precaution")
641
 	precaution_other := c.GetString("precaution_other")
642
 	precaution_other := c.GetString("precaution_other")
642
 	psychological_other := c.GetString("psychological_other")
643
 	psychological_other := c.GetString("psychological_other")
643
 
644
 
784
 	is_eat, _ := c.GetInt64("is_eat", 0)
785
 	is_eat, _ := c.GetInt64("is_eat", 0)
785
 
786
 
786
 	cvc_a, _ := c.GetFloat("cvc_a", 0)
787
 	cvc_a, _ := c.GetFloat("cvc_a", 0)
787
-	cvc_b, _ := c.GetFloat("cvc_b", 0)
788
+	cvc_v, _ := c.GetFloat("cvc_v", 0)
788
 	channels, _ := c.GetInt64("channel", 0)
789
 	channels, _ := c.GetInt64("channel", 0)
789
 
790
 
790
 	if id <= 0 {
791
 	if id <= 0 {
826
 	}
827
 	}
827
 
828
 
828
 	assessmentAfterDislysis := models.AssessmentAfterDislysis{
829
 	assessmentAfterDislysis := models.AssessmentAfterDislysis{
829
-		UserOrgId:              adminUserInfo.Org.Id,
830
-		PatientId:              id,
831
-		AssessmentDate:         recordDate.Unix(),
832
-		Temperature:            temperature,
833
-		PulseFrequency:         pulse_frequency,
834
-		BreathingRate:          breathing_rate,
835
-		SystolicBloodPressure:  systolic_blood_pressure,
836
-		DiastolicBloodPressure: diastolic_blood_pressure,
837
-		ActualUltrafiltration:  actual_ultrafiltration,
838
-		ActualDisplacement:     actual_displacement,
839
-		ActualTreatmentHour:    actualtreatHour,
840
-		ActualTreatmentMinute:  actualtreatmin,
841
-		WeightAfter:            weightAfter,
842
-		AdditionalWeight:       additionalWeight,
843
-		WeightLoss:             weightReduce,
844
-		Cruor:                  cruor,
845
-		SymptomAfterDialysis:   symptomsAfterDialysi,
846
-		InternalFistula:        internalFistula,
847
-		Catheter:               catheter,
848
-		Complication:           complications,
849
-		DialysisIntakes:        dialysateVolume,
850
-		CreatedTime:            time.Now().Unix(),
851
-		Status:                 1,
852
-		Remark:                 remark,
853
-		BloodAccessPartId:      blood_access_part_id,
854
-		BloodAccessPartOperaId: blood_access_part_opera_id,
855
-		DialysisIntakesUnit:    dialysis_intakes_unit,
856
-
830
+		UserOrgId:                    adminUserInfo.Org.Id,
831
+		PatientId:                    id,
832
+		AssessmentDate:               recordDate.Unix(),
833
+		Temperature:                  temperature,
834
+		PulseFrequency:               pulse_frequency,
835
+		BreathingRate:                breathing_rate,
836
+		SystolicBloodPressure:        systolic_blood_pressure,
837
+		DiastolicBloodPressure:       diastolic_blood_pressure,
838
+		ActualUltrafiltration:        actual_ultrafiltration,
839
+		ActualDisplacement:           actual_displacement,
840
+		ActualTreatmentHour:          actualtreatHour,
841
+		ActualTreatmentMinute:        actualtreatmin,
842
+		WeightAfter:                  weightAfter,
843
+		AdditionalWeight:             additionalWeight,
844
+		WeightLoss:                   weightReduce,
845
+		Cruor:                        cruor,
846
+		SymptomAfterDialysis:         symptomsAfterDialysi,
847
+		InternalFistula:              internalFistula,
848
+		Catheter:                     catheter,
849
+		Complication:                 complications,
850
+		DialysisIntakes:              dialysateVolume,
851
+		CreatedTime:                  time.Now().Unix(),
852
+		Status:                       1,
853
+		Remark:                       remark,
854
+		BloodAccessPartId:            blood_access_part_id,
855
+		BloodAccessPartOperaId:       blood_access_part_opera_id,
856
+		DialysisIntakesUnit:          dialysis_intakes_unit,
857
 		PuncturePointOozingBlood:     puncturePointOozingBlood,
857
 		PuncturePointOozingBlood:     puncturePointOozingBlood,
858
 		PuncturePointHaematoma:       puncturePointHaematoma,
858
 		PuncturePointHaematoma:       puncturePointHaematoma,
859
 		InternalFistulaTremorAc:      internalFistulaTremorAc,
859
 		InternalFistulaTremorAc:      internalFistulaTremorAc,
875
 		InAdvanceReasonOther:         in_advance_reason_other,
875
 		InAdvanceReasonOther:         in_advance_reason_other,
876
 		IsEat:                        is_eat,
876
 		IsEat:                        is_eat,
877
 		CvcA:                         cvc_a,
877
 		CvcA:                         cvc_a,
878
-		CvcB:                         cvc_b,
878
+		CvcV:                         cvc_v,
879
 		Channel:                      channels,
879
 		Channel:                      channels,
880
 	}
880
 	}
881
 
881
 

+ 31 - 6
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

1803
 	//跟剧机构ID获取APPID
1803
 	//跟剧机构ID获取APPID
1804
 	app, _ := service.GetAppId(orgid)
1804
 	app, _ := service.GetAppId(orgid)
1805
 	name, err := service.GetRoleName(id, orgid, app.Id)
1805
 	name, err := service.GetRoleName(id, orgid, app.Id)
1806
+
1806
 	//获取管理员
1807
 	//获取管理员
1807
 	admin, err := service.GetAdmin(id)
1808
 	admin, err := service.GetAdmin(id)
1808
 	positionName, err := service.GetPositionName(id, orgid, app.Id)
1809
 	positionName, err := service.GetPositionName(id, orgid, app.Id)
1815
 			names = role.RoleName + "," + names
1816
 			names = role.RoleName + "," + names
1816
 		}
1817
 		}
1817
 	}
1818
 	}
1818
-	fmt.Println("role_ids--------------", role_ids)
1819
+	//fmt.Println("role_ids--------------", role_ids)
1819
 	if err != nil {
1820
 	if err != nil {
1820
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1821
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1821
 		return
1822
 		return
2252
 	//OrgId, _ := service.GetCreatByOrgId(orgid)
2253
 	//OrgId, _ := service.GetCreatByOrgId(orgid)
2253
 	//fmt.Println("创建者ID", OrgId.Creator)
2254
 	//fmt.Println("创建者ID", OrgId.Creator)
2254
 	creatId := adminUserInfo.AdminUser.Id
2255
 	creatId := adminUserInfo.AdminUser.Id
2255
-	fmt.Println("creatid", creatId)
2256
+	//fmt.Println("creatid", creatId)
2256
 	fmt.Println("当前机构ID信息", orgid)
2257
 	fmt.Println("当前机构ID信息", orgid)
2257
 	Username, err := service.GetMyOrgInformationFour(creatId, orgid)
2258
 	Username, err := service.GetMyOrgInformationFour(creatId, orgid)
2258
 	if err != nil {
2259
 	if err != nil {
2503
 }
2504
 }
2504
 
2505
 
2505
 func (this *NewDialysisApiController) GetMobile() {
2506
 func (this *NewDialysisApiController) GetMobile() {
2506
-	fmt.Println("--------------触发了没有")
2507
 	adminInfo := this.GetMobileAdminUserInfo()
2507
 	adminInfo := this.GetMobileAdminUserInfo()
2508
 	id := adminInfo.AdminUser.Id
2508
 	id := adminInfo.AdminUser.Id
2509
 
2509
 
2521
 
2521
 
2522
 	adminInfo := this.GetMobileAdminUserInfo()
2522
 	adminInfo := this.GetMobileAdminUserInfo()
2523
 	cretor := adminInfo.AdminUser.Id
2523
 	cretor := adminInfo.AdminUser.Id
2524
-	cretorPosition, err := service.GetRolePosition(cretor)
2525
-	fmt.Println("cretorPosition", cretorPosition.RoleName)
2524
+	orgid := adminInfo.Org.Id
2525
+
2526
+	//去查角色
2527
+	role, err := service.GetAdminUserRole(cretor, orgid)
2528
+	fmt.Println("role----------------", role.RoleIds)
2529
+	role_ids := strings.Split(role.RoleIds, ",")
2530
+	var names = ""
2531
+	for _, item := range role_ids {
2532
+		id, _ := strconv.ParseInt(item, 10, 64)
2533
+		role, _ := service.GetRole(id)
2534
+		if len(role.RoleName) != 0 {
2535
+			names = role.RoleName + "," + names
2536
+		}
2537
+	}
2538
+	if err != nil {
2539
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2540
+		return
2541
+	}
2542
+	this.ServeSuccessJSON(map[string]interface{}{
2543
+		"names": names,
2544
+	})
2545
+}
2546
+
2547
+func (this *NewDialysisApiController) GetOrgs() {
2548
+	adminInfo := this.GetMobileAdminUserInfo()
2549
+	fmt.Println("a---------")
2550
+	orgs, err := service.GetOrgs(adminInfo.AdminUser.Id)
2526
 	if err != nil {
2551
 	if err != nil {
2527
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2552
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2528
 		return
2553
 		return
2529
 	}
2554
 	}
2530
 	this.ServeSuccessJSON(map[string]interface{}{
2555
 	this.ServeSuccessJSON(map[string]interface{}{
2531
-		"cretorPosition": cretorPosition,
2556
+		"orgs": orgs,
2532
 	})
2557
 	})
2533
 }
2558
 }

+ 2 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go 查看文件

153
 	beego.Router("/m/api/patient/sumitform", &NewDialysisApiController{}, "Get:SumitForm")
153
 	beego.Router("/m/api/patient/sumitform", &NewDialysisApiController{}, "Get:SumitForm")
154
 	beego.Router("/m/api/patient/getroleposition", &NewDialysisApiController{}, "Get:GetRolePosition")
154
 	beego.Router("/m/api/patient/getroleposition", &NewDialysisApiController{}, "Get:GetRolePosition")
155
 	beego.Router("/m/api/patient/getmobile", &NewDialysisApiController{}, "Get:GetMobile")
155
 	beego.Router("/m/api/patient/getmobile", &NewDialysisApiController{}, "Get:GetMobile")
156
+	beego.Router("/m/api/patient/getorgs", &NewDialysisApiController{}, "Get:GetOrgs")
157
+
156
 }
158
 }

+ 1 - 1
models/device_models.go 查看文件

833
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat" form:"is_eat"`
833
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat" form:"is_eat"`
834
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit" form:"dialysis_intakes_unit"`
834
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit" form:"dialysis_intakes_unit"`
835
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
835
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
836
-	CvcB                            float64 `gorm:"column:cvc_b" json:"cvc_b" form:"cvc_b"`
836
+	CvcV                            float64 `gorm:"column:cvc_v" json:"cvc_v" form:"cvc_v"`
837
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
837
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
838
 }
838
 }
839
 
839
 

+ 6 - 2
models/dialysis.go 查看文件

546
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
546
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
547
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
547
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
548
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
548
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
549
-	CvcB                            float64 `gorm:"column:cvc_b" json:"cvc_b" form:"cvc_b"`
549
+	CvcV                            float64 `gorm:"column:cvc_v" json:"cvc_v" form:"cvc_v"`
550
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
550
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
551
 }
551
 }
552
 
552
 
782
 	PsychologicalAssessmentOther string `gorm:"column:psychological_assessment_other" json:"psychological_assessment_other"`
782
 	PsychologicalAssessmentOther string `gorm:"column:psychological_assessment_other" json:"psychological_assessment_other"`
783
 	Score                        string `gorm:"column:score" json:"score"`
783
 	Score                        string `gorm:"column:score" json:"score"`
784
 	SickConditionOther           string `gorm:"column:sick_condition_other" json:"sick_condition_other"`
784
 	SickConditionOther           string `gorm:"column:sick_condition_other" json:"sick_condition_other"`
785
-	Precaution                   int64  `gorm:"column:precaution" json:"precaution"`
785
+	Precaution                   string `gorm:"column:precaution" json:"precaution"`
786
 	PrecautionOther              string `gorm:"column:precaution_other" json:"precaution_other"`
786
 	PrecautionOther              string `gorm:"column:precaution_other" json:"precaution_other"`
787
 	PsychologicalOther           string `gorm:"column:psychological_other" json:"psychological_other"`
787
 	PsychologicalOther           string `gorm:"column:psychological_other" json:"psychological_other"`
788
 	IsPrecaution                 int64  `gorm:"column:is_precaution" json:"is_precaution"`
788
 	IsPrecaution                 int64  `gorm:"column:is_precaution" json:"is_precaution"`
824
 	Sex           int64  `gorm:"column:sex" json:"sex" form:"sex"`
824
 	Sex           int64  `gorm:"column:sex" json:"sex" form:"sex"`
825
 	Birthday      int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
825
 	Birthday      int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
826
 	UserTitleName string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
826
 	UserTitleName string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
827
+	RoleIds       string `gorm:"column:role_ids" json:"role_ids" form:"role_ids"`
828
+	OrgName       string `gorm:"column:org_name" json:"org_name" form:"org_name"`
829
+	OrgLogo       string `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
830
+	Creator       int64  `gorm:"column:creator" json:"creator" form:"creator"`
827
 }
831
 }
828
 
832
 
829
 func (SgjUserAdminRole) TableName() string {
833
 func (SgjUserAdminRole) TableName() string {

+ 14 - 0
service/manage_service.go 查看文件

1087
 	return err
1087
 	return err
1088
 }
1088
 }
1089
 
1089
 
1090
+func GetAdminUserRole(id int64, orgid int64) (models.SgjUserAdminRole, error) {
1091
+	role := models.SgjUserAdminRole{}
1092
+	err := UserReadDB().Where("admin_user_id = ? and org_id = ? and status = 1", id, orgid).Find(&role).Error
1093
+	return role, err
1094
+}
1095
+
1090
 func GetRolePosition(id int64) (models.SgjUserRole, error) {
1096
 func GetRolePosition(id int64) (models.SgjUserRole, error) {
1091
 	role := models.SgjUserRole{}
1097
 	role := models.SgjUserRole{}
1092
 	err := UserReadDB().Where("id = ? And status =1", id).Find(&role).Error
1098
 	err := UserReadDB().Where("id = ? And status =1", id).Find(&role).Error
1098
 	err := UserReadDB().Where("id=? and status = 1", id).Find(&admin).Error
1104
 	err := UserReadDB().Where("id=? and status = 1", id).Find(&admin).Error
1099
 	return admin, err
1105
 	return admin, err
1100
 }
1106
 }
1107
+
1108
+func GetOrgs(id int64) (roles []*models.SgjUserAdminRole, err error) {
1109
+
1110
+	db := UserReadDB().Table("sgj_user_admin_role as s").Where("s.status = 1")
1111
+	err = db.Group("s.org_id").Select("s.id,s.admin_user_id,s.org_id,s.app_id,s.role_id,s.user_name,s.avatar,s.user_type,s.user_title,s.intro,s.user_title_name,s.role_ids,s.message,s.sex,s.birthday,x.org_name,x.org_logo,x.creator").Where("s.admin_user_id = ?", id).Joins("left join sgj_user_org as x on x.id = s.org_id").Scan(&roles).Error
1112
+
1113
+	return roles, err
1114
+}

+ 2 - 2
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go 查看文件

319
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
319
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
320
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
320
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
321
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
321
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
322
-	CvcB                            float64 `gorm:"column:cvc_b" json:"cvc_b" form:"cvc_b"`
322
+	CvcV                            float64 `gorm:"column:cvc_v" json:"cvc_v" form:"cvc_v"`
323
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
323
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
324
 }
324
 }
325
 
325
 
385
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
385
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
386
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
386
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
387
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
387
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
388
-	CvcB                            float64 `gorm:"column:cvc_b" json:"cvc_b" form:"cvc_b"`
388
+	CvcV                            float64 `gorm:"column:cvc_v" json:"cvc_v" form:"cvc_v"`
389
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
389
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
390
 }
390
 }
391
 
391