Kaynağa Gözat

医保对接

csx 4 yıl önce
ebeveyn
işleme
52a4162248

+ 8 - 2
controllers/mobile_api_controllers/login_api_controller.go Dosyayı Görüntüle

150
 		this.Ctx.SetCookie("token_cookie", token, expiration, "/")
150
 		this.Ctx.SetCookie("token_cookie", token, expiration, "/")
151
 
151
 
152
 		var configList interface{}
152
 		var configList interface{}
153
+		var dict_config_list interface{}
154
+
153
 		var FiledList []*models.FiledConfig
155
 		var FiledList []*models.FiledConfig
154
 
156
 
155
 		if org.Id > 0 {
157
 		if org.Id > 0 {
158
+			dict_config_list, _ = service.GetDictConfigList(org.Id)
159
+
156
 			configList, _ = service.GetConfigList(org.Id)
160
 			configList, _ = service.GetConfigList(org.Id)
157
 			FiledList, _ = service.FindFiledByOrgId(org.Id)
161
 			FiledList, _ = service.FindFiledByOrgId(org.Id)
158
 		}
162
 		}
208
 				"org_id":      templateInfo.OrgId,
212
 				"org_id":      templateInfo.OrgId,
209
 				"template_id": templateInfo.TemplateId,
213
 				"template_id": templateInfo.TemplateId,
210
 			},
214
 			},
211
-			"config_list": configList,
212
-			"filed_list":  FiledList,
215
+			"config_list":      configList,
216
+			"dict_config_list": dict_config_list,
217
+
218
+			"filed_list": FiledList,
213
 		})
219
 		})
214
 	}
220
 	}
215
 }
221
 }

+ 8 - 2
controllers/new_mobile_api_controllers/forget_password_controller.go Dosyayı Görüntüle

160
 			this.Ctx.SetCookie("token_cookie", token, expiration, "/")
160
 			this.Ctx.SetCookie("token_cookie", token, expiration, "/")
161
 
161
 
162
 			var configList interface{}
162
 			var configList interface{}
163
+			var dict_configList interface{}
164
+
163
 			var FiledList []*models.FiledConfig
165
 			var FiledList []*models.FiledConfig
164
 
166
 
165
 			if org.Id > 0 {
167
 			if org.Id > 0 {
166
 				configList, _ = service.GetConfigList(org.Id)
168
 				configList, _ = service.GetConfigList(org.Id)
169
+				dict_configList, _ = service.GetDictConfigList(org.Id)
170
+
167
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
171
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
168
 			}
172
 			}
169
 			if len(FiledList) == 0 {
173
 			if len(FiledList) == 0 {
219
 					"org_id":      templateInfo.OrgId,
223
 					"org_id":      templateInfo.OrgId,
220
 					"template_id": templateInfo.TemplateId,
224
 					"template_id": templateInfo.TemplateId,
221
 				},
225
 				},
222
-				"config_list": configList,
223
-				"filed_list":  FiledList,
226
+				"config_list":      configList,
227
+				"dict_config_list": dict_configList,
228
+
229
+				"filed_list": FiledList,
224
 			})
230
 			})
225
 		}
231
 		}
226
 
232
 

+ 14 - 5
controllers/new_mobile_api_controllers/home_api_controller.go Dosyayı Görüntüle

222
 		this.Ctx.SetCookie("token_cookie", token, expiration, "/")
222
 		this.Ctx.SetCookie("token_cookie", token, expiration, "/")
223
 
223
 
224
 		var configList interface{}
224
 		var configList interface{}
225
+		var dict_config_list interface{}
225
 		var FiledList []*models.FiledConfig
226
 		var FiledList []*models.FiledConfig
226
 
227
 
227
 		if org.Id > 0 {
228
 		if org.Id > 0 {
229
+			dict_config_list, _ = service.GetDictConfigList(org.Id)
228
 			configList, _ = service.GetConfigList(org.Id)
230
 			configList, _ = service.GetConfigList(org.Id)
229
 			FiledList, _ = service.FindFiledByOrgId(org.Id)
231
 			FiledList, _ = service.FindFiledByOrgId(org.Id)
230
 		}
232
 		}
