Browse Source

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

陈少旭 1 week ago
parent
commit
5e775547ea

BIN
XT_New.exe View File


+ 4 - 4
controllers/base_api_controller.go View File

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

+ 27 - 0
controllers/dialysis_api_controller.go View File

530
 		DialysisDialyszersId:       dialysis_dialyszers_id,
530
 		DialysisDialyszersId:       dialysis_dialyszers_id,
531
 	}
531
 	}
532
 
532
 
533
+	if adminUserInfo.CurrentOrgId == 10721 {
534
+		if prescription.ModeId == 2 {
535
+			if prescription.ReplacementTotal == 0 {
536
+				prescription.ReplacementTotal = 15
537
+			}
538
+
539
+		}
540
+	}
541
+
533
 	//长沙南雅医院,自动生成抗凝剂的临时处方
542
 	//长沙南雅医院,自动生成抗凝剂的临时处方
534
 	if adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 10340 {
543
 	if adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 10340 {
535
 		if prescribing_number == 0 {
544
 		if prescribing_number == 0 {
882
 			}
891
 			}
883
 		}
892
 		}
884
 
893
 
894
+		if adminUserInfo.CurrentOrgId == 10721 {
895
+			if prescription.ModeId == 2 {
896
+				if prescription.ReplacementTotal == 0 {
897
+					prescription.ReplacementTotal = 15
898
+				}
899
+
900
+			}
901
+		}
902
+
885
 		updateErr := service.UpDateDialysisPrescription(&prescription)
903
 		updateErr := service.UpDateDialysisPrescription(&prescription)
886
 
904
 
887
 		if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
905
 		if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
1566
 		prescription.AdminUserId = adminUserInfo.AdminUser.Id
1584
 		prescription.AdminUserId = adminUserInfo.AdminUser.Id
1567
 	}
1585
 	}
1568
 
1586
 
1587
+	if adminUserInfo.CurrentOrgId == 10721 {
1588
+		if prescription.ModeId == 2 {
1589
+			if prescription.ReplacementTotal == 0 {
1590
+				prescription.ReplacementTotal = 15
1591
+			}
1592
+
1593
+		}
1594
+	}
1595
+
1569
 	err := service.SavePrescriptionAndCreateSolution(&solution, &prescription)
1596
 	err := service.SavePrescriptionAndCreateSolution(&solution, &prescription)
1570
 
1597
 
1571
 	if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
