XMLWAN пре 3 година
родитељ
комит
697fa48a2d

Разлика између датотеке није приказан због своје велике величине
+ 975 - 396
controllers/stock_in_api_controller.go


+ 1 - 0
service/auto_create_week_schedules_service.go Прегледај датотеку

@@ -150,6 +150,7 @@ func _refreshWeekSchedulesWithTemplateItems(tx *gorm.DB, orgID int64, week time.
150 150
 
151 151
 		valueStrs := make([]string, 0, len(templateItems))
152 152
 		values := make([]interface{}, 0, len(templateItems)*11)
153
+
153 154
 		for _, item := range templateItems {
154 155
 			deviceNumber := deviceNumberMap[item.DeviceNumberID]
155 156
 			if deviceNumber == nil {

+ 2 - 1
service/patient_service.go Прегледај датотеку

@@ -2581,7 +2581,8 @@ func GetAllPrescriptionByListOne(orgID int64, scheduleDate int64) (prescriptions
2581 2581
 
2582 2582
 	redis := RedisClient()
2583 2583
 	defer redis.Close()
2584
-	key := strconv.FormatInt(orgID, 10) + ":" + ":prescriptions_list_all"
2584
+	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(scheduleDate, 10) + ":prescriptions_list_all"
2585
+
2585 2586
 	prescriptions_list_all, _ := redis.Get(key).Result()
2586 2587
 
2587 2588
 	if len(prescriptions_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis

+ 2 - 2
service/stock_service.go Прегледај датотеку

@@ -3004,10 +3004,10 @@ func IsExistDrugByName(drugname string, drugdesc string, orgid int64) (*models.B
3004 3004
 	return &drug, nil
3005 3005
 }
3006 3006
 
3007
-func IsExistDrugByNameOne(drugname string, dosage float64, maxunit string, unival int64, minunit string, packtunit string, orgid int64) (*models.BaseDrugLib, error) {
3007
+func IsExistDrugByNameOne(drugname string, dosage float64, doseunit string, minnumber int64, minunit string, packtunit string, orgid int64) (*models.BaseDrugLib, error) {
3008 3008
 	var drug models.BaseDrugLib
3009 3009
 	var err error
3010
-	err = XTReadDB().Model(&drug).Where("drug_name = ? and dosage = ?  and max_unit = ? and unval = ? and min_unit=? and packing_unit = ? and status =1 and org_id = ?", drugname, dosage, maxunit, unival, minunit, packtunit, orgid).Find(&drug).Error
3010
+	err = XTReadDB().Model(&drug).Where("drug_name = ? and dose = ? and dose_unit = ?   and min_number = ? and min_unit=? and max_unit = ? and status =1 and org_id = ?", drugname, dosage, doseunit, minnumber, minunit, packtunit, orgid).Find(&drug).Error
3011 3011
 	if err == gorm.ErrRecordNotFound {
3012 3012
 		return nil, err
3013 3013
 	}