瀏覽代碼

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

XMLWAN 4 年之前
父節點
當前提交
d0ca7fdf00

+ 3 - 0
.idea/misc.xml 查看文件

@@ -3,6 +3,9 @@
3 3
   <component name="JavaScriptSettings">
4 4
     <option name="languageLevel" value="ES6" />
5 5
   </component>
6
+  <component name="RustProjectSettings">
7
+    <option name="toolchainHomeDirectory" value="$USER_HOME$/.cargo/bin" />
8
+  </component>
6 9
   <component name="SvnBranchConfigurationManager">
7 10
     <option name="myConfigurationMap">
8 11
       <map>

+ 3 - 3
conf/app.conf 查看文件

@@ -1,11 +1,11 @@
1 1
 appname = 血透
2
-httpport = 9529
3
-runmode = dev
2
+httpport = 9531
3
+runmode = prod
4 4
 
5 5
 #
6 6
 copyrequestbody = true
7 7
 sessionon = true
8
-sessiongcmaxlifetime = 64800
8
+#sessiongcmaxlifetime = 64800
9 9
 
10 10
 tokencookiemaxlifetime = 7200
11 11
 enablexsrf = false

+ 6 - 6
controllers/base_api_controller.go 查看文件

@@ -81,7 +81,7 @@ func (this *BaseAuthAPIController) Prepare() {
81 81
 		userAdmin.ModifyTime = 1530786071
82 82
 		var subscibe models.ServeSubscibe
83 83
 		subscibe.ID = 1
84
-		subscibe.OrgId = 9919
84
+		subscibe.OrgId = 3877
85 85
 		subscibe.PeriodStart = 1538035409
86 86
 		subscibe.PeriodEnd = 1569571409
87 87
 		subscibe.State = 1
@@ -91,14 +91,14 @@ func (this *BaseAuthAPIController) Prepare() {
91 91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
92 92
 		subscibes[4] = &subscibe
93 93
 		var adminUserInfo service.AdminUserInfo
94
-		adminUserInfo.CurrentOrgId = 9919
94
+		adminUserInfo.CurrentOrgId = 3877
95 95
 		adminUserInfo.CurrentAppId = 4
96 96
 		adminUserInfo.AdminUser = &userAdmin
97 97
 		adminUserInfo.Subscibes = subscibes
98 98
 		this.SetSession("admin_user_info", &adminUserInfo)
99 99
 
100
-		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
101
-		//this.StopRun()
100
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
101
+		this.StopRun()
102 102
 
103 103
 	}
104 104
 
@@ -327,7 +327,7 @@ func (this *BaseServeAPIController) Prepare() {
327 327
 		userAdmin.ModifyTime = 1530786071
328 328
 		var subscibe models.ServeSubscibe
329 329
 		subscibe.ID = 1
330
-		subscibe.OrgId = 9919
330
+		subscibe.OrgId = 3877
331 331
 		subscibe.PeriodStart = 1538035409
332 332
 		subscibe.PeriodEnd = 1569571409
333 333
 		subscibe.State = 1
@@ -337,7 +337,7 @@ func (this *BaseServeAPIController) Prepare() {
337 337
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
338 338
 		subscibes[4] = &subscibe
339 339
 		var adminUserInfo service.AdminUserInfo
340
-		adminUserInfo.CurrentOrgId = 9919
340
+		adminUserInfo.CurrentOrgId = 3877
341 341
 		adminUserInfo.CurrentAppId = 4
342 342
 		adminUserInfo.AdminUser = &userAdmin
343 343
 		adminUserInfo.Subscibes = subscibes

+ 10 - 10
controllers/dialysis_api_controller.go 查看文件

@@ -327,11 +327,11 @@ func (c *DialysisApiController) PostPrescription() {
327 327
 		PreImpulse:                 preImpules,
328 328
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
329 329
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
330
-		Blood:                      blood,
331
-		DialysisDialyszers:         dialysis_dialyszers,
332
-		DialysisIrrigation:         dialysis_irrigation,
333
-		AntioxidantCommodityName:   antioxidant_commodity_name,
334
-		DisplaceSpeed:              displace_speed,
330
+		Blood:                    blood,
331
+		DialysisDialyszers:       dialysis_dialyszers,
332
+		DialysisIrrigation:       dialysis_irrigation,
333
+		AntioxidantCommodityName: antioxidant_commodity_name,
334
+		DisplaceSpeed:            displace_speed,
335 335
 	}
336 336
 
337 337
 	//查询最近透析准备表里是否存在 透析器 灌流器
@@ -656,11 +656,11 @@ func (c *DialysisApiController) PostSoulution() {
656 656
 
657 657
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
658 658
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
659
-		Blood:                     blood,
660
-		DialysisIrrigation:        dialysis_irrigation,
661
-		DialysisDialyszers:        dialysis_dialyszers,
662
-		AntioxidantCommodityName:  antioxidant_commodity_name,
663
-		DisplaceSpeed:             displace_speed,
659
+		Blood:                    blood,
660
+		DialysisIrrigation:       dialysis_irrigation,
661
+		DialysisDialyszers:       dialysis_dialyszers,
662
+		AntioxidantCommodityName: antioxidant_commodity_name,
663
+		DisplaceSpeed:            displace_speed,
664 664
 	}
665 665
 
666 666
 	//查询最近透析准备表里是否存在 透析器 灌流器

+ 22 - 0
controllers/his_api_controller.go 查看文件

@@ -78,6 +78,8 @@ func HisManagerApiRegistRouters() {
78 78
 	beego.Router("/api/orderdetail/get", &HisApiController{}, "get:GetAllOrderDetail")
79 79
 	beego.Router("/api/orderdetaicollect/get", &HisApiController{}, "get:GetAllOrderDetailCollect")
80 80
 
81
+	beego.Router("/api/cost/compare", &HisApiController{}, "get:GetMedicalInsuranceCostCompareList")
82
+
81 83
 }
82 84
 
83 85
 func (c *HisApiController) Sscard() {
@@ -2731,3 +2733,23 @@ func (c *HisApiController) GetAllOrderDetailCollect() {
2731 2733
 	})
2732 2734
 	return
2733 2735
 }
2736
+
2737
+func (c *HisApiController) GetMedicalInsuranceCostCompareList() {
2738
+	page, _ := c.GetInt64("page")
2739
+	limit, _ := c.GetInt64("limit")
2740
+	keywords := c.GetString("keywords")
2741
+
2742
+	if page <= 0 {
2743
+		page = 1
2744
+	}
2745
+	if limit <= 0 {
2746
+		limit = 10
2747
+	}
2748
+	list, total, _ := service.GetMedicalInsuranceCostCompareList(c.GetAdminUserInfo().CurrentOrgId, page, limit, keywords)
2749
+	c.ServeSuccessJSON(map[string]interface{}{
2750
+		"total": total,
2751
+		"list":  list,
2752
+	})
2753
+	return
2754
+
2755
+}

+ 19 - 19
controllers/his_project_api_controller.go 查看文件

@@ -826,25 +826,25 @@ func (this *HisProjectApiController) SaveHisPatient() {
826 826
 			IsNeedCostOfProduction: cost_checked,
827 827
 			TreatmentCost:          medicalExpense_float,
828 828
 			MedicalInsuranceNumber: medicalinsurancecard,
829
-			Name:                   name,
830
-			Age:                    age,
831
-			Number:                 str,
832
-			RegisterType:           register,
833
-			RegisterCost:           registrationfees_float,
834
-			BalanceAccountsType:    settlementValue,
835
-			Gender:                 sex,
836
-			Total:                  totals_float,
837
-			UserOrgId:              orgId,
838
-			Status:                 1,
839
-			RecordDate:             nowtime,
840
-			IsReturn:               1,
841
-			Ctime:                  time.Now().Unix(),
842
-			Phone:                  phone,
843
-			SocialType:             social_type,
844
-			IdCardType:             id_card_type,
845
-			Diagnosis:              diagnosis_id,
846
-			PType:                  reg_type,
847
-			SickType:               sick_type,
829
+			Name:                name,
830
+			Age:                 age,
831
+			Number:              str,
832
+			RegisterType:        register,
833
+			RegisterCost:        registrationfees_float,
834
+			BalanceAccountsType: settlementValue,
835
+			Gender:              sex,
836
+			Total:               totals_float,
837
+			UserOrgId:           orgId,
838
+			Status:              1,
839
+			RecordDate:          nowtime,
840
+			IsReturn:            1,
841
+			Ctime:               time.Now().Unix(),
842
+			Phone:               phone,
843
+			SocialType:          social_type,
844
+			IdCardType:          id_card_type,
845
+			Diagnosis:           diagnosis_id,
846
+			PType:               reg_type,
847
+			SickType:            sick_type,
848 848
 		}
849 849
 		service.CreateHisPatient(&hisPatient)
850 850
 		this.ServeSuccessJSON(map[string]interface{}{

+ 92 - 92
controllers/manage_api_controller.go 查看文件

@@ -1192,35 +1192,35 @@ func (this *MachineApiController) SaveInformation() {
1192 1192
 			Date:  startdate,
1193 1193
 			Class: classtype,
1194 1194
 			//	Zone:                  zone,
1195
-			BedNumber:             bednumber,
1196
-			PatientId:             patient_time,
1197
-			Contagion:             contagion,
1198
-			DialysisMode:          dialysis_mode,
1199
-			StartTime:             startDate.Unix(),
1200
-			EndTime:               endDate.Unix(),
1201
-			DialysisHour:          dialysis_time,
1202
-			Hyperfiltratio:        hyperfiletration,
1203
-			WeightLoss:            weight_loss,
1204
-			WarningValue:          warining_value,
1205
-			UserTotal:             user_total,
1206
-			Move:                  run,
1207
-			FailureStage:          failure_stage,
1208
-			FaultDescription:      falult_desciription,
1209
-			CodeInformation:       code_information,
1210
-			DisinfectantType:      disinfectant_type,
1211
-			DisinfectType:         disinfect_type,
1212
-			Disinfection:          disinfection,
1213
-			MachineRun:            machine_run,
1214
-			FluidPath:             fluid_path,
1215
-			Disinfectant:          disinfectant,
1216
-			DisinfectionStatus:    disinfection_status,
1217
-			DisinfectionResidue:   disinfection_residue,
1218
-			LongTime:              longtime,
1219
-			DisinfecStartime:      start_Date.Unix(),
1220
-			DisinfecEndtime:       end_Date.Unix(),
1221
-			DialysisChecked:       dialysis_checked,
1222
-			DialysisName:          dialysis_name,
1223
-			Norms:                 norms,
1195
+			BedNumber:           bednumber,
1196
+			PatientId:           patient_time,
1197
+			Contagion:           contagion,
1198
+			DialysisMode:        dialysis_mode,
1199
+			StartTime:           startDate.Unix(),
1200
+			EndTime:             endDate.Unix(),
1201
+			DialysisHour:        dialysis_time,
1202
+			Hyperfiltratio:      hyperfiletration,
1203
+			WeightLoss:          weight_loss,
1204
+			WarningValue:        warining_value,
1205
+			UserTotal:           user_total,
1206
+			Move:                run,
1207
+			FailureStage:        failure_stage,
1208
+			FaultDescription:    falult_desciription,
1209
+			CodeInformation:     code_information,
1210
+			DisinfectantType:    disinfectant_type,
1211
+			DisinfectType:       disinfect_type,
1212
+			Disinfection:        disinfection,
1213
+			MachineRun:          machine_run,
1214
+			FluidPath:           fluid_path,
1215
+			Disinfectant:        disinfectant,
1216
+			DisinfectionStatus:  disinfection_status,
1217
+			DisinfectionResidue: disinfection_residue,
1218
+			LongTime:            longtime,
1219
+			DisinfecStartime:    start_Date.Unix(),
1220
+			DisinfecEndtime:     end_Date.Unix(),
1221
+			DialysisChecked:     dialysis_checked,
1222
+			DialysisName:        dialysis_name,
1223
+			Norms:               norms,
1224 1224
 			DialysisConcentration: dialysis_concentration,
1225 1225
 			GermChecked:           germ_checked,
1226 1226
 			GermName:              germ_name,
@@ -1241,38 +1241,38 @@ func (this *MachineApiController) SaveInformation() {
1241 1241
 		})
1242 1242
 	} else if errinfor == nil {
1243 1243
 		infor := models.DeviceInformation{
1244
-			Date:                  startdate,
1245
-			Class:                 classtype,
1246
-			Zone:                  zone,
1247
-			BedNumber:             bednumber,
1248
-			PatientId:             patient_time,
1249
-			Contagion:             contagion,
1250
-			DialysisMode:          dialysis_mode,
1251
-			StartTime:             startDate.Unix(),
1252
-			EndTime:               endDate.Unix(),
1253
-			DialysisHour:          dialysis_time,
1254
-			Hyperfiltratio:        hyperfiletration,
1255
-			WeightLoss:            weight_loss,
1256
-			WarningValue:          warining_value,
1257
-			UserTotal:             user_total,
1258
-			Move:                  run,
1259
-			FailureStage:          failure_stage,
1260
-			FaultDescription:      falult_desciription,
1261
-			CodeInformation:       code_information,
1262
-			DisinfectantType:      disinfectant_type,
1263
-			DisinfectType:         disinfect_type,
1264
-			Disinfection:          disinfection,
1265
-			MachineRun:            machine_run,
1266
-			FluidPath:             fluid_path,
1267
-			Disinfectant:          disinfectant,
1268
-			DisinfectionStatus:    disinfection_status,
1269
-			DisinfectionResidue:   disinfection_residue,
1270
-			LongTime:              longtime,
1271
-			DisinfecStartime:      start_Date.Unix(),
1272
-			DisinfecEndtime:       end_Date.Unix(),
1273
-			DialysisChecked:       dialysis_checked,
1274
-			DialysisName:          dialysis_name,
1275
-			Norms:                 norms,
1244
+			Date:                startdate,
1245
+			Class:               classtype,
1246
+			Zone:                zone,
1247
+			BedNumber:           bednumber,
1248
+			PatientId:           patient_time,
1249
+			Contagion:           contagion,
1250
+			DialysisMode:        dialysis_mode,
1251
+			StartTime:           startDate.Unix(),
1252
+			EndTime:             endDate.Unix(),
1253
+			DialysisHour:        dialysis_time,
1254
+			Hyperfiltratio:      hyperfiletration,
1255
+			WeightLoss:          weight_loss,
1256
+			WarningValue:        warining_value,
1257
+			UserTotal:           user_total,
1258
+			Move:                run,
1259
+			FailureStage:        failure_stage,
1260
+			FaultDescription:    falult_desciription,
1261
+			CodeInformation:     code_information,
1262
+			DisinfectantType:    disinfectant_type,
1263
+			DisinfectType:       disinfect_type,
1264
+			Disinfection:        disinfection,
1265
+			MachineRun:          machine_run,
1266
+			FluidPath:           fluid_path,
1267
+			Disinfectant:        disinfectant,
1268
+			DisinfectionStatus:  disinfection_status,
1269
+			DisinfectionResidue: disinfection_residue,
1270
+			LongTime:            longtime,
1271
+			DisinfecStartime:    start_Date.Unix(),
1272
+			DisinfecEndtime:     end_Date.Unix(),
1273
+			DialysisChecked:     dialysis_checked,
1274
+			DialysisName:        dialysis_name,
1275
+			Norms:               norms,
1276 1276
 			DialysisConcentration: dialysis_concentration,
1277 1277
 			GermChecked:           germ_checked,
1278 1278
 			GermName:              germ_name,
@@ -2488,37 +2488,37 @@ func (this *MachineApiController) UpdateForm() {
2488 2488
 	err = service.UpdatedZoneID(bednumber, orgid, &deviceNumber)
2489 2489
 	fmt.Println("更新区号失败", err)
2490 2490
 	information := models.DeviceInformation{
2491
-		Date:                  startdate,
2492
-		Class:                 classtype,
2493
-		Zone:                  zone,
2494
-		BedNumber:             bednumber,
2495
-		Contagion:             contagion,
2496
-		DialysisMode:          dialysis_mode,
2497
-		StartTime:             startDate.Unix(),
2498
-		EndTime:               endDate.Unix(),
2499
-		DialysisHour:          dialysis_time,
2500
-		Hyperfiltratio:        hyperfiletration,
2501
-		WeightLoss:            weight_loss,
2502
-		WarningValue:          warining_value,
2503
-		UserTotal:             user_total,
2504
-		Move:                  run,
2505
-		FailureStage:          failure_stage,
2506
-		FaultDescription:      falult_desciription,
2507
-		CodeInformation:       code_information,
2508
-		DisinfectantType:      disinfectant_type,
2509
-		DisinfectType:         disinfect_type,
2510
-		Disinfection:          disinfection,
2511
-		MachineRun:            machine_run,
2512
-		FluidPath:             fluid_path,
2513
-		Disinfectant:          disinfectant,
2514
-		DisinfectionStatus:    disinfection_status,
2515
-		DisinfectionResidue:   disinfection_residue,
2516
-		LongTime:              longtime,
2517
-		DisinfecStartime:      distartime,
2518
-		DisinfecEndtime:       diendtime,
2519
-		DialysisChecked:       dialysis_checked,
2520
-		DialysisName:          dialysis_name,
2521
-		Norms:                 norms,
2491
+		Date:                startdate,
2492
+		Class:               classtype,
2493
+		Zone:                zone,
2494
+		BedNumber:           bednumber,
2495
+		Contagion:           contagion,
2496
+		DialysisMode:        dialysis_mode,
2497
+		StartTime:           startDate.Unix(),
2498
+		EndTime:             endDate.Unix(),
2499
+		DialysisHour:        dialysis_time,
2500
+		Hyperfiltratio:      hyperfiletration,
2501
+		WeightLoss:          weight_loss,
2502
+		WarningValue:        warining_value,
2503
+		UserTotal:           user_total,
2504
+		Move:                run,
2505
+		FailureStage:        failure_stage,
2506
+		FaultDescription:    falult_desciription,
2507
+		CodeInformation:     code_information,
2508
+		DisinfectantType:    disinfectant_type,
2509
+		DisinfectType:       disinfect_type,
2510
+		Disinfection:        disinfection,
2511
+		MachineRun:          machine_run,
2512
+		FluidPath:           fluid_path,
2513
+		Disinfectant:        disinfectant,
2514
+		DisinfectionStatus:  disinfection_status,
2515
+		DisinfectionResidue: disinfection_residue,
2516
+		LongTime:            longtime,
2517
+		DisinfecStartime:    distartime,
2518
+		DisinfecEndtime:     diendtime,
2519
+		DialysisChecked:     dialysis_checked,
2520
+		DialysisName:        dialysis_name,
2521
+		Norms:               norms,
2522 2522
 		DialysisConcentration: dialysis_concentration,
2523 2523
 		GermChecked:           germ_checked,
2524 2524
 		GermName:              germ_name,

+ 0 - 1
controllers/manager_center_api_controller.go 查看文件

@@ -221,7 +221,6 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
221 221
 func (c *ManagerCenterApiController) EditBaseDrugLib() {
222 222
 	id, _ := c.GetInt64("id")
223 223
 	drug_name := c.GetString("drug_name")
224
-
225 224
 	pinyin := c.GetString("pinyin")
226 225
 	wubi := c.GetString("wubi")
227 226
 	drug_alias := c.GetString("drug_alias")

+ 34 - 23
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

@@ -1158,11 +1158,11 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1158 1158
 		PreImpulse:                 pre_impulse,
1159 1159
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
1160 1160
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
1161
-		Blood:                      blood,
1162
-		DialysisDialyszers:         dialysis_dialyszers,
1163
-		DialysisIrrigation:         dialysis_irrigation,
1164
-		AntioxidantCommodityName:   antioxidant_commodity_name,
1165
-		DisplaceSpeed:              displace_speed,
1161
+		Blood:                    blood,
1162
+		DialysisDialyszers:       dialysis_dialyszers,
1163
+		DialysisIrrigation:       dialysis_irrigation,
1164
+		AntioxidantCommodityName: antioxidant_commodity_name,
1165
+		DisplaceSpeed:            displace_speed,
1166 1166
 	}
1167 1167
 
1168 1168
 	//查询最近透析准备表里是否存在 透析器 灌流器
@@ -2039,11 +2039,11 @@ func (c *DialysisAPIController) PostSolution() {
2039 2039
 		ALiquid:                   a_liquid,
2040 2040
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
2041 2041
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
2042
-		Blood:                     blood,
2043
-		DialysisDialyszers:        dialysis_dialyszers,
2044
-		DialysisIrrigation:        dialysis_irrigation,
2045
-		AntioxidantCommodityName:  antioxidant_commodity_name,
2046
-		DisplaceSpeed:             displace_speed,
2042
+		Blood:                    blood,
2043
+		DialysisDialyszers:       dialysis_dialyszers,
2044
+		DialysisIrrigation:       dialysis_irrigation,
2045
+		AntioxidantCommodityName: antioxidant_commodity_name,
2046
+		DisplaceSpeed:            displace_speed,
2047 2047
 	}
2048 2048
 
2049 2049
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
@@ -2956,20 +2956,31 @@ func (c *DialysisAPIController) CreateRemindDoctorAdvice() {
2956 2956
 			}
2957 2957
 		}
2958 2958
 
2959
-		advices = append(advices, &advice)
2959
+		temp_advice, _ := service.FindRemindAdvice(advice.UserOrgId, advice.AdviceName, advice.AdviceDesc, advice.TemplateId, advice.FrequencyType, patient, advice.RecordDate)
2960
+		if temp_advice.ID == 0 {
2961
+			advices = append(advices, &advice)
2962
+		}
2960 2963
 	}
2961 2964
 
2962
-	list, err := service.CreateMGroupAdvice(adminUserInfo.Org.Id, advices, groupNo)
2965
+	if len(advices) > 0 {
2966
+		list, err := service.CreateMGroupAdvice(adminUserInfo.Org.Id, advices, groupNo)
2963 2967
 
2964
-	if err != nil {
2965
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateDoctorAdviceFail)
2966
-		return
2967
-	}
2968
+		if err != nil {
2969
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateDoctorAdviceFail)
2970
+			return
2971
+		}
2968 2972
 
2969
-	c.ServeSuccessJSON(map[string]interface{}{
2970
-		"msg":     "ok",
2971
-		"advices": list,
2972
-	})
2973
+		c.ServeSuccessJSON(map[string]interface{}{
2974
+			"msg":     "ok",
2975
+			"advices": list,
2976
+		})
2977
+
2978
+	} else {
2979
+		c.ServeSuccessJSON(map[string]interface{}{
2980
+			"msg": "ok",
2981
+		})
2982
+
2983
+	}
2973 2984
 
2974 2985
 	return
2975 2986
 
@@ -4643,15 +4654,15 @@ func (c *DialysisAPIController) BatchDeleteMonitor() {
4643 4654
 }
4644 4655
 
4645 4656
 func (c *DialysisAPIController) GetPatientDialysisRecordList() {
4646
-	
4657
+
4647 4658
 	id, _ := c.GetInt64("id")
4648 4659
 	fmt.Println(id)
4649 4660
 	timeLayout := "2006-01-02"
4650 4661
 	loc, _ := time.LoadLocation("Local")
4651 4662
 	start_time := time.Now().Format("2006-01-02")
4652
-	
4663
+
4653 4664
 	startime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
4654
-	fmt.Println("start_timestart_time",start_time)
4665
+	fmt.Println("start_timestart_time", start_time)
4655 4666
 	nowTime := time.Now()
4656 4667
 	endTime := nowTime.AddDate(-1, 0, 0)
4657 4668
 	endTimes := endTime.Format("2006-01-02")

+ 2 - 1
controllers/new_mobile_api_controllers/new_role_api_controller.go 查看文件

@@ -436,7 +436,8 @@ func (this *NewRoleApiController) AddRoleStaff() {
436 436
 }
437 437
 
438 438
 func (this *NewRoleApiController) GetFuntionPurviews() {
439
-	functionPurview, _ := service.GetFunctionPurview()
439
+	pid, _ := this.GetInt64("pid")
440
+	functionPurview, _ := service.GetFunctionPurview(pid)
440 441
 	this.ServeSuccessJSON(map[string]interface{}{
441 442
 		"funtion_purview": functionPurview,
442 443
 	})

+ 80 - 80
controllers/patient_api_controller.go 查看文件

@@ -254,29 +254,29 @@ func (c *PatientApiController) CreatePatient() {
254 254
 	//获取老表的最后一条数据
255 255
 	patients, err := service.GetLastPatientData(adminUserInfo.CurrentOrgId)
256 256
 	patientsNew := models.XtPatientsNew{
257
-		UserOrgId:                    adminUserInfo.CurrentOrgId,
258
-		UserId:                       0,
259
-		Avatar:                       patients.Avatar,
260
-		PatientType:                  patients.PatientType,
261
-		DialysisNo:                   patients.DialysisNo,
262
-		AdmissionNumber:              patients.AdmissionNumber,
263
-		Source:                       patients.Source,
264
-		Lapseto:                      patients.Lapseto,
265
-		PartitionId:                  patients.PartitionId,
266
-		BedId:                        patients.BedId,
267
-		Name:                         patients.Name,
268
-		Alias:                        patients.Alias,
269
-		Gender:                       patients.Gender,
270
-		MaritalStatus:                patients.MaritalStatus,
271
-		IdCardNo:                     patients.IdCardNo,
272
-		Birthday:                     patients.Birthday,
273
-		ReimbursementWayId:           patients.ReimbursementWayId,
274
-		HealthCareType:               patients.HealthCareType,
275
-		HealthCareNo:                 patients.HealthCareNo,
276
-		HealthCareDueDate:            patients.HealthCareDueDate,
277
-		Height:                       patients.Height,
278
-		BloodType:                    patients.BloodType,
279
-		Rh:                           patients.Rh,
257
+		UserOrgId:          adminUserInfo.CurrentOrgId,
258
+		UserId:             0,
259
+		Avatar:             patients.Avatar,
260
+		PatientType:        patients.PatientType,
261
+		DialysisNo:         patients.DialysisNo,
262
+		AdmissionNumber:    patients.AdmissionNumber,
263
+		Source:             patients.Source,
264
+		Lapseto:            patients.Lapseto,
265
+		PartitionId:        patients.PartitionId,
266
+		BedId:              patients.BedId,
267
+		Name:               patients.Name,
268
+		Alias:              patients.Alias,
269
+		Gender:             patients.Gender,
270
+		MaritalStatus:      patients.MaritalStatus,
271
+		IdCardNo:           patients.IdCardNo,
272
+		Birthday:           patients.Birthday,
273
+		ReimbursementWayId: patients.ReimbursementWayId,
274
+		HealthCareType:     patients.HealthCareType,
275
+		HealthCareNo:       patients.HealthCareNo,
276
+		HealthCareDueDate:  patients.HealthCareDueDate,
277
+		Height:             patients.Height,
278
+		BloodType:          patients.BloodType,
279
+		Rh:                 patients.Rh,
280 280
 		HealthCareDueAlertDate:       patients.HealthCareDueAlertDate,
281 281
 		EducationLevel:               patients.EducationLevel,
282 282
 		Profession:                   patients.Profession,
@@ -322,28 +322,28 @@ func (c *PatientApiController) CreatePatient() {
322 322
 		Nation:                       patients.Nation,
323 323
 		NativePlace:                  patients.NativePlace,
324 324
 		Age:                          patients.Age,
325
-		InfectiousNextRecordTime:     patients.InfectiousNextRecordTime,
326
-		IsInfectious:                 patients.IsInfectious,
327
-		RemindCycle:                  patients.RemindCycle,
328
-		ResponseResult:               patients.ResponseResult,
329
-		IsOpenRemind:                 patients.IsOpenRemind,
330
-		FirstTreatmentDate:           patients.FirstTreatmentDate,
331
-		DialysisAge:                  patients.DialysisAge,
332
-		ExpenseKind:                  patients.ExpenseKind,
333
-		TellPhone:                    patients.TellPhone,
334
-		ContactName:                  patients.ContactName,
335
-		BloodPatients:                1,
336
-		SlowPatients:                 0,
337
-		MemberPatients:               0,
338
-		EcommerPatients:              "",
339
-		BloodId:                      patients.ID,
340
-		SlowId:                       0,
341
-		MemberId:                     0,
342
-		MemberFistdate:               0,
343
-		MemberPatienttype:            0,
344
-		MemberTreatement:             0,
345
-		EquitmentId:                  "",
346
-		UserSysBeforeCount:           patient.UserSysBeforeCount,
325
+		InfectiousNextRecordTime: patients.InfectiousNextRecordTime,
326
+		IsInfectious:             patients.IsInfectious,
327
+		RemindCycle:              patients.RemindCycle,
328
+		ResponseResult:           patients.ResponseResult,
329
+		IsOpenRemind:             patients.IsOpenRemind,
330
+		FirstTreatmentDate:       patients.FirstTreatmentDate,
331
+		DialysisAge:              patients.DialysisAge,
332
+		ExpenseKind:              patients.ExpenseKind,
333
+		TellPhone:                patients.TellPhone,
334
+		ContactName:              patients.ContactName,
335
+		BloodPatients:            1,
336
+		SlowPatients:             0,
337
+		MemberPatients:           0,
338
+		EcommerPatients:          "",
339
+		BloodId:                  patients.ID,
340
+		SlowId:                   0,
341
+		MemberId:                 0,
342
+		MemberFistdate:           0,
343
+		MemberPatienttype:        0,
344
+		MemberTreatement:         0,
345
+		EquitmentId:              "",
346
+		UserSysBeforeCount:       patient.UserSysBeforeCount,
347 347
 	}
348 348
 
349 349
 	err = service.CreatePatientsNew(&patientsNew)
@@ -481,28 +481,28 @@ func (c *PatientApiController) EditPatient() {
481 481
 		return
482 482
 	}
483 483
 	patientsNew := models.XtPatientsNew{
484
-		UserOrgId:                 patient.UserOrgId,
485
-		UserId:                    patient.UserId,
486
-		Avatar:                    patient.Avatar,
487
-		PatientType:               patient.PatientType,
488
-		DialysisNo:                patient.DialysisNo,
489
-		AdmissionNumber:           patient.AdmissionNumber,
490
-		Source:                    patient.Source,
491
-		PartitionId:               patient.PartitionId,
492
-		BedId:                     patient.BedId,
493
-		Name:                      patient.Name,
494
-		Alias:                     patient.Alias,
495
-		Gender:                    patient.Gender,
496
-		MaritalStatus:             patient.MaritalStatus,
497
-		IdCardNo:                  patient.IdCardNo,
498
-		Birthday:                  patient.Birthday,
499
-		ReimbursementWayId:        patient.ReimbursementWayId,
500
-		HealthCareType:            patient.HealthCareType,
501
-		HealthCareNo:              patient.HealthCareNo,
502
-		HealthCareDueDate:         patient.HealthCareDueDate,
503
-		Height:                    patient.Height,
504
-		BloodType:                 patient.BloodType,
505
-		Rh:                        patient.Rh,
484
+		UserOrgId:          patient.UserOrgId,
485
+		UserId:             patient.UserId,
486
+		Avatar:             patient.Avatar,
487
+		PatientType:        patient.PatientType,
488
+		DialysisNo:         patient.DialysisNo,
489
+		AdmissionNumber:    patient.AdmissionNumber,
490
+		Source:             patient.Source,
491
+		PartitionId:        patient.PartitionId,
492
+		BedId:              patient.BedId,
493
+		Name:               patient.Name,
494
+		Alias:              patient.Alias,
495
+		Gender:             patient.Gender,
496
+		MaritalStatus:      patient.MaritalStatus,
497
+		IdCardNo:           patient.IdCardNo,
498
+		Birthday:           patient.Birthday,
499
+		ReimbursementWayId: patient.ReimbursementWayId,
500
+		HealthCareType:     patient.HealthCareType,
501
+		HealthCareNo:       patient.HealthCareNo,
502
+		HealthCareDueDate:  patient.HealthCareDueDate,
503
+		Height:             patient.Height,
504
+		BloodType:          patient.BloodType,
505
+		Rh:                 patient.Rh,
506 506
 		HealthCareDueAlertDate:    patient.HealthCareDueAlertDate,
507 507
 		EducationLevel:            patient.EducationLevel,
508 508
 		Profession:                patient.Profession,
@@ -544,19 +544,19 @@ func (c *PatientApiController) EditPatient() {
544 544
 		Nation:                    patient.Nation,
545 545
 		NativePlace:               patient.NativePlace,
546 546
 		Age:                       patient.Age,
547
-		InfectiousNextRecordTime:  patient.InfectiousNextRecordTime,
548
-		IsInfectious:              patient.IsInfectious,
549
-		RemindCycle:               patient.RemindCycle,
550
-		ResponseResult:            patient.ResponseResult,
551
-		IsOpenRemind:              patient.IsOpenRemind,
552
-		FirstTreatmentDate:        patient.FirstTreatmentDate,
553
-		DialysisAge:               patient.DialysisAge,
554
-		ExpenseKind:               patient.ExpenseKind,
555
-		TellPhone:                 patient.TellPhone,
556
-		ContactName:               patient.ContactName,
557
-		UpdatedTime:               time.Now().Unix(),
558
-		BloodPatients:             1,
559
-		Lapseto:                   patient.Lapseto,
547
+		InfectiousNextRecordTime: patient.InfectiousNextRecordTime,
548
+		IsInfectious:             patient.IsInfectious,
549
+		RemindCycle:              patient.RemindCycle,
550
+		ResponseResult:           patient.ResponseResult,
551
+		IsOpenRemind:             patient.IsOpenRemind,
552
+		FirstTreatmentDate:       patient.FirstTreatmentDate,
553
+		DialysisAge:              patient.DialysisAge,
554
+		ExpenseKind:              patient.ExpenseKind,
555
+		TellPhone:                patient.TellPhone,
556
+		ContactName:              patient.ContactName,
557
+		UpdatedTime:              time.Now().Unix(),
558
+		BloodPatients:            1,
559
+		Lapseto:                  patient.Lapseto,
560 560
 	}
561 561
 	//	//更新病人ID获取新表病人ID
562 562
 	err = service.UpdatepatientTwo(&patientsNew, id)

+ 28 - 28
controllers/role_controller.go 查看文件

@@ -559,7 +559,7 @@ func (this *RoleAPIController) EditPurviewInitData() {
559 559
 		if item.Name == "耗材管理" {
560 560
 			item.Childs = append(item.Childs, subConsumablesPurviewTreeViewModel...)
561 561
 		}
562
-		if item.Name == "药管理" {
562
+		if item.Name == "药管理" {
563 563
 			item.Childs = append(item.Childs, subDrugPurviewTreeViewModel...)
564 564
 		}
565 565
 		if item.Name == "自备药管理" {
@@ -982,33 +982,33 @@ func (this *RoleAPIController) AddAdmin() {
982 982
 			if total <= 0 {
983 983
 				//新增用户
984 984
 				app_role := &models.App_Role{
985
-					AdminUserId:                             adminUser.Id,
986
-					OrgId:                                   adminUserInfo.CurrentOrgId,
987
-					AppId:                                   adminUserInfo.CurrentAppId,
988
-					Avatar:                                  "",
989
-					UserName:                                name,
990
-					UserTitleName:                           user_title_name,
991
-					Status:                                  1,
992
-					UserType:                                int8(userType),
993
-					UserTitle:                               int8(userTitle),
994
-					CreateTime:                              time.Now().Unix(),
995
-					ModifyTime:                              time.Now().Unix(),
996
-					RoleIds:                                 roleIds,
997
-					Department:                              department,
998
-					DepartmentId:                            department_id,
999
-					Sex:                                     sex,
1000
-					Age:                                     age,
1001
-					Nation:                                  nation,
1002
-					CardType:                                card_type,
1003
-					IdCard:                                  id_card,
1004
-					Education:                               education,
1005
-					StudyMajorName:                          study_major_name,
1006
-					WorkMajorName:                           work_major_name,
1007
-					RoleType:                                role_type,
1008
-					MedicalCode:                             medical_code,
1009
-					DoctorCode:                              doctor_code,
1010
-					Licensing:                               licensing,
1011
-					JobNumber:                               job_number,
985
+					AdminUserId:    adminUser.Id,
986
+					OrgId:          adminUserInfo.CurrentOrgId,
987
+					AppId:          adminUserInfo.CurrentAppId,
988
+					Avatar:         "",
989
+					UserName:       name,
990
+					UserTitleName:  user_title_name,
991
+					Status:         1,
992
+					UserType:       int8(userType),
993
+					UserTitle:      int8(userTitle),
994
+					CreateTime:     time.Now().Unix(),
995
+					ModifyTime:     time.Now().Unix(),
996
+					RoleIds:        roleIds,
997
+					Department:     department,
998
+					DepartmentId:   department_id,
999
+					Sex:            sex,
1000
+					Age:            age,
1001
+					Nation:         nation,
1002
+					CardType:       card_type,
1003
+					IdCard:         id_card,
1004
+					Education:      education,
1005
+					StudyMajorName: study_major_name,
1006
+					WorkMajorName:  work_major_name,
1007
+					RoleType:       role_type,
1008
+					MedicalCode:    medical_code,
1009
+					DoctorCode:     doctor_code,
1010
+					Licensing:      licensing,
1011
+					JobNumber:      job_number,
1012 1012
 					PrescriptionQualificationIdentification: prescription_qualification_identification,
1013 1013
 					IdentificationOutpatients:               identification_outpatients,
1014 1014
 					StartTime:                               theStartTime.Unix(),

+ 1 - 1
controllers/stock_in_api_controller.go 查看文件

@@ -1379,7 +1379,7 @@ func (c *StockManagerApiController) EditWarehouseOut() {
1379 1379
 					sys_record_time := int64(items["sys_record_time"].(float64))
1380 1380
 
1381 1381
 					warehouseOutInfo := &models.WarehouseOutInfo{
1382
-						ID:                      id,
1382
+						ID: id,
1383 1383
 						WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
1384 1384
 						WarehouseOutId:          warehouseOut.ID,
1385 1385
 						GoodId:                  good_id,

+ 2 - 0
models/data_models.go 查看文件

@@ -17,6 +17,7 @@ type Dataconfig struct {
17 17
 	Title          string `gorm:"column:title" json:"title" form:"title"`
18 18
 	Content        string `gorm:"column:content" json:"content" form:"content"`
19 19
 	Order          int64  `gorm:"column:orders" json:"orders" form:"orders"`
20
+	Code           string `gorm:"column:code" json:"code" form:"code"`
20 21
 	FieldType      int64  `gorm:"column:field_type" json:"field_type" form:"field_type"`
21 22
 }
22 23
 
@@ -41,6 +42,7 @@ type DictDataconfig struct {
41 42
 	Title          string `gorm:"column:title" json:"title" form:"title"`
42 43
 	Content        string `gorm:"column:content" json:"content" form:"content"`
43 44
 	Order          int64  `gorm:"column:orders" json:"orders" form:"orders"`
45
+	Code           string `gorm:"column:code" json:"code" form:"code"`
44 46
 }
45 47
 
46 48
 func (DictDataconfig) TableName() string {

+ 44 - 3
service/his_service.go 查看文件

@@ -988,7 +988,9 @@ func GetHisPrescriptionByType(change_type int64, record_time int64, org_id int64
988 988
 		err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date  = ?", patient_id, org_id, Id.RecordDate).
989 989
 			Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
990 990
 				return db.Where("status = 1 AND user_org_id = ?", org_id).
991
-					Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
991
+					Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
992
+						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("Drug", "status=1")
993
+					}).
992 994
 					Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
993 995
 						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
994 996
 					})
@@ -1000,7 +1002,9 @@ func GetHisPrescriptionByType(change_type int64, record_time int64, org_id int64
1000 1002
 		err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date  = ?", patient_id, org_id, Id.RecordDate).
1001 1003
 			Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
1002 1004
 				return db.Where("status = 1 AND user_org_id = ?", org_id).
1003
-					Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
1005
+					Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1006
+						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("Drug", "status=1")
1007
+					}).
1004 1008
 					Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1005 1009
 						return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
1006 1010
 					})
@@ -1013,7 +1017,9 @@ func GetCallHisPrescriptions(start_time int64, end_time int64, org_id int64, pat
1013 1017
 	err = readDb.Model(&VMOtherHisPrescriptionInfo{}).Where("patient_id = ? AND user_org_id = ? AND  status=1 AND record_date >= ? AND record_date <= ?", patient_id, org_id, start_time, end_time).
1014 1018
 		Preload("VMHisPrescription", func(db *gorm.DB) *gorm.DB {
1015 1019
 			return db.Where("status = 1 AND user_org_id = ?", org_id).
1016
-				Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
1020
+				Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1021
+					return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("Drug", "status=1")
1022
+				}).
1017 1023
 				Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1018 1024
 					return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
1019 1025
 				})
@@ -1253,3 +1259,38 @@ func GetHisOrderDetailByNumber(order_number string, org_id int64) (order []*HisO
1253 1259
 	}).Find(&order).Error
1254 1260
 	return
1255 1261
 }
1262
+
1263
+type MedicalInsuranceCostCompare struct {
1264
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
1265
+	StartTime int64   `gorm:"column:start_time" json:"start_time" form:"start_time"`
1266
+	EndTime   int64   `gorm:"column:end_time" json:"end_time" form:"end_time"`
1267
+	Insutype  string  `gorm:"column:insutype" json:"insutype" form:"insutype"`
1268
+	CheckType int64   `gorm:"column:check_type" json:"check_type" form:"check_type"`
1269
+	Num       int64   `gorm:"column:num" json:"num" form:"num"`
1270
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
1271
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
1272
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1273
+	CostTotal float64 `gorm:"column:cost_total" json:"cost_total" form:"cost_total"`
1274
+	FuncTotal float64 `gorm:"column:func_total" json:"func_total" form:"func_total"`
1275
+	PsnPay    float64 `gorm:"column:psn_pay" json:"psn_pay" form:"psn_pay"`
1276
+	Creator   int64   `gorm:"column:creator" json:"creator" form:"creator"`
1277
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
1278
+}
1279
+
1280
+func (MedicalInsuranceCostCompare) TableName() string {
1281
+	return "medical_insurance_cost_compare"
1282
+}
1283
+
1284
+func GetMedicalInsuranceCostCompareList(orgID, page, limit int64, keywords string) (list []*MedicalInsuranceCostCompare, total int, err error) {
1285
+	offset := (page - 1) * limit
1286
+	db := readDb.Model(&MedicalInsuranceCostCompare{}).Where("user_org_id = ?", orgID)
1287
+
1288
+	if len(keywords) == 0 {
1289
+		db = db.Where("status=1")
1290
+		err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1291
+	} else {
1292
+		db = db.Where("status=1")
1293
+		err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1294
+	}
1295
+	return
1296
+}

+ 6 - 0
service/manage_center_service.go 查看文件

@@ -351,3 +351,9 @@ func FindDiagnoseById(id int64) (*models.HisXtDiagnoseConfig, error) {
351 351
 	err := readDb.Model(&models.HisXtDiagnoseConfig{}).Where("id = ? AND status = 1", id).First(&dealer).Error
352 352
 	return dealer, err
353 353
 }
354
+
355
+func GetDoseCode(dose_id int64, user_org_id int64) (error, string) {
356
+	var data models.DictDataconfig
357
+	err := readDb.Model(&models.DictDataconfig{}).Where(" (user_org_id = ? Or user_org_id = 0) AND parent_id = 4 AND module = 'system' AND status = 1 AND value = ?", user_org_id, dose_id).First(&data).Error
358
+	return err, data.Code
359
+}

+ 5 - 0
service/patient_service.go 查看文件

@@ -1479,3 +1479,8 @@ func UpdatePatientDialysisSolutionOne(patientid int64, orgid int64, prescription
1479 1479
 	err = XTWriteDB().Model(&prescription).Where("patient_id = ? and user_org_id = ? and record_date = ? ", patientid, orgid, timenow).Updates(map[string]interface{}{"dialyzer": prescription.Dialyzer, "anticoagulant": prescription.Anticoagulant, "mode_id": prescription.ModeId, "dialysis_duration_hour": prescription.DialysisDurationHour, "anticoagulant_shouji": prescription.AnticoagulantShouji, "anticoagulant_weichi": prescription.AnticoagulantWeichi, "anticoagulant_zongliang": prescription.AnticoagulantZongliang, "kalium": prescription.Kalium, "sodium": prescription.Sodium, "calcium": prescription.Calcium, "dialyzer_perfusion_apparatus": prescription.DialyzerPerfusionApparatus, "blood_access": prescription.BloodAccess, "dialysate_flow": prescription.DialysateFlow, "dialysate_temperature": prescription.DialysateTemperature, "dialysis_dialyszers": prescription.DialysisDialyszers, "dialysis_irrigation": prescription.DialysisIrrigation}).Error
1480 1480
 	return err
1481 1481
 }
1482
+
1483
+func FindRemindAdvice(user_org_id int64, advice_name string, advice_desc string, template_id string, fre_type int64, patient_id int64, record_date int64) (advice models.DoctorAdvice, err error) {
1484
+	err = XTWriteDB().Model(&models.DoctorAdvice{}).Where("patient_id = ? and user_org_id = ? and record_date = ? and advice_name = ? and advice_desc = ? and template_id = ? and frequency_type = ? ", patient_id, user_org_id, record_date, advice_name, advice_desc, template_id, fre_type).First(&advice).Error
1485
+	return
1486
+}

+ 17 - 14
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go 查看文件

@@ -1,5 +1,7 @@
1 1
 package schedule_dialysis
2 2
 
3
+import "XT_New/models"
4
+
3 5
 type PatientVM struct {
4 6
 	ID                           int64   `gorm:"column:id" json:"id" form:"id"`
5 7
 	UserOrgId                    int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
@@ -522,20 +524,21 @@ type ScheduleVM struct {
522 524
 	BedID        int64 `gorm:"column:bed_id" json:"bed_id"`
523 525
 	PartitionId  int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
524 526
 
525
-	Patient                  *PatientVM                  `gorm:"ForeignKey:PatientID" json:"patient"`
526
-	DialysisOrder            DialysisOrderVM             `gorm:"ForeignKey:DialysisDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"dialysis_order"`
527
-	Prescription             PrescriptionVM              `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"prescription"`
528
-	ReceiveAssessment        ReceiveAssessmentVM         `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"receive_assessment"`
529
-	XtReceiveTreatmentAsses  *XtReceiveTreatmentAsses    `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"xt_receive_assessment"`
530
-	AssessmentBeforeDislysis AssessmentBeforeDislysisVM  `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_before_dislysis"`
531
-	AssessmentAfterDislysis  AssessmentAfterDislysisVM   `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_after_dislysis"`
532
-	MonitoringRecords        []*MonitoringRecordVM       `gorm:"ForeignKey:MonitoringDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"monitor_records"`
533
-	DeviceNumber             *DeviceNumberVM             `gorm:"ForeignKey:BedID" json:"device_number"`
534
-	DeviceZone               *DeviceZoneVM               `gorm:"ForeignKey:PartitionId" json:"device_zone"`
535
-	Advices                  []*DoctorAdviceVM           `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientId" json:"advices"`
536
-	DoubleCheck              *DoubleCheckVM              `gorm:"ForeignKey:CheckDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"check"`
537
-	Summer                   *SummerVM                   `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"summer"`
538
-	LastAfterWeight          XtAssessmentAfterDislysisVM `gorm:"ForeignKey:PatientID;AssociationForeignKey:PatientID" json:"lastafterweight"`
527
+	Patient                  *PatientVM                    `gorm:"ForeignKey:PatientID" json:"patient"`
528
+	DialysisOrder            DialysisOrderVM               `gorm:"ForeignKey:DialysisDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"dialysis_order"`
529
+	Prescription             PrescriptionVM                `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"prescription"`
530
+	ReceiveAssessment        ReceiveAssessmentVM           `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"receive_assessment"`
531
+	XtReceiveTreatmentAsses  *XtReceiveTreatmentAsses      `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"xt_receive_assessment"`
532
+	AssessmentBeforeDislysis AssessmentBeforeDislysisVM    `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_before_dislysis"`
533
+	AssessmentAfterDislysis  AssessmentAfterDislysisVM     `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_after_dislysis"`
534
+	MonitoringRecords        []*MonitoringRecordVM         `gorm:"ForeignKey:MonitoringDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"monitor_records"`
535
+	DeviceNumber             *DeviceNumberVM               `gorm:"ForeignKey:BedID" json:"device_number"`
536
+	DeviceZone               *DeviceZoneVM                 `gorm:"ForeignKey:PartitionId" json:"device_zone"`
537
+	Advices                  []*DoctorAdviceVM             `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientId" json:"advices"`
538
+	DoubleCheck              *DoubleCheckVM                `gorm:"ForeignKey:CheckDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"check"`
539
+	Summer                   *SummerVM                     `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"summer"`
540
+	LastAfterWeight          XtAssessmentAfterDislysisVM   `gorm:"ForeignKey:PatientID;AssociationForeignKey:PatientID" json:"lastafterweight"`
541
+	HisAdvices               []*models.HisDoctorAdviceInfo `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"his_advices"`
539 542
 }
540 543
 
541 544
 func (ScheduleVM) TableName() string {

+ 5 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go 查看文件

@@ -42,6 +42,11 @@ func GetSchedules(orgID int64, schIDs []string) ([]*ScheduleVM, error) {
42 42
 				Where("user_org_id = ? AND advice_type = 2 AND status = 1", orgID).
43 43
 				Order("start_time asc, groupno desc, advice_order desc, id asc")
44 44
 		}).
45
+		Preload("HisAdvices", func(db *gorm.DB) *gorm.DB {
46
+			return db.Select("id, user_org_id, patient_id, advice_type, advice_date, record_date, start_time, drug_spec_unit,advice_name,advice_desc, reminder_date, drug_spec, drug_spec_unit, single_dose, single_dose_unit, prescribing_number, prescribing_number_unit, delivery_way, execution_frequency, advice_doctor, status, created_time,updated_time, advice_affirm, remark, stop_time, stop_reason, stop_doctor, stop_state, parent_id, execution_time, execution_staff, execution_state, checker, check_state, check_time, groupno, IF(parent_id > 0, parent_id, id) as advice_order").
47
+				Where("user_org_id = ? AND status = 1", orgID).
48
+				Order("start_time asc, groupno desc, advice_order desc, id asc")
49
+		}).
45 50
 		Where("user_org_id = ? AND status = 1 AND id in (?)", orgID, schIDs).Order("schedule_date desc").
46 51
 		Find(&schedules).
47 52
 		Error

+ 2 - 2
service/role_service.go 查看文件

@@ -761,8 +761,8 @@ func SaveAdminUser(role *models.App_Role) (err error) {
761 761
 	return
762 762
 }
763 763
 
764
-func GetFunctionPurview() (purview []*models.SgjUserOperatePurview, err error) {
765
-	err = readUserDb.Model(&models.SgjUserOperatePurview{}).Where("status = 1 ").Order("number asc").Find(&purview).Error
764
+func GetFunctionPurview(pid int64) (purview []*models.SgjUserOperatePurview, err error) {
765
+	err = readUserDb.Model(&models.SgjUserOperatePurview{}).Where("status = 1  AND parentid = ?", pid).Order("number asc").Find(&purview).Error
766 766
 	return
767 767
 }
768 768