Browse Source

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

28169 2 weeks ago
parent
commit
bb85bdda1a
2 changed files with 8 additions and 5 deletions
  1. 3 2
      controllers/his_export_data_controller.go
  2. 5 3
      service/export_data_service.go

+ 3 - 2
controllers/his_export_data_controller.go View File

@@ -153,10 +153,11 @@ func (c *HisExportDataController) GetSummaryExport() {
153 153
 		}
154 154
 		endTime = theTime.Unix()
155 155
 	}
156
-	fmt.Println("111111")
157 156
 	result, _ := service.GetHisOrderBy10697SummaryThree(start_time, end_time, startTime, endTime, c.GetAdminUserInfo().CurrentOrgId)
157
+	org_info, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
158 158
 	c.ServeSuccessJSON(map[string]interface{}{
159
-		"result": result,
159
+		"result":   result,
160
+		"org_info": org_info,
160 161
 	})
161 162
 }
162 163
 

+ 5 - 3
service/export_data_service.go View File

@@ -296,6 +296,7 @@ type MedicalCharges struct {
296 296
 
297 297
 type MedicalChargesThree struct {
298 298
 	PatientID                string  `gorm:"column:ID"`   // 姓名
299
+	CanBaoDi                 string  `gorm:"column:参保地"`  // 姓名
299 300
 	PsnName                  string  `gorm:"column:姓名"`   // 姓名
300 301
 	TypeName                 string  `gorm:"column:类型"`   // 姓名
301 302
 	Total                    float64 `gorm:"column:合计次数"` // 姓名
@@ -451,6 +452,7 @@ func GetHisOrderBy10697SummaryThree(startTime, endTime string, st_stamp, end_sta
451 452
 	// 执行主查询
452 453
 	err := readDb.Table("his_order").
453 454
 		Select(`p.id as ID, p.name AS 姓名,
455
+			pp.insuplc_admdvs as 参保地,
454 456
 			CASE his_order.insutype
455 457
 				WHEN '390' THEN '城乡'
456 458
 				WHEN '310' THEN '职工'
@@ -476,9 +478,9 @@ func GetHisOrderBy10697SummaryThree(startTime, endTime string, st_stamp, end_sta
476 478
 			"" AS 挂账,
477 479
 			"" AS 冲账,
478 480
 			0 AS 实收`).
479
-		Joins("JOIN (?) i ON his_order.number = i.order_number", subQuery).                       // 使用子查询
480
-		Joins("JOIN xt_patients p on p.id = his_order.patient_id and p.user_org_id = ?", org_id). // 使用子查询
481
-
481
+		Joins("JOIN (?) i ON his_order.number = i.order_number", subQuery).                           // 使用子查询
482
+		Joins("JOIN xt_patients p on p.id = his_order.patient_id and p.user_org_id = ?", org_id).     // 使用子查询
483
+		Joins("JOIN his_patient pp on pp.number = his_order.mdtrt_id and p.user_org_id = ?", org_id). // 使用子查询
482 484
 		Where("his_order.user_org_id = ? AND his_order.order_status = ? AND his_order.setl_time >= ? AND his_order.setl_time <= ?  AND his_order.STATUS = ?",
483 485
 			org_id, 2, startTime+" 00:00:00", endTime+" 23:59:59", 1).
484 486
 		Group("his_order.patient_id").