Bladeren bron

医保对接

csx 4 jaren geleden
bovenliggende
commit
52a4162248

+ 8 - 2
controllers/mobile_api_controllers/login_api_controller.go Bestand weergeven

@@ -150,9 +150,13 @@ func (this *LoginAPIController) LoginByPwd() {
150 150
 		this.Ctx.SetCookie("token_cookie", token, expiration, "/")
151 151
 
152 152
 		var configList interface{}
153
+		var dict_config_list interface{}
154
+
153 155
 		var FiledList []*models.FiledConfig
154 156
 
155 157
 		if org.Id > 0 {
158
+			dict_config_list, _ = service.GetDictConfigList(org.Id)
159
+
156 160
 			configList, _ = service.GetConfigList(org.Id)
157 161
 			FiledList, _ = service.FindFiledByOrgId(org.Id)
158 162
 		}
@@ -208,8 +212,10 @@ func (this *LoginAPIController) LoginByPwd() {
208 212
 				"org_id":      templateInfo.OrgId,
209 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 Bestand weergeven

@@ -160,10 +160,14 @@ func (this *ForgetPwdController) ModifyPassword() {
160 160
 			this.Ctx.SetCookie("token_cookie", token, expiration, "/")
161 161
 
162 162
 			var configList interface{}
163
+			var dict_configList interface{}
164
+
163 165
 			var FiledList []*models.FiledConfig
164 166
 
165 167
 			if org.Id > 0 {
166 168
 				configList, _ = service.GetConfigList(org.Id)
169
+				dict_configList, _ = service.GetDictConfigList(org.Id)
170
+
167 171
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
168 172
 			}
169 173
 			if len(FiledList) == 0 {
@@ -219,8 +223,10 @@ func (this *ForgetPwdController) ModifyPassword() {
219 223
 					"org_id":      templateInfo.OrgId,
220 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 Bestand weergeven

@@ -222,9 +222,11 @@ func (this *HomeController) ChangeOrg() {
222 222
 		this.Ctx.SetCookie("token_cookie", token, expiration, "/")
223 223
 
224 224
 		var configList interface{}
225
+		var dict_config_list interface{}
225 226
 		var FiledList []*models.FiledConfig
226 227
 
227 228
 		if org.Id > 0 {
229
+			dict_config_list, _ = service.GetDictConfigList(org.Id)
228 230
 			configList, _ = service.GetConfigList(org.Id)
229 231
 			FiledList, _ = service.FindFiledByOrgId(org.Id)
230 232
 		}
@@ -281,8 +283,9 @@ func (this *HomeController) ChangeOrg() {
281 283
 				"org_id":      templateInfo.OrgId,
282 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,9 +540,13 @@ func (this *HomeController) CreateOrg() {
537 540
 				this.Ctx.SetCookie("token_cookie", token, expiration, "/")
538 541
 
539 542
 				var configList interface{}
543
+				var dict_config_list interface{}
544
+
540 545
 				var FiledList []*models.FiledConfig
541 546
 
542 547
 				if org.Id > 0 {
548
+					dict_config_list, _ = service.GetDictConfigList(org.Id)
549
+
543 550
 					configList, _ = service.GetConfigList(org.Id)
544 551
 					FiledList, _ = service.FindFiledByOrgId(org.Id)
545 552
 				}
@@ -588,9 +595,11 @@ func (this *HomeController) CreateOrg() {
588 595
 						"org_id":      templateInfo.OrgId,
589 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 Bestand weergeven

@@ -277,7 +277,10 @@ func (c *MobileHisApiController) CreateHisPrescription() {
277 277
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
278 278
 					return
279 279
 				}
280
+				fmt.Println(preTime)
281
+				fmt.Println(theTime2)
280 282
 				pTime := theTime2.Unix()
283
+				fmt.Println(pTime)
281 284
 
282 285
 				ctime := time.Now().Unix()
283 286
 				prescription := &models.HisPrescription{
@@ -321,7 +324,7 @@ func (c *MobileHisApiController) CreateHisPrescription() {
321 324
 							s.Status = 1
322 325
 							s.UserOrgId = adminInfo.Org.Id
323 326
 							s.RecordDate = recordDateTime
324
-							s.StartTime = prescription.PreTime
327
+							s.StartTime = pTime
325 328
 							s.Groupno = groupNo
326 329
 							s.CreatedTime = ctime
327 330
 							s.UpdatedTime = mtime
@@ -458,7 +461,7 @@ func (c *MobileHisApiController) setAdviceWithJSON(advice *models.HisDoctorAdvic
458 461
 					advice.CheckTime = hisAdvice.CheckTime
459 462
 					advice.Checker = hisAdvice.Checker
460 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 Bestand weergeven

@@ -365,9 +365,12 @@ func (this *MobileRegistController) CreateOrg() {
365 365
 
366 366
 			var configList interface{}
367 367
 			var FiledList []*models.FiledConfig
368
+			var dict_configList interface{}
368 369
 
369 370
 			if org.Id > 0 {
370 371
 				configList, _ = service.GetConfigList(org.Id)
372
+				dict_configList, _ = service.GetDictConfigList(org.Id)
373
+
371 374
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
372 375
 			}
373 376
 			if len(FiledList) == 0 {
@@ -415,8 +418,10 @@ func (this *MobileRegistController) CreateOrg() {
415 418
 					"org_id":      templateInfo.OrgId,
416 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,8 +854,9 @@ func (this *MobileRegistController) Login() {
849 854
 				"org_id":      0,
850 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 861
 		this.ServeJSON()
856 862
 	}

+ 23 - 7
controllers/new_mobile_api_controllers/new_login_api_controller.go Bestand weergeven

@@ -52,6 +52,8 @@ func (this *NewLoginApiController) GetLogin() {
52 52
 			var app *models.OrgApp
53 53
 			var templateInfo models.GobalTemplate
54 54
 			var configList interface{}
55
+			var dict_configList interface{}
56
+
55 57
 			var FiledList []*models.FiledConfig
56 58
 
57 59
 			var getAppRoleErr error
@@ -86,6 +88,8 @@ func (this *NewLoginApiController) GetLogin() {
86 88
 				}
87 89
 				templateInfo, _ = service.GetOrgInfoTemplate(org.Id)
88 90
 				configList, _ = service.GetConfigList(org.Id)
91
+				dict_configList, _ = service.GetDictConfigList(org.Id)
92
+
89 93
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
90 94
 			}
91 95
 
@@ -113,9 +117,11 @@ func (this *NewLoginApiController) GetLogin() {
113 117
 					"org_id":      templateInfo.OrgId,
114 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 127
 			this.ServeJSON()
@@ -275,9 +281,13 @@ func (this *NewLoginApiController) LoginByCs() {
275 281
 			this.Ctx.SetCookie("token_cookie", token, expiration, "/")
276 282
 
277 283
 			var configList interface{}
284
+			var dict_configList interface{}
285
+
278 286
 			var FiledList []*models.FiledConfig
279 287
 
280 288
 			if org.Id > 0 {
289
+				dict_configList, _ = service.GetDictConfigList(org.Id)
290
+
281 291
 				configList, _ = service.GetConfigList(org.Id)
282 292
 				FiledList, _ = service.FindFiledByOrgId(org.Id)
283 293
 			}
@@ -358,8 +368,10 @@ func (this *NewLoginApiController) LoginByCs() {
358 368
 					"org_id":      templateInfo.OrgId,
359 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 377
 	} else {
@@ -482,6 +494,8 @@ func (this *NewLoginApiController) LoginByCs() {
482 494
 					this.Ctx.SetCookie("token_cookie", token, expiration, "/")
483 495
 
484 496
 					configList, _ := service.GetConfigList(org.Id)
497
+					dict_configList, _ := service.GetDictConfigList(org.Id)
498
+
485 499
 					var FiledList []*models.FiledConfig
486 500
 					FiledList, _ = service.FindFiledByOrgId(org.Id)
487 501
 					if len(FiledList) == 0 {
@@ -530,8 +544,10 @@ func (this *NewLoginApiController) LoginByCs() {
530 544
 							"org_id":      templateInfo.OrgId,
531 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 Bestand weergeven

@@ -23,6 +23,29 @@ func (Dataconfig) TableName() string {
23 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 49
 type DictionaryDataconfig struct {
27 50
 	ID             int64  `gorm:"column:id" json:"id" form:"id"`
28 51
 	ParentId       int64  `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
@@ -92,6 +115,29 @@ func (ConfigViewModel) TableName() string {
92 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 141
 type FiledConfig struct {
96 142
 	ID          int64  `gorm:"column:id" json:"id"`
97 143
 	OrgId       int64  `gorm:"column:org_id" json:"org_id"`

+ 106 - 0
service/data.go Bestand weergeven

@@ -115,6 +115,112 @@ func GetConfigList(orgID int64) (dataconfig interface{}, err error) {
115 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 224
 func FindConfigByFieldname(module string, field_name string, org_id int64) (dataconfig models.Dataconfig, err error) {
119 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 226
 	return

+ 5 - 0
service/doctor_advice_service.go Bestand weergeven

@@ -470,3 +470,8 @@ func GetDoctorAdviceByType(change_type int64, record_time int64, org_id int64, p
470 470
 	}
471 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 Bestand weergeven

@@ -948,6 +948,8 @@ type VMOtherHisPrescriptionInfo struct {
948 948
 	PatientId         int64                `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
949 949
 	Status            int64                `gorm:"column:status" json:"status" form:"status"`
950 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 953
 	VMHisPrescription []*VMHisPrescription `gorm:"ForeignKey:RecordDate,PatientId;AssociationForeignKey:RecordDate,PatientId" json:"prescriptions"`
952 954
 }
953 955
 
@@ -1088,20 +1090,20 @@ func GetHisPrescriptionByPatientID(patientID int64, orgID int64) (info models.Hi
1088 1090
 }
1089 1091
 
1090 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 1109
 func (VMHisProjectTeam) TableName() string {
@@ -1145,12 +1147,10 @@ func (VMHisPrescriptionTwo) TableName() string {
1145 1147
 func GetAllProjectTeamList(orgid int64) (project []*VMHisProjectTeam, err error) {
1146 1148
 	err = XTReadDB().Model(&VMHisProjectTeam{}).Where("user_org_id = ? and status = 1", orgid).Find(&project).Error
1147 1149
 	for _, item := range project {
1148
-		var project_item VMHisProject
1150
+		var project_item []*VMHisProject
1149 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 1155
 	return
1156 1156
 }