Browse Source

提交代码

陈少旭 1 month ago
parent
commit
173c06d123
1 changed files with 31 additions and 17 deletions
  1. 31 17
      controllers/his_charge_api_controller.go

+ 31 - 17
controllers/his_charge_api_controller.go View File

@@ -30,12 +30,12 @@ func HisChargeApiRegistRouters() {
30 30
 	beego.Router("/api/his/inspectioninfo/get", &HisChargeApiController{}, "get:GetHisInspectionInfo")
31 31
 
32 32
 	//发票
33
-	beego.Router("/api/fapiao/create", &HisChargeApiController{}, "post:CreateFaPiaoRecord")
34
-	beego.Router("/api/fapiao/modify", &HisChargeApiController{}, "post:ModifyFaPiaoRecord")
35
-	beego.Router("/api/fapiao/list", &HisChargeApiController{}, "get:GetFaPiaoRecordList")
36
-	beego.Router("/api/fapiao/delete", &HisChargeApiController{}, "post:DeleteFaPiaoRecord")
37
-	beego.Router("/api/fapiao", &HisChargeApiController{}, "get:GetFaPiaoRecord")
38
-	beego.Router("/api/fapiao/is_use", &HisChargeApiController{}, "post:UpdateFaPiaoRecordIsUse")
33
+	beego.Router("/api/bwfapiao/create", &HisChargeApiController{}, "post:CreateFaPiaoRecord")
34
+	beego.Router("/api/bwfapiao/modify", &HisChargeApiController{}, "post:ModifyFaPiaoRecord")
35
+	beego.Router("/api/bwfapiao/list", &HisChargeApiController{}, "get:GetFaPiaoRecordList")
36
+	beego.Router("/api/bwfapiao/delete", &HisChargeApiController{}, "post:DeleteFaPiaoRecord")
37
+	beego.Router("/api/bwfapiao", &HisChargeApiController{}, "get:GetFaPiaoRecord")
38
+	beego.Router("/api/bwfapiao/is_use", &HisChargeApiController{}, "post:UpdateFaPiaoRecordIsUse")
39 39
 	beego.Router("/api/his/getyidiclear", &HisChargeApiController{}, "get:GetHisYidiClearRecord")
40 40
 	beego.Router("/api/his/getexportdata", &HisChargeApiController{}, "get:GetExportData")
41 41
 
@@ -443,19 +443,19 @@ func (c *HisChargeApiController) GetPrescriptionStatisticsDetail() {
443 443
 	patient_id, _ := c.GetInt64("patient_id")
444 444
 	item_type, _ := c.GetInt64("type")
445 445
 
446
-	date1, _ := time.Parse("2006-01-02", start_time)
447
-	date2, _ := time.Parse("2006-01-02", end_time)
446
+	//date1, _ := time.Parse("2006-01-02", start_time)
447
+	//date2, _ := time.Parse("2006-01-02", end_time)
448 448
 	// 计算日期间隔
449
-	duration := date2.Sub(date1)
449
+	//duration := date2.Sub(date1)
450 450
 
451 451
 	// 一个月的时间跨度为30天 * 24小时 * 60分钟 * 60秒
452
-	oneMonthDuration := 30 * 24 * time.Hour
452
+	//oneMonthDuration := 30 * 24 * time.Hour
453 453
 
454
-	if duration <= oneMonthDuration {
455
-	} else {
456
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorTimeCodeParamWrong)
457
-		return
458
-	}
454
+	//if duration <= oneMonthDuration {
455
+	//} else {
456
+	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorTimeCodeParamWrong)
457
+	//	return
458
+	//}
459 459
 	adminUser := c.GetAdminUserInfo()
460 460
 	timeLayout := "2006-01-02"
461 461
 	loc, _ := time.LoadLocation("Local")
@@ -543,6 +543,10 @@ func (c *HisChargeApiController) GetChargeStatisticsSettle() {
543 543
 	end_time := c.GetString("end_time")
544 544
 	keyword := c.GetString("keyword")
545 545
 	item_type, _ := c.GetInt64("type")
546
+	s_type, _ := c.GetInt64("s_type")
547
+	limit, _ := c.GetInt64("limit")
548
+	page, _ := c.GetInt64("page")
549
+
546 550
 	adminUser := c.GetAdminUserInfo()
547 551
 
548 552
 	timeLayout := "2006-01-02"
@@ -559,14 +563,24 @@ func (c *HisChargeApiController) GetChargeStatisticsSettle() {
559 563
 	}
560 564
 	endRecordDateTime := endTime.Unix()
561 565
 
562
-	chargePatient, err := service.GetAllPatientChargeSettle(adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime, keyword, item_type)
566
+	var chargePatient []*models.SettlePatient
567
+	var total int64
568
+	var err2 error
569
+	if s_type == 1 {
570
+		chargePatient, total, err2 = service.GetAllPatientChargeSettle(adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime, keyword, item_type, limit, page)
571
+
572
+	} else {
573
+		chargePatient, err2 = service.GetAllPatientChargeSettleTwo(adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime, keyword, item_type)
574
+
575
+	}
563 576
 	sick, _, _ := service.FindAllMZSickList(adminUser.CurrentOrgId, 1, 10000)
564 577
 	config, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
565 578
 
566
-	if err == nil {
579
+	if err2 == nil {
567 580
 		c.ServeSuccessJSON(map[string]interface{}{
568 581
 			"patients": chargePatient,
569 582
 			"config":   config,
583
+			"total":    total,
570 584
 			"sick":     sick,
571 585
 		})
572 586
 		return