Browse Source

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

XMLWAN 1 year ago
parent
commit
dc6bb06637

+ 6 - 6
controllers/base_api_controller.go View File

82
 		userAdmin.ModifyTime = 1530786071
82
 		userAdmin.ModifyTime = 1530786071
83
 		var subscibe models.ServeSubscibe
83
 		var subscibe models.ServeSubscibe
84
 		subscibe.ID = 11
84
 		subscibe.ID = 11
85
-		subscibe.OrgId = 10440 //机构id
85
+		subscibe.OrgId = 9671 //机构id
86
 		subscibe.PeriodStart = 1547447814
86
 		subscibe.PeriodStart = 1547447814
87
 		subscibe.PeriodEnd = 1550039814
87
 		subscibe.PeriodEnd = 1550039814
88
 		subscibe.State = 1
88
 		subscibe.State = 1
92
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
92
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93
 		subscibes[4] = &subscibe
93
 		subscibes[4] = &subscibe
94
 		var adminUserInfo service.AdminUserInfo
94
 		var adminUserInfo service.AdminUserInfo
95
-		adminUserInfo.CurrentOrgId = 10440 //机构id小英9675或4
96
-		adminUserInfo.CurrentAppId = 15388 //4
95
+		adminUserInfo.CurrentOrgId = 9671 //机构id小英9675或4
96
+		adminUserInfo.CurrentAppId = 3427 //4
97
 		adminUserInfo.AdminUser = &userAdmin
97
 		adminUserInfo.AdminUser = &userAdmin
98
 		adminUserInfo.Subscibes = subscibes
98
 		adminUserInfo.Subscibes = subscibes
99
 		this.SetSession("admin_user_info", &adminUserInfo)
99
 		this.SetSession("admin_user_info", &adminUserInfo)
328
 		userAdmin.ModifyTime = 1530786071
328
 		userAdmin.ModifyTime = 1530786071
329
 		var subscibe models.ServeSubscibe
329
 		var subscibe models.ServeSubscibe
330
 		subscibe.ID = 11
330
 		subscibe.ID = 11
331
-		subscibe.OrgId = 10440 //机构id小英9675或4
331
+		subscibe.OrgId = 9671 //机构id小英9675或4
332
 		subscibe.PeriodStart = 1538035409
332
 		subscibe.PeriodStart = 1538035409
333
 		subscibe.PeriodEnd = 1569571409
333
 		subscibe.PeriodEnd = 1569571409
334
 		subscibe.State = 1
334
 		subscibe.State = 1
338
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
338
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339
 		subscibes[4] = &subscibe
339
 		subscibes[4] = &subscibe
340
 		var adminUserInfo service.AdminUserInfo
340
 		var adminUserInfo service.AdminUserInfo
341
-		adminUserInfo.CurrentOrgId = 10440 //机构id小英9675或4
342
-		adminUserInfo.CurrentAppId = 15388 //4
341
+		adminUserInfo.CurrentOrgId = 9671 //机构id小英9675或4
342
+		adminUserInfo.CurrentAppId = 3427 //4
343
 		adminUserInfo.AdminUser = &userAdmin
343
 		adminUserInfo.AdminUser = &userAdmin
344
 		adminUserInfo.Subscibes = subscibes
344
 		adminUserInfo.Subscibes = subscibes
345
 		this.SetSession("admin_user_info", &adminUserInfo)
345
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 2 - 1
controllers/mobile_api_controllers/patient_api_controller.go View File

3838
 				}
3838
 				}
3839
 			}
3839
 			}
3840
 
3840
 
3841
+			fmt.Println("admin==================", adminUserInfo.Org.Id)
3841
 			//长沙南雅
3842
 			//长沙南雅
