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,7 +82,7 @@ func (this *BaseAuthAPIController) Prepare() {
82 82
 		userAdmin.ModifyTime = 1530786071
83 83
 		var subscibe models.ServeSubscibe
84 84
 		subscibe.ID = 11
85
-		subscibe.OrgId = 10440 //机构id
85
+		subscibe.OrgId = 9671 //机构id
86 86
 		subscibe.PeriodStart = 1547447814
87 87
 		subscibe.PeriodEnd = 1550039814
88 88
 		subscibe.State = 1
@@ -92,8 +92,8 @@ func (this *BaseAuthAPIController) Prepare() {
92 92
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93 93
 		subscibes[4] = &subscibe
94 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 97
 		adminUserInfo.AdminUser = &userAdmin
98 98
 		adminUserInfo.Subscibes = subscibes
99 99
 		this.SetSession("admin_user_info", &adminUserInfo)
@@ -328,7 +328,7 @@ func (this *BaseServeAPIController) Prepare() {
328 328
 		userAdmin.ModifyTime = 1530786071
329 329
 		var subscibe models.ServeSubscibe
330 330
 		subscibe.ID = 11
331
-		subscibe.OrgId = 10440 //机构id小英9675或4
331
+		subscibe.OrgId = 9671 //机构id小英9675或4
332 332
 		subscibe.PeriodStart = 1538035409
333 333
 		subscibe.PeriodEnd = 1569571409
334 334
 		subscibe.State = 1
@@ -338,8 +338,8 @@ func (this *BaseServeAPIController) Prepare() {
338 338
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339 339
 		subscibes[4] = &subscibe
340 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 343
 		adminUserInfo.AdminUser = &userAdmin
344 344
 		adminUserInfo.Subscibes = subscibes
345 345
 		this.SetSession("admin_user_info", &adminUserInfo)

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

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

+ 15 - 1
controllers/patient_api_controller.go View File

@@ -1418,9 +1418,22 @@ func (c *PatientApiController) CreateGroupAdvice() {
1418 1418
 		}
1419 1419
 
1420 1420
 		remark, _ := adviceNameM["remark"].(string)
1421
-		fmt.Println("哦哦撒搜哦搜搜哦remark-----------------------------------", remark)
1421
+
1422 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 1437
 		if adviceType == 1 {
1425 1438
 
1426 1439
 			if adviceNameM["frequency_type"] != nil || reflect.TypeOf(adviceNameM["frequency_type"]).String() == "float64" {
@@ -1448,6 +1461,7 @@ func (c *PatientApiController) CreateGroupAdvice() {
1448 1461
 				}
1449 1462
 				advice.PushStartTime = startTime
1450 1463
 			}
1464
+
1451 1465
 		}
1452 1466
 
1453 1467
 		if adviceNameM["children"] != nil && reflect.TypeOf(adviceNameM["children"]).String() == "string" {

+ 11 - 5
service/his_service.go View File

@@ -981,13 +981,19 @@ func GetHisOrderList(user_org_id int64, page int64, limit int64, start_time_time
981 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 998
 	if sort_type == 1 {
993 999
 		if start_time_timestamp != 0 {