28169 6 dagen geleden
bovenliggende
commit
54d163e40d

+ 4 - 4
controllers/base_api_controller.go Bestand weergeven

@@ -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 = 10217 //机构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 = 10217 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 18723 //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 = 10217 //机构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 = 10217 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 18723 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 30 - 9
controllers/dialysis_api_controller.go Bestand weergeven

@@ -722,7 +722,7 @@ func (c *DialysisApiController) PostPrescription() {
722 722
 
723 723
 		err := service.AddSigleRecord(&prescription)
724 724
 
725
-		if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
725
+		if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 9478 {
726 726
 
727 727
 			monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
728 728
 
@@ -733,8 +733,15 @@ func (c *DialysisApiController) PostPrescription() {
733 733
 				ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
734 734
 				var replacement_rate float64
735 735
 
736
-				//乘10 除10是为了保留一位小数
737
-				replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
736
+				if adminUserInfo.CurrentOrgId == 10721 {
737
+					//乘10 除10是为了保留一位小数
738
+					replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
739
+				}
740
+
741
+				if adminUserInfo.CurrentOrgId == 9478 {
742
+					//乘10 除10是为了保留一位小数
743
+					replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
744
+				}
738 745
 
739 746
 				var firstOpeateTime = monitorList[0].OperateTime
740 747
 				for _, item := range monitorList {
@@ -915,8 +922,15 @@ func (c *DialysisApiController) PostPrescription() {
915 922
 				ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
916 923
 				var replacement_rate float64
917 924
 
918
-				//乘10 除10是为了保留一位小数
919
-				replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
925
+				if adminUserInfo.CurrentOrgId == 10721 {
926
+					//乘10 除10是为了保留一位小数
927
+					replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
928
+				}
929
+
930
+				if adminUserInfo.CurrentOrgId == 9478 {
931
+					//乘10 除10是为了保留一位小数
932
+					replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
933
+				}
920 934
 
921 935
 				var firstOpeateTime = monitorList[0].OperateTime
922 936
 				for _, item := range monitorList {
@@ -1609,7 +1623,7 @@ func (c *DialysisApiController) PostSoulution() {
1609 1623
 
1610 1624
 	err := service.SavePrescriptionAndCreateSolution(&solution, &prescription)
1611 1625
 
1612
-	if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
1626
+	if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 9478 {
1613 1627
 
1614 1628
 		monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
1615 1629
 
@@ -1620,8 +1634,15 @@ func (c *DialysisApiController) PostSoulution() {
1620 1634
 			ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
1621 1635
 			var replacement_rate float64
1622 1636
 
1623
-			//乘10 除10是为了保留一位小数
1624
-			replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
1637
+			if adminUserInfo.CurrentOrgId == 10721 {
1638
+				//乘10 除10是为了保留一位小数
1639
+				replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
1640
+			}
1641
+
1642
+			if adminUserInfo.CurrentOrgId == 9478 {
1643
+				//乘10 除10是为了保留一位小数
1644
+				replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
1645
+			}
1625 1646
 
1626 1647
 			var firstOpeateTime = monitorList[0].OperateTime
1627 1648
 			for _, item := range monitorList {
@@ -4845,7 +4866,7 @@ func (c *DialysisApiController) GetDialysisOrder() {
4845 4866
 	//获取上次的透后体重
4846 4867
 	//	assessmentAfterDislysis, _ := service.MobileGetLastTimeAssessmentAfterDislysis(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4847 4868
 	assessmentAfterDislysis, _ := service.MobileGetLast(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4848
-
4869
+	fmt.Println("assessmentAfterDislysis--------------------------", assessmentAfterDislysis)
4849 4870
 	//获取透析次数
4850 4871
 	_, total, err := service.GetTotalDialysisCout(adminUserInfo.CurrentOrgId, patientInfo.ID)
4851 4872
 

+ 1 - 1
controllers/his_api_controller.go Bestand weergeven

@@ -3494,7 +3494,7 @@ func (c *HisApiController) CreateHisPrescription() {
3494 3494
 	var adviceList []models.HisDoctorAdviceInfo
3495 3495
 	var projectList []models.HisPrescriptionProject
3496 3496
 
3497
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10635 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 || adminInfo.CurrentOrgId == 10721 || adminInfo.CurrentOrgId == 10726 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10571 || adminInfo.CurrentOrgId == 10724 || adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10653 || adminInfo.CurrentOrgId == 10567 || adminInfo.CurrentOrgId == 10751 || adminInfo.CurrentOrgId == 10752 || adminInfo.CurrentOrgId == 9478 {
3497
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10635 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 || adminInfo.CurrentOrgId == 10721 || adminInfo.CurrentOrgId == 10726 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10571 || adminInfo.CurrentOrgId == 10724 || adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10653 || adminInfo.CurrentOrgId == 10567 || adminInfo.CurrentOrgId == 10751 || adminInfo.CurrentOrgId == 10752 || adminInfo.CurrentOrgId == 9478 || adminInfo.CurrentOrgId == 10567 {
3498 3498
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3499 3499
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3500 3500
 

+ 30 - 8
controllers/mobile_api_controllers/dialysis_api_controller.go Bestand weergeven

@@ -149,6 +149,7 @@ func (this *DialysisAPIController) Scheduals() {
149 149
 					// 医嘱信息
150 150
 					scheduals[key].Advices = make([]models.VMDoctorAdviceForList, 0)
151 151
 					for _, advice := range advices {
152
+
152 153
 						if item.PatientId == advice.PatientId {
153 154
 							scheduals[key].Advices = append(scheduals[key].Advices, advice)
154 155
 						}
@@ -2401,7 +2402,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
2401 2402
 		err := service.AddSigleRecord(&prescription)
2402 2403
 
2403 2404
 		//溪康 更改目标超滤量 同步监测里面的超滤量 超滤率 置换量 置换率
2404
-		if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 {
2405
+		if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9478 {
2405 2406
 
2406 2407
 			monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
2407 2408
 
@@ -2412,8 +2413,15 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
2412 2413
 				ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
2413 2414
 				var replacement_rate float64
2414 2415
 
2415
-				//乘10 除10是为了保留一位小数
2416
-				replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
2416
+				if adminUserInfo.Org.Id == 10721 {
2417
+					//乘10 除10是为了保留一位小数
2418
+					replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
2419
+				}
2420
+
2421
+				if adminUserInfo.Org.Id == 9478 {
2422
+					//乘10 除10是为了保留一位小数
2423
+					replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
2424
+				}
2417 2425
 
2418 2426
 				var firstOpeateTime = monitorList[0].OperateTime
2419 2427
 				for _, item := range monitorList {
@@ -2710,8 +2718,15 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
2710 2718
 				ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
2711 2719
 				var replacement_rate float64
2712 2720
 
2713
-				//乘10 除10是为了保留一位小数
2714
-				replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
2721
+				if adminUserInfo.Org.Id == 10721 {
2722
+					//乘10 除10是为了保留一位小数
2723
+					replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
2724
+				}
2725
+
2726
+				if adminUserInfo.Org.Id == 9478 {
2727
+					//乘10 除10是为了保留一位小数
2728
+					replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
2729
+				}
2715 2730
 
2716 2731
 				var firstOpeateTime = monitorList[0].OperateTime
2717 2732
 				for _, item := range monitorList {
@@ -5096,7 +5111,7 @@ func (c *DialysisAPIController) PostSolution() {
5096 5111
 
5097 5112
 	service.SavePrescriptionAndCreateSolution(&solution, &prescription)
5098 5113
 
5099
-	if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 {
5114
+	if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9478 {
5100 5115
 
5101 5116
 		monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
5102 5117
 
@@ -5107,8 +5122,15 @@ func (c *DialysisAPIController) PostSolution() {
5107 5122
 			ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
5108 5123
 			var replacement_rate float64
5109 5124
 
5110
-			//乘10 除10是为了保留一位小数
5111
-			replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
5125
+			if adminUserInfo.Org.Id == 10721 {
5126
+				//乘10 除10是为了保留一位小数
5127
+				replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
5128
+			}
5129
+
5130
+			if adminUserInfo.Org.Id == 9478 {
5131
+				//乘10 除10是为了保留一位小数
5132
+				replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
5133
+			}
5112 5134
 
5113 5135
 			var firstOpeateTime = monitorList[0].OperateTime
5114 5136
 			for _, item := range monitorList {

+ 1 - 1
controllers/mobile_api_controllers/patient_api_controller.go Bestand weergeven

@@ -3186,7 +3186,7 @@ func (c *PatientApiController) ModifyExecDoctorAdvice() {
3186 3186
 		}
3187 3187
 		service.ModifyHisPrescriptionProject(&project, ids)
3188 3188
 
3189
-		if adminUserInfo.Org.Id == 10644 {
3189
+		if adminUserInfo.Org.Id == 10644 || adminUserInfo.Org.Id == 9478 {
3190 3190
 			projectList, _ := service.GetHisPrescriptionProjectByIds(ids)
3191 3191
 			if len(projectList) > 0 {
3192 3192
 				for _, item := range projectList {

+ 8 - 0
controllers/patient_api_controller.go Bestand weergeven

@@ -4143,8 +4143,10 @@ func (c *PatientApiController) CheckDoctorAdvice() {
4143 4143
 }
4144 4144
 
4145 4145
 func (c *PatientApiController) UpdateDoctorAdvice() {
4146
+
4146 4147
 	patient, _ := c.GetInt64("patient", 0)
4147 4148
 	id, _ := c.GetInt64("id", 0)
4149
+
4148 4150
 	if id <= 0 || patient <= 0 {
4149 4151
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
4150 4152
 		return
@@ -4153,6 +4155,7 @@ func (c *PatientApiController) UpdateDoctorAdvice() {
4153 4155
 	adminUserInfo := c.GetAdminUserInfo()
4154 4156
 
4155 4157
 	advice, _ := service.FindDoctorAdvice(adminUserInfo.CurrentOrgId, id)
4158
+
4156 4159
 	if advice.ID == 0 || advice.PatientId != patient {
4157 4160
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDoctorAdviceNotExist)
4158 4161
 		return
@@ -4882,6 +4885,8 @@ func (c *PatientApiController) ProEducation() {
4882 4885
 }
4883 4886
 
4884 4887
 func adviceFormData(advice *models.DoctorAdvice, data []byte, action string) (code int) {
4888
+
4889
+	fmt.Println("actiong===============", action)
4885 4890
 	dataBody := make(map[string]interface{}, 0)
4886 4891
 	err := json.Unmarshal(data, &dataBody)
4887 4892
 	if err != nil {
@@ -5006,6 +5011,7 @@ func adviceFormData(advice *models.DoctorAdvice, data []byte, action string) (co
5006 5011
 		return
5007 5012
 	}
5008 5013
 	adviceName, _ := dataBody["advice_name"].(string)
5014
+
5009 5015
 	if len(adviceName) == 0 {
5010 5016
 		utils.ErrorLog("len(advice_name) == 0")
5011 5017
 		code = enums.ErrorCodeParamWrong
@@ -5093,6 +5099,8 @@ func adviceFormData(advice *models.DoctorAdvice, data []byte, action string) (co
5093 5099
 
5094 5100
 	if dataBody["push_start_time"] != nil && reflect.TypeOf(dataBody["push_start_time"]).String() == "string" {
5095 5101
 		push_start_time, _ := dataBody["push_start_time"].(string)
5102
+
5103
+		fmt.Println("push_start_time===========", push_start_time)
5096 5104
 		var startTime int64
5097 5105
 		if len(push_start_time) > 0 {
5098 5106
 			theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", push_start_time+" 00:00:00", loc)

+ 4 - 2
service/warhouse_service.go Bestand weergeven

@@ -8852,12 +8852,14 @@ func ConsumableNewHisPrescriptionDelivery(orgID int64, patient_id int64, record_
8852 8852
 			sum_count += item.StockCount
8853 8853
 		}
8854 8854
 
8855
+		var now_time = time.Now().Unix() + 1
8856
+
8855 8857
 		OutInfo := &models.WarehouseOutInfo{
8856 8858
 			WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
8857 8859
 			WarehouseOutId:          warehouseOut.ID,
8858 8860
 			WarehouseInfotId:        warehouse.ID,
8859 8861
 			Status:                  1,
8860
-			Ctime:                   time.Now().Unix(),
8862
+			Ctime:                   now_time,
8861 8863
 			Remark:                  warehouse.Remark,
8862 8864
 			OrgId:                   orgID,
8863 8865
 			Type:                    1,
@@ -8907,7 +8909,7 @@ func ConsumableNewHisPrescriptionDelivery(orgID int64, patient_id int64, record_
8907 8909
 			Creator:                 creator,
8908 8910
 			UpdateCreator:           0,
8909 8911
 			Status:                  1,
8910
-			Ctime:                   time.Now().Unix(),
8912
+			Ctime:                   now_time,
8911 8913
 			Mtime:                   0,
8912 8914
 			Price:                   warehouse.PackingPrice, //零售价
8913 8915
 			WarehousingDetailId:     warehouse.ID,