281
 				"org_id":      templateInfo.OrgId,
283
 				"org_id":      templateInfo.OrgId,
282
 				"template_id": templateInfo.TemplateId,
284
 				"template_id": templateInfo.TemplateId,
283
 			},
285
 			},
284
-			"config_list": configList,
285
-			"filed_list":  FiledList,
286
+			"config_list":      configList,
287
+			"dict_config_list": dict_config_list,
288
+			"filed_list":       FiledList,
286
 		})
289
 		})
287
 	}
290
 	}
288
 
291
 
537
 				this.Ctx.SetCookie("token_cookie", token, expiration, "/")
540
 				this.Ctx.SetCookie("token_cookie", token, expiration, "/")
538
 
541
 
539
 				var configList interface{}
542
 				var configList interface{}
543
+				var dict_config_list interface{}
544
+
540
 				var FiledList []*models.FiledConfig
545
 				var FiledList []*models.FiledConfig
541
 
546
 
542
 				if org.Id > 0 {
547
 				if org.Id > 0 {
548
+					dict_config_list, _ = service.GetDictConfigList(org.Id)
549
+
543
 					configList, _ = service.GetConfigList(org.Id)
550
 					configList, _ = service.GetConfigList(org.Id)
544
 					FiledList, _ = service.FindFiledByOrgId(org.Id)
551
 					FiledList, _ = service.FindFiledByOrgId(org.Id)
545
 				}
552
 				}
588
 						"org_id":      templateInfo.OrgId,
595
 						"org_id":      templateInfo.OrgId,
589
 						"template_id": templateInfo.TemplateId,
596
 						"template_id": templateInfo.TemplateId,
590
 					},
597
 					},
591
-					"config_list": configList,
592
-					"filed_list":  FiledList,
593
-					"status":      1,
598
+					"config_list":      configList,
599
+					"dict_config_list": dict_config_list,
600
+
601
+					"filed_list": FiledList,
602
+					"status":     1,
594
 				})
603
 				})
595
 			}
604
 			}
596
 
605
 

+ 5 - 2
controllers/new_mobile_api_controllers/mobile_his_api_controller.go Dosyayı Görüntüle

277
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
277
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
278
 					return
278
 					return
279
 				}
279
 				}
280
+				fmt.Println(preTime)
281
+				fmt.Println(theTime2)
280
 				pTime := theTime2.Unix()
282
 				pTime := theTime2.Unix()
283
+				fmt.Println(pTime)
281
 
284
 
282
 				ctime := time.Now().Unix()
285
 				ctime := time.Now().Unix()
283
 				prescription := &models.HisPrescription{
286
 				prescription := &models.HisPrescription{
321
 							s.Status = 1
324
 							s.Status = 1
322
 							s.UserOrgId = adminInfo.Org.Id
325
 							s.UserOrgId = adminInfo.Org.Id
323
 							s.RecordDate = recordDateTime
326
 							s.RecordDate = recordDateTime
324
-							s.StartTime = prescription.PreTime
327
+							s.StartTime = pTime
325
 							s.Groupno = groupNo
328
 							s.Groupno = groupNo
326
 							s.CreatedTime = ctime
329
 							s.CreatedTime = ctime
327
 							s.UpdatedTime = mtime
330
 							s.UpdatedTime = mtime
458
 					advice.CheckTime = hisAdvice.CheckTime
461
 					advice.CheckTime = hisAdvice.CheckTime
459
 					advice.Checker = hisAdvice.Checker
462
 					advice.Checker = hisAdvice.Checker
460
 					advice.CheckState = hisAdvice.CheckState
463
 					advice.CheckState = hisAdvice.CheckState
461
-					advice.StartTime = hisAdvice.StartTime
464
+					//advice.StartTime = hisAdvice.StartTime
462
 
465
 
463
 				}
466
 				}
464
 			}
467
 			}

+ 10 - 4
controllers/new_mobile_api_controllers/mobile_regist_controller.go Dosyayı Görüntüle

365
 
365
 
366
 			var configList interface{}
366
 			var configList interface{}
