Преглед на файлове

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

陈少旭 преди 1 година
родител
ревизия
2bb1c3eac1

+ 15 - 4
controllers/dialysis_api_controller.go Целия файл

2668
 				newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2668
 				newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2669
 				newprescribe.Status = 1
2669
 				newprescribe.Status = 1
2670
 
2670
 
2671
+				if adminUserInfo.CurrentOrgId == 10579 {
2672
+					newprescribe.Modifier = 0
2673
+				}
2671
 				err := service.AddSigleRecord(&newprescribe)
2674
 				err := service.AddSigleRecord(&newprescribe)
2672
 
2675
 
2673
 				//记录日志
2676
 				//记录日志
2743
 					newprescribe.Creater = adminUserInfo.AdminUser.Id
2746
 					newprescribe.Creater = adminUserInfo.AdminUser.Id
2744
 					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2747
 					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2745
 					newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2748
 					newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2746
-
2749
+					if adminUserInfo.CurrentOrgId == 10579 {
2750
+						newprescribe.Modifier = 0
2751
+					}
2747
 					err := service.AddSigleRecord(&newprescribe)
2752
 					err := service.AddSigleRecord(&newprescribe)
2748
 					//记录日志
2753
 					//记录日志
2749
 					byterequest, _ := json.Marshal(newprescribe)
2754
 					byterequest, _ := json.Marshal(newprescribe)
2786
 					newprescribe.Creater = adminUserInfo.AdminUser.Id
2791
 					newprescribe.Creater = adminUserInfo.AdminUser.Id
2787
 					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2792
 					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2788
 					newprescribe.Modifier = adminUserInfo.AdminUser.Id
2793
 					newprescribe.Modifier = adminUserInfo.AdminUser.Id
2789
-
2794
+					if adminUserInfo.CurrentOrgId == 10579 {
2795
+						newprescribe.Modifier = 0
2796
+					}
2790
 					err := service.AddSigleRecord(&newprescribe)
2797
 					err := service.AddSigleRecord(&newprescribe)
2791
 					//记录日志
2798
 					//记录日志
2792
 					byterequest, _ := json.Marshal(newprescribe)
2799
 					byterequest, _ := json.Marshal(newprescribe)
2975
 			newprescribe.TargetUltrafiltration = dewater_amount
2982
 			newprescribe.TargetUltrafiltration = dewater_amount
2976
 			newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2983
 			newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2977
 			newprescribe.Status = 1
2984
 			newprescribe.Status = 1
2978
-
2985
+			if adminUserInfo.CurrentOrgId == 10579 {
2986
+				newprescribe.Modifier = 0
2987
+			}
2979
 			err := service.AddSigleRecord(&newprescribe)
2988
 			err := service.AddSigleRecord(&newprescribe)
2980
 			//记录日志
2989
 			//记录日志
2981
 			byterequest, _ := json.Marshal(newprescribe)
2990
 			byterequest, _ := json.Marshal(newprescribe)
3048
 				newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
3057
 				newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
3049
 				newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
3058
 				newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
3050
 				newprescribe.Status = 1
3059
 				newprescribe.Status = 1
3051
-
3060
+				if adminUserInfo.CurrentOrgId == 10579 {
3061
+					newprescribe.Modifier = 0
3062
+				}
3052
 				err := service.AddSigleRecord(&newprescribe)
3063
 				err := service.AddSigleRecord(&newprescribe)
3053
 				//记录日志
3064
 				//记录日志
3054
 				byterequest, _ := json.Marshal(newprescribe)
3065
 				byterequest, _ := json.Marshal(newprescribe)

+ 6 - 6
controllers/his_api_controller.go Целия файл

213
 	number := count + 1
213
 	number := count + 1
214
 
214
 
215
 	//if number >= 1000 {
215
 	//if number >= 1000 {
216
-	//	zero = "0000" + strconv.FormatInt(number, 10)
216
+	//        zero = "0000" + strconv.FormatInt(number, 10)
217
 	//} else if number >= 10000 {
217
 	//} else if number >= 10000 {
218
-	//	zero = "000" + strconv.FormatInt(number, 10)
218
+	//        zero = "000" + strconv.FormatInt(number, 10)
219
 	//} else if number >= 100000 {
219
 	//} else if number >= 100000 {
220
-	//	zero = "00" + strconv.FormatInt(number, 10)
220
+	//        zero = "00" + strconv.FormatInt(number, 10)
221
 	//} else if number >= 1000000 {
221
 	//} else if number >= 1000000 {
222
-	//	zero = "0" + strconv.FormatInt(number, 10)
222
+	//        zero = "0" + strconv.FormatInt(number, 10)
223
 	//} else {
223
 	//} else {
224
 	zero = "0" + strconv.FormatInt(number, 10)
224
 	zero = "0" + strconv.FormatInt(number, 10)
225
 	//}
225
 	//}
229
 	})
229
 	})
230
 	return
230
 	return
