Explorar el Código

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

csx hace 3 años
padre
commit
3d9b039c3a
Se han modificado 2 ficheros con 37 adiciones y 2 borrados
  1. 18 2
      controllers/sz/sz_his_api_controller.go
  2. 19 0
      service/his_service.go

+ 18 - 2
controllers/sz/sz_his_api_controller.go Ver fichero

@@ -2152,6 +2152,9 @@ func (c *SZHisApiController) GetSettleInfo() {
2152 2152
 	admin_user_id, _ := c.GetInt64("admin_user_id")
2153 2153
 	his_patient_id, _ := c.GetInt64("his_patient_id")
2154 2154
 
2155
+	id_str := c.GetString("ids")
2156
+	ids_arr := strings.Split(id_str,  ",")
2157
+
2155 2158
 	order_id, _ := c.GetInt64("order_id")
2156 2159
 
2157 2160
 	sick_type, _ := c.GetInt64("sick_type")
@@ -2193,7 +2196,12 @@ func (c *SZHisApiController) GetSettleInfo() {
2193 2196
 		var end_time int64
2194 2197
 
2195 2198
 		if settle_accounts_type == 1 { //日结
2196
-			prescriptions, _ = service.GetNewHisPrescriptionTwo(adminUser.CurrentOrgId, his_patient_id, recordDateTime, his.MedicalTreatmentType)
2199
+			if reg_type == 11{
2200
+
2201
+				prescriptions,_ = service.GetPrescriptionByIds(ids_arr,adminUser.CurrentOrgId)
2202
+		   }else{
2203
+			prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime, strconv.Itoa(int(reg_type)))
2204
+		   }
2197 2205
 
2198 2206
 		} else { //月结
2199 2207
 			start_time_str := c.GetString("start_time")
@@ -2985,6 +2993,9 @@ func (c *SZHisApiController) GetPreSettleInfo() {
2985 2993
 	reg_type, _ := c.GetInt64("p_type")
2986 2994
 	sick_type, _ := c.GetInt64("sick_type")
2987 2995
 
2996
+	id_str := c.GetString("ids")
2997
+	ids_arr := strings.Split(id_str,  ",")
2998
+
2988 2999
 	timestamp := time.Now().Unix()
2989 3000
 	tempTime := time.Unix(timestamp, 0)
2990 3001
 	timeFormat := tempTime.Format("20060102150405")
@@ -3013,7 +3024,12 @@ func (c *SZHisApiController) GetPreSettleInfo() {
3013 3024
 	var end_time int64
3014 3025
 
3015 3026
 	if settle_accounts_type == 1 { //日结
3016
-		prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime, strconv.Itoa(int(reg_type)))
3027
+		if reg_type == 11{
3028
+
3029
+			prescriptions,_ = service.GetPrescriptionByIds(ids_arr,adminUser.CurrentOrgId)
3030
+		   }else{
3031
+			prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime, strconv.Itoa(int(reg_type)))
3032
+		   }
3017 3033
 
3018 3034
 	} else { //月结
3019 3035
 		start_time_str := c.GetString("start_time")

+ 19 - 0
service/his_service.go Ver fichero

@@ -1097,6 +1097,25 @@ func GetDoctorList(orgid int64) (role []*models.SgjUserAdminRole, err error) {
1097 1097
 	return role, err
1098 1098
 }
1099 1099
 
1100
+func GetPrescriptionByIds(ids []string, org_id int64) (prescription []*models.HisPrescription, err error) {
1101
+	err = readDb.Model(&models.HisPrescription{}).
1102
+	 Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
1103
+	  return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("XtHisAddtionConfig", "status=1")
1104
+	 }).
1105
+	 Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1106
+	  return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("Drug", "status=1")
1107
+	 }).
1108
+	 Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1109
+	  return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject").Preload("GoodInfo", "status=1")
1110
+	 }).Preload("TempHisOrder", func(db *gorm.DB) *gorm.DB {
1111
+	 return db.Where("status = 1 AND user_org_id = ?", org_id)
1112
+	}).
1113
+	 Where("id in (?) AND user_org_id = ? AND status = 1", ids,org_id).
1114
+	 Find(&prescription).Error
1115
+	
1116
+	return
1117
+   }
1118
+
1100 1119
 func GetDoctorListTwo(orgid int64) (role []*models.SgjUserAdminRole, err error) {
1101 1120
 
1102 1121
 	db := UserReadDB().Table("sgj_user_admin_role as x").Where("x.status =1 AND x.user_type = 2 AND x.org_id = ?", orgid)