367
 			var FiledList []*models.FiledConfig
367
 			var FiledList []*models.FiledConfig
368
+			var dict_configList interface{}
368
 
369
 
369
 			if org.Id > 0 {
370
 			if org.Id > 0 {
370
 				configList, _ = service.GetConfigList(org.Id)
371
 				configList, _ = service.GetConfigList(org.Id)
372
+				dict_configList, _ = service.GetDictConfigList(org.Id)
373
+
371
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
374
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
372
 			}
375
 			}
373
 			if len(FiledList) == 0 {
376
 			if len(FiledList) == 0 {
415
 					"org_id":      templateInfo.OrgId,
418
 					"org_id":      templateInfo.OrgId,
416
 					"template_id": templateInfo.TemplateId,
419
 					"template_id": templateInfo.TemplateId,
417
 				},
420
 				},
418
-				"config_list": configList,
419
-				"filed_list":  FiledList,
421
+				"config_list":      configList,
422
+				"dict_config_list": dict_configList,
423
+
424
+				"filed_list": FiledList,
420
 			})
425
 			})
421
 		}
426
 		}
422
 
427
 
849
 				"org_id":      0,
854
 				"org_id":      0,
850
 				"template_id": 0,
855
 				"template_id": 0,
851
 			},
856
 			},
852
-			"config_list": nil,
853
-			"filed_list":  nil,
857
+			"config_list":      nil,
858
+			"dict_config_list": nil,
859
+			"filed_list":       nil,
854
 		})
860
 		})
855
 		this.ServeJSON()
861
 		this.ServeJSON()
856
 	}
862
 	}

+ 23 - 7
controllers/new_mobile_api_controllers/new_login_api_controller.go Dosyayı Görüntüle

52
 			var app *models.OrgApp
52
 			var app *models.OrgApp
53
 			var templateInfo models.GobalTemplate
53
 			var templateInfo models.GobalTemplate
54
 			var configList interface{}
54
 			var configList interface{}
55
+			var dict_configList interface{}
56
+
55
 			var FiledList []*models.FiledConfig
57
 			var FiledList []*models.FiledConfig
56
 
58
 
57
 			var getAppRoleErr error
59
 			var getAppRoleErr error
86
 				}
88
 				}
87
 				templateInfo, _ = service.GetOrgInfoTemplate(org.Id)
89
 				templateInfo, _ = service.GetOrgInfoTemplate(org.Id)
88
 				configList, _ = service.GetConfigList(org.Id)
90
 				configList, _ = service.GetConfigList(org.Id)
91
+				dict_configList, _ = service.GetDictConfigList(org.Id)
92
+
89
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
93
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
90
 			}
94
 			}
91
 
95
 
113
 					"org_id":      templateInfo.OrgId,
117
 					"org_id":      templateInfo.OrgId,
114
 					"template_id": templateInfo.TemplateId,
118
 					"template_id": templateInfo.TemplateId,
115
 				},
119
 				},
116
-				"config_list": configList,
117
-				"filed_list":  FiledList,
118
-				"isLogin":     true,
120
+				"config_list":      configList,
121
+				"dict_config_list": dict_configList,
122
+
123
+				"filed_list": FiledList,
124
+				"isLogin":    true,
119
 			})
125
 			})
120
 
126
 
121
 			this.ServeJSON()
127
 			this.ServeJSON()
275
 			this.Ctx.SetCookie("token_cookie", token, expiration, "/")
281
 			this.Ctx.SetCookie("token_cookie", token, expiration, "/")
276
 
282
 
277
 			var configList interface{}
283
 			var configList interface{}
284
+			var dict_configList interface{}
285
+
278
 			var FiledList []*models.FiledConfig
286
 			var FiledList []*models.FiledConfig
279
 
287
 
280
 			if org.Id > 0 {
288
 			if org.Id > 0 {
289
+				dict_configList, _ = service.GetDictConfigList(org.Id)
290
+
281
 				configList, _ = service.GetConfigList(org.Id)
291
 				configList, _ = service.GetConfigList(org.Id)
282
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
292
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
283
 			}
293
 			}