1598
 	if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {

+ 2 - 1
controllers/gobal_config_api_controller.go View File

2336
 	orgId := c.GetAdminUserInfo().CurrentOrgId
2336
 	orgId := c.GetAdminUserInfo().CurrentOrgId
2337
 
2337
 
2338
 	list, err := service.GetSingleOrderDetail(id, orgId)
2338
 	list, err := service.GetSingleOrderDetail(id, orgId)
2339
-	fmt.Println("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH", list)
2339
+
2340
 	drugoutlist, _ := service.GetDrugWarehouseOutDetailNighty(id, orgId)
2340
 	drugoutlist, _ := service.GetDrugWarehouseOutDetailNighty(id, orgId)
2341
+
2341
 	dealerList, err := service.GetAllDealerList(orgId)
2342
 	dealerList, err := service.GetAllDealerList(orgId)
2342
 	manufacturerList, err := service.GetAllManufacturerList(orgId)
2343
 	manufacturerList, err := service.GetAllManufacturerList(orgId)
2343
 	drugFlowList, _ := service.GetDrugStockFlowDetail(start_time, orgId)
2344
 	drugFlowList, _ := service.GetDrugStockFlowDetail(start_time, orgId)

+ 3 - 3
controllers/his_api_controller.go View File

4027
 								if p.PatientId != 30038 {
4027
 								if p.PatientId != 30038 {
4028
 
4028
 
4029
 									//用机构ID区分
4029
 									//用机构ID区分
4030
-									if adminInfo.CurrentOrgId != 10721 && adminInfo.CurrentOrgId != 10164 {
4030
+									if adminInfo.CurrentOrgId != 9671 && adminInfo.CurrentOrgId != 10164 {
4031
 										if goodOutConfig.IsOpen == 1 {
4031
 										if goodOutConfig.IsOpen == 1 {
4032
 											//耗材出库
4032
 											//耗材出库
4033
 											if p.Type == 3 {
4033
 											if p.Type == 3 {
4462
 										}
4462
 										}
4463
 									}
4463
 									}
4464
 
4464
 
4465
-									if adminInfo.CurrentOrgId == 10721 || adminInfo.CurrentOrgId == 10164 {
4465
+									if adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10164 {
4466
 
4466
 
4467
 										//耗材出库
4467
 										//耗材出库
4468
 										if p.Type == 3 {
4468
 										if p.Type == 3 {
6689
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDeletePMedicineWrong)
6689
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDeletePMedicineWrong)
6690
 		return
6690
 		return
6691
 	}
6691
 	}
6692
-	//已收费和已发药限制逻辑
6693
 
6692
 
6693
+	//已收费和已发药限制逻辑
6694
 	if len(projects) > 0 {
6694
 	if len(projects) > 0 {
6695
 		for _, item := range projects {
6695
 		for _, item := range projects {
6696
 			service.DeletePrintInfo(item.ID) //删除打印信息
6696
 			service.DeletePrintInfo(item.ID) //删除打印信息

+ 27 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

2264
 		DialysisStrainerId:         dialysis_strainer_id,
2264
 		DialysisStrainerId:         dialysis_strainer_id,
2265
 	}
2265
 	}
2266
 
2266
 
2267
+	if adminUserInfo.Org.Id == 10721 {
2268
+		if prescription.ModeId == 2 {
2269
+			if prescription.ReplacementTotal == 0 {
2270
+				prescription.ReplacementTotal = 15
2271
+			}
2272
+		}
2273
+
2274
+	}
2275
+
2267
 	//查询最近透析准备表里是否存在 透析器 灌流器
2276
 	//查询最近透析准备表里是否存在 透析器 灌流器
2268
 
2277
 
2269
 	//
2278
 	//
2639
 
2648
 
2640
 		prescription.ID = dialysisPrescription.ID
2649
 		prescription.ID = dialysisPrescription.ID
2641
 
2650
 
2651
+		if adminUserInfo.Org.Id == 10721 {
2652
+			if prescription.ModeId == 2 {
2653
+				if prescription.ReplacementTotal == 0 {
2654
+					prescription.ReplacementTotal = 15
2655
+				}
2656
+			}
2657
+
2658
+		}
2659
+
2642
 		service.UpDateDialysisPrescription(&prescription)
2660
 		service.UpDateDialysisPrescription(&prescription)
2643
 
2661
 
2644
 		//溪康 更改目标超滤量 同步监测里面的超滤量 超滤率 置换量 置换率
2662
 		//溪康 更改目标超滤量 同步监测里面的超滤量 超滤率 置换量 置换率
4462
 		DialysisStrainerId:         dialysis_strainer_id,
4480
 		DialysisStrainerId:         dialysis_strainer_id,
4463
 	}
4481
 	}
4464
 
4482
 
4483
+	if adminUserInfo.Org.Id == 10721 {
4484
+		if prescription.ModeId == 2 {
4485
+			if prescription.ReplacementTotal == 0 {
4486
+				prescription.ReplacementTotal = 15
4487
+			}
4488
+
4489
+		}
4490
+	}
4491
+
4465
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
4492
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
4466
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
4493
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
4467
 
4494
 

+ 4 - 2
controllers/new_mobile_api_controllers/dialysis_parameter_api_controller.go View File

41
 	theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
41
 	theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
42
 	if len(keywords) > 0 {
42
 	if len(keywords) > 0 {
43
 
43
 
44
-		//dialysisSchedule, err, total := service.GetDialysisParametersByKeyword(orgid, keywords, scheduleType, partitionType, page, limit, theTime.Unix())
44
+		dialysisSchedule, _, _ := service.GetDialysisParametersByKeyword(orgid, keywords, scheduleType, partitionType, page, limit, theTime.Unix())
45
 		//查询今日排班的病人
45
 		//查询今日排班的病人
46
 		patient, err := service.GetDialysisTodaySchedulePatient(orgid, theTime.Unix(), page, limit, keywords, scheduleType, partitionType)
46
 		patient, err := service.GetDialysisTodaySchedulePatient(orgid, theTime.Unix(), page, limit, keywords, scheduleType, partitionType)
47
 		var vlist []interface{}
47
 		var vlist []interface{}
58
 			elist = append(elist, dialysis)
58
 			elist = append(elist, dialysis)
59
 			if err == nil {
59
 			if err == nil {
60
 				this.ServeSuccessJSON(map[string]interface{}{
60
 				this.ServeSuccessJSON(map[string]interface{}{
61
-					//"schedule":     dialysisSchedule,
61
+					"schedule": dialysisSchedule,
62
 					//"total":        total,
62
 					//"total":        total,
63
 					"prescription": vlist,
63
 					"prescription": vlist,
64
 					"dialysbefor":  elist,
64
 					"dialysbefor":  elist,
70
 		}
70
 		}
71
 	} else {
71
 	} else {
72
 		dialysisSchedule, err, total := service.GetDialysisParameter(orgid, theTime.Unix(), scheduleType, partitionType, page, limit)
72
 		dialysisSchedule, err, total := service.GetDialysisParameter(orgid, theTime.Unix(), scheduleType, partitionType, page, limit)
73
+
74
+		fmt.Println("dialysisSchedule------------------------", dialysisSchedule)
73
 		//查询今日排班的病人
75
 		//查询今日排班的病人
74
 		patient, err := service.GetDialysisTodaySchedulePatient(orgid, theTime.Unix(), page, limit, keywords, scheduleType, partitionType)
76
 		patient, err := service.GetDialysisTodaySchedulePatient(orgid, theTime.Unix(), page, limit, keywords, scheduleType, partitionType)
75
 
77
 

+ 2 - 2
service/gobal_config_service.go View File

349
 	}
349
 	}
350
 
350
 
351
 	if manufacturerId > 0 {
351
 	if manufacturerId > 0 {
352
-		err = db.Select("x.id,x.warehousing_id,x.drug_id,x.batch_number,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,t.manufacturer,x.remark,x.ctime,x.org_id,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.storehouse_id,x.max_unit as count_unit,t.drug_type,t.drug_name,t.drug_spec,t.min_unit,t.dose,t.dose_unit,t.max_unit,t.min_number,s.creater,x.drug_code").Joins("left join xt_base_drug as t on t.id = x.drug_id and t.org_id = ? and t.status =1", orgid).Where("t.manufacturer = ?", manufacturerId).Joins("left join xt_drug_warehouse as s on s.id = x.warehousing_id and s.org_id = ? and s.status =1", orgid).Order("x.id desc").Count(&total).Offset(offset).Limit(limit).Scan(&drugInfo).Error
352
+		err = db.Select("x.id,x.warehousing_id,x.drug_id,x.batch_number,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,t.manufacturer,x.remark,x.ctime,x.org_id,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.storehouse_id,x.max_unit as count_unit,t.drug_type,t.drug_name,t.drug_spec,t.min_unit,t.dose,t.dose_unit,t.max_unit,t.min_number,s.creater,x.drug_code").Joins("left join xt_base_drug as t on t.id = x.drug_id and t.org_id = ? and t.status =1", orgid).Where("t.manufacturer = ?", manufacturerId).Joins("left join xt_drug_warehouse as s on s.id = x.warehousing_id and s.org_id = ? and s.status =1", orgid).Order("x.id desc").Count(&total).Offset(offset).Limit(limit).Group("x.id").Scan(&drugInfo).Error
353
 	} else {
353
 	} else {
354
-		err = db.Select("x.id,x.warehousing_id,x.drug_id,x.batch_number,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,t.manufacturer,x.remark,x.ctime,x.org_id,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.storehouse_id,x.max_unit as count_unit,t.drug_type,t.drug_name,t.drug_spec,t.min_unit,t.dose,t.dose_unit,t.max_unit,t.min_number,s.creater,x.drug_code").Joins("left join xt_base_drug as t on t.id = x.drug_id and t.org_id = ? and t.status =1", orgid).Joins("left join xt_drug_warehouse as s on s.id = x.warehousing_id and s.org_id = ? and s.status =1", orgid).Order("x.id desc").Count(&total).Offset(offset).Limit(limit).Scan(&drugInfo).Error
354
+		err = db.Select("x.id,x.warehousing_id,x.drug_id,x.batch_number,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,t.manufacturer,x.remark,x.ctime,x.org_id,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.storehouse_id,x.max_unit as count_unit,t.drug_type,t.drug_name,t.drug_spec,t.min_unit,t.dose,t.dose_unit,t.max_unit,t.min_number,s.creater,x.drug_code").Joins("left join xt_base_drug as t on t.id = x.drug_id and t.org_id = ? and t.status =1", orgid).Joins("left join xt_drug_warehouse as s on s.id = x.warehousing_id and s.org_id = ? and s.status =1", orgid).Order("x.id desc").Count(&total).Offset(offset).Limit(limit).Group("x.id").Scan(&drugInfo).Error
355
 	}
355
 	}
356
 
356
 
357
 	return drugInfo, total, err
357
 	return drugInfo, total, err

+ 1 - 1
service/mobile_dialysis_service.go View File

2764
 // 透析方案
2764
 // 透析方案
2765
 func GetDialysisSolution(orgID int64, patientID int64, mode_id int64) (models.DialysisSolution, error) {
2765
 func GetDialysisSolution(orgID int64, patientID int64, mode_id int64) (models.DialysisSolution, error) {
2766
 	var record models.DialysisSolution
2766
 	var record models.DialysisSolution
2767
-	err := readDb.Model(&models.DialysisSolution{}).Where("patient_id = ? and user_org_id = ? and status = 1 AND mode_id = ?", patientID, orgID, mode_id).Last(&record).Error
2767
+	err := readDb.Model(&models.DialysisSolution{}).Where("patient_id = ? and user_org_id = ? and status = 1 AND mode_id = ? and solution_status=1", patientID, orgID, mode_id).Last(&record).Error
2768
 	return record, err
2768
 	return record, err
2769
 }
2769
 }
2770
 
2770