Pārlūkot izejas kodu

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 gadus atpakaļ
vecāks
revīzija
907c7aaf80
2 mainītis faili ar 6 papildinājumiem un 6 dzēšanām
  1. 2 2
      controllers/sz/sz_his_api_controller.go
  2. 4 4
      service/his_service.go

+ 2 - 2
controllers/sz/sz_his_api_controller.go Parādīt failu

@@ -3012,7 +3012,7 @@ func (c *SZHisApiController) GetPreSettleInfo() {
3012 3012
 	var end_time int64
3013 3013
 
3014 3014
 	if settle_accounts_type == 1 { //日结
3015
-		prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
3015
+		prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime, strconv.Itoa(int(reg_type)))
3016 3016
 
3017 3017
 	} else { //月结
3018 3018
 		start_time_str := c.GetString("start_time")
@@ -3035,7 +3035,7 @@ func (c *SZHisApiController) GetPreSettleInfo() {
3035 3035
 		recordEndTime := theEndTime.Unix()
3036 3036
 		end_time = recordEndTime
3037 3037
 
3038
-		prescriptions, _ = service.GetMonthHisPrescription(adminUser.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
3038
+		prescriptions, _ = service.GetMonthHisPrescription(adminUser.CurrentOrgId, patient_id, recordStartTime, recordEndTime, strconv.Itoa(int(reg_type)))
3039 3039
 	}
3040 3040
 
3041 3041
 	var ids []int64

+ 4 - 4
service/his_service.go Parādīt failu

@@ -296,7 +296,7 @@ func GetHisPrescription(org_id int64, patient_id int64, record_date int64) (pres
296 296
 	return
297 297
 }
298 298
 
299
-func GetNewHisPrescription(org_id int64, his_patient_id int64, record_date int64) (prescription []*models.HisPrescription, err error) {
299
+func GetNewHisPrescription(org_id int64, his_patient_id int64, record_date int64, reg_type string) (prescription []*models.HisPrescription, err error) {
300 300
 	err = readDb.Model(&models.HisPrescription{}).
301 301
 		Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
302 302
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("XtHisAddtionConfig", "status=1")
@@ -307,7 +307,7 @@ func GetNewHisPrescription(org_id int64, his_patient_id int64, record_date int64
307 307
 		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
308 308
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1").Preload("GoodInfo", "status=1")
309 309
 		}).
310
-		Where("user_org_id = ? AND status = 1 AND record_date = ? AND his_patient_id = ? AND order_status <> 2 AND p_type <> 1", org_id, record_date, his_patient_id).
310
+		Where("user_org_id = ? AND status = 1 AND record_date = ? AND his_patient_id = ? AND order_status <> 2 AND p_type <> 1 AND med_type = ?", org_id, record_date, his_patient_id, reg_type).
311 311
 		Find(&prescription).Error
312 312
 	return
313 313
 }
@@ -1023,7 +1023,7 @@ func FindSickById(id int64) (*models.OutpatientServiceSick, error) {
1023 1023
 //	return "his_prescription"
1024 1024
 //}
1025 1025
 
1026
-func GetMonthHisPrescription(org_id int64, patient_id int64, start_time int64, end_time int64) (prescription []*models.HisPrescription, err error) {
1026
+func GetMonthHisPrescription(org_id int64, patient_id int64, start_time int64, end_time int64, reg_type string) (prescription []*models.HisPrescription, err error) {
1027 1027
 	err = readDb.Model(&models.HisPrescription{}).
1028 1028
 		Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
1029 1029
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("XtHisAddtionConfig", "status=1")
@@ -1034,7 +1034,7 @@ func GetMonthHisPrescription(org_id int64, patient_id int64, start_time int64, e
1034 1034
 		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1035 1035
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1").Preload("GoodInfo", "status=1")
1036 1036
 		}).
1037
-		Where("user_org_id = ? AND record_date >= ? AND record_date <= ? AND patient_id = ? AND order_status <> 2 AND status = 1  AND p_type <> 1", org_id, start_time, end_time, patient_id).
1037
+		Where("user_org_id = ? AND record_date >= ? AND record_date <= ? AND patient_id = ? AND order_status <> 2 AND status = 1  AND p_type <> 1 AND med_type = ?", org_id, start_time, end_time, patient_id, reg_type).
1038 1038
 		Find(&prescription).Error
1039 1039
 	return
1040 1040
 }