358
 					"org_id":      templateInfo.OrgId,
368
 					"org_id":      templateInfo.OrgId,
359
 					"template_id": templateInfo.TemplateId,
369
 					"template_id": templateInfo.TemplateId,
360
 				},
370
 				},
361
-				"config_list": configList,
362
-				"filed_list":  FiledList,
371
+				"config_list":      configList,
372
+				"dict_config_list": dict_configList,
373
+
374
+				"filed_list": FiledList,
363
 			})
375
 			})
364
 		}
376
 		}
365
 	} else {
377
 	} else {
482
 					this.Ctx.SetCookie("token_cookie", token, expiration, "/")
494
 					this.Ctx.SetCookie("token_cookie", token, expiration, "/")
483
 
495
 
484
 					configList, _ := service.GetConfigList(org.Id)
496
 					configList, _ := service.GetConfigList(org.Id)
497
+					dict_configList, _ := service.GetDictConfigList(org.Id)
498
+
485
 					var FiledList []*models.FiledConfig
499
 					var FiledList []*models.FiledConfig
486
 					FiledList, _ = service.FindFiledByOrgId(org.Id)
500
 					FiledList, _ = service.FindFiledByOrgId(org.Id)
487
 					if len(FiledList) == 0 {
501
 					if len(FiledList) == 0 {
530
 							"org_id":      templateInfo.OrgId,
544
 							"org_id":      templateInfo.OrgId,
531
 							"template_id": templateInfo.TemplateId,
545
 							"template_id": templateInfo.TemplateId,
532
 						},
546
 						},
533
-						"config_list": configList,
534
-						"filed_list":  FiledList,
547
+						"config_list":      configList,
548
+						"dict_config_list": dict_configList,
549
+
550
+						"filed_list": FiledList,
535
 					})
551
 					})
536
 				}
552
 				}
537
 
553
 

+ 46 - 0
models/data_models.go Dosyayı Görüntüle

23
 	return "xt_data_config"
23
 	return "xt_data_config"
24
 }
24
 }
25
 
25
 
26
+type DictDataconfig struct {
27
+	ID             int64  `gorm:"column:id" json:"id" form:"id"`
28
+	ParentId       int64  `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
29
+	Module         string `gorm:"column:module" json:"module" form:"module"`
30
+	OrgId          int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
31
+	Name           string `gorm:"column:name" json:"name" form:"name"`
32
+	FieldName      string `gorm:"column:field_name" json:"field_name" form:"field_name"`
33
+	Value          int    `gorm:"column:value" json:"value" form:"value"`
34
+	CreatedTime    string `gorm:"column:create_time" json:"create_time" form:"create_time"`
35
+	UpdatedTime    string `gorm:"column:update_time" json:"update_time" form:"update_time"`
36
+	CreateUserId   int64  `gorm:"column:create_user_id" json:"create_user_id" form:"create_user_id"`
37
+	Status         int64  `gorm:"column:status" json:"status" form:"status"`
38
+	Remark         string `gorm:"column:remark" json:"remark" form:"remark"`
39
+	DeleteIdSystem int64  `gorm:"column:delete_id_system" json:"delete_id_system" form:"delete_id_system"`
40
+	Title          string `gorm:"column:title" json:"title" form:"title"`
41
+	Content        string `gorm:"column:content" json:"content" form:"content"`
42
+	Order          int64  `gorm:"column:orders" json:"orders" form:"orders"`
43
+}
44
+
45
+func (DictDataconfig) TableName() string {
46
+	return "xt_drug_data_config"
47
+}
48
+
26
 type DictionaryDataconfig struct {
49
 type DictionaryDataconfig struct {
27
 	ID             int64  `gorm:"column:id" json:"id" form:"id"`
50
 	ID             int64  `gorm:"column:id" json:"id" form:"id"`
28
 	ParentId       int64  `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
51
 	ParentId       int64  `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
92
 	return "xt_data_config"
115
 	return "xt_data_config"
93
 }
116
 }
94
 
117
 
118
+type DictConfigViewModel struct {
119
+	ID           int64             `gorm:"column:id" json:"id" form:"id"`
120
+	ParentId     int64             `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
121
+	Module       string            `gorm:"column:module" json:"module" form:"module"`
122
+	OrgId        int64             `gorm:"column:org_id" json:"org_id" form:"org_id"`
123
+	Name         string            `gorm:"column:name" json:"name" form:"name"`
124
+	FieldName    string            `gorm:"column:field_name" json:"field_name" form:"field_name"`
125
+	Value        int               `gorm:"column:value" json:"value" form:"value"`
126
+	CreatedTime  string            `gorm:"column:create_time" json:"create_time" form:"create_time"`
127
+	UpdatedTime  string            `gorm:"column:update_time" json:"update_time" form:"update_time"`
128
+	CreateUserId int64             `gorm:"column:create_user_id" json:"create_user_id" form:"create_user_id"`
129
+	Status       int64             `gorm:"column:status" json:"status" form:"status"`
130
+	Remark       string            `gorm:"column:remark" json:"remark" form:"remark"`
131
+	Title        string            `gorm:"column:title" json:"title" form:"title"`
132
+	Content      string            `gorm:"column:content" json:"content" form:"content"`
133
+	Order        int64             `gorm:"column:orders" json:"orders" form:"orders"`
134
+	Childs       []*DictDataconfig `json:"childs" `
135
+}
136
+
137
+func (DictConfigViewModel) TableName() string {
138
+	return "xt_drug_data_config"
139
+}
140
+
95
 type FiledConfig struct {
141
 type FiledConfig struct {
96
 	ID          int64  `gorm:"column:id" json:"id"`
142
 	ID          int64  `gorm:"column:id" json:"id"`
97
 	OrgId       int64  `gorm:"column:org_id" json:"org_id"`
143
 	OrgId       int64  `gorm:"column:org_id" json:"org_id"`

+ 106 - 0
service/data.go Dosyayı Görüntüle

115
 	return resultConfig, err
115
 	return resultConfig, err
116
 }
116
 }
