XMLWAN 4 лет назад
Родитель
Сommit
5e671b9c37

+ 7 - 0
controllers/data_api_controller.go Просмотреть файл

@@ -224,6 +224,7 @@ func (c *DataApiController) UpdateChildConfig() {
224 224
 	dataconfig.UpdatedTime = time.Now().Format("2006-01-02 15:04:05")
225 225
 	dataconfig.Remark = string(dataBody["remark"].(string))
226 226
 	dataconfig.Order = int64(dataBody["orders"].(float64))
227
+	dataconfig.FieldType = int64(dataBody["field_type"].(float64))
227 228
 	fmt.Println("dataconfitg------", dataconfig.Order)
228 229
 	//if dataBody["orders"] != nil {
229 230
 	//	dataconfig.Order = int64(dataBody["orders"].(float64))
@@ -348,6 +349,12 @@ func (c *DataApiController) CreateChildConfig() {
348 349
 		dataconfig.Order = 0
349 350
 	}
350 351
 
352
+	if dataBody["field_type"] != nil {
353
+		dataconfig.FieldType = int64(dataBody["field_type"].(float64))
354
+	} else {
355
+		dataconfig.FieldType = 0
356
+	}
357
+
351 358
 	// 验证关键字段的值是否重复
352 359
 	// thisConfig,_:=service.FindConfigByName(dataconfig.Module, dataconfig.Name,dataconfig.ParentId,dataconfig.OrgId)
353 360
 	// if thisConfig.ID >0 {

+ 25 - 0
controllers/doctors_api_controller.go Просмотреть файл

@@ -38,6 +38,7 @@ func DoctorApiRegistRouters() {
38 38
 	beego.Router("/api/patient/getpasswayassmentbyid", &DoctorsApiController{}, "Get:GetPasswayAssesmentById")
39 39
 	beego.Router("/api/patient/updatepasswayassesment", &DoctorsApiController{}, "Get:UpdatePassWayAssesment")
40 40
 	beego.Router("/api/patient/deletepasswayassessment", &DoctorsApiController{}, "Get:DeleteWayAssessment")
41
+	beego.Router("/api/patient/getaccesslist", &DoctorsApiController{}, "Get:GetAccessList")
41 42
 }
42 43
 
43 44
 func (c *DoctorsApiController) ScheduleAdvices() {
@@ -340,6 +341,7 @@ func (this *DoctorsApiController) SaveVasularAccess() {
340 341
 	stop_time := this.GetString("stop_time")
341 342
 	stopTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", stop_time+" 00:00:00", loc)
342 343
 	patient_id, _ := this.GetInt64("patient_id")
344
+	other_vascular := this.GetString("other_vascular")
343 345
 	adminUserInfo := this.GetAdminUserInfo()
344 346
 	orgId := adminUserInfo.CurrentOrgId
345 347
 	creator := adminUserInfo.AdminUser.Id
@@ -363,6 +365,7 @@ func (this *DoctorsApiController) SaveVasularAccess() {
363 365
 			Ctime:                  time.Now().Unix(),
364 366
 			StopTime:               stopTime.Unix(),
365 367
 			PatientId:              patient_id,
368
+			OtherVascular:          other_vascular,
366 369
 		}
367 370
 		err := service.SaveVascularAccess(&access)
368 371
 		if err == nil {
@@ -436,6 +439,7 @@ func (this *DoctorsApiController) UpdateVasularAccess() {
436 439
 	creator := adminUserInfo.AdminUser.Id
437 440
 	patientId, _ := this.GetInt64("patient_id")
438 441
 	fmt.Println("patient_id222222222222222222", patientId)
442
+	other_vascular := this.GetString("other_vascular")
439 443
 	access := models.XtPatientVascularAccess{
440 444
 		AccessProject:          access_project,
441 445
 		BloodAccessPartId:      blood_access_part_id,
@@ -450,6 +454,7 @@ func (this *DoctorsApiController) UpdateVasularAccess() {
450 454
 		UserOrgId:              orgId,
451 455
 		Status:                 1,
452 456
 		StopTime:               stopTime.Unix(),
457
+		OtherVascular:          other_vascular,
453 458
 	}
454 459
 	_, errcode := service.GetDialysisDateByDateOne(startTime.Unix(), patientId, orgId, id)
455 460
 	if errcode == gorm.ErrRecordNotFound {
@@ -581,3 +586,23 @@ func (this *DoctorsApiController) DeleteWayAssessment() {
581 586
 	this.ServeSuccessJSON(returnData)
582 587
 	return
583 588
 }
589
+
590
+func (this *DoctorsApiController) GetAccessList() {
591
+
592
+	adminUserInfo := this.GetAdminUserInfo()
593
+	orgId := adminUserInfo.CurrentOrgId
594
+	//血管通路
595
+	list, err := service.GetAccessList(orgId)
596
+	blood_access_part_opera, err := service.GetParentAccessList(orgId, list.ID)
597
+
598
+	//血管通路部位
599
+	access, err := service.GetBloodAccess(orgId)
600
+	blood_access_part, err := service.GetParentAccessList(orgId, access.ID)
601
+	if err == nil {
602
+		this.ServeSuccessJSON(map[string]interface{}{
603
+			"blood_access_part_opera": blood_access_part_opera,
604
+			"blood_access_part":       blood_access_part,
605
+		})
606
+		return
607
+	}
608
+}

+ 2 - 0
controllers/inspection_api_controller.go Просмотреть файл

@@ -92,9 +92,11 @@ func (c *InspectionApiController) PatientInspectionReference() {
92 92
 		}
93 93
 	}
94 94
 
95
+	list, err := service.GetInspectionReferenceByOrgId(0)
95 96
 	c.ServeSuccessJSON(map[string]interface{}{
96 97
 		"reference":    reference,
97 98
 		"patient_info": patient_info,
99
+		"list":         list,
98 100
 	})
99 101
 	return
100 102
 

Разница между файлами не показана из-за своего большого размера
+ 1022 - 74
controllers/manage_api_controller.go


+ 1 - 0
models/data_models.go Просмотреть файл

@@ -17,6 +17,7 @@ type Dataconfig struct {
17 17
 	Title          string `gorm:"column:title" json:"title" form:"title"`
18 18
 	Content        string `gorm:"column:content" json:"content" form:"content"`
19 19
 	Order          int64  `gorm:"column:orders" json:"orders" form:"orders"`
20
+	FieldType      int64  `gorm:"column:field_type" json:"field_type" form:"field_type"`
20 21
 }
21 22
 
22 23
 func (Dataconfig) TableName() string {

+ 144 - 23
models/device_models.go Просмотреть файл

@@ -605,6 +605,9 @@ type DeviceCulture struct {
605 605
 	UserOrgId         int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
606 606
 	EquitmentId       int64  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
607 607
 	Bed               string `gorm:"column:bed" json:"bed" form:"bed"`
608
+	Sort              string `gorm:"column:sort" json:"sort" form:"sort"`
609
+	PassExamination   int64  `gorm:"column:pass_examination" json:"pass_examination" form:"pass_examination"`
610
+	Modifications     int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
608 611
 }
609 612
 
610 613
 func (DeviceCulture) TableName() string {
@@ -652,6 +655,9 @@ type DeviceDialysate struct {
652 655
 	BedId             int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
653 656
 	EquitmentId       int64  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
654 657
 	Bed               string `gorm:"column:bed" json:"bed" form:"bed"`
658
+	Sort              string `gorm:"column:sort" json:"sort" form:"sort"`
659
+	PassExamination   int64  `gorm:"column:pass_examination" json:"pass_examination" form:"pass_examination"`
660
+	Modifications     int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
655 661
 }
656 662
 
657 663
 func (DeviceDialysate) TableName() string {
@@ -688,29 +694,32 @@ type DeviceIons struct {
688 694
 
689 695
 //透析液离子浓度检测
690 696
 type DeviceIon struct {
691
-	ID             int64  `gorm:"column:id" json:"id" form:"id"`
692
-	SamplingDate   int64  `gorm:"column:sampling_date" json:"sampling_date" form:"sampling_date"`
693
-	Samplerc       int64  `gorm:"column:samplerc" json:"samplerc" form:"samplerc"`
694
-	DetectionUnit  string `gorm:"column:detection_unit" json:"detection_unit" form:"detection_unit"`
695
-	ConcentrateNof string `gorm:"column:concentrate_nof" json:"concentrate_nof" form:"concentrate_nof"`
696
-	ConcentrateNog string `gorm:"column:concentrate_nog" json:"concentrate_nog" form:"concentrate_nog"`
697
-	DateReportc    int64  `gorm:"column:date_reportc" json:"date_reportc" form:"date_reportc"`
698
-	ActualNa       string `gorm:"column:actual_na" json:"actual_na" form:"actual_na"`
699
-	ActualPna      string `gorm:"column:actual_pna" json:"actual_pna" form:"actual_pna"`
700
-	ActualK        string `gorm:"column:actual_k" json:"actual_k" form:"actual_k"`
701
-	ActualCa       string `gorm:"column:actual_ca" json:"actual_ca" form:"actual_ca"`
702
-	ActualCi       string `gorm:"column:actual_ci" json:"actual_ci" form:"actual_ci"`
703
-	ActualHco      string `gorm:"column:actual_hco" json:"actual_hco" form:"actual_hco"`
704
-	ActualMg       string `gorm:"column:actual_mg" json:"actual_mg" form:"actual_mg"`
705
-	ActualPh       string `gorm:"column:actual_ph" json:"actual_ph" form:"actual_ph"`
706
-	Remakes        string `gorm:"column:remakes" json:"remakes" form:"remakes"`
707
-	Status         int64  `gorm:"column:status" json:"status" form:"status"`
708
-	UserOrgId      int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
709
-	Ctime          int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
710
-	Mtime          int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
711
-	BedId          int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
712
-	EquitmentId    int64  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
713
-	Bed            string `gorm:"column:bed" json:"bed" form:"bed"`
697
+	ID              int64  `gorm:"column:id" json:"id" form:"id"`
698
+	SamplingDate    int64  `gorm:"column:sampling_date" json:"sampling_date" form:"sampling_date"`
699
+	Samplerc        int64  `gorm:"column:samplerc" json:"samplerc" form:"samplerc"`
700
+	DetectionUnit   string `gorm:"column:detection_unit" json:"detection_unit" form:"detection_unit"`
701
+	ConcentrateNof  string `gorm:"column:concentrate_nof" json:"concentrate_nof" form:"concentrate_nof"`
702
+	ConcentrateNog  string `gorm:"column:concentrate_nog" json:"concentrate_nog" form:"concentrate_nog"`
703
+	DateReportc     int64  `gorm:"column:date_reportc" json:"date_reportc" form:"date_reportc"`
704
+	ActualNa        string `gorm:"column:actual_na" json:"actual_na" form:"actual_na"`
705
+	ActualPna       string `gorm:"column:actual_pna" json:"actual_pna" form:"actual_pna"`
706
+	ActualK         string `gorm:"column:actual_k" json:"actual_k" form:"actual_k"`
707
+	ActualCa        string `gorm:"column:actual_ca" json:"actual_ca" form:"actual_ca"`
708
+	ActualCi        string `gorm:"column:actual_ci" json:"actual_ci" form:"actual_ci"`
709
+	ActualHco       string `gorm:"column:actual_hco" json:"actual_hco" form:"actual_hco"`
710
+	ActualMg        string `gorm:"column:actual_mg" json:"actual_mg" form:"actual_mg"`
711
+	ActualPh        string `gorm:"column:actual_ph" json:"actual_ph" form:"actual_ph"`
712
+	Remakes         string `gorm:"column:remakes" json:"remakes" form:"remakes"`
713
+	Status          int64  `gorm:"column:status" json:"status" form:"status"`
714
+	UserOrgId       int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
715
+	Ctime           int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
716
+	Mtime           int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
717
+	BedId           int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
718
+	EquitmentId     int64  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
719
+	Bed             string `gorm:"column:bed" json:"bed" form:"bed"`
720
+	Sort            string `gorm:"column:sort" json:"sort" form:"sort"`
721
+	PassExamination int64  `gorm:"column:pass_examination" json:"pass_examination" form:"pass_examination"`
722
+	Modifications   int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
714 723
 }
715 724
 
716 725
 func (DeviceIon) TableName() string {
@@ -892,3 +901,115 @@ type VmSchedule struct {
892 901
 	Number       string `gorm:"column:number" json:"number" form:"number"`
893 902
 	ZoneName     string `gorm:"column:name" json:"zon_name" form:"name"`
894 903
 }
904
+
905
+type XtDeviceOxygenates struct {
906
+	ID                int64  `gorm:"column:id" json:"id" form:"id"`
907
+	SamplingDate      int64  `gorm:"column:sampling_date" json:"sampling_date" form:"sampling_date"`
908
+	Specimenb         int64  `gorm:"column:specimenb" json:"specimenb" form:"specimenb"`
909
+	ConcentrateNoc    string `gorm:"column:concentrate_noc" json:"concentrate_noc" form:"concentrate_noc"`
910
+	ConcentratebNod   string `gorm:"column:concentrateb_nod" json:"concentrateb_nod" form:"concentrateb_nod"`
911
+	SamplingLocationb int64  `gorm:"column:sampling_locationb" json:"sampling_locationb" form:"sampling_locationb"`
912
+	DetectionUnit     string `gorm:"column:detection_unit" json:"detection_unit" form:"detection_unit"`
913
+	Samplerb          int64  `gorm:"column:samplerb" json:"samplerb" form:"samplerb"`
914
+	ReportingDateb    int64  `gorm:"column:reporting_dateb" json:"reporting_dateb" form:"reporting_dateb"`
915
+	DetectionResultb  string `gorm:"column:detection_resultb" json:"detection_resultb" form:"detection_resultb"`
916
+	Status            int64  `gorm:"column:status" json:"status" form:"status"`
917
+	UserOrgId         int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
918
+	Ctime             int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
919
+	Mtime             int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
920
+	BedId             int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
921
+	EquitmentId       int64  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
922
+	Bed               string `gorm:"column:bed" json:"bed" form:"bed"`
923
+	Sort              string `gorm:"column:sort" json:"sort" form:"sort"`
924
+	PassExamination   int64  `gorm:"column:pass_examination" json:"pass_examination" form:"pass_examination"`
925
+	Modifications     int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
926
+}
927
+
928
+func (XtDeviceOxygenates) TableName() string {
929
+
930
+	return "xt_device_oxygenates"
931
+}
932
+
933
+type XtDeviceHadwater struct {
934
+	ID                int64  `gorm:"column:id" json:"id" form:"id"`
935
+	SamplingDate      int64  `gorm:"column:sampling_date" json:"sampling_date" form:"sampling_date"`
936
+	Specimenb         int64  `gorm:"column:specimenb" json:"specimenb" form:"specimenb"`
937
+	ConcentrateNoc    string `gorm:"column:concentrate_noc" json:"concentrate_noc" form:"concentrate_noc"`
938
+	ConcentratebNod   string `gorm:"column:concentrateb_nod" json:"concentrateb_nod" form:"concentrateb_nod"`
939
+	SamplingLocationb int64  `gorm:"column:sampling_locationb" json:"sampling_locationb" form:"sampling_locationb"`
940
+	DetectionUnit     string `gorm:"column:detection_unit" json:"detection_unit" form:"detection_unit"`
941
+	Samplerb          int64  `gorm:"column:samplerb" json:"samplerb" form:"samplerb"`
942
+	ReportingDateb    int64  `gorm:"column:reporting_dateb" json:"reporting_dateb" form:"reporting_dateb"`
943
+	DetectionResultb  string `gorm:"column:detection_resultb" json:"detection_resultb" form:"detection_resultb"`
944
+	Status            int64  `gorm:"column:status" json:"status" form:"status"`
945
+	UserOrgId         int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
946
+	Ctime             int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
947
+	Mtime             int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
948
+	BedId             int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
949
+	EquitmentId       int64  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
950
+	Bed               string `gorm:"column:bed" json:"bed" form:"bed"`
951
+	Sort              string `gorm:"column:sort" json:"sort" form:"sort"`
952
+	PassExamination   int64  `gorm:"column:pass_examination" json:"pass_examination" form:"pass_examination"`
953
+	Modifications     int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
954
+}
955
+
956
+func (XtDeviceHadwater) TableName() string {
957
+
958
+	return "xt_device_hadwater"
959
+}
960
+
961
+type XtDeviceWater struct {
962
+	ID                int64  `gorm:"column:id" json:"id" form:"id"`
963
+	SamplingDate      int64  `gorm:"column:sampling_date" json:"sampling_date" form:"sampling_date"`
964
+	Specimenb         int64  `gorm:"column:specimenb" json:"specimenb" form:"specimenb"`
965
+	ConcentrateNoc    string `gorm:"column:concentrate_noc" json:"concentrate_noc" form:"concentrate_noc"`
966
+	ConcentratebNod   string `gorm:"column:concentrateb_nod" json:"concentrateb_nod" form:"concentrateb_nod"`
967
+	SamplingLocationb int64  `gorm:"column:sampling_locationb" json:"sampling_locationb" form:"sampling_locationb"`
968
+	DetectionUnit     string `gorm:"column:detection_unit" json:"detection_unit" form:"detection_unit"`
969
+	Samplerb          int64  `gorm:"column:samplerb" json:"samplerb" form:"samplerb"`
970
+	ReportingDateb    int64  `gorm:"column:reporting_dateb" json:"reporting_dateb" form:"reporting_dateb"`
971
+	DetectionResultb  string `gorm:"column:detection_resultb" json:"detection_resultb" form:"detection_resultb"`
972
+	Status            int64  `gorm:"column:status" json:"status" form:"status"`
973
+	UserOrgId         int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
974
+	Ctime             int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
975
+	Mtime             int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
976
+	BedId             int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
977
+	EquitmentId       int64  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
978
+	Bed               string `gorm:"column:bed" json:"bed" form:"bed"`
979
+	Sort              string `gorm:"column:sort" json:"sort" form:"sort"`
980
+	PassExamination   int64  `gorm:"column:pass_examination" json:"pass_examination" form:"pass_examination"`
981
+	Modifications     int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
982
+}
983
+
984
+func (XtDeviceWater) TableName() string {
985
+
986
+	return "xt_device_water"
987
+}
988
+
989
+type XtDevicePh struct {
990
+	ID                int64  `gorm:"column:id" json:"id" form:"id"`
991
+	SamplingDate      int64  `gorm:"column:sampling_date" json:"sampling_date" form:"sampling_date"`
992
+	Specimenb         int64  `gorm:"column:specimenb" json:"specimenb" form:"specimenb"`
993
+	ConcentrateNoc    string `gorm:"column:concentrate_noc" json:"concentrate_noc" form:"concentrate_noc"`
994
+	ConcentratebNod   string `gorm:"column:concentrateb_nod" json:"concentrateb_nod" form:"concentrateb_nod"`
995
+	SamplingLocationb int64  `gorm:"column:sampling_locationb" json:"sampling_locationb" form:"sampling_locationb"`
996
+	DetectionUnit     string `gorm:"column:detection_unit" json:"detection_unit" form:"detection_unit"`
997
+	Samplerb          int64  `gorm:"column:samplerb" json:"samplerb" form:"samplerb"`
998
+	ReportingDateb    int64  `gorm:"column:reporting_dateb" json:"reporting_dateb" form:"reporting_dateb"`
999
+	DetectionResultb  string `gorm:"column:detection_resultb" json:"detection_resultb" form:"detection_resultb"`
1000
+	Status            int64  `gorm:"column:status" json:"status" form:"status"`
1001
+	UserOrgId         int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1002
+	Ctime             int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1003
+	Mtime             int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1004
+	BedId             int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
1005
+	EquitmentId       int64  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
1006
+	Bed               string `gorm:"column:bed" json:"bed" form:"bed"`
1007
+	Sort              string `gorm:"column:sort" json:"sort" form:"sort"`
1008
+	PassExamination   int64  `gorm:"column:pass_examination" json:"pass_examination" form:"pass_examination"`
1009
+	Modifications     int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
1010
+}
1011
+
1012
+func (XtDevicePh) TableName() string {
1013
+
1014
+	return "xt_device_ph"
1015
+}

+ 51 - 0
models/user_models.go Просмотреть файл

@@ -491,6 +491,7 @@ type XtPatientVascularAccess struct {
491 491
 	Modify                 int64  `gorm:"column:modify" json:"modify" form:"modify"`
492 492
 	StopTime               int64  `gorm:"column:stop_time" json:"stop_time" form:"stop_time"`
493 493
 	PatientId              int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
494
+	OtherVascular          string `gorm:"column:other_vascular" json:"other_vascular" form:"other_vascular"`
494 495
 }
495 496
 
496 497
 func (XtPatientVascularAccess) TableName() string {
@@ -518,3 +519,53 @@ func (XtPatientPasswayAssessment) TableName() string {
518 519
 
519 520
 	return "xt_patient_passway_assessment"
520 521
 }
522
+
523
+type XtAerialDetection struct {
524
+	ID                  int64  `gorm:"column:id" json:"id" form:"id"`
525
+	StartTime           int64  `gorm:"column:start_time" json:"start_time" form:"start_time"`
526
+	CreatedTime         int64  `gorm:"column:created_time" json:"created_ime" form:"created_time"`
527
+	Class               int64  `gorm:"column:class" json:"class" form:"class"`
528
+	DisinfectionMethods string `gorm:"column:disinfection_methods" json:"disinfection_methods" form:"disinfection_methods"`
529
+	DisinfectionFluid   string `gorm:"column:disinfection_fluid" json:"disinfection_fluid" form:"disinfection_fluid"`
530
+	Sort                string `gorm:"column:sort" json:"sort" form:"sort"`
531
+	Creator             int64  `gorm:"column:creator" json:"creator" form:"creator"`
532
+	DetectionTime       int64  `gorm:"column:detection_time" json:"detection_time" form:"detection_time"`
533
+	DetectionResult     string `gorm:"column:detection_result" json:"detection_result" form:"detection_result"`
534
+	UploadTime          int64  `gorm:"column:upload_time" json:"upload_time" form:"upload_time"`
535
+	CheckOut            int64  `gorm:"column:check_out" json:"check_out" form:"check_out"`
536
+	Modifications       int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
537
+	UserOrgId           int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
538
+	Ctime               int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
539
+	Mtime               int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
540
+	Status              int64  `gorm:"column:status" json:"status" form:"status"`
541
+}
542
+
543
+func (XtAerialDetection) TableName() string {
544
+
545
+	return "xt_aerial_detection"
546
+}
547
+
548
+type XtBodyDetection struct {
549
+	ID                  int64  `gorm:"column:id" json:"id" form:"id"`
550
+	StartTime           int64  `gorm:"column:start_time" json:"start_time" form:"start_time"`
551
+	CreatedTime         int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
552
+	Class               int64  `gorm:"column:class" json:"class" form:"class"`
553
+	DisinfectionMethods string `gorm:"column:disinfection_methods" json:"disinfection_methods" form:"disinfection_methods"`
554
+	DisinfectionFluid   string `gorm:"column:disinfection_fluid" json:"disinfection_fluid" form:"disinfection_fluid"`
555
+	Sort                string `gorm:"column:sort" json:"sort" form:"sort"`
556
+	Creator             int64  `gorm:"column:creator" json:"creator" form:"creator"`
557
+	DetectionTime       int64  `gorm:"column:detection_time" json:"detection_time" form:"detection_time"`
558
+	DetectionResult     string `gorm:"column:detection_result" json:"detection_result" form:"detection_result"`
559
+	UploadTime          int64  `gorm:"column:upload_time" json:"upload_time" form:"upload_time"`
560
+	CheckOut            int64  `gorm:"column:check_out" json:"check_out" form:"check_out"`
561
+	Modifications       int64  `gorm:"column:modifications" json:"modifications" form:"modifications"`
562
+	UserOrgId           int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
563
+	Ctime               int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
564
+	Mtime               int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
565
+	Status              int64  `gorm:"column:status" json:"status" form:"status"`
566
+}
567
+
568
+func (XtBodyDetection) TableName() string {
569
+
570
+	return "xt_body_detection"
571
+}

+ 1 - 1
service/data.go Просмотреть файл

@@ -247,7 +247,7 @@ func FindConfigByTitleForUpdate(module string, title string, org_id int64, id in
247 247
 }
248 248
 
249 249
 func UpdateChildConfig(dataconfig *models.Dataconfig) (err error) {
250
-	err = readDb.Model(&models.Dataconfig{}).Where("id =?", dataconfig.ID).Update(map[string]interface{}{"name": dataconfig.Name, "update_time": dataconfig.UpdatedTime, "remark": dataconfig.Remark, "orders": dataconfig.Order}).Error
250
+	err = readDb.Model(&models.Dataconfig{}).Where("id =?", dataconfig.ID).Update(map[string]interface{}{"name": dataconfig.Name, "update_time": dataconfig.UpdatedTime, "remark": dataconfig.Remark, "orders": dataconfig.Order, "field_type": dataconfig.FieldType}).Error
251 251
 	return
252 252
 }
253 253
 

+ 6 - 0
service/inspection_service.go Просмотреть файл

@@ -211,3 +211,9 @@ func GetAllInspectionReference(orgId int64) (inspectionReference []*models.Inspe
211 211
 	err = readDb.Model(&models.InspectionReference{}).Where("org_id = ? AND status = 1", orgId).Find(&inspectionReference).Error
212 212
 	return
213 213
 }
214
+
215
+func GetInspectionReferenceByOrgId(orgid int64) (insepciton []*models.XtInspectionReference, err error) {
216
+
217
+	err = readDb.Model(&insepciton).Where("org_id = ? and status = 1 and project_name = '传染病检查'", orgid).Find(&insepciton).Error
218
+	return insepciton, err
219
+}

+ 321 - 22
service/manage_service.go Просмотреть файл

@@ -588,28 +588,6 @@ func GetCultureData(bedid int64, start int64, end int64, orgId int64) (cultures
588 588
 	return cultures, err
589 589
 }
590 590
 
591
-func GetDialysateData(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
592
-	db := UserReadDB().Table("xt_device_dialysate as x").Where("x.status = 1")
593
-	table := UserReadDB().Table("sgj_user_admin_role as r")
594
-	fmt.Println("table", table)
595
-	if orgId > 0 {
596
-		db = db.Where("x.user_org_id = ?", orgId)
597
-	}
598
-	if bedid > 0 {
599
-		db = db.Where("x.bed_id = ?", bedid)
600
-	}
601
-	if start > 0 {
602
-		db = db.Where("x.sampling_date >= ?", start)
603
-	}
604
-	if end > 0 {
605
-		db = db.Where("x.sampling_date <= ?", end)
606
-	}
607
-
608
-	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
609
-
610
-	return dialysate, err
611
-}
612
-
613 591
 func GetDeviceIonData(bedid int64, start int64, end int64, orgId int64) (ions []*models.DeviceIons, err error) {
614 592
 	db := UserReadDB().Table("xt_device_ion as x").Where("x.status = 1")
615 593
 	table := UserReadDB().Table("sgj_user_admin_role as r")
@@ -1242,3 +1220,324 @@ func GetDeviceInfomation(orgid int64, scheduledate int64) (information []*models
1242 1220
 	err = UserReadDB().Model(&information).Where("user_org_id = ? and date = ? and status =1", orgid, scheduledate).Find(&information).Error
1243 1221
 	return information, err
1244 1222
 }
1223
+
1224
+func CreateOxygenates(oxygenates *models.XtDeviceOxygenates) error {
1225
+
1226
+	err := UserWriteDB().Create(&oxygenates).Error
1227
+	return err
1228
+}
1229
+
1230
+func CreateHadWater(hadwater *models.XtDeviceHadwater) error {
1231
+
1232
+	err := UserWriteDB().Create(&hadwater).Error
1233
+	return err
1234
+}
1235
+
1236
+func CreateWater(water *models.XtDeviceWater) error {
1237
+
1238
+	err := UserWriteDB().Create(&water).Error
1239
+	return err
1240
+}
1241
+
1242
+func CreateDevicePh(ph *models.XtDevicePh) error {
1243
+
1244
+	err := UserWriteDB().Create(&ph).Error
1245
+	return err
1246
+}
1247
+
1248
+func GetAllDeviceOxygenates(orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1249
+	db := UserReadDB().Table("xt_device_oxygenates as x").Where("x.status = 1")
1250
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1251
+	fmt.Println("table", table)
1252
+	if orgId > 0 {
1253
+		db = db.Where("x.user_org_id = ?", orgId)
1254
+	}
1255
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1256
+
1257
+	return dialysate, err
1258
+}
1259
+
1260
+func GetAllHadWater(orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1261
+	db := UserReadDB().Table("xt_device_hadwater as x").Where("x.status = 1")
1262
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1263
+	fmt.Println("table", table)
1264
+	if orgId > 0 {
1265
+		db = db.Where("x.user_org_id = ?", orgId)
1266
+	}
1267
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1268
+
1269
+	return dialysate, err
1270
+}
1271
+
1272
+func GetDeviceWater(orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1273
+	db := UserReadDB().Table("xt_device_water as x").Where("x.status = 1")
1274
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1275
+	fmt.Println("table", table)
1276
+	if orgId > 0 {
1277
+		db = db.Where("x.user_org_id = ?", orgId)
1278
+	}
1279
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1280
+
1281
+	return dialysate, err
1282
+}
1283
+
1284
+func GetDevicePH(orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1285
+	db := UserReadDB().Table("xt_device_ph as x").Where("x.status = 1")
1286
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1287
+	fmt.Println("table", table)
1288
+	if orgId > 0 {
1289
+		db = db.Where("x.user_org_id = ?", orgId)
1290
+	}
1291
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1292
+
1293
+	return dialysate, err
1294
+}
1295
+
1296
+func GetDialysateData(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1297
+	db := UserReadDB().Table("xt_device_dialysate as x").Where("x.status = 1")
1298
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1299
+	fmt.Println("table", table)
1300
+	if orgId > 0 {
1301
+		db = db.Where("x.user_org_id = ?", orgId)
1302
+	}
1303
+	if bedid > 0 {
1304
+		db = db.Where("x.bed_id = ?", bedid)
1305
+	}
1306
+	if start > 0 {
1307
+		db = db.Where("x.sampling_date >= ?", start)
1308
+	}
1309
+	if end > 0 {
1310
+		db = db.Where("x.sampling_date <= ?", end)
1311
+	}
1312
+
1313
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1314
+
1315
+	return dialysate, err
1316
+}
1317
+
1318
+func GetOxygenates(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1319
+	db := UserReadDB().Table("xt_device_oxygenates as x").Where("x.status = 1")
1320
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1321
+	fmt.Println("table", table)
1322
+	if orgId > 0 {
1323
+		db = db.Where("x.user_org_id = ?", orgId)
1324
+	}
1325
+	if bedid > 0 {
1326
+		db = db.Where("x.bed_id = ?", bedid)
1327
+	}
1328
+	if start > 0 {
1329
+		db = db.Where("x.sampling_date >= ?", start)
1330
+	}
1331
+	if end > 0 {
1332
+		db = db.Where("x.sampling_date <= ?", end)
1333
+	}
1334
+
1335
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1336
+
1337
+	return dialysate, err
1338
+}
1339
+
1340
+func GetHardWater(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1341
+	db := UserReadDB().Table("xt_device_hadwater as x").Where("x.status = 1")
1342
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1343
+	fmt.Println("table", table)
1344
+	if orgId > 0 {
1345
+		db = db.Where("x.user_org_id = ?", orgId)
1346
+	}
1347
+	if bedid > 0 {
1348
+		db = db.Where("x.bed_id = ?", bedid)
1349
+	}
1350
+	if start > 0 {
1351
+		db = db.Where("x.sampling_date >= ?", start)
1352
+	}
1353
+	if end > 0 {
1354
+		db = db.Where("x.sampling_date <= ?", end)
1355
+	}
1356
+
1357
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1358
+
1359
+	return dialysate, err
1360
+}
1361
+
1362
+func GetWater(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1363
+	db := UserReadDB().Table("xt_device_water as x").Where("x.status = 1")
1364
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1365
+	fmt.Println("table", table)
1366
+	if orgId > 0 {
1367
+		db = db.Where("x.user_org_id = ?", orgId)
1368
+	}
1369
+	if bedid > 0 {
1370
+		db = db.Where("x.bed_id = ?", bedid)
1371
+	}
1372
+	if start > 0 {
1373
+		db = db.Where("x.sampling_date >= ?", start)
1374
+	}
1375
+	if end > 0 {
1376
+		db = db.Where("x.sampling_date <= ?", end)
1377
+	}
1378
+
1379
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1380
+
1381
+	return dialysate, err
1382
+}
1383
+
1384
+func GetDevicePh(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
1385
+	db := UserReadDB().Table("xt_device_ph as x").Where("x.status = 1")
1386
+	table := UserReadDB().Table("sgj_user_admin_role as r")
1387
+	fmt.Println("table", table)
1388
+	if orgId > 0 {
1389
+		db = db.Where("x.user_org_id = ?", orgId)
1390
+	}
1391
+	if bedid > 0 {
1392
+		db = db.Where("x.bed_id = ?", bedid)
1393
+	}
1394
+	if start > 0 {
1395
+		db = db.Where("x.sampling_date >= ?", start)
1396
+	}
1397
+	if end > 0 {
1398
+		db = db.Where("x.sampling_date <= ?", end)
1399
+	}
1400
+
1401
+	err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
1402
+
1403
+	return dialysate, err
1404
+}
1405
+
1406
+func GetOxygenatesById(id int64) (models.XtDeviceOxygenates, error) {
1407
+	oxygenates := models.XtDeviceOxygenates{}
1408
+	err := UserReadDB().Model(&oxygenates).Where("id = ? and status = 1", id).Find(&oxygenates).Error
1409
+	return oxygenates, err
1410
+}
1411
+
1412
+func UpdateOxygenates(id int64, orgid int64, dialysate *models.XtDeviceOxygenates) error {
1413
+	err := writeUserDb.Model(&dialysate).Where("id=? AND user_org_id = ? AND status = 1", id, orgid).Updates(map[string]interface{}{"sampling_date": dialysate.SamplingDate, "specimenb": dialysate.Specimenb, "concentrate_noc": dialysate.ConcentrateNoc, "concentrateb_nod": dialysate.ConcentratebNod, "sampling_locationb": dialysate.SamplingLocationb, "detection_unit": dialysate.DetectionUnit, "samplerb": dialysate.Samplerb, "reporting_dateb": dialysate.ReportingDateb, "detection_resultb": dialysate.DetectionResultb, "mtime": time.Now().Unix()}).Error
1414
+	return err
1415
+}
1416
+
1417
+func GetHardWaterById(id int64) (models.XtDeviceHadwater, error) {
1418
+	hadwater := models.XtDeviceHadwater{}
1419
+	err := UserReadDB().Model(&hadwater).Where("id = ? and status = 1", id).Find(&hadwater).Error
1420
+	return hadwater, err
1421
+}
1422
+
1423
+func GetWaterById(id int64) (models.XtDeviceWater, error) {
1424
+
1425
+	water := models.XtDeviceWater{}
1426
+	err := UserReadDB().Model(&water).Where("id=? and status =1", id).Find(&water).Error
1427
+	return water, err
1428
+}
1429
+
1430
+func GetDevicePhById(id int64) (models.XtDevicePh, error) {
1431
+
1432
+	devicePh := models.XtDevicePh{}
1433
+	err := UserReadDB().Model(&devicePh).Where("id = ? and status =1", id).Find(&devicePh).Error
1434
+	return devicePh, err
1435
+}
1436
+
1437
+func CreateAerialDetection(detection *models.XtAerialDetection) error {
1438
+
1439
+	err := XTWriteDB().Create(&detection).Error
1440
+	return err
1441
+}
1442
+
1443
+func GetAirList(limit int64, page int64, orgid int64) (airlist []*models.XtAerialDetection, total int64, err error) {
1444
+	offset := (page - 1) * limit
1445
+	err = XTReadDB().Model(&airlist).Where("user_org_id = ? and status =1", orgid).Count(&total).Limit(limit).Offset(offset).Find(&airlist).Error
1446
+	return airlist, total, err
1447
+}
1448
+
1449
+func GetAirDisinfectDetail(id int64) (models.XtAerialDetection, error) {
1450
+
1451
+	detection := models.XtAerialDetection{}
1452
+	err := XTReadDB().Model(&detection).Where("id = ? and status = 1", id).Find(&detection).Error
1453
+	return detection, err
1454
+}
1455
+
1456
+func UpdateAeriaDetection(detection *models.XtAerialDetection, id int64) error {
1457
+
1458
+	err := XTWriteDB().Model(&detection).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"start_time": detection.StartTime, "created_time": detection.CreatedTime, "class": detection.Class, "disinfection_methods": detection.DisinfectionMethods, "disinfection_fluid": detection.DisinfectionFluid, "sort": detection.Sort, "creator": detection.Creator, "detection_time": detection.DetectionTime, "detection_result": detection.DetectionResult, "upload_time": detection.UploadTime, "check_out": detection.CheckOut, "modifications": detection.Modifications}).Error
1459
+	return err
1460
+}
1461
+
1462
+func DeleteAirDisinfect(id int64) error {
1463
+	detection := models.XtAerialDetection{}
1464
+	err := XTWriteDB().Model(&detection).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"status": 0}).Error
1465
+	return err
1466
+}
1467
+
1468
+func SaveBodyDetection(detection *models.XtBodyDetection) error {
1469
+
1470
+	err := XTWriteDB().Create(&detection).Error
1471
+	return err
1472
+}
1473
+
1474
+func GetBodyList(limit int64, page int64, orgid int64) (body []*models.XtBodyDetection, total int64, err error) {
1475
+
1476
+	offset := (page - 1) * limit
1477
+	err = XTReadDB().Model(&body).Where("user_org_id = ? and status =1", orgid).Count(&total).Limit(limit).Offset(offset).Find(&body).Error
1478
+	return body, total, err
1479
+
1480
+}
1481
+
1482
+func GetBodyDisinfectDetail(id int64) (models.XtBodyDetection, error) {
1483
+
1484
+	detection := models.XtBodyDetection{}
1485
+	err := XTReadDB().Model(&detection).Where("id = ? and status = 1", id).Find(&detection).Error
1486
+	return detection, err
1487
+}
1488
+
1489
+func UpdateBodyDetection(detection *models.XtBodyDetection, id int64) error {
1490
+
1491
+	err := XTWriteDB().Model(&detection).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"start_time": detection.StartTime, "created_time": detection.CreatedTime, "class": detection.Class, "disinfection_methods": detection.DisinfectionMethods, "disinfection_fluid": detection.DisinfectionFluid, "sort": detection.Sort, "creator": detection.Creator, "detection_time": detection.DetectionTime, "detection_result": detection.DetectionResult, "upload_time": detection.UploadTime, "check_out": detection.CheckOut, "modifications": detection.Modifications}).Error
1492
+	return err
1493
+}
1494
+
1495
+func DeleteBodyDisInfect(id int64) error {
1496
+
1497
+	detection := models.XtBodyDetection{}
1498
+	err := XTWriteDB().Model(&detection).Where("id = ?  and status = 1", id).Updates(map[string]interface{}{"status": 0}).Error
1499
+	return err
1500
+}
1501
+
1502
+func UpdateHadWater(id int64, orgid int64, hadwater *models.XtDeviceHadwater) error {
1503
+
1504
+	err := writeUserDb.Model(&hadwater).Where("id=? AND user_org_id = ? AND status = 1", id, orgid).Updates(map[string]interface{}{"sampling_date": hadwater.SamplingDate, "specimenb": hadwater.Specimenb, "concentrate_noc": hadwater.ConcentrateNoc, "concentrateb_nod": hadwater.ConcentratebNod, "sampling_locationb": hadwater.SamplingLocationb, "detection_unit": hadwater.DetectionUnit, "samplerb": hadwater.Samplerb, "reporting_dateb": hadwater.ReportingDateb, "detection_resultb": hadwater.DetectionResultb, "mtime": time.Now().Unix()}).Error
1505
+	return err
1506
+}
1507
+
1508
+func UpdateDeviceWater(id int64, orgid int64, hadwater *models.XtDeviceWater) error {
1509
+
1510
+	err := writeUserDb.Model(&hadwater).Where("id=? AND user_org_id = ? AND status = 1", id, orgid).Updates(map[string]interface{}{"sampling_date": hadwater.SamplingDate, "specimenb": hadwater.Specimenb, "concentrate_noc": hadwater.ConcentrateNoc, "concentrateb_nod": hadwater.ConcentratebNod, "sampling_locationb": hadwater.SamplingLocationb, "detection_unit": hadwater.DetectionUnit, "samplerb": hadwater.Samplerb, "reporting_dateb": hadwater.ReportingDateb, "detection_resultb": hadwater.DetectionResultb, "mtime": time.Now().Unix()}).Error
1511
+	return err
1512
+}
1513
+
1514
+func UpdateDivicePh(id int64, orgid int64, hadwater *models.XtDevicePh) error {
1515
+	err := writeUserDb.Model(&hadwater).Where("id=? AND user_org_id = ? AND status = 1", id, orgid).Updates(map[string]interface{}{"sampling_date": hadwater.SamplingDate, "specimenb": hadwater.Specimenb, "concentrate_noc": hadwater.ConcentrateNoc, "concentrateb_nod": hadwater.ConcentratebNod, "sampling_locationb": hadwater.SamplingLocationb, "detection_unit": hadwater.DetectionUnit, "samplerb": hadwater.Samplerb, "reporting_dateb": hadwater.ReportingDateb, "detection_resultb": hadwater.DetectionResultb, "mtime": time.Now().Unix()}).Error
1516
+	return err
1517
+}
1518
+
1519
+func DeleteOxygenates(id int64) error {
1520
+	oxygenates := models.XtDeviceOxygenates{}
1521
+	err := writeUserDb.Model(&oxygenates).Where("id = ? ", id).Updates(map[string]interface{}{"status": 0}).Error
1522
+	return err
1523
+}
1524
+
1525
+func DeleteHadWater(id int64) error {
1526
+	hadwater := models.XtDeviceHadwater{}
1527
+	err := writeUserDb.Model(&hadwater).Where("id =?", id).Updates(map[string]interface{}{"status": 0}).Error
1528
+	return err
1529
+}
1530
+
1531
+func DeleteWater(id int64) error {
1532
+
1533
+	water := models.XtDeviceWater{}
1534
+	err := writeUserDb.Model(&water).Where("id = ? ", id).Updates(map[string]interface{}{"status": 0}).Error
1535
+	return err
1536
+}
1537
+
1538
+func DeleteDevicePh(id int64) error {
1539
+
1540
+	ph := models.XtDevicePh{}
1541
+	err := writeUserDb.Model(&ph).Where("id = ? ", id).Updates(map[string]interface{}{"status": 0}).Error
1542
+	return err
1543
+}

+ 21 - 1
service/patientmanage_service.go Просмотреть файл

@@ -1520,7 +1520,7 @@ func GetVasularAccessByDetail(id int64) (models.XtPatientVascularAccess, error)
1520 1520
 
1521 1521
 func UpdateVascularAccess(access *models.XtPatientVascularAccess, id int64) error {
1522 1522
 
1523
-	err := XTWriteDB().Model(&access).Where("id= ?", id).Updates(map[string]interface{}{"access_project": access.AccessProject, "blood_access_part_id": access.BloodAccessPartId, "inflow_pass": access.InflowPass, "start_time": access.StartTime, "first_start_time": access.FirstStartTime, "blood_access_part_opera_id": access.BloodAccessPartOperaId, "stop_reason": access.StopReason, "remark": access.Remark, "user_status": access.UserStatus, "modify": access.Modify, "stop_time": access.StopTime}).Error
1523
+	err := XTWriteDB().Model(&access).Where("id= ?", id).Updates(map[string]interface{}{"access_project": access.AccessProject, "blood_access_part_id": access.BloodAccessPartId, "inflow_pass": access.InflowPass, "start_time": access.StartTime, "first_start_time": access.FirstStartTime, "blood_access_part_opera_id": access.BloodAccessPartOperaId, "stop_reason": access.StopReason, "remark": access.Remark, "user_status": access.UserStatus, "modify": access.Modify, "stop_time": access.StopTime, "other_vascular": access.OtherVascular}).Error
1524 1524
 	return err
1525 1525
 }
1526 1526
 
@@ -1567,3 +1567,23 @@ func GetLastPassWayAssessment(orgid int64, patientId int64) (models.XtPatientVas
1567 1567
 	err := XTReadDB().Model(&assessment).Where("user_org_id = ? and patient_id = ? and status =1 and user_status = 1", orgid, patientId).Order("start_time desc").Last(&assessment).Error
1568 1568
 	return assessment, err
1569 1569
 }
1570
+
1571
+func GetAccessList(orgid int64) (*models.Dataconfig, error) {
1572
+
1573
+	dataconfig := models.Dataconfig{}
1574
+	err := XTReadDB().Model(&dataconfig).Where("org_id = 0 and name = '血管通路' and status = ?", 1).Find(&dataconfig).Error
1575
+	return &dataconfig, err
1576
+}
1577
+
1578
+func GetParentAccessList(orgid int64, parentid int64) (dataconfig []*models.Dataconfig, err error) {
1579
+
1580
+	err = XTReadDB().Model(&dataconfig).Where("org_id in(0,?) and parent_id = ? and status =1", orgid, parentid).Find(&dataconfig).Error
1581
+	return dataconfig, err
1582
+
1583
+}
1584
+
1585
+func GetBloodAccess(orgid int64) (*models.Dataconfig, error) {
1586
+	dataconfig := models.Dataconfig{}
1587
+	err := XTReadDB().Model(&dataconfig).Where("org_id = 0 and name = '血管通路部位' and status = 1 ").Find(&dataconfig).Error
1588
+	return &dataconfig, err
1589
+}

+ 2 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go Просмотреть файл

@@ -192,6 +192,8 @@ type PrescriptionVM struct {
192 192
 	ALiquid                    int64   `gorm:"column:a_liquid" json:"a_liquid"`
193 193
 	AnticoagulantStopTimeMin   int64   `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
194 194
 	AnticoagulantStopTimeHour  int64   `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
195
+	DialysisDialyszers         string  `gorm:"column:dialysis_dialyszers" json:"dialysis_dialyszers" form:"dialysis_dialyszers"`
196
+	DialysisIrrigation         string  `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
195 197
 }
196 198
 
197 199
 func (PrescriptionVM) TableName() string {