csx 3 年 前
コミット
18d0f0c738
共有3 個のファイルを変更した19 個の追加1 個の削除を含む
  1. 13 0
      controllers/his_api_controller.go
  2. 1 1
      controllers/his_project_api_controller.go
  3. 5 0
      service/his_service.go

+ 13 - 0
controllers/his_api_controller.go ファイルの表示

@@ -570,6 +570,19 @@ func (c *HisApiController) GetHisPatientInfo() {
570 570
 		}
571 571
 	}
572 572
 
573
+	if config.ID > 0 && config.IsOpen == 1 {
574
+		for _, item := range sch_prescriptions {
575
+			for _, subItem := range item.HisPrescriptionProjectTemplate {
576
+				if subItem.Type == 3 {
577
+					info, _ := service.GetGoodWarehoseInfoByGoodId(subItem.ProjectId, admin.CurrentOrgId)
578
+					if info.Price > 0 {
579
+						subItem.GoodInfo.PackingPrice = info.Price
580
+					}
581
+				}
582
+			}
583
+		}
584
+	}
585
+
573 586
 	//prescriptions, _ := service.GetHisPrescription(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime)
574 587
 	//monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
575 588
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)

+ 1 - 1
controllers/his_project_api_controller.go ファイルの表示

@@ -1230,7 +1230,7 @@ func (this *HisProjectApiController) GetDoctorAdvicePrint() {
1230 1230
 	his, _ := service.GetLastHisPatient(patient_id, adminUserInfo.CurrentOrgId)
1231 1231
 	prescriptionInfo, _ := service.GetPrscriptionInfo(patient_id, recordDateTime)
1232 1232
 	//advicePrint, err := service.GetPre(patient_id, recordDateTime, idStrs, adminUserInfo.CurrentOrgId, temp_p_type)
1233
-	hisPatient, _ := service.GetHisPatient(adminUserInfo.CurrentOrgId, recordDateTime)
1233
+	hisPatient, _ := service.GetHisPatientInfo(adminUserInfo.CurrentOrgId, patient_id, recordDateTime)
1234 1234
 	//hisPatient, _ := service.GetHisPatientById(patient_id)
1235 1235
 	hisHospitalRecord, _ := service.GetLastHospitalRecordTwo(patient_id, adminUserInfo.CurrentOrgId)
1236 1236
 

+ 5 - 0
service/his_service.go ファイルの表示

@@ -2308,3 +2308,8 @@ func GetWarehoseInfoByDrugId(drug_id int64, org_id int64) (info OtherDrugWarehou
2308 2308
 	err = readDb.Model(&OtherDrugWarehouseInfo{}).Where("(drug_id = ? AND org_id = ? AND  status = 1 and stock_max_number > 0)  or  (drug_id = ? AND org_id = ? AND status = 1  AND stock_min_number >0)", drug_id, org_id, drug_id, org_id).First(&info).Error
2309 2309
 	return
2310 2310
 }
2311
+
2312
+func GetGoodWarehoseInfoByGoodId(good_id int64, org_id int64) (info models.GoodSotckInfo, err error) {
2313
+	err = readDb.Model(&models.GoodSotckInfo{}).Where("stock_count > 0 and status = 1 and good_id = ? and org_id = ?", good_id, org_id).First(&info).Error
2314
+	return
2315
+}