117
 
117
 
118
+func GetDictConfigList(orgID int64) (dataconfig interface{}, err error) {
119
+	var configList []*models.DictionaryDataconfig
120
+
121
+	err = readDb.Model(&models.DictionaryDataconfig{}).Where("(org_id in (0,?) and status = 1) or (status = 0 and delete_id_system > 0 and org_id = ?)", orgID, orgID).Order("orders asc, id asc").Find(&configList).Error
122
+	if err != nil {
123
+		return nil, err
124
+	}
125
+
126
+	// configResult := make([]*ConfigViewModel,0)
127
+	childConfig := make(map[int64][]*models.DictionaryDataconfig)
128
+	resultConfig := make(map[string][]*models.DictionaryConfigViewModel)
129
+	deleteSystemChilds := make([]*models.DictionaryDataconfig, 0)
130
+	editSystemChilds := make([]*models.DictionaryDataconfig, 0)
131
+	for _, config := range configList {
132
+		if config.Status == 1 && config.DeleteIdSystem > 0 {
133
+			editSystemChilds = append(editSystemChilds, config)
134
+		}
135
+
136
+		if config.Status == 0 && config.DeleteIdSystem > 0 {
137
+			deleteSystemChilds = append(deleteSystemChilds, config)
138
+		}
139
+	}
140
+	continueFlag := false
141
+	for _, config := range configList {
142
+		continueFlag = false
143
+		if config.ParentId == 0 {
144
+			newConfig := &models.DictionaryConfigViewModel{
145
+				ID:           config.ID,
146
+				ParentId:     config.ParentId,
147
+				Module:       config.Module,
148
+				OrgId:        config.OrgId,
149
+				Name:         config.Name,
150
+				FieldName:    config.FieldName,
151
+				Value:        config.Value,
152
+				CreateUserId: config.CreateUserId,
153
+				Status:       config.Status,
154
+				Remark:       config.Remark,
155
+				Title:        config.Title,
156
+				Content:      config.Content,
157
+			}
158
+			// configResult = append(configResult,newConfig)
159
+			result := resultConfig[config.Module]
160
+			if result == nil {
161
+				result = make([]*models.DictionaryConfigViewModel, 0)
162
+			}
163
+			for _, vm := range editSystemChilds {
164
+				if vm.DeleteIdSystem == config.ID {
165
+					continueFlag = true
166
+					break
167
+				}
168
+			}
169
+
170
+			for _, _vm := range deleteSystemChilds {
171
+				if _vm.DeleteIdSystem == config.ID {
172
+					continueFlag = true
173
+					break
174
+				}
175
+			}
176
+			if config.OrgId != 0 && config.Status == 0 && config.DeleteIdSystem > 0 {
177
+				continue
178
+			}
179
+			if continueFlag {
180
+				continue
181
+			}
182
+			result = append(result, newConfig)
183
+			resultConfig[config.Module] = result
184
+		} else {
185
+			childs := childConfig[config.ParentId]
186
+			if childs == nil {
187
+				childs = make([]*models.DictionaryDataconfig, 0)
188
+			}
189
+			continueFlag := false
190
+			for _, vm := range editSystemChilds {
191
+				if vm.DeleteIdSystem == config.ID {
192
+					continueFlag = true
193
+					break
194
+				}
195
+			}
196
+
197
+			for _, _vm := range deleteSystemChilds {
198
+				if _vm.DeleteIdSystem == config.ID {
199
+					continueFlag = true
200
+					break
201
+				}
202
+			}
203
+			if config.OrgId != 0 && config.Status == 0 && config.DeleteIdSystem > 0 {
204
+				continue
205
+			}
206
+			if continueFlag {
207
+				continue
208
+			}
209
+
210
+			childs = append(childs, config)
211
+			childConfig[config.ParentId] = childs
212
+		}
213
+	}
214
+
215
+	for _, vm := range resultConfig {
216
+		for _, _vm := range vm {
217
+			_vm.Childs = childConfig[_vm.ID]
218
+		}
219
+		// vm.Childs = childConfig[vm.ID]
220
+	}
221
+	return resultConfig, err
222
+}
223
+
118
 func FindConfigByFieldname(module string, field_name string, org_id int64) (dataconfig models.Dataconfig, err error) {
224
 func FindConfigByFieldname(module string, field_name string, org_id int64) (dataconfig models.Dataconfig, err error) {
119
 	err = readDb.Model(&models.Dataconfig{}).Where("module=? and field_name=? and org_id in (0,?) and status = 1", module, field_name, org_id).First(&dataconfig).Error
225
 	err = readDb.Model(&models.Dataconfig{}).Where("module=? and field_name=? and org_id in (0,?) and status = 1", module, field_name, org_id).First(&dataconfig).Error
120
 	return
226
 	return

+ 5 - 0
service/doctor_advice_service.go Dosyayı Görüntüle

470
 	}
470
 	}
