Ver código fonte

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 9 meses atrás
pai
commit
7d82b3640b

+ 9 - 0
controllers/his_project_api_controller.go Ver arquivo

@@ -149,6 +149,7 @@ func (this *HisProjectApiController) SaveProject() {
149 149
 			firstLetter += string(py[0][0])
150 150
 		}
151 151
 	}
152
+
152 153
 	hisProject := models.XtHisProject{
153 154
 		ProjectName:                 project_name,
154 155
 		Pinyin:                      firstLetter,
@@ -191,6 +192,10 @@ func (this *HisProjectApiController) SaveProject() {
191 192
 		ZuobiaoId:                   bbx01,
192 193
 		FirstLetter:                 firstLetter,
193 194
 	}
195
+	if this.GetAdminUserInfo().CurrentOrgId == 10206 {
196
+		de, _ := service.GetDepartMentDetail(executive_section)
197
+		hisProject.Bck01b = de.Number
198
+	}
194 199
 	//查询项目名称是否存在
195 200
 	_, errcode := service.GetHisProjectIsExist(project_name, orgId)
196 201
 	if errcode == gorm.ErrRecordNotFound {
@@ -343,6 +348,10 @@ func (this *HisProjectApiController) UpdatedProject() {
343 348
 		ZuobiaoId:                   bbx01,
344 349
 		UserOrgId:                   orgId,
345 350
 	}
351
+	if this.GetAdminUserInfo().CurrentOrgId == 10206 {
352
+		de, _ := service.GetDepartMentDetail(executive_section)
353
+		hisProject.Bck01b = de.Number
354
+	}
346 355
 
347 356
 	err := service.UpdatedProject(id, &hisProject)
348 357
 

+ 2 - 0
controllers/manager_center_api_controller.go Ver arquivo

@@ -1682,6 +1682,7 @@ func (c *ManagerCenterApiController) CreateGoodInfo() {
1682 1682
 		Bbx01:                       bbx01,
1683 1683
 		Bby01:                       bby01,
1684 1684
 		ZuobiaoId:                   bbx01,
1685
+		Bck01b:                      "55",
1685 1686
 	}
1686 1687
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1687 1688
 	if err == nil {
@@ -1825,6 +1826,7 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1825 1826
 		Bbx01:                       bbx01,
1826 1827
 		Bby01:                       bby01,
1827 1828
 		ZuobiaoId:                   bbx01,
1829
+		Bck01b:                      "55",
1828 1830
 	}
1829 1831
 
1830 1832
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)

+ 1 - 1
controllers/statistics_api_controller.go Ver arquivo

@@ -1021,7 +1021,7 @@ func (c *StatisticsApiController) GetDialysisTotalDetail() {
1021 1021
 	}
1022 1022
 }
