Browse Source

修改redis清除数据时间

csx 4 years ago
parent
commit
db105087ca

+ 1 - 1
controllers/drug_stock_api_contorller.go View File

@@ -1868,7 +1868,7 @@ func (c *StockDrugApiController) GetDrugQueryInfo() {
1868 1868
 	keyword := c.GetString("keyword")
1869 1869
 
1870 1870
 	adminUserInfo := c.GetAdminUserInfo()
1871
-	list, total, err := service.FindAllStockInfo(adminUserInfo.CurrentOrgId, page, limit, keyword)
1871
+	list, total, err := service.FindAllDrugStockInfo(adminUserInfo.CurrentOrgId, page, limit, keyword)
1872 1872
 	if err == nil {
1873 1873
 		c.ServeSuccessJSON(map[string]interface{}{
1874 1874
 			"list":  list,

+ 10 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -2612,6 +2612,16 @@ func (c *DialysisAPIController) CreateRemindDoctorAdvice() {
2612 2612
 			advice.WeekDay = week_day
2613 2613
 		}
2614 2614
 
2615
+		if adviceNameM["way"] != nil || reflect.TypeOf(adviceNameM["way"]).String() == "float64" {
2616
+			way := int64(adviceNameM["way"].(float64))
2617
+			advice.Way = way
2618
+		}
2619
+
2620
+		if adviceNameM["drug_id"] != nil || reflect.TypeOf(adviceNameM["drug_id"]).String() == "float64" {
2621
+			drug_id := int64(adviceNameM["drug_id"].(float64))
2622
+			advice.DrugId = drug_id
2623
+		}
2624
+
2615 2625
 		if adviceNameM["template_id"] != nil && reflect.TypeOf(adviceNameM["template_id"]).String() == "string" {
2616 2626
 			template_id, _ := adviceNameM["template_id"].(string)
2617 2627
 			advice.TemplateId = template_id

+ 8 - 8
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -2335,13 +2335,13 @@ func adviceFormData(advice *models.DoctorAdvice, data []byte, action string) (co
2335 2335
 		advice.AdviceDesc = adviceDsc
2336 2336
 	}
2337 2337
 
2338
-	if dataBody["src_type"] == nil {
2338
+	if dataBody["way"] == nil {
2339 2339
 		advice.Way = 0
2340 2340
 
2341 2341
 	} else {
2342
-		if dataBody["src_type"] != nil || reflect.TypeOf(dataBody["src_type"]).String() == "float64" {
2343
-			src_type := int64(dataBody["src_type"].(float64))
2344
-			advice.Way = src_type
2342
+		if dataBody["way"] != nil || reflect.TypeOf(dataBody["way"]).String() == "float64" {
2343
+			way := int64(dataBody["way"].(float64))
2344
+			advice.Way = way
2345 2345
 		}
2346 2346
 
2347 2347
 	}
@@ -3060,13 +3060,13 @@ func (c *PatientApiController) setAdviceWithJSON(advice *models.GroupAdvice, jso
3060 3060
 	//	src_type, _ := strconv.ParseInt(json["src_type"].(string),10)
3061 3061
 	//	advice.Way = src_type
3062 3062
 	//}
3063
-	if json["src_type"] == nil {
3063
+	if json["way"] == nil {
3064 3064
 		advice.Way = 0
3065 3065
 
3066 3066
 	} else {
3067
-		if json["src_type"] != nil || reflect.TypeOf(json["src_type"]).String() == "float64" {
3068
-			src_type := int64(json["src_type"].(float64))
3069
-			advice.Way = src_type
3067
+		if json["way"] != nil || reflect.TypeOf(json["way"]).String() == "float64" {
3068
+			way := int64(json["way"].(float64))
3069
+			advice.Way = way
3070 3070
 		}
3071 3071
 
3072 3072
 	}

+ 2 - 0
models/doctor_advice_models.go View File

@@ -73,6 +73,8 @@ type DoctorAdviceTemplate struct {
73 73
 	WeekDays                string                  `gorm:"column:week_days" json:"week_days"`
74 74
 	FrequencyType           int64                   `gorm:"column:frequency_type" json:"frequency_type"`
75 75
 	SubDoctorAdviceTemplate []*DoctorAdviceTemplate `gorm:"ForeignKey:ParentId;AssociationForeignKey:ID" json:"child"`
76
+	Way                     int64                   `gorm:"column:way" json:"way"`
77
+	DrugId                  int64                   `gorm:"column:drug_id" json:"drug_id"`
76 78
 }
77 79
 
78 80
 func (DoctorAdviceTemplate) TableName() string {

+ 1 - 1
service/doctor_advice_service.go View File

@@ -202,7 +202,7 @@ func FindDoctorAdviceTemplateById(id int64, org_id int64) (temps models.DoctorAd
202 202
 
203 203
 func FindAllAdviceTemplate(org_id int64, advice_type int64) (temps []*models.DoctorAdviceParentTemplate, err error) {
204 204
 	err = readDb.Model(&models.DoctorAdviceParentTemplate{}).Preload("DoctorAdviceTemplate", func(db *gorm.DB) *gorm.DB {
205
-		return db.Select("id,advice_name,advice_desc,single_dose,single_dose_unit,prescribing_number,prescribing_number_unit,delivery_way,execution_frequency,status,created_time,updated_time,parent_id,template_id,drug_spec,drug_spec_unit,advice_type,day_count,week_days,frequency_type, IF(parent_id>0, parent_id, id) as advice_order").Where("status = 1").Order("advice_order desc, id")
205
+		return db.Select("id,advice_name,advice_desc,single_dose,single_dose_unit,prescribing_number,prescribing_number_unit,delivery_way,execution_frequency,status,created_time,updated_time,parent_id,template_id,drug_spec,drug_spec_unit,advice_type,day_count,week_days,frequency_type,way,drug_id, IF(parent_id>0, parent_id, id) as advice_order").Where("status = 1").Order("advice_order desc, id")
206 206
 	}).Where("org_id = ? AND status=1 AND advice_type = ?", org_id, advice_type).Find(&temps).Error
207 207
 	return
208 208
 }