471
 	return
471
 	return
472
 }
472
 }
473
+
474
+func GetDict(orgid int64) (drugways []*models.DrugwayDic, total int64, err error) {
475
+	err = readDb.Model(&models.DrugwayDic{}).Where("(org_id =? or org_id = 0) and status=1", orgid).Count(&total).Order("id desc").Find(&drugways).Error
476
+	return
477
+}

+ 19 - 19
service/his_service.go Dosyayı Görüntüle

948
 	PatientId         int64                `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
948
 	PatientId         int64                `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
949
 	Status            int64                `gorm:"column:status" json:"status" form:"status"`
949
 	Status            int64                `gorm:"column:status" json:"status" form:"status"`
950
 	CheckGroup        []int64              `gorm:"-" json:"check_group" form:"check_group"`
950
 	CheckGroup        []int64              `gorm:"-" json:"check_group" form:"check_group"`
951
+	DoctorId          int64                `gorm:"column:doctor_id" json:"doctor_id" form:"doctor_id"`
952
+	Departments       int64                `gorm:"column:departments" json:"departments" form:"departments"`
951
 	VMHisPrescription []*VMHisPrescription `gorm:"ForeignKey:RecordDate,PatientId;AssociationForeignKey:RecordDate,PatientId" json:"prescriptions"`
