Преглед изворни кода

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

See999 пре 4 година
родитељ
комит
d222cb44ae

+ 3 - 2
controllers/dialysis_api_controller.go Прегледај датотеку

@@ -2885,7 +2885,8 @@ func (c *DialysisApiController) PostReceiveTreatmentAsses() {
2885 2885
 	psychological_assessment_other := c.GetString("psychological_assessment_other")
2886 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 2890
 	precaution_other := c.GetString("precaution_other")
2890 2891
 	psychological_other := c.GetString("psychological_other")
2891 2892
 	admission_number := c.GetString("admission_number")
@@ -3066,7 +3067,7 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
3066 3067
 	assessment.Dialyzer = data.Dialyzer
3067 3068
 	assessment.IsEat = data.IsEat
3068 3069
 	assessment.CvcA = data.CvcA
3069
-	assessment.CvcB = data.CvcB
3070
+	assessment.CvcV = data.CvcV
3070 3071
 	assessment.Channel = data.Channel
3071 3072
 
3072 3073
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)

+ 31 - 31
controllers/mobile_api_controllers/dialysis_api_controller.go Прегледај датотеку

@@ -637,7 +637,8 @@ func (c *DialysisAPIController) PostAcceptsAssessment() {
637 637
 	score := c.GetString("score")
638 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 642
 	precaution_other := c.GetString("precaution_other")
642 643
 	psychological_other := c.GetString("psychological_other")
643 644
 
@@ -784,7 +785,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
784 785
 	is_eat, _ := c.GetInt64("is_eat", 0)
785 786
 
786 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 789
 	channels, _ := c.GetInt64("channel", 0)
789 790
 
790 791
 	if id <= 0 {
@@ -826,34 +827,33 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
826 827
 	}
827 828
 
828 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 857
 		PuncturePointOozingBlood:     puncturePointOozingBlood,
858 858
 		PuncturePointHaematoma:       puncturePointHaematoma,
859 859
 		InternalFistulaTremorAc:      internalFistulaTremorAc,
@@ -875,7 +875,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
875 875
 		InAdvanceReasonOther:         in_advance_reason_other,
876 876
 		IsEat:                        is_eat,
877 877
 		CvcA:                         cvc_a,
878
-		CvcB:                         cvc_b,
878
+		CvcV:                         cvc_v,
879 879
 		Channel:                      channels,
880 880
 	}
881 881
 

+ 31 - 6
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Прегледај датотеку

@@ -1803,6 +1803,7 @@ func (this *NewDialysisApiController) GetRoleName() {
1803 1803
 	//跟剧机构ID获取APPID
1804 1804
 	app, _ := service.GetAppId(orgid)
1805 1805
 	name, err := service.GetRoleName(id, orgid, app.Id)
1806
+
1806 1807
 	//获取管理员
1807 1808
 	admin, err := service.GetAdmin(id)
1808 1809
 	positionName, err := service.GetPositionName(id, orgid, app.Id)
@@ -1815,7 +1816,7 @@ func (this *NewDialysisApiController) GetRoleName() {
1815 1816
 			names = role.RoleName + "," + names
1816 1817
 		}
1817 1818
 	}
1818
-	fmt.Println("role_ids--------------", role_ids)
1819
+	//fmt.Println("role_ids--------------", role_ids)
1819 1820
 	if err != nil {
1820 1821
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1821 1822
 		return
@@ -2252,7 +2253,7 @@ func (this *NewDialysisApiController) GetMyInformationFour() {
2252 2253
 	//OrgId, _ := service.GetCreatByOrgId(orgid)
2253 2254
 	//fmt.Println("创建者ID", OrgId.Creator)
2254 2255
 	creatId := adminUserInfo.AdminUser.Id
2255
-	fmt.Println("creatid", creatId)
2256
+	//fmt.Println("creatid", creatId)
2256 2257
 	fmt.Println("当前机构ID信息", orgid)
2257 2258
 	Username, err := service.GetMyOrgInformationFour(creatId, orgid)
2258 2259
 	if err != nil {
@@ -2503,7 +2504,6 @@ func (this *NewDialysisApiController) SumitForm() {
2503 2504
 }
2504 2505
 
2505 2506
 func (this *NewDialysisApiController) GetMobile() {
2506
-	fmt.Println("--------------触发了没有")
2507 2507
 	adminInfo := this.GetMobileAdminUserInfo()
2508 2508
 	id := adminInfo.AdminUser.Id
2509 2509
 
@@ -2521,13 +2521,38 @@ func (this *NewDialysisApiController) GetRolePosition() {
2521 2521
 
2522 2522
 	adminInfo := this.GetMobileAdminUserInfo()
2523 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 2551
 	if err != nil {
2527 2552
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2528 2553
 		return
2529 2554
 	}
2530 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,4 +153,6 @@ func NewMobileAPIControllersRegisterRouters() {
153 153
 	beego.Router("/m/api/patient/sumitform", &NewDialysisApiController{}, "Get:SumitForm")
154 154
 	beego.Router("/m/api/patient/getroleposition", &NewDialysisApiController{}, "Get:GetRolePosition")
155 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,7 +833,7 @@ type XtAssessmentAfterDislysis struct {
833 833
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat" form:"is_eat"`
834 834
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit" form:"dialysis_intakes_unit"`
835 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 837
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
838 838
 }
839 839
 

+ 6 - 2
models/dialysis.go Прегледај датотеку

@@ -546,7 +546,7 @@ type AssessmentAfterDislysis struct {
546 546
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
547 547
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
548 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 550
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
551 551
 }
552 552
 
@@ -782,7 +782,7 @@ type ReceiveTreatmentAsses struct {
782 782
 	PsychologicalAssessmentOther string `gorm:"column:psychological_assessment_other" json:"psychological_assessment_other"`
783 783
 	Score                        string `gorm:"column:score" json:"score"`
784 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 786
 	PrecautionOther              string `gorm:"column:precaution_other" json:"precaution_other"`
787 787
 	PsychologicalOther           string `gorm:"column:psychological_other" json:"psychological_other"`
788 788
 	IsPrecaution                 int64  `gorm:"column:is_precaution" json:"is_precaution"`
@@ -824,6 +824,10 @@ type SgjUserAdminRole struct {
824 824
 	Sex           int64  `gorm:"column:sex" json:"sex" form:"sex"`
825 825
 	Birthday      int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
826 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 833
 func (SgjUserAdminRole) TableName() string {

+ 14 - 0
service/manage_service.go Прегледај датотеку

@@ -1087,6 +1087,12 @@ func CreateTable(table *models.KyActivityTable) error {
1087 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 1096
 func GetRolePosition(id int64) (models.SgjUserRole, error) {
1091 1097
 	role := models.SgjUserRole{}
1092 1098
 	err := UserReadDB().Where("id = ? And status =1", id).Find(&role).Error
@@ -1098,3 +1104,11 @@ func GetMobile(id int64) (models.SgjUserAdmin, error) {
1098 1104
 	err := UserReadDB().Where("id=? and status = 1", id).Find(&admin).Error
1099 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,7 +319,7 @@ type AssessmentAfterDislysisVM struct {
319 319
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
320 320
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
321 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 323
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
324 324
 }
325 325
 
@@ -385,7 +385,7 @@ type XtAssessmentAfterDislysisVM struct {
385 385
 	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat"`
386 386
 	DialysisIntakesUnit             int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit"`
387 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 389
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
390 390
 }
391 391