Kaynağa Gözat

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

陈少旭 1 hafta önce
ebeveyn
işleme
5e775547ea

BIN
XT_New.exe Dosyayı Görüntüle


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

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

+ 27 - 0
controllers/dialysis_api_controller.go Dosyayı Görüntüle

@@ -530,6 +530,15 @@ func (c *DialysisApiController) PostPrescription() {
530 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 543
 	if adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 10340 {
535 544
 		if prescribing_number == 0 {
@@ -882,6 +891,15 @@ func (c *DialysisApiController) PostPrescription() {
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 903
 		updateErr := service.UpDateDialysisPrescription(&prescription)
886 904
 
887 905
 		if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
@@ -1566,6 +1584,15 @@ func (c *DialysisApiController) PostSoulution() {
1566 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 1596
 	err := service.SavePrescriptionAndCreateSolution(&solution, &prescription)
1570 1597
 
1571 1598
 	if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {

+ 2 - 1
controllers/gobal_config_api_controller.go Dosyayı Görüntüle

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

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

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

+ 27 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go Dosyayı Görüntüle

@@ -2264,6 +2264,15 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
2264 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,6 +2648,15 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
2639 2648
 
2640 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 2660
 		service.UpDateDialysisPrescription(&prescription)
2643 2661
 
2644 2662
 		//溪康 更改目标超滤量 同步监测里面的超滤量 超滤率 置换量 置换率
@@ -4462,6 +4480,15 @@ func (c *DialysisAPIController) PostSolution() {
4462 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 4492
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
4466 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 Dosyayı Görüntüle

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

+ 2 - 2
service/gobal_config_service.go Dosyayı Görüntüle

@@ -349,9 +349,9 @@ func GetDrugInOrderDetail(startime int64, endtime int64, orgid int64, orderType
349 349
 	}
350 350
 
351 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 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 357
 	return drugInfo, total, err

+ 1 - 1
service/mobile_dialysis_service.go Dosyayı Görüntüle

@@ -2764,7 +2764,7 @@ func GetDialysisPrescribeOne(orgID int64, patientID int64, recordDate int64) (mo
2764 2764
 // 透析方案
2765 2765
 func GetDialysisSolution(orgID int64, patientID int64, mode_id int64) (models.DialysisSolution, error) {
2766 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 2768
 	return record, err
2769 2769
 }
2770 2770