csx 4 lat temu
rodzic
commit
358f8bc9c5

+ 3 - 0
.idea/misc.xml Wyświetl plik

3
   <component name="JavaScriptSettings">
3
   <component name="JavaScriptSettings">
4
     <option name="languageLevel" value="ES6" />
4
     <option name="languageLevel" value="ES6" />
5
   </component>
5
   </component>
6
+  <component name="RustProjectSettings">
7
+    <option name="toolchainHomeDirectory" value="$USER_HOME$/.cargo/bin" />
8
+  </component>
6
   <component name="SvnBranchConfigurationManager">
9
   <component name="SvnBranchConfigurationManager">
7
     <option name="myConfigurationMap">
10
     <option name="myConfigurationMap">
8
       <map>
11
       <map>

+ 1 - 1
conf/app.conf Wyświetl plik

5
 #
5
 #
6
 copyrequestbody = true
6
 copyrequestbody = true
7
 sessionon = true
7
 sessionon = true
8
-sessiongcmaxlifetime = 64800
8
+#sessiongcmaxlifetime = 64800
9
 
9
 
10
 tokencookiemaxlifetime = 7200
10
 tokencookiemaxlifetime = 7200
11
 enablexsrf = false
11
 enablexsrf = false

+ 22 - 0
controllers/his_api_controller.go Wyświetl plik

78
 	beego.Router("/api/orderdetail/get", &HisApiController{}, "get:GetAllOrderDetail")
78
 	beego.Router("/api/orderdetail/get", &HisApiController{}, "get:GetAllOrderDetail")
79
 	beego.Router("/api/orderdetaicollect/get", &HisApiController{}, "get:GetAllOrderDetailCollect")
79
 	beego.Router("/api/orderdetaicollect/get", &HisApiController{}, "get:GetAllOrderDetailCollect")
80
 
80
 
81
+	beego.Router("/api/cost/compare", &HisApiController{}, "get:GetMedicalInsuranceCostCompareList")
82
+
81
 }
83
 }
82
 
84
 
83
 func (c *HisApiController) Sscard() {
85
 func (c *HisApiController) Sscard() {
2731
 	})
2733
 	})
2732
 	return
2734
 	return
2733
 }
2735
 }
2736
+
2737
+func (c *HisApiController) GetMedicalInsuranceCostCompareList() {
2738
+	page, _ := c.GetInt64("page")
2739
+	limit, _ := c.GetInt64("limit")
2740
+	keywords := c.GetString("keywords")
2741
+
2742
+	if page <= 0 {
2743
+		page = 1
2744
+	}
2745
+	if limit <= 0 {
2746
+		limit = 10
2747
+	}
2748
+	list, total, _ := service.GetMedicalInsuranceCostCompareList(c.GetAdminUserInfo().CurrentOrgId, page, limit, keywords)
2749
+	c.ServeSuccessJSON(map[string]interface{}{
2750
+		"total": total,
2751
+		"list":  list,
2752
+	})
2753
+	return
2754
+
2755
+}

+ 2 - 1
controllers/new_mobile_api_controllers/new_role_api_controller.go Wyświetl plik

436
 }
436
 }
437
 
437
 
438
 func (this *NewRoleApiController) GetFuntionPurviews() {
438
 func (this *NewRoleApiController) GetFuntionPurviews() {
439
-	functionPurview, _ := service.GetFunctionPurview()
439
+	pid, _ := this.GetInt64("pid")
440
+	functionPurview, _ := service.GetFunctionPurview(pid)
440
 	this.ServeSuccessJSON(map[string]interface{}{
441
 	this.ServeSuccessJSON(map[string]interface{}{
441
 		"funtion_purview": functionPurview,
442
 		"funtion_purview": functionPurview,
442
 	})
443
 	})

+ 1 - 1
controllers/role_controller.go Wyświetl plik

558
 		if item.Name == "耗材管理" {
558
 		if item.Name == "耗材管理" {
559
 			item.Childs = append(item.Childs, subConsumablesPurviewTreeViewModel...)
559
 			item.Childs = append(item.Childs, subConsumablesPurviewTreeViewModel...)
560
 		}
560
 		}
561
-		if item.Name == "药管理" {
561
+		if item.Name == "药管理" {
562
 			item.Childs = append(item.Childs, subDrugPurviewTreeViewModel...)
562
 			item.Childs = append(item.Childs, subDrugPurviewTreeViewModel...)
563
 		}
563
 		}
564
 		if item.Name == "自备药管理" {
564
 		if item.Name == "自备药管理" {

+ 44 - 3
service/his_service.go Wyświetl plik

988
 		err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date  = ?", patient_id, org_id, Id.RecordDate).
988
 		err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date  = ?", patient_id, org_id, Id.RecordDate).
989
 			Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
989
 			Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
990
 				return db.Where("status = 1 AND user_org_id = ?", org_id).
990
 				return db.Where("status = 1 AND user_org_id = ?", org_id).
991
-					Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
991
+					Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
992
+						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("Drug", "status=1")
993
+					}).
992
 					Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
994
 					Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
993
 						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
995
 						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
994
 					})
