소스 검색

11月9日库存管理

XMLWAN 2 년 전
부모
커밋
1cf61979da
3개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  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 파일 보기

560
 	err = readDb.Model(&models.HisPsn{}).Where("patient_id = ?", patient_id).Last(&psn).Error
560
 	err = readDb.Model(&models.HisPsn{}).Where("patient_id = ?", patient_id).Last(&psn).Error
561
 	return
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 파일 보기

80
 	offset := (page - 1) * limit
80
 	offset := (page - 1) * limit
81
 	likeKey := "%" + keyword + "%"
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
 	if good_type == 2 {
85
 	if good_type == 2 {
86
 		db = db.Where(" x.total_count<=x.stock_warn_count")
86
 		db = db.Where(" x.total_count<=x.stock_warn_count")

+ 3 - 3
service/self_drug_service.go 파일 보기

1819
 		db = db.Preload("DrugWarehouseInfo", "org_id = ? and status = 1 and is_check = 1", orgId)
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
 	if len(keyword) > 0 {
1826
 	if len(keyword) > 0 {
1827
 		db = db.Where("drug_name like ? or manufacturer in(?)", likeKey, ids)
1827
 		db = db.Where("drug_name like ? or manufacturer in(?)", likeKey, ids)