Kaynağa Gözat

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

XMLWAN 4 yıl önce
ebeveyn
işleme
f3e139e832

+ 50 - 52
controllers/base_api_controller.go Dosyayı Görüntüle

@@ -2,8 +2,6 @@ package controllers
2 2
 
3 3
 import (
4 4
 	"XT_New/enums"
5
-	"XT_New/models"
6
-
7 5
 	//"XT_New/models"
8 6
 
9 7
 	//"XT_New/models"
@@ -69,33 +67,33 @@ type BaseAuthAPIController struct {
69 67
 func (this *BaseAuthAPIController) Prepare() {
70 68
 	this.BaseAPIController.Prepare()
71 69
 	if this.GetAdminUserInfo() == nil {
72
-		var userAdmin models.AdminUser
73
-		userAdmin.Id = 1448
74
-		userAdmin.Mobile = "13318599895"
70
+		//var userAdmin models.AdminUser
71
+		//userAdmin.Id = 1448
72
+		//userAdmin.Mobile = "13318599895"
75 73
 
76 74
 		//userAdmin.Id = 597
77 75
 		//userAdmin.Mobile = "19874122664"
78
-		userAdmin.IsSuperAdmin = false
79
-		userAdmin.Status = 1
80
-		userAdmin.CreateTime = 1530786071
81
-		userAdmin.ModifyTime = 1530786071
82
-		var subscibe models.ServeSubscibe
83
-		subscibe.ID = 1
84
-		subscibe.OrgId = 3877
85
-		subscibe.PeriodStart = 1538035409
86
-		subscibe.PeriodEnd = 1569571409
87
-		subscibe.State = 1
88
-		subscibe.Status = 1
89
-		subscibe.CreatedTime = 1538035409
90
-		subscibe.UpdatedTime = 1538035409
91
-		subscibes := make(map[int64]*models.ServeSubscibe, 0)
92
-		subscibes[4] = &subscibe
93
-		var adminUserInfo service.AdminUserInfo
94
-		adminUserInfo.CurrentOrgId = 3877
95
-		adminUserInfo.CurrentAppId = 4
96
-		adminUserInfo.AdminUser = &userAdmin
97
-		adminUserInfo.Subscibes = subscibes
98
-		this.SetSession("admin_user_info", &adminUserInfo)
76
+		//userAdmin.IsSuperAdmin = false
77
+		//userAdmin.Status = 1
78
+		//userAdmin.CreateTime = 1530786071
79
+		//userAdmin.ModifyTime = 1530786071
80
+		//var subscibe models.ServeSubscibe
81
+		//subscibe.ID = 1
82
+		//subscibe.OrgId = 4
83
+		//subscibe.PeriodStart = 1538035409
84
+		//subscibe.PeriodEnd = 1569571409
85
+		//subscibe.State = 1
86
+		//subscibe.Status = 1
87
+		//subscibe.CreatedTime = 1538035409
88
+		//subscibe.UpdatedTime = 1538035409
89
+		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
90
+		//subscibes[4] = &subscibe
91
+		//var adminUserInfo service.AdminUserInfo
92
+		//adminUserInfo.CurrentOrgId = 4
93
+		//adminUserInfo.CurrentAppId = 4
94
+		//adminUserInfo.AdminUser = &userAdmin
95
+		//adminUserInfo.Subscibes = subscibes
96
+		//this.SetSession("admin_user_info", &adminUserInfo)
99 97
 
100 98
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
101 99
 		this.StopRun()
@@ -315,35 +313,35 @@ type BaseServeAPIController struct {
315 313
 func (this *BaseServeAPIController) Prepare() {
316 314
 	this.BaseAPIController.Prepare()
317 315
 	if this.GetAdminUserInfo() == nil {
318
-		var userAdmin models.AdminUser
319
-		userAdmin.Id = 1448
320
-		userAdmin.Mobile = "13318599895"
316
+		//var userAdmin models.AdminUser
317
+		//userAdmin.Id = 1448
318
+		//userAdmin.Mobile = "13318599895"
321 319
 
322 320
 		//userAdmin.Id = 597
323 321
 		//userAdmin.Mobile = "19874122664"
324
-		userAdmin.IsSuperAdmin = false
325
-		userAdmin.Status = 1
326
-		userAdmin.CreateTime = 1530786071
327
-		userAdmin.ModifyTime = 1530786071
328
-		var subscibe models.ServeSubscibe
329
-		subscibe.ID = 1
330
-		subscibe.OrgId = 3877
331
-		subscibe.PeriodStart = 1538035409
332
-		subscibe.PeriodEnd = 1569571409
333
-		subscibe.State = 1
334
-		subscibe.Status = 1
335
-		subscibe.CreatedTime = 1538035409
336
-		subscibe.UpdatedTime = 1538035409
337
-		subscibes := make(map[int64]*models.ServeSubscibe, 0)
338
-		subscibes[4] = &subscibe
339
-		var adminUserInfo service.AdminUserInfo
340
-		adminUserInfo.CurrentOrgId = 3877
341
-		adminUserInfo.CurrentAppId = 4
342
-		adminUserInfo.AdminUser = &userAdmin
343
-		adminUserInfo.Subscibes = subscibes
344
-		this.SetSession("admin_user_info", &adminUserInfo)
345
-		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
346
-		//this.StopRun()
322
+		//userAdmin.IsSuperAdmin = false
323
+		//userAdmin.Status = 1
324
+		//userAdmin.CreateTime = 1530786071
325
+		//userAdmin.ModifyTime = 1530786071
326
+		//var subscibe models.ServeSubscibe
327
+		//subscibe.ID = 1
328
+		//subscibe.OrgId = 4
329
+		//subscibe.PeriodStart = 1538035409
330
+		//subscibe.PeriodEnd = 1569571409
331
+		//subscibe.State = 1
332
+		//subscibe.Status = 1
333
+		//subscibe.CreatedTime = 1538035409
334
+		//subscibe.UpdatedTime = 1538035409
335
+		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
336
+		//subscibes[4] = &subscibe
337
+		//var adminUserInfo service.AdminUserInfo
338
+		//adminUserInfo.CurrentOrgId = 4
339
+		//adminUserInfo.CurrentAppId = 4
340
+		//adminUserInfo.AdminUser = &userAdmin
341
+		//adminUserInfo.Subscibes = subscibes
342
+		//this.SetSession("admin_user_info", &adminUserInfo)
343
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
344
+		this.StopRun()
347 345
 	}
348 346
 
349 347
 	//if adminUserInfo.AppRole != nil {

+ 36 - 2
controllers/his_api_controller.go Dosyayı Görüntüle

@@ -80,6 +80,10 @@ func HisManagerApiRegistRouters() {
80 80
 
81 81
 	beego.Router("/api/cost/compare", &HisApiController{}, "get:GetMedicalInsuranceCostCompareList")
82 82
 
83
+	beego.Router("/api/record/list", &HisApiController{}, "get:GetPutOnRecordList")
84
+
85
+	//beego.Router("/api/export/template", &HisApiController{}, "get:ExportOrderTemplate")
86
+
83 87
 }
84 88
 
85 89
 func (c *HisApiController) Sscard() {
@@ -453,7 +457,7 @@ func (c *HisApiController) CreateHisPrescription() {
453 457
 							var s models.HisDoctorAdviceInfo
454 458
 							s.PrescriptionId = prescription.ID
455 459
 							s.AdviceType = 2
456
-							s.AdviceDoctor = adminInfo.AdminUser.Id
460
+							s.AdviceDoctor = doctor_id
457 461
 							s.StopState = 2
458 462
 							s.ExecutionState = 2
459 463
 							s.AdviceDate = recordDateTime
@@ -1789,7 +1793,7 @@ type ResultTwo struct {
1789 1793
 		} `json:"baseinfo"`
1790 1794
 		Idetinfo []interface{} `json:"idetinfo"`
1791 1795
 		Iinfo    []struct {
1792
-			Balc                   int64       `json:"balc"`
1796
+			Balc                   float64     `json:"balc"`
1793 1797
 			CvlservFlag            string      `json:"cvlserv_flag"`
1794 1798
 			EmpName                string      `json:"emp_name"`
1795 1799
 			InsuplcAdmdvs          string      `json:"insuplc_admdvs"`
@@ -2769,3 +2773,33 @@ func (c *HisApiController) GetMedicalInsuranceCostCompareList() {
2769 2773
 	return
2770 2774
 
2771 2775
 }
2776
+
2777
+func (c *HisApiController) GetPutOnRecordList() {
2778
+	page, _ := c.GetInt64("page")
2779
+	limit, _ := c.GetInt64("limit")
2780
+	keywords := c.GetString("keywords")
2781
+	is_put_on_record, _ := c.GetInt64("is_put_on_record")
2782
+
2783
+	if page <= 0 {
2784
+		page = 1
2785
+	}
2786
+	if limit <= 0 {
2787
+		limit = 10
2788
+	}
2789
+	list, total, _ := service.GetGdybPsnNcdsRecordList(c.GetAdminUserInfo().CurrentOrgId, page, limit, keywords, is_put_on_record)
2790
+	c.ServeSuccessJSON(map[string]interface{}{
2791
+		"total": total,
2792
+		"list":  list,
2793
+	})
2794
+	return
2795
+
2796
+}
2797
+
2798
+//func (c *HisApiController)ExportOrderTemplate(){
2799
+//	start_time := c.GetString("start_time")
2800
+//	end_time := c.GetString("end_time")
2801
+//
2802
+//
2803
+//
2804
+//
2805
+//}

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

@@ -317,7 +317,7 @@ func (c *MobileHisApiController) CreateHisPrescription() {
317 317
 							var s models.HisDoctorAdviceInfo
318 318
 							s.PrescriptionId = prescription.ID
319 319
 							s.AdviceType = 2
320
-							s.AdviceDoctor = adminInfo.AdminUser.Id
320
+							s.AdviceDoctor = doctor_id
321 321
 							s.StopState = 2
322 322
 							s.ExecutionState = 2
323 323
 							s.AdviceDate = recordDateTime

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

@@ -1300,3 +1300,68 @@ func GetMedicalInsuranceCostCompareList(orgID, page, limit int64, keywords strin
1300 1300
 	}
1301 1301
 	return
1302 1302
 }
1303
+
1304
+type TempPatients struct {
1305
+	ID                int64             `gorm:"column:id" json:"id" form:"id"`
1306
+	UserOrgId         int64             `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1307
+	UserId            int64             `gorm:"column:user_id" json:"user_id" form:"user_id"`
1308
+	Avatar            string            `gorm:"column:avatar" json:"avatar" form:"avatar"`
1309
+	Lapseto           int64             `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
1310
+	Name              string            `gorm:"column:name" json:"name" form:"name"`
1311
+	IdCardNo          string            `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
1312
+	Phone             string            `gorm:"column:phone" json:"phone" form:"phone"`
1313
+	HomeTelephone     string            `gorm:"column:home_telephone" json:"home_telephone" form:"home_telephone"`
1314
+	HomeAddress       string            `gorm:"column:home_address" json:"home_address" form:"home_address"`
1315
+	Status            int64             `gorm:"column:status" json:"status" form:"status"`
1316
+	GdybPsnNcdsRecord GdybPsnNcdsRecord `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"record"`
1317
+}
1318
+
1319
+func (TempPatients) TableName() string {
1320
+	return "xt_patients"
1321
+}
1322
+
1323
+type GdybPsnNcdsRecord struct {
1324
+	ID            int64  `gorm:"column:id" json:"id" form:"id"`
1325
+	UserOrgId     int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1326
+	PatientId     int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1327
+	PsnNo         string `gorm:"column:psn_no" json:"psn_no" form:"psn_no"`
1328
+	Ctime         int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1329
+	Mtime         int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1330
+	Status        int64  `gorm:"column:status" json:"status" form:"status"`
1331
+	IsCancel      int64  `gorm:"column:is_cancel" json:"is_cancel" form:"is_cancel"`
1332
+	TrtDclaDetlSn string `gorm:"column:trt_dcla_detl_sn" json:"trt_dcla_detl_sn" form:"trt_dcla_detl_sn"`
1333
+	DoctorId      int64  `gorm:"column:doctor_id" json:"doctor_id" form:"doctor_id"`
1334
+	DepartmentId  int64  `gorm:"column:department_id" json:"department_id" form:"department_id"`
1335
+	Insutype      string `gorm:"column:insutype" json:"insutype" form:"insutype"`
1336
+	SickType      int64  `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
1337
+	OrgName       string `gorm:"column:org_name" json:"org_name" form:"org_name"`
1338
+}
1339
+
1340
+func (GdybPsnNcdsRecord) TableName() string {
1341
+	return "gdyb_psn_ncds_record"
1342
+}
1343
+
1344
+func GetGdybPsnNcdsRecordList(orgID, page, limit int64, keywords string, is_cancel int64) (list []*TempPatients, total int64, err error) {
1345
+	offset := (page - 1) * limit
1346
+	db := readDb.Model(&TempPatients{})
1347
+	db = db.Preload("GdybPsnNcdsRecord", func(db *gorm.DB) *gorm.DB {
1348
+		return db.Model(&GdybPsnNcdsRecord{}).Where("user_org_id = ?", orgID).Order("id asc")
1349
+	})
1350
+	if len(keywords) == 0 {
1351
+		if is_cancel != 0 {
1352
+			db = db.Joins("JOIN gdyb_psn_ncds_record On gdyb_psn_ncds_record.patient_id = xt_patients.id AND gdyb_psn_ncds_record.is_cancel = ?", is_cancel)
1353
+			db = db.Where("user_org_id = ? AND status = 1 AND lapseto = 1", orgID)
1354
+		} else {
1355
+			db = db.Preload("GdybPsnNcdsRecord", "user_org_id = ?", orgID)
1356
+			db = db.Where("user_org_id = ? AND status = 1 AND lapseto = 1", orgID)
1357
+		}
1358
+		err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1359
+	} else {
1360
+		keywords = "%" + keywords + "%"
1361
+		db = db.Where("user_org_id = ? AND status = 1 AND lapseto = 1 AND name LIKE ?", orgID, keywords)
1362
+		err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1363
+
1364
+	}
1365
+
1366
+	return
1367
+}