231
 }
231
 }
232
+
232
 func (c *HisApiController) ChangeOrderDesc() {
233
 func (c *HisApiController) ChangeOrderDesc() {
233
 	id, _ := c.GetInt64("id")
234
 	id, _ := c.GetInt64("id")
234
 	desc := c.GetString("desc")
235
 	desc := c.GetString("desc")
3174
 	var adviceList []models.HisDoctorAdviceInfo
3175
 	var adviceList []models.HisDoctorAdviceInfo
3175
 	var projectList []models.HisPrescriptionProject
3176
 	var projectList []models.HisPrescriptionProject
3176
 
3177
 
3177
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 9504 {
3178
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10598 {
3178
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3179
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3179
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3180
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3180
 
3181
 
7401
 							//advice.UpdatedTime = time.Now().Unix()
7402
 							//advice.UpdatedTime = time.Now().Unix()
7402
 							advice.CreatedTime = hisAdvice.CreatedTime
7403
 							advice.CreatedTime = hisAdvice.CreatedTime
7403
 							advice.UpdatedTime = time.Now().Unix()
7404
 							advice.UpdatedTime = time.Now().Unix()
7404
-
7405
 						} else {
7405
 						} else {
7406
 							advice.CreatedTime = hisAdvice.CreatedTime
7406
 							advice.CreatedTime = hisAdvice.CreatedTime
7407
 							advice.UpdatedTime = hisAdvice.UpdatedTime
7407
 							advice.UpdatedTime = hisAdvice.UpdatedTime

+ 5 - 5
controllers/mobile_api_controllers/dialysis_api_controller.go Целия файл

3404
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
3404
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
3405
 			}
3405
 			}
3406
 
3406
 
3407
-			if adminUserInfo.Org.Id == 10597 { //adminUserInfo.Org.Id == 9538
3407
+			if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 10679 { //adminUserInfo.Org.Id == 9538
3408
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
3408
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
3409
 			}
3409
 			}
3410
 
3410
 
4443
 
4443
 
4444
 			}
4444
 			}
4445
 
4445
 
4446
-			if adminInfo.Org.Id == 10597 {
4446
+			if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10679 {
4447
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
4447
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
4448
 				record.UltrafiltrationRate = ultrafiltration_rate
4448
 				record.UltrafiltrationRate = ultrafiltration_rate
4449
 			}
4449
 			}
4519
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4519
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4520
 			}
4520
 			}
4521
 
4521
 
4522
-			if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10599 {
4522
+			if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10599 || adminInfo.Org.Id == 10679 {
4523
 				record.UltrafiltrationRate = 0
4523
 				record.UltrafiltrationRate = 0
4524
 			}
4524
 			}
4525
 			//if template.TemplateId == 47 {
4525
 			//if template.TemplateId == 47 {
4547
 		}
4547
 		}
4548
 	}
4548
 	}
4549
 
4549
 
4550
-	if adminInfo.Org.Id == 10597 {
4550
+	if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10679 {
4551
 		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4551
 		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4552
 		record.UltrafiltrationVolume = ultrafiltration_volume
4552
 		record.UltrafiltrationVolume = ultrafiltration_volume
4553
 	}
4553
 	}
5602
 			service.CreateDialysisFinish(finish)
5602
 			service.CreateDialysisFinish(finish)
5603
 		}
5603
 		}
5604
 
5604
 