953
 	VMHisPrescription []*VMHisPrescription `gorm:"ForeignKey:RecordDate,PatientId;AssociationForeignKey:RecordDate,PatientId" json:"prescriptions"`
952
 }
954
 }
953
 
955
 
1088
 }
1090
 }
1089
 
1091
 
1090
 type VMHisProjectTeam struct {
1092
 type VMHisProjectTeam struct {
1091
-	ID           int64   `gorm:"column:id" json:"id" form:"id"`
1092
-	ProjectTeam  string  `gorm:"column:project_team" json:"project_team" form:"project_team"`
1093
-	Price        float64 `gorm:"column:price" json:"price" form:"price"`
1094
-	Pinyin       string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
1095
-	Wubi         string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
1096
-	TubeColor    int64   `gorm:"column:tube_color" json:"tube_color" form:"tube_color"`
1097
-	TeamType     int64   `gorm:"column:team_type" json:"team_type" form:"team_type"`
1098
-	Remark       string  `gorm:"column:remark" json:"remark" form:"remark"`
1099
-	UserOrgId    int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1100
-	Status       int64   `gorm:"column:status" json:"status" form:"status"`
1101
-	CreatedTime  int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
1102
-	UpdatedTime  int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
1103
-	ProjectId    string  `gorm:"column:project_id" json:"project_id" form:"project_id"`
1104
-	VMHisProject []*VMHisProject
1093
+	ID           int64           `gorm:"column:id" json:"id" form:"id"`
1094
+	ProjectTeam  string          `gorm:"column:project_team" json:"project_team" form:"project_team"`
1095
+	Price        float64         `gorm:"column:price" json:"price" form:"price"`
1096
+	Pinyin       string          `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
1097
+	Wubi         string          `gorm:"column:wubi" json:"wubi" form:"wubi"`
1098
+	TubeColor    int64           `gorm:"column:tube_color" json:"tube_color" form:"tube_color"`
1099
+	TeamType     int64           `gorm:"column:team_type" json:"team_type" form:"team_type"`
1100
+	Remark       string          `gorm:"column:remark" json:"remark" form:"remark"`
1101
+	UserOrgId    int64           `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1102
+	Status       int64           `gorm:"column:status" json:"status" form:"status"`
1103
+	CreatedTime  int64           `gorm:"column:created_time" json:"created_time" form:"created_time"`
1104
+	UpdatedTime  int64           `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
1105
+	ProjectId    string          `gorm:"column:project_id" json:"project_id" form:"project_id"`
1106
+	VMHisProject []*VMHisProject `gorm:"-" json:"project" form:"project"`
1105
 }
1107
 }
1106
 
1108
 
1107
 func (VMHisProjectTeam) TableName() string {
1109
 func (VMHisProjectTeam) TableName() string {
1145
 func GetAllProjectTeamList(orgid int64) (project []*VMHisProjectTeam, err error) {
1147
 func GetAllProjectTeamList(orgid int64) (project []*VMHisProjectTeam, err error) {
1146
 	err = XTReadDB().Model(&VMHisProjectTeam{}).Where("user_org_id = ? and status = 1", orgid).Find(&project).Error
1148
 	err = XTReadDB().Model(&VMHisProjectTeam{}).Where("user_org_id = ? and status = 1", orgid).Find(&project).Error
1147
 	for _, item := range project {
1149
 	for _, item := range project {
1148
-		var project_item VMHisProject
1150
+		var project_item []*VMHisProject
1149
 		ids := strings.Split(item.ProjectId, ",")
1151
 		ids := strings.Split(item.ProjectId, ",")
1150
-		for _, id := range ids {
1151
-			XTReadDB().Model(&VMSchedule{}).Where("user_org_id = ? and status = 1 AND id = ?", orgid, id).First(&project_item)
1152
-			item.VMHisProject = append(item.VMHisProject, &project_item)
1153
-		}
1152
+		XTReadDB().Model(&VMHisProject{}).Where("status = 1 AND id IN (?)", ids).Find(&project_item)
1153
+		item.VMHisProject = append(item.VMHisProject, project_item...)
1154
 	}
1154
 	}
1155
 	return
1155
 	return
1156
 }
1156
 }