1023 1023
 func (c *StatisticsApiController) GetDialysisTotalDetailInfo() {
1024
-	date_str := c.GetString("data")
1024
+	date_str := c.GetString("date")
1025 1025
 	mode, _ := c.GetInt64("mode")
1026 1026
 	origin, _ := c.GetInt64("origin")
1027 1027
 	page, _ := c.GetInt64("page")

+ 3 - 1
models/good_models.go Ver arquivo

@@ -104,7 +104,9 @@ type GoodInfo struct {
104 104
 	SumInCount                  int64                `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
105 105
 	Bbx01                       string               `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
106 106
 	Bby01                       string               `gorm:"column:bby01" json:"bby01" form:"bby01"`
107
-	ZuobiaoId                   string               `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
107
+	Bck01b                      string               `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
108
+
109
+	ZuobiaoId string `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
108 110
 
109 111
 	WarehousingInfoOne []*StartWarehousingInfo `gorm:"json:"warehouse_info"` //期间增加
110 112
 

+ 2 - 1
models/his_models.go Ver arquivo

@@ -48,6 +48,7 @@ type XtHisProject struct {
48 48
 	Bbx01                       string  `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
49 49
 	Bby01                       string  `gorm:"column:bby01" json:"bby01" form:"bby01"`
50 50
 	ZuobiaoId                   string  `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
51
+	Bck01b                      string  `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
51 52
 }
52 53
 
53 54
 func (XtHisProject) TableName() string {
@@ -557,7 +558,7 @@ type HisPrescription struct {
557 558
 	BatchNumber            string                    `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
558 559
 	PrescriptionNumber     string                    `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
559 560
 	Patients               Patients                  `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
560
-	HisPatient             VMHisPatient              `gorm:"ForeignKey:PatientId;AssociationForeignKey:patient_id" json:"hisPatient"`
561
+	HisPatient             VMHisPatient              `gorm:"ForeignKey:ID;AssociationForeignKey:HisPatientId" json:"hisPatient"`
561 562
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
562 563
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
563 564
 	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`

+ 2 - 2
service/his_project_service.go Ver arquivo

@@ -59,7 +59,7 @@ func GetProjectDetail(id int64) (models.XtHisProject, error) {
59 59
 
60 60
 func UpdatedProject(id int64, pro *models.XtHisProject) error {
61 61
 
62
-	err := XTWriteDB().Model(&pro).Where("id=?", id).Updates(map[string]interface{}{"project_name": pro.ProjectName, "pinyin": pro.Pinyin, "wubi": pro.Pinyin, "price": pro.Price, "unit": pro.Unit, "cost_classify": pro.CostClassify, "executive_section": pro.ExecutiveSection, "medical_coverage": pro.MedicalCoverage, "statistical_classification": pro.StatisticalClassification, "disease_directory": pro.DiseaseDirectory, "is_record": pro.IsRecord, "medical_code": pro.MedicalCode, "tube_color": pro.TubeColor, "medical_status": pro.MedicalStatus, "remark": pro.Remark, "sign": pro.Sign, "default_number": pro.DefaultNumber, "is_default": pro.IsDefault, "is_charge": pro.IsCharge, "is_estimate": pro.IsEstimate, "is_workload": pro.IsWorkload, "sort": pro.Sort, "doctor_advice": pro.DoctorAdvice, "single_dose": pro.SingleDose, "execution_frequency": pro.ExecutionFrequency, "delivery_way": pro.DeliveryWay, "number_days": pro.NumberDays, "total": pro.Total, "updated_time": pro.UpdatedTime, "category": pro.Category, "specail_project": pro.SpecailProject, "social_security_directory_code": pro.SocialSecurityDirectoryCode, "record_date": pro.RecordDate, "is_print": pro.IsPrint, "bbx01": pro.Bbx01, "bby01": pro.Bby01, "zuobiao_id": pro.ZuobiaoId}).Error
62
+	err := XTWriteDB().Model(&pro).Where("id=?", id).Updates(map[string]interface{}{"project_name": pro.ProjectName, "pinyin": pro.Pinyin, "wubi": pro.Pinyin, "price": pro.Price, "unit": pro.Unit, "cost_classify": pro.CostClassify, "executive_section": pro.ExecutiveSection, "medical_coverage": pro.MedicalCoverage, "statistical_classification": pro.StatisticalClassification, "disease_directory": pro.DiseaseDirectory, "is_record": pro.IsRecord, "medical_code": pro.MedicalCode, "tube_color": pro.TubeColor, "medical_status": pro.MedicalStatus, "remark": pro.Remark, "sign": pro.Sign, "default_number": pro.DefaultNumber, "is_default": pro.IsDefault, "is_charge": pro.IsCharge, "is_estimate": pro.IsEstimate, "is_workload": pro.IsWorkload, "sort": pro.Sort, "doctor_advice": pro.DoctorAdvice, "single_dose": pro.SingleDose, "execution_frequency": pro.ExecutionFrequency, "delivery_way": pro.DeliveryWay, "number_days": pro.NumberDays, "total": pro.Total, "updated_time": pro.UpdatedTime, "category": pro.Category, "specail_project": pro.SpecailProject, "social_security_directory_code": pro.SocialSecurityDirectoryCode, "record_date": pro.RecordDate, "is_print": pro.IsPrint, "bbx01": pro.Bbx01, "bby01": pro.Bby01, "zuobiao_id": pro.ZuobiaoId, "bck01b": pro.Bck01b}).Error
63 63
 	return err
64 64
 }
65 65
 
@@ -419,7 +419,7 @@ func GetHistPatient(orgid int64, keyword string) (hisPatient []*models.HisPatien
419 419
 }
420 420
 
421 421
 func GetDoctorAdvicePrint(his_patient_id int64, recorddate int64, schIDs []string, orgid int64, p_type int64) (prescription []*models.HisPrescription, err error) {
422
-	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 and p_type = ? ", his_patient_id, recorddate, schIDs, p_type).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
422
+	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 and p_type = ? ", his_patient_id, recorddate, schIDs, p_type).Preload("HisPatient", "status = 1 and  user_org_id = ?", orgid).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
423 423
 		return db.Where("status = 1 and user_org_id = ?", orgid).Preload("Drug", "status = 1")
424 424
 	}).Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
425 425
 		return db.Where("status = 1 AND user_org_id = ?", orgid).Preload("HisProject").Preload("GoodInfo", "status=1").Preload("XtHisProjectTeam", "status = 1")

+ 13 - 6
service/statistis_qc_service.go Ver arquivo

@@ -643,14 +643,14 @@ func GetPrescriptionByAnticoagulant(page int64, limit int64, orgid int64, antico
643 643
 
644 644
 func GetPrescriptionByDialyzer(page int64, limit int64, orgid int64, dialyzer string, start_time int64, end_time int64) (solution []*models.DialysisPrescription, total int64, err error) {
645 645
 
646
-	db := XTReadDB().Model(&models.DialysisPrescription{}).Where("status = 1")
646
+	db := XTReadDB().Model(&models.DialysisPrescription{}).Preload("QCPatients", "status = 1 and user_org_id = ?", orgid).Where("status = 1")
647 647
 	if len(dialyzer) > 0 {
648 648
 		db = db.Where("dialysis_dialyszers = ?", dialyzer)
649 649
 	}
650 650
 	if orgid > 0 {
651 651
 		db = db.Where("user_org_id = ?", orgid)
652 652
 	}
653
-	db = db.Where("record_date >= ? and record_date <= ?", start_time, end_time)
653
+	db = db.Where("record_date >= ? and record_date <= ? and status = 1", start_time, end_time)
654 654
 
655 655
 	offset := (page - 1) * limit
656 656
 
@@ -736,7 +736,8 @@ func GetDialysisCompletionDetail(org_id int64, start_time int64, end_time int64,
736 736
 	      CONCAT(a.actual_treatment_hour, 'h', a.actual_treatment_minute,'min') as actual_duration,
737 737
 	      ABS(TIMESTAMPDIFF(MINUTE, MAKETIME(p.dialysis_duration_hour, p.dialysis_duration_minute, 0), MAKETIME(a.actual_treatment_hour, a.actual_treatment_minute, 0))) as diff,
738 738
 	      p.prescription_doctor as doctor,
739
-	      o.finish_nurse as nurse
739
+	      o.finish_nurse as nurse,
740
+	    	pp.id_card_no as id_card_no
740 741
 	   FROM
741 742
 	       xt_dialysis_order o
742 743
 		JOIN
@@ -765,7 +766,9 @@ func GetDialysisCompletionDetail(org_id int64, start_time int64, end_time int64,
765 766
 	      CONCAT(a.actual_treatment_hour, 'h', a.actual_treatment_minute,'min') as actual_duration,
766 767
 	      ABS(TIMESTAMPDIFF(MINUTE, MAKETIME(p.dialysis_duration_hour, p.dialysis_duration_minute, 0), MAKETIME(a.actual_treatment_hour, a.actual_treatment_minute, 0))) as diff,
767 768
 	      p.prescription_doctor as doctor,
768
-	      o.finish_nurse as nurse
769
+	      o.finish_nurse as nurse,
770
+	   pp.id_card_no as id_card_no
771
+	      
769 772
 	   FROM
770 773
 	       xt_dialysis_order o
771 774
 		JOIN
@@ -793,7 +796,8 @@ func GetDialysisCompletionDetail(org_id int64, start_time int64, end_time int64,
793 796
 	      CONCAT(a.actual_treatment_hour, 'h', a.actual_treatment_minute,'min') as actual_duration,
794 797
 	      ABS(TIMESTAMPDIFF(MINUTE, MAKETIME(p.dialysis_duration_hour, p.dialysis_duration_minute, 0), MAKETIME(a.actual_treatment_hour, a.actual_treatment_minute, 0))) as diff,
795 798
 	      p.prescription_doctor as doctor,
796
-	      o.finish_nurse as nurse
799
+	      o.finish_nurse as nurse,
800
+	   pp.id_card_no as id_card_no
797 801
 	   FROM
798 802
 	       xt_dialysis_order o
799 803
 		JOIN
@@ -821,7 +825,8 @@ func GetDialysisCompletionDetail(org_id int64, start_time int64, end_time int64,
821 825
 	      CONCAT(a.actual_treatment_hour, 'h', a.actual_treatment_minute,'min') as actual_duration,
822 826
 	      ABS(TIMESTAMPDIFF(MINUTE, MAKETIME(p.dialysis_duration_hour, p.dialysis_duration_minute, 0), MAKETIME(a.actual_treatment_hour, a.actual_treatment_minute, 0))) as diff,
823 827
 	      p.prescription_doctor as doctor,
824
-	      o.finish_nurse as nurse
828
+	      o.finish_nurse as nurse,
829
+	   pp.id_card_no as id_card_no
825 830
 	   FROM
826 831
 	       xt_dialysis_order o
827 832
 		JOIN
@@ -859,6 +864,7 @@ func GetDialysisCompletionDetail(org_id int64, start_time int64, end_time int64,
859 864
 		"diff":              0,
860 865
 		"doctor":            "",
861 866
 		"nurse":             "",
867
+		"id_card_no":        "",
862 868
 	}
863 869
 
864 870
 	// Create the dynamic struct type
@@ -882,6 +888,7 @@ func GetDialysisCompletionDetail(org_id int64, start_time int64, end_time int64,
882 888
 			reflect.ValueOf(result).Elem().FieldByName("Diff").Addr().Interface(),
883 889
 			reflect.ValueOf(result).Elem().FieldByName("Doctor").Addr().Interface(),
884 890
 			reflect.ValueOf(result).Elem().FieldByName("Nurse").Addr().Interface(),
891
+			reflect.ValueOf(result).Elem().FieldByName("Id_card_no").Addr().Interface(),
885 892
 		}
886 893
 
887 894
 		// Scan the row into the struct