5605
-		if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9671 {
5605
+		if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10164 {
5606
 			list, err := service.CreateMGroupAdviceOne(adminUserInfo.Org.Id, advices, groupNo)
5606
 			list, err := service.CreateMGroupAdviceOne(adminUserInfo.Org.Id, advices, groupNo)
5607
 			for _, item := range advices {
5607
 			for _, item := range advices {
5608
 				byterequest, _ := json.Marshal(item)
5608
 				byterequest, _ := json.Marshal(item)

+ 25 - 5
controllers/mobile_api_controllers/patient_api_controller.go Целия файл

2722
 		newprescribe.ID = dialysisPrescription.ID
2722
 		newprescribe.ID = dialysisPrescription.ID
2723
 
2723
 
2724
 		if dialysisPrescription.ID == 0 {
2724
 		if dialysisPrescription.ID == 0 {
2725
-			if adminUserInfo.Org.Id == 10340 {
2725
+			if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10679 {
2726
 				newprescribe.Sodium = 138
2726
 				newprescribe.Sodium = 138
2727
 				newprescribe.Bicarbonate = 31.1
2727
 				newprescribe.Bicarbonate = 31.1
2728
 				newprescribe.DialysateFlow = 500
2728
 				newprescribe.DialysateFlow = 500
2729
 				newprescribe.PrescribingNumber = 1
2729
 				newprescribe.PrescribingNumber = 1
2730
 
2730
 
2731
 			}
2731
 			}
2732
+			if adminUserInfo.Org.Id == 10579 {
2733
+				newprescribe.Modifier = 0
2734
+			}
2732
 			err := service.AddSigleRecord(&newprescribe)
2735
 			err := service.AddSigleRecord(&newprescribe)
2733
 			//记录日志
2736
 			//记录日志
2734
 			byterequest, _ := json.Marshal(newprescribe)
2737
 			byterequest, _ := json.Marshal(newprescribe)
2887
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
2890
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
2888
 			newprescribe.ID = dialysisPrescription.ID
2891
 			newprescribe.ID = dialysisPrescription.ID
2889
 			if dialysisPrescription.ID == 0 {
2892
 			if dialysisPrescription.ID == 0 {
2890
-				if adminUserInfo.Org.Id == 10340 {
2893
+				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10679 {
2891
 					newprescribe.Sodium = 138
2894
 					newprescribe.Sodium = 138
2892
 					newprescribe.Bicarbonate = 31.1
2895
 					newprescribe.Bicarbonate = 31.1
2893
 					newprescribe.DialysateFlow = 500
2896
 					newprescribe.DialysateFlow = 500
2894
 				}
2897
 				}
2898
+				if adminUserInfo.Org.Id == 10579 {
2899
+					newprescribe.Modifier = 0
2900
+				}
2895
 				err := service.AddSigleRecord(&newprescribe)
2901
 				err := service.AddSigleRecord(&newprescribe)
2896
 
2902
 
2897
 				//记录日志
2903
 				//记录日志
2937
 				appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
2943
 				appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
2938
 				//
2944
 				//
2939
 				if appRole.UserType == 2 || appRole.UserType == 1 {
2945
 				if appRole.UserType == 2 || appRole.UserType == 1 {
2940
-					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2946
+					if adminUserInfo.Org.Id == 10579 {
2947
+						newprescribe.Modifier = 0
2948
+					} else {
2949
+						newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2950
+					}
2951
+
2941
 					if adminUserInfo.Org.Id == 9882 {
2952
 					if adminUserInfo.Org.Id == 9882 {
2942
 						newprescribe.Creater = adminUserInfo.AdminUser.Id
2953
 						newprescribe.Creater = adminUserInfo.AdminUser.Id
2943
 					}
2954
 					}
3042
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
3053
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
3043
 			newprescribe.ID = dialysisPrescription.ID
3054
 			newprescribe.ID = dialysisPrescription.ID
3044
 			if dialysisPrescription.ID == 0 {
3055
 			if dialysisPrescription.ID == 0 {
3045
-				if adminUserInfo.Org.Id == 10340 {
3056
+				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10679 {
3046
 					newprescribe.Sodium = 138
3057
 					newprescribe.Sodium = 138
3047
 					newprescribe.Bicarbonate = 31.1
3058
 					newprescribe.Bicarbonate = 31.1
3048
 					newprescribe.DialysateFlow = 500
3059
 					newprescribe.DialysateFlow = 500
3049
 				}
3060
 				}
3061
+				if adminUserInfo.Org.Id == 10579 {
3062
+					newprescribe.Modifier = 0
3063
+				}
3050
 				err := service.AddSigleRecord(&newprescribe)
3064
 				err := service.AddSigleRecord(&newprescribe)
3051
 				//记录日志
3065
 				//记录日志
3052
 				byterequest, _ := json.Marshal(newprescribe)
3066
 				byterequest, _ := json.Marshal(newprescribe)
3162
 			}
3176
 			}
3163
 
3177
 
3164
 			if dialysisPrescription.ID == 0 {
3178
 			if dialysisPrescription.ID == 0 {
3165
-				if adminUserInfo.Org.Id == 10340 {
3179
+				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10679 {
3166
 					newprescribe.Sodium = 138
3180
 					newprescribe.Sodium = 138
3167
 					newprescribe.Bicarbonate = 31.1
3181
 					newprescribe.Bicarbonate = 31.1
3168
 					newprescribe.DialysateFlow = 500
3182
 					newprescribe.DialysateFlow = 500
3169
 				}
3183
 				}
3184
+				if adminUserInfo.Org.Id == 10579 {
3185
+					newprescribe.Modifier = 0
3186
+				}
3170
 				err := service.AddSigleRecord(&newprescribe)
3187
 				err := service.AddSigleRecord(&newprescribe)
3171
 
3188
 
3172
 				//获取key,清空redis
3189
 				//获取key,清空redis
3206
 						newprescribe.Creater = adminUserInfo.AdminUser.Id
3223
 						newprescribe.Creater = adminUserInfo.AdminUser.Id
3207
 					}
3224
 					}
3208
 				}
3225
 				}
3226
+				if adminUserInfo.Org.Id == 10579 {
3227
+					newprescribe.Modifier = 0
3228
+				}
3209
 				err := service.UpDateDialysisPrescription(&newprescribe)
3229
 				err := service.UpDateDialysisPrescription(&newprescribe)
3210
 
3230
 
3211
 				//记录日志
3231
 				//记录日志