996
 					})
1000
 		err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date  = ?", patient_id, org_id, Id.RecordDate).
1002
 		err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date  = ?", patient_id, org_id, Id.RecordDate).
1001
 			Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
1003
 			Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
1002
 				return db.Where("status = 1 AND user_org_id = ?", org_id).
1004
 				return db.Where("status = 1 AND user_org_id = ?", org_id).
1003
-					Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
1005
+					Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1006
+						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("Drug", "status=1")
1007
+					}).
1004
 					Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1008
 					Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1005
 						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
1009
 						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
1006
 					})
1010
 					})
1013
 	err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date >= ? AND record_date <= ?", patient_id, org_id, start_time, end_time).
1017
 	err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date >= ? AND record_date <= ?", patient_id, org_id, start_time, end_time).
1014
 		Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
1018
 		Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
1015
 			return db.Where("status = 1 AND user_org_id = ?", org_id).
1019
 			return db.Where("status = 1 AND user_org_id = ?", org_id).
1016
-				Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
1020
+				Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1021
+					return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("Drug", "status=1")
1022
+				}).
1017
 				Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1023
 				Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1018
 					return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
1024
 					return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
1019
 				})
1025
 				})
1253
 	}).Find(&order).Error
1259
 	}).Find(&order).Error
1254
 	return
1260
 	return
1255
 }
1261
 }
1262
+
1263
+type MedicalInsuranceCostCompare struct {
1264
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
1265
+	StartTime int64   `gorm:"column:start_time" json:"start_time" form:"start_time"`
1266
+	EndTime   int64   `gorm:"column:end_time" json:"end_time" form:"end_time"`
1267
+	Insutype  string  `gorm:"column:insutype" json:"insutype" form:"insutype"`
1268
+	CheckType int64   `gorm:"column:check_type" json:"check_type" form:"check_type"`
1269
+	Num       int64   `gorm:"column:num" json:"num" form:"num"`
1270
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
1271
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
1272
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1273
+	CostTotal float64 `gorm:"column:cost_total" json:"cost_total" form:"cost_total"`
1274
+	FuncTotal float64 `gorm:"column:func_total" json:"func_total" form:"func_total"`
1275
+	PsnPay    float64 `gorm:"column:psn_pay" json:"psn_pay" form:"psn_pay"`
1276
+	Creator   int64   `gorm:"column:creator" json:"creator" form:"creator"`
1277
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
1278
+}
1279
+
1280
+func (MedicalInsuranceCostCompare) TableName() string {
1281
+	return "medical_insurance_cost_compare"
1282
+}
1283
+
1284
+func GetMedicalInsuranceCostCompareList(orgID, page, limit int64, keywords string) (list []*MedicalInsuranceCostCompare, total int, err error) {
1285
+	offset := (page - 1) * limit
1286
+	db := readDb.Model(&MedicalInsuranceCostCompare{}).Where("user_org_id = ?", orgID)
1287
+
1288
+	if len(keywords) == 0 {
1289
+		db = db.Where("status=1")
1290
+		err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1291
+	} else {
1292
+		db = db.Where("status=1")
1293
+		err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1294
+	}
1295
+	return
1296
+}

+ 17 - 14
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go Wyświetl plik

1
 package schedule_dialysis
1
 package schedule_dialysis
2
 
2
 
