Selaa lähdekoodia

Merge branch '20200710_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20200710_xt_api_new_branch

XMLWAN 4 vuotta sitten
vanhempi
commit
10e40ece7c

+ 85 - 80
controllers/patient_api_controller.go Näytä tiedosto

@@ -252,29 +252,29 @@ func (c *PatientApiController) CreatePatient() {
252 252
 	//获取老表的最后一条数据
253 253
 	patients, err := service.GetLastPatientData(adminUserInfo.CurrentOrgId)
254 254
 	patientsNew := models.XtPatientsNew{
255
-		UserOrgId:                    adminUserInfo.CurrentOrgId,
256
-		UserId:                       0,
257
-		Avatar:                       patients.Avatar,
258
-		PatientType:                  patients.PatientType,
259
-		DialysisNo:                   patients.DialysisNo,
260
-		AdmissionNumber:              patients.AdmissionNumber,
261
-		Source:                       patients.Source,
262
-		Lapseto:                      patients.Lapseto,
263
-		PartitionId:                  patients.PartitionId,
264
-		BedId:                        patients.BedId,
265
-		Name:                         patients.Name,
266
-		Alias:                        patients.Alias,
267
-		Gender:                       patients.Gender,
268
-		MaritalStatus:                patients.MaritalStatus,
269
-		IdCardNo:                     patients.IdCardNo,
270
-		Birthday:                     patients.Birthday,
271
-		ReimbursementWayId:           patients.ReimbursementWayId,
272
-		HealthCareType:               patients.HealthCareType,
273
-		HealthCareNo:                 patients.HealthCareNo,
274
-		HealthCareDueDate:            patients.HealthCareDueDate,
275
-		Height:                       patients.Height,
276
-		BloodType:                    patients.BloodType,
277
-		Rh:                           patients.Rh,
255
+		UserOrgId:          adminUserInfo.CurrentOrgId,
256
+		UserId:             0,
257
+		Avatar:             patients.Avatar,
258
+		PatientType:        patients.PatientType,
259
+		DialysisNo:         patients.DialysisNo,
260
+		AdmissionNumber:    patients.AdmissionNumber,
261
+		Source:             patients.Source,
262
+		Lapseto:            patients.Lapseto,
263
+		PartitionId:        patients.PartitionId,
264
+		BedId:              patients.BedId,
265
+		Name:               patients.Name,
266
+		Alias:              patients.Alias,
267
+		Gender:             patients.Gender,
268
+		MaritalStatus:      patients.MaritalStatus,
269
+		IdCardNo:           patients.IdCardNo,
270
+		Birthday:           patients.Birthday,
271
+		ReimbursementWayId: patients.ReimbursementWayId,
272
+		HealthCareType:     patients.HealthCareType,
273
+		HealthCareNo:       patients.HealthCareNo,
274
+		HealthCareDueDate:  patients.HealthCareDueDate,
275
+		Height:             patients.Height,
276
+		BloodType:          patients.BloodType,
277
+		Rh:                 patients.Rh,
278 278
 		HealthCareDueAlertDate:       patients.HealthCareDueAlertDate,
279 279
 		EducationLevel:               patients.EducationLevel,
280 280
 		Profession:                   patients.Profession,
@@ -320,28 +320,28 @@ func (c *PatientApiController) CreatePatient() {
320 320
 		Nation:                       patients.Nation,
321 321
 		NativePlace:                  patients.NativePlace,
322 322
 		Age:                          patients.Age,
323
-		InfectiousNextRecordTime:     patients.InfectiousNextRecordTime,
324
-		IsInfectious:                 patients.IsInfectious,
325
-		RemindCycle:                  patients.RemindCycle,
326
-		ResponseResult:               patients.ResponseResult,
327
-		IsOpenRemind:                 patients.IsOpenRemind,
328
-		FirstTreatmentDate:           patients.FirstTreatmentDate,
329
-		DialysisAge:                  patients.DialysisAge,
330
-		ExpenseKind:                  patients.ExpenseKind,
331
-		TellPhone:                    patients.TellPhone,
332
-		ContactName:                  patients.ContactName,
333
-		BloodPatients:                1,
334
-		SlowPatients:                 0,
335
-		MemberPatients:               0,
336
-		EcommerPatients:              "",
337
-		BloodId:                      patients.ID,
338
-		SlowId:                       0,
339
-		MemberId:                     0,
340
-		MemberFistdate:               0,
341
-		MemberPatienttype:            0,
342
-		MemberTreatement:             0,
343
-		EquitmentId:                  "",
344
-		UserSysBeforeCount:           patient.UserSysBeforeCount,
323
+		InfectiousNextRecordTime: patients.InfectiousNextRecordTime,
324
+		IsInfectious:             patients.IsInfectious,
325
+		RemindCycle:              patients.RemindCycle,
326
+		ResponseResult:           patients.ResponseResult,
327
+		IsOpenRemind:             patients.IsOpenRemind,
328
+		FirstTreatmentDate:       patients.FirstTreatmentDate,
329
+		DialysisAge:              patients.DialysisAge,
330
+		ExpenseKind:              patients.ExpenseKind,
331
+		TellPhone:                patients.TellPhone,
332
+		ContactName:              patients.ContactName,
333
+		BloodPatients:            1,
334
+		SlowPatients:             0,
335
+		MemberPatients:           0,
336
+		EcommerPatients:          "",
337
+		BloodId:                  patients.ID,
338
+		SlowId:                   0,
339
+		MemberId:                 0,
340
+		MemberFistdate:           0,
341
+		MemberPatienttype:        0,
342
+		MemberTreatement:         0,
343
+		EquitmentId:              "",
344
+		UserSysBeforeCount:       patient.UserSysBeforeCount,
345 345
 	}
346 346
 
347 347
 	err = service.CreatePatientsNew(&patientsNew)
@@ -479,28 +479,28 @@ func (c *PatientApiController) EditPatient() {
479 479
 		return
480 480
 	}
481 481
 	patientsNew := models.XtPatientsNew{
482
-		UserOrgId:                 patient.UserOrgId,
483
-		UserId:                    patient.UserId,
484
-		Avatar:                    patient.Avatar,
485
-		PatientType:               patient.PatientType,
486
-		DialysisNo:                patient.DialysisNo,
487
-		AdmissionNumber:           patient.AdmissionNumber,
488
-		Source:                    patient.Source,
489
-		PartitionId:               patient.PartitionId,
490
-		BedId:                     patient.BedId,
491
-		Name:                      patient.Name,
492
-		Alias:                     patient.Alias,
493
-		Gender:                    patient.Gender,
494
-		MaritalStatus:             patient.MaritalStatus,
495
-		IdCardNo:                  patient.IdCardNo,
496
-		Birthday:                  patient.Birthday,
497
-		ReimbursementWayId:        patient.ReimbursementWayId,
498
-		HealthCareType:            patient.HealthCareType,
499
-		HealthCareNo:              patient.HealthCareNo,
500
-		HealthCareDueDate:         patient.HealthCareDueDate,
501
-		Height:                    patient.Height,
502
-		BloodType:                 patient.BloodType,
503
-		Rh:                        patient.Rh,
482
+		UserOrgId:          patient.UserOrgId,
483
+		UserId:             patient.UserId,
484
+		Avatar:             patient.Avatar,
485
+		PatientType:        patient.PatientType,
486
+		DialysisNo:         patient.DialysisNo,
487
+		AdmissionNumber:    patient.AdmissionNumber,
488
+		Source:             patient.Source,
489
+		PartitionId:        patient.PartitionId,
490
+		BedId:              patient.BedId,
491
+		Name:               patient.Name,
492
+		Alias:              patient.Alias,
493
+		Gender:             patient.Gender,
494
+		MaritalStatus:      patient.MaritalStatus,
495
+		IdCardNo:           patient.IdCardNo,
496
+		Birthday:           patient.Birthday,
497
+		ReimbursementWayId: patient.ReimbursementWayId,
498
+		HealthCareType:     patient.HealthCareType,
499
+		HealthCareNo:       patient.HealthCareNo,
500
+		HealthCareDueDate:  patient.HealthCareDueDate,
501
+		Height:             patient.Height,
502
+		BloodType:          patient.BloodType,
503
+		Rh:                 patient.Rh,
504 504
 		HealthCareDueAlertDate:    patient.HealthCareDueAlertDate,
505 505
 		EducationLevel:            patient.EducationLevel,
506 506
 		Profession:                patient.Profession,
@@ -542,19 +542,19 @@ func (c *PatientApiController) EditPatient() {
542 542
 		Nation:                    patient.Nation,
543 543
 		NativePlace:               patient.NativePlace,
544 544
 		Age:                       patient.Age,
545
-		InfectiousNextRecordTime:  patient.InfectiousNextRecordTime,
546
-		IsInfectious:              patient.IsInfectious,
547
-		RemindCycle:               patient.RemindCycle,
548
-		ResponseResult:            patient.ResponseResult,
549
-		IsOpenRemind:              patient.IsOpenRemind,
550
-		FirstTreatmentDate:        patient.FirstTreatmentDate,
551
-		DialysisAge:               patient.DialysisAge,
552
-		ExpenseKind:               patient.ExpenseKind,
553
-		TellPhone:                 patient.TellPhone,
554
-		ContactName:               patient.ContactName,
555
-		UpdatedTime:               time.Now().Unix(),
556
-		BloodPatients:             1,
557
-		Lapseto:                   patient.Lapseto,
545
+		InfectiousNextRecordTime: patient.InfectiousNextRecordTime,
546
+		IsInfectious:             patient.IsInfectious,
547
+		RemindCycle:              patient.RemindCycle,
548
+		ResponseResult:           patient.ResponseResult,
549
+		IsOpenRemind:             patient.IsOpenRemind,
550
+		FirstTreatmentDate:       patient.FirstTreatmentDate,
551
+		DialysisAge:              patient.DialysisAge,
552
+		ExpenseKind:              patient.ExpenseKind,
553
+		TellPhone:                patient.TellPhone,
554
+		ContactName:              patient.ContactName,
555
+		UpdatedTime:              time.Now().Unix(),
556
+		BloodPatients:            1,
557
+		Lapseto:                  patient.Lapseto,
558 558
 	}
559 559
 	//	//更新病人ID获取新表病人ID
560 560
 	err = service.UpdatepatientTwo(&patientsNew, id)
@@ -3235,6 +3235,11 @@ func patientFormData(patient *models.Patients, data []byte, method string) (cont
3235 3235
 		patient.Remark = remark
3236 3236
 	}
3237 3237
 
3238
+	if patientBody["sch_remark"] != nil && reflect.TypeOf(patientBody["sch_remark"]).String() == "string" {
3239
+		sch_remark := patientBody["sch_remark"].(string)
3240
+		patient.SchRemark = sch_remark
3241
+	}
3242
+
3238 3243
 	if patientBody["patient_complains"] != nil && reflect.TypeOf(patientBody["patient_complains"]).String() == "string" {
3239 3244
 		patient_complains := patientBody["patient_complains"].(string)
3240 3245
 		patient.PatientComplains = patient_complains

+ 45 - 24
controllers/public_api_controller.go Näytä tiedosto

@@ -183,8 +183,9 @@ func (c *PublicApiController) HandleData() {
183 183
 		//org_app_14, _ := service.GetAppByType(int64(apps.OrgId), 14)
184 184
 		//org_app_15, _ := service.GetAppByType(int64(apps.OrgId), 15)
185 185
 
186
-		org_app_16, _ := service.GetAppByType(int64(apps.OrgId), 16)
187
-		org_app_17, _ := service.GetAppByType(int64(apps.OrgId), 17)
186
+		//org_app_16, _ := service.GetAppByType(int64(apps.OrgId), 16)
187
+		//org_app_17, _ := service.GetAppByType(int64(apps.OrgId), 17)
188
+		org_app_18, _ := service.GetAppByType(int64(apps.OrgId), 18)
188 189
 
189 190
 		var xt_temp_org_app *models.OrgApp
190 191
 		//var mall_temp_org_app *models.OrgApp
@@ -277,28 +278,48 @@ func (c *PublicApiController) HandleData() {
277 278
 		//	mall_temp_org_app = mall_org_app
278 279
 		//}
279 280
 		//
280
-		if org_app_16 == nil || org_app_16.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
281
-			app, _ := service.GetOrgAppA(0, 16)
282
-			//org, _ := service.GetOrgById(int64(12))
283
-			org, _ := service.GetOrgByIdB(int64(apps.OrgId))
284
-			if org == nil || org.Id == 0 {
285
-				continue
286
-			}
287
-
288
-			app.OrgId = apps.OrgId
289
-			app.Creator = int(org.Creator)
290
-			app.Number = 11
291
-			app.Id = 0
292
-			app.Status = 1
293
-			app.ModifyTime = time.Now().Unix()
294
-			app.CreateTime = time.Now().Unix()
295
-			app.Pid = xt_temp_org_app.Id
296
-			service.CreateOrgApp(app)
297
-
298
-		}
281
+		//if org_app_16 == nil || org_app_16.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
282
+		//	app, _ := service.GetOrgAppA(0, 16)
283
+		//	//org, _ := service.GetOrgById(int64(12))
284
+		//	org, _ := service.GetOrgByIdB(int64(apps.OrgId))
285
+		//	if org == nil || org.Id == 0 {
286
+		//		continue
287
+		//	}
288
+		//
289
+		//	app.OrgId = apps.OrgId
290
+		//	app.Creator = int(org.Creator)
291
+		//	app.Number = 11
292
+		//	app.Id = 0
293
+		//	app.Status = 1
294
+		//	app.ModifyTime = time.Now().Unix()
295
+		//	app.CreateTime = time.Now().Unix()
296
+		//	app.Pid = xt_temp_org_app.Id
297
+		//	service.CreateOrgApp(app)
298
+		//
299
+		//}
300
+		//
301
+		//if org_app_17 == nil || org_app_17.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
302
+		//	app, _ := service.GetOrgAppA(0, 17)
303
+		//	//org, _ := service.GetOrgById(int64(12))
304
+		//	org, _ := service.GetOrgByIdB(int64(apps.OrgId))
305
+		//	if org == nil || org.Id == 0 {
306
+		//		continue
307
+		//	}
308
+		//
309
+		//	app.OrgId = apps.OrgId
310
+		//	app.Creator = int(org.Creator)
311
+		//	app.Number = 12
312
+		//	app.Id = 0
313
+		//	app.Status = 1
314
+		//	app.ModifyTime = time.Now().Unix()
315
+		//	app.CreateTime = time.Now().Unix()
316
+		//	app.Pid = xt_temp_org_app.Id
317
+		//	service.CreateOrgApp(app)
318
+		//
319
+		//}
299 320
 
300
-		if org_app_17 == nil || org_app_17.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
301
-			app, _ := service.GetOrgAppA(0, 17)
321
+		if org_app_18 == nil || org_app_18.Id == 0 { //判断之前是否有创建该app类型,如果没有则插入数据
322
+			app, _ := service.GetOrgAppA(0, 18)
302 323
 			//org, _ := service.GetOrgById(int64(12))
303 324
 			org, _ := service.GetOrgByIdB(int64(apps.OrgId))
304 325
 			if org == nil || org.Id == 0 {
@@ -307,7 +328,7 @@ func (c *PublicApiController) HandleData() {
307 328
 
308 329
 			app.OrgId = apps.OrgId
309 330
 			app.Creator = int(org.Creator)
310
-			app.Number = 12
331
+			app.Number = 5
311 332
 			app.Id = 0
312 333
 			app.Status = 1
313 334
 			app.ModifyTime = time.Now().Unix()

+ 1 - 0
models/board_models.go Näytä tiedosto

@@ -77,6 +77,7 @@ type BoardPatients struct {
77 77
 	FirstTreatmentDate           int64   `gorm:"column:first_treatment_date" json:"first_treatment_date" form:"first_treatment_date"`
78 78
 	ContactName                  string  `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
79 79
 	UserSysBeforeCount           int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
80
+	SchRemark                    string  `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
80 81
 }
81 82
 
82 83
 func (BoardPatients) TableName() string {

+ 2 - 0
models/dialysis.go Näytä tiedosto

@@ -76,6 +76,7 @@ type SchedualPatient struct {
76 76
 	FirstTreatmentDate      int64                   `gorm:"column:first_treatment_date" json:"first_treatment_date" form:"first_treatment_date"`
77 77
 	ContactName             string                  `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
78 78
 	UserSysBeforeCount      int64                   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
79
+	SchRemark               string                  `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
79 80
 }
80 81
 
81 82
 func (SchedualPatient) TableName() string {
@@ -157,6 +158,7 @@ type SchedualPatient2 struct {
157 158
 	FirstTreatmentDate      int64                `gorm:"column:first_treatment_date" json:"first_treatment_date" form:"first_treatment_date"`
158 159
 	ContactName             string               `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
159 160
 	UserSysBeforeCount      int64                `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
161
+	SchRemark               string               `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
160 162
 }
161 163
 
162 164
 func (SchedualPatient2) TableName() string {

+ 1 - 0
models/monitor_models.go Näytä tiedosto

@@ -104,6 +104,7 @@ type MonitorPatients struct {
104 104
 	FirstTreatmentDate           int64   `gorm:"column:first_treatment_date" json:"first_treatment_date" form:"first_treatment_date"`
105 105
 	ContactName                  string  `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
106 106
 	UserSysBeforeCount           int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
107
+	SchRemark                    string  `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
107 108
 }
108 109
 
109 110
 func (MonitorPatients) TableName() string {

+ 4 - 0
models/patient_models.go Näytä tiedosto

@@ -114,6 +114,7 @@ type Patients struct {
114 114
 	ContactName              string `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
115 115
 	UserSysBeforeCount       int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
116 116
 	IsExcelExport            int64  `gorm:"column:is_excel_export" json:"is_excel_export" form:"is_excel_export"`
117
+	SchRemark                string `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
117 118
 
118 119
 	ContagionIds []int64 `gorm:"-"`
119 120
 	DryWeight    float64 `gorm:"-"`
@@ -518,6 +519,7 @@ type XtPatientsNew struct {
518 519
 	EquitmentId                  string  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
519 520
 	UserSysBeforeCount           int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
520 521
 	IsExcelExport                int64   `gorm:"column:is_excel_export" json:"is_excel_export" form:"is_excel_export"`
522
+	SchRemark                    string  `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
521 523
 }
522 524
 
523 525
 func (XtPatientsNew) TableName() string {
@@ -569,6 +571,7 @@ type CdmPatients struct {
569 571
 	CreatedTime        int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
570 572
 	UpdatedTime        int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
571 573
 	UserSysBeforeCount int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
574
+	SchRemark          string `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
572 575
 }
573 576
 
574 577
 func (CdmPatients) TableName() string {
@@ -841,6 +844,7 @@ type XtPatients struct {
841 844
 	TellPhone                    string  `gorm:"column:tell_phone" json:"tell_phone" form:"tell_phone"`
842 845
 	ContactName                  string  `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
843 846
 	UserSysBeforeCount           int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
847
+	SchRemark                    string  `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
844 848
 }
845 849
 
846 850
 func (XtPatients) TableName() string {

+ 2 - 2
models/vm_models.go Näytä tiedosto

@@ -86,8 +86,8 @@ type VMOrgPatients struct {
86 86
 	FirstTreatmentDate       int64  `gorm:"column:first_treatment_date" json:"first_treatment_date" form:"first_treatment_date"`
87 87
 	ContactName              string `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
88 88
 	UserSysBeforeCount       int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
89
-
90
-	ContagionIds string `json:"contagion_ids" gorm:"-"`
89
+	SchRemark                string `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
90
+	ContagionIds             string `json:"contagion_ids" gorm:"-"`
91 91
 }
92 92
 
93 93
 func (VMOrgPatients) TableName() string {

+ 1 - 1
service/data.go Näytä tiedosto

@@ -167,7 +167,7 @@ func DeleteChildConfig(dataconfig *models.Dataconfig) (err error) {
167 167
 }
168 168
 
169 169
 func FindFiledByOrgId(org_id int64) (filedConfig []*models.FiledConfig, err error) {
170
-	err = readDb.Model(&models.FiledConfig{}).Where("org_id =? AND sys_module = 0", org_id).Find(&filedConfig).Error
170
+	err = readDb.Model(&models.FiledConfig{}).Where("org_id =? AND  sys_module = 0", org_id).Find(&filedConfig).Error
171 171
 	return
172 172
 }
173 173