Browse Source

11月9日库存管理

XMLWAN 2 years ago
parent
commit
1cf61979da
3 changed files with 9 additions and 4 deletions
  1. 5 0
      service/his_hospital_service.go
  2. 1 1
      service/new_stock_service.go
  3. 3 3
      service/self_drug_service.go

+ 5 - 0
service/his_hospital_service.go View File

@@ -560,3 +560,8 @@ func GetPsnByPatientId(patient_id int64) (psn models.HisPsn, err error) {
560 560
 	err = readDb.Model(&models.HisPsn{}).Where("patient_id = ?", patient_id).Last(&psn).Error
561 561
 	return
562 562
 }
563
+
564
+func GetHisPrescriptionProjectByIDTwo(id int64) (projects models.HisPrescriptionProject, err error) {
565
+	err = readDb.Model(&models.HisPrescriptionProject{}).Preload("HisProject", "status = 1").Preload("GoodInfo", "status = 1").Where("id = ? AND status = 1", id).First(&projects).Error
566
+	return
567
+}

+ 1 - 1
service/new_stock_service.go View File

@@ -80,7 +80,7 @@ func GetGoodStockList(orgId int64, storehouse_id int64, good_type int64, keyword
80 80
 	offset := (page - 1) * limit
81 81
 	likeKey := "%" + keyword + "%"
82 82
 
83
-	db := XTReadDB().Table("xt_good_information as x").Where("x.status = 1 and x.total_count > 0 and x.org_id =?", orgId)
83
+	db := XTReadDB().Table("xt_good_information as x").Where("x.status = 1  and x.org_id =?", orgId)
84 84
 
85 85
 	if good_type == 2 {
86 86
 		db = db.Where(" x.total_count<=x.stock_warn_count")

+ 3 - 3
service/self_drug_service.go View File

@@ -1819,9 +1819,9 @@ func GetDrugStockCountList(orgId int64, storehouse_id int64, good_type int64, ke
1819 1819
 		db = db.Preload("DrugWarehouseInfo", "org_id = ? and status = 1 and is_check = 1", orgId)
1820 1820
 	}
1821 1821
 
1822
-	if len(goodIds) > 0 {
1823
-		db = db.Where("id in(?)", goodIds)
1824
-	}
1822
+	//if len(goodIds) > 0 {
1823
+	//	db = db.Where("id in(?)", goodIds)
1824
+	//}
1825 1825
 
1826 1826
 	if len(keyword) > 0 {
1827 1827
 		db = db.Where("drug_name like ? or manufacturer in(?)", likeKey, ids)