Browse Source

历史排班

28169 1 year ago
parent
commit
7e2c83ef70

+ 8 - 3
controllers/pharmacy_controller.go View File

@@ -266,8 +266,10 @@ func (this *PharmacyController) WaitingDrug() {
266 266
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
267 267
 			return
268 268
 		}
269
+		baseList, _ := service.GetAllBaseDrugListTwo(orgid)
269 270
 		this.ServeSuccessJSON(map[string]interface{}{
270
-			"list": listt,
271
+			"list":     listt,
272
+			"baseList": baseList,
271 273
 		})
272 274
 		return
273 275
 	}
@@ -291,8 +293,10 @@ func (this *PharmacyController) WaitingDrug() {
291 293
 				flist = append(flist, patientlist)
292 294
 			}
293 295
 		}
296
+		baseList, _ := service.GetAllBaseDrugListTwo(orgid)
294 297
 		this.ServeSuccessJSON(map[string]interface{}{
295
-			"list": flist,
298
+			"list":     flist,
299
+			"baseList": baseList,
296 300
 		})
297 301
 		return
298 302
 	}
@@ -325,7 +329,7 @@ func (this *PharmacyController) GetPharmacyContent() {
325 329
 	}
326 330
 	var list []*models.PharmacyContent
327 331
 	list, err = service.GetPatientMedication(orgid, patient_id, stime, etime, is_medicine)
328
-
332
+	baseList, _ := service.GetAllBaseDrugListTwo(orgid)
329 333
 	if err != nil {
330 334
 		utils.ErrorLog(err.Error())
331 335
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -333,6 +337,7 @@ func (this *PharmacyController) GetPharmacyContent() {
333 337
 	}
334 338
 	return_value := make(map[string]interface{})
335 339
 	return_value["list"] = list
340
+	return_value["baseList"] = baseList
336 341
 	//if is_medicine == 1{发药时间先不展示
337 342
 	//	return_value["time"] = time
338 343
 	//}

+ 1 - 0
controllers/schedule_api_controller.go View File

@@ -3837,6 +3837,7 @@ func (this *ScheduleApiController) GetThreeWeekList() {
3837 3837
 	orgId := adminUserInfo.CurrentOrgId
3838 3838
 	partitions, _ := service.GetSchedulePartitionPanel(orgId)
3839 3839
 	list, err := service.GetThreeWeekList(theStartTIme, theEndtTIme, orgId, schedule_type, partition_id)
3840
+
3840 3841
 	if err != nil {
3841 3842
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
3842 3843
 		return

+ 11 - 0
models/drug.go View File

@@ -110,6 +110,17 @@ func (BaseDrugLibSeven) TableName() string {
110 110
 	return "xt_base_drug"
111 111
 }
112 112
 
113
+type BaseDrugLibEleven struct {
114
+	ID               int64  `gorm:"column:id" json:"id" form:"id"`
115
+	DrugName         string `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
116
+	Manufacturer     int64  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
117
+	ManufacturerName string `gorm:"column:manufacturer_name" json:"manufacturer_name"`
118
+}
119
+
120
+func (BaseDrugLibEleven) TableName() string {
121
+	return "xt_base_drug"
122
+}
123
+
113 124
 type BaseDrugLibTen struct {
114 125
 	ID                  int64 `gorm:"column:id" json:"id" form:"id"`
115 126
 	OrgId               int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`

+ 10 - 0
service/gobal_config_service.go View File

@@ -594,6 +594,16 @@ func GetAllBaseDrugList(orgid int64) (drug []*models.BaseDrugLib, err error) {
594 594
 	return drug, err
595 595
 }
596 596
 
597
+func GetAllBaseDrugListTwo(orgid int64) (drug []*models.BaseDrugLibEleven, err error) {
598
+
599
+	db := XTReadDB().Table("xt_base_drug as x").Where("x.status = 1")
600
+	if orgid > 0 {
601
+		db = db.Where("x.org_id =?", orgid)
602
+	}
603
+	err = db.Select("x.id,x.drug_name,p.manufacturer_name").Joins("left join xt_manufacturer as p on p.id =x.manufacturer").Scan(&drug).Error
604
+	return drug, err
605
+}
606
+
597 607
 func GetDrugWarehuseOrderInfo(orgid int64) (drug []*models.DrugWarehouseInfo, err error) {
598 608
 
599 609
 	err = XTReadDB().Where("org_id = ? and status = 1", orgid).Group("drug_id").Find(&drug).Error