3842
 			if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 9671 {
3843
 			if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 9671 {
3843
 
3844
 
3844
 				//查询该患者今日有没有双人核对
3845
 				//查询该患者今日有没有双人核对
3845
 				check, _ := service.MobileGetDoubleCheckSix(adminUserInfo.Org.Id, patientInfo.ID, RecordDate)
3846
 				check, _ := service.MobileGetDoubleCheckSix(adminUserInfo.Org.Id, patientInfo.ID, RecordDate)
3846
-
3847
+				fmt.Println("check----------------", check)
3847
 				if check.ID > 0 {
3848
 				if check.ID > 0 {
3848
 					advice.Checker = check.Modifier
3849
 					advice.Checker = check.Modifier
3849
 					advice.CheckState = 1
3850
 					advice.CheckState = 1

+ 15 - 1
controllers/patient_api_controller.go View File

1418
 		}
1418
 		}
1419
 
1419
 
1420
 		remark, _ := adviceNameM["remark"].(string)
1420
 		remark, _ := adviceNameM["remark"].(string)
1421
-		fmt.Println("哦哦撒搜哦搜搜哦remark-----------------------------------", remark)
1421
+
1422
 		advice.Remark = remark
1422
 		advice.Remark = remark
1423
 
1423
 
1424
+		if adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10340 || adminUserInfo.CurrentOrgId == 9671 {
1425
+			if advice.PrescribingNumber == 0 {
1426
+				advice.PrescribingNumber = 1
1427
+			}
1428
+			//查询该患者今日有没有双人核对
1429
+			check, _ := service.MobileGetDoubleCheckSix(adminUserInfo.CurrentOrgId, patientInfo.ID, advice.AdviceDate)
1430
+			fmt.Println("chek", check)
1431
+			if check.ID > 0 {
1432
+				advice.Checker = check.Modifier
1433
+				advice.CheckState = 1
1434
+				advice.CheckTime = time.Now().Unix()
1435
+			}
1436
+		}
1424
 		if adviceType == 1 {
1437
 		if adviceType == 1 {
1425
 
1438
 
1426
 			if adviceNameM["frequency_type"] != nil || reflect.TypeOf(adviceNameM["frequency_type"]).String() == "float64" {
1439
 			if adviceNameM["frequency_type"] != nil || reflect.TypeOf(adviceNameM["frequency_type"]).String() == "float64" {
1448
 				}
1461
 				}
1449
 				advice.PushStartTime = startTime
1462
 				advice.PushStartTime = startTime
1450
 			}
1463
 			}
1464
+
1451
 		}
1465
 		}
1452
 
1466
 
1453
 		if adviceNameM["children"] != nil && reflect.TypeOf(adviceNameM["children"]).String() == "string" {
1467
 		if adviceNameM["children"] != nil && reflect.TypeOf(adviceNameM["children"]).String() == "string" {

+ 11 - 5
service/his_service.go View File

981
 		db = db.Joins("join xt_patients as patient on patient.id = his_order.patient_id  AND patient.name like ? AND patient.user_org_id = ?", keywords, user_org_id)
981
 		db = db.Joins("join xt_patients as patient on patient.id = his_order.patient_id  AND patient.name like ? AND patient.user_org_id = ?", keywords, user_org_id)
982
 
982
 
983
 	}
983
 	}
984
-
985
-	if sch_type > 0 {
986
-		db = db.Joins("join xt_schedule sch on sch.schedule_date = his_order.settle_accounts_date AND sch.patient_id = his_order.patient_id AND sch.schedule_type = ? AND sch.schedule_date >= ? AND sch.schedule_date <= ?", sch_type, start_time_timestamp, end_time_timestamp)
984
+	if sch_type > 0 && zone_type > 0 {
985
+		db = db.Joins("join xt_schedule sch on sch.schedule_date = his_order.settle_accounts_date AND sch.patient_id = his_order.patient_id AND sch.schedule_type = ? AND sch.schedule_date >= ? AND sch.schedule_date <= ? AND sch.partition_id = ? AND sch.status  = 1", sch_type, start_time_timestamp, end_time_timestamp, zone_type)
987
 	}
986
 	}
988
-	if zone_type > 0 {
989
-		db = db.Joins("join xt_schedule sch on sch.schedule_date = his_order.settle_accounts_date AND sch.patient_id = his_order.patient_id AND sch.partition_id = ?", zone_type)
987
+	if sch_type > 0 && zone_type == 0 {
988
+		db = db.Joins("join xt_schedule sch on sch.schedule_date = his_order.settle_accounts_date AND sch.patient_id = his_order.patient_id AND sch.schedule_type = ? AND sch.schedule_date >= ? AND sch.schedule_date <= ? AND sch.status = 1", sch_type, start_time_timestamp, end_time_timestamp)
990
 	}
989
 	}
990
+	if sch_type == 0 && zone_type > 0 {
991
+		db = db.Joins("join xt_schedule sch on sch.schedule_date = his_order.settle_accounts_date AND sch.patient_id = his_order.patient_id  AND sch.schedule_date >= ? AND sch.schedule_date <= ? AND sch.partition_id = ? AND sch.status = 1", start_time_timestamp, end_time_timestamp, zone_type)
992
+	}
993
+
994
+	//if zone_type > 0 {
995
+	//	db = db.Joins("join xt_schedule sch_two on sch_two.schedule_date = his_order.settle_accounts_date AND sch_two.patient_id = his_order.patient_id AND sch_two.partition_id = ?", zone_type)
996
+	//}
991
 
997
 
992
 	if sort_type == 1 {
998
 	if sort_type == 1 {
993
 		if start_time_timestamp != 0 {
999
 		if start_time_timestamp != 0 {