3
+import "XT_New/models"
4
+
3
 type PatientVM struct {
5
 type PatientVM struct {
4
 	ID                           int64   `gorm:"column:id" json:"id" form:"id"`
6
 	ID                           int64   `gorm:"column:id" json:"id" form:"id"`
5
 	UserOrgId                    int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
7
 	UserOrgId                    int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
519
 	BedID        int64 `gorm:"column:bed_id" json:"bed_id"`
521
 	BedID        int64 `gorm:"column:bed_id" json:"bed_id"`
520
 	PartitionId  int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
522
 	PartitionId  int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
521
 
523
 
522
-	Patient                  *PatientVM                  `gorm:"ForeignKey:PatientID" json:"patient"`
523
-	DialysisOrder            DialysisOrderVM             `gorm:"ForeignKey:DialysisDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"dialysis_order"`
524
-	Prescription             PrescriptionVM              `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"prescription"`
525
-	ReceiveAssessment        ReceiveAssessmentVM         `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"receive_assessment"`
526
-	XtReceiveTreatmentAsses  *XtReceiveTreatmentAsses    `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"xt_receive_assessment"`
527
-	AssessmentBeforeDislysis AssessmentBeforeDislysisVM  `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_before_dislysis"`
528
-	AssessmentAfterDislysis  AssessmentAfterDislysisVM   `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_after_dislysis"`
529
-	MonitoringRecords        []*MonitoringRecordVM       `gorm:"ForeignKey:MonitoringDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"monitor_records"`
530
-	DeviceNumber             *DeviceNumberVM             `gorm:"ForeignKey:BedID" json:"device_number"`
531
-	DeviceZone               *DeviceZoneVM               `gorm:"ForeignKey:PartitionId" json:"device_zone"`
532
-	Advices                  []*DoctorAdviceVM           `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientId" json:"advices"`
533
-	DoubleCheck              *DoubleCheckVM              `gorm:"ForeignKey:CheckDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"check"`
534
-	Summer                   *SummerVM                   `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"summer"`
535
-	LastAfterWeight          XtAssessmentAfterDislysisVM `gorm:"ForeignKey:PatientID;AssociationForeignKey:PatientID" json:"lastafterweight"`
524
+	Patient                  *PatientVM                    `gorm:"ForeignKey:PatientID" json:"patient"`
525
+	DialysisOrder            DialysisOrderVM               `gorm:"ForeignKey:DialysisDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"dialysis_order"`
526
+	Prescription             PrescriptionVM                `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"prescription"`
527
+	ReceiveAssessment        ReceiveAssessmentVM           `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"receive_assessment"`
528
+	XtReceiveTreatmentAsses  *XtReceiveTreatmentAsses      `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"xt_receive_assessment"`
529
+	AssessmentBeforeDislysis AssessmentBeforeDislysisVM    `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_before_dislysis"`
530
+	AssessmentAfterDislysis  AssessmentAfterDislysisVM     `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_after_dislysis"`
531
+	MonitoringRecords        []*MonitoringRecordVM         `gorm:"ForeignKey:MonitoringDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"monitor_records"`
532
+	DeviceNumber             *DeviceNumberVM               `gorm:"ForeignKey:BedID" json:"device_number"`
533
+	DeviceZone               *DeviceZoneVM                 `gorm:"ForeignKey:PartitionId" json:"device_zone"`
534
+	Advices                  []*DoctorAdviceVM             `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientId" json:"advices"`
535
+	DoubleCheck              *DoubleCheckVM                `gorm:"ForeignKey:CheckDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"check"`
536
+	Summer                   *SummerVM                     `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"summer"`
537
+	LastAfterWeight          XtAssessmentAfterDislysisVM   `gorm:"ForeignKey:PatientID;AssociationForeignKey:PatientID" json:"lastafterweight"`
538
+	HisAdvices               []*models.HisDoctorAdviceInfo `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"his_advices"`
536
 }
539
 }
537
 
540
 
538
 func (ScheduleVM) TableName() string {
541
 func (ScheduleVM) TableName() string {

+ 5 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go Wyświetl plik

42
 				Where("user_org_id = ? AND advice_type = 2 AND status = 1", orgID).
42
 				Where("user_org_id = ? AND advice_type = 2 AND status = 1", orgID).
43
 				Order("start_time asc, groupno desc, advice_order desc, id asc")
43
 				Order("start_time asc, groupno desc, advice_order desc, id asc")
44
 		}).
44
 		}).
45
+		Preload("HisAdvices", func(db *gorm.DB) *gorm.DB {
46
+			return db.Select("id, user_org_id, patient_id, advice_type, advice_date, record_date, start_time, drug_spec_unit,advice_name,advice_desc, reminder_date, drug_spec, drug_spec_unit, single_dose, single_dose_unit, prescribing_number, prescribing_number_unit, delivery_way, execution_frequency, advice_doctor, status, created_time,updated_time, advice_affirm, remark, stop_time, stop_reason, stop_doctor, stop_state, parent_id, execution_time, execution_staff, execution_state, checker, check_state, check_time, groupno, IF(parent_id > 0, parent_id, id) as advice_order").
47
+				Where("user_org_id = ? AND status = 1", orgID).
48
+				Order("start_time asc, groupno desc, advice_order desc, id asc")
49
+		}).
45
 		Where("user_org_id = ? AND status = 1 AND id in (?)", orgID, schIDs).Order("schedule_date desc").
50
 		Where("user_org_id = ? AND status = 1 AND id in (?)", orgID, schIDs).Order("schedule_date desc").
46
 		Find(&schedules).
51
 		Find(&schedules).
47
 		Error
52
 		Error