Browse Source

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

陈少旭 1 year ago
parent
commit
02ec663ca6
42 changed files with 2460 additions and 697 deletions
  1. 4 5
      controllers/base_api_controller.go
  2. 254 0
      controllers/dialysis_api_controller.go
  3. 2 2
      controllers/doctor_schedule_api_controller.go
  4. 1 1
      controllers/gobal_config_api_controller.go
  5. 27 8
      controllers/his_api_controller.go
  6. 277 283
      controllers/his_print_api_controller.go
  7. 11 0
      controllers/manager_center_api_controller.go
  8. 10 10
      controllers/mobile_api_controllers/check_weight_api_controller.go
  9. 18 1
      controllers/mobile_api_controllers/dialysis_api_controller.go
  10. 36 1
      controllers/mobile_api_controllers/dialysis_api_controller_extend.go
  11. 2 0
      controllers/mobile_api_controllers/mobile_api_router_register.go
  12. 67 50
      controllers/mobile_api_controllers/patient_api_controller.go
  13. 88 5
      controllers/new_mobile_api_controllers/staff_schedule_api_controller.go
  14. 66 18
      controllers/patient_api_controller.go
  15. 445 1
      controllers/patient_dataconfig_api_controller.go
  16. 3 4
      controllers/print_data_api_controller.go
  17. 69 0
      controllers/schedule_api_controller.go
  18. 31 31
      controllers/self_drug_api_congtroller.go
  19. 1 0
      controllers/sign_api_controller.go
  20. 1 1
      controllers/verify_login_controller.go
  21. 32 31
      models/good_models.go
  22. 1 0
      models/his_models.go
  23. 1 0
      models/new_stock_models.go
  24. 221 0
      models/patient_models.go
  25. 34 30
      models/self_drug_models.go
  26. 75 44
      models/stock_models.go
  27. 2 2
      service/common_service.go
  28. 2 2
      service/dialysis_service.go
  29. 1 1
      service/drug_stock_service.go
  30. 143 6
      service/gobal_config_service.go
  31. 18 9
      service/his_service.go
  32. 1 1
      service/manage_service.go
  33. 5 1
      service/new_stock_service.go
  34. 113 92
      service/new_warehouse_service.go
  35. 7 6
      service/patient_schedule_template_service.go
  36. 144 4
      service/patient_service.go
  37. 4 1
      service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go
  38. 7 0
      service/schedule_service.go
  39. 202 25
      service/self_drug_service.go
  40. 23 16
      service/sign_service.go
  41. 10 4
      service/stock_service.go
  42. 1 1
      service/warhouse_service.go

+ 4 - 5
controllers/base_api_controller.go View File

@@ -73,7 +73,6 @@ func (this *BaseAuthAPIController) Prepare() {
73 73
 		var userAdmin models.AdminUser
74 74
 		userAdmin.Id = 1448
75 75
 		userAdmin.Mobile = "15717313968"
76
-
77 76
 		userAdmin.Id = 1 //4,809
78 77
 		userAdmin.Mobile = "12222222222"
79 78
 		userAdmin.IsSuperAdmin = true
@@ -82,7 +81,7 @@ func (this *BaseAuthAPIController) Prepare() {
82 81
 		userAdmin.ModifyTime = 1530786071
83 82
 		var subscibe models.ServeSubscibe
84 83
 		subscibe.ID = 11
85
-		subscibe.OrgId = 9671 //机构id
84
+		subscibe.OrgId = 3877 //机构id
86 85
 		subscibe.PeriodStart = 1547447814
87 86
 		subscibe.PeriodEnd = 1550039814
88 87
 		subscibe.State = 1
@@ -92,7 +91,7 @@ func (this *BaseAuthAPIController) Prepare() {
92 91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93 92
 		subscibes[4] = &subscibe
94 93
 		var adminUserInfo service.AdminUserInfo
95
-		adminUserInfo.CurrentOrgId = 9671 //机构id小英9675或4
94
+		adminUserInfo.CurrentOrgId = 3877 //机构id小英9675或4
96 95
 		adminUserInfo.CurrentAppId = 3244 //4
97 96
 		adminUserInfo.AdminUser = &userAdmin
98 97
 		adminUserInfo.Subscibes = subscibes
@@ -328,7 +327,7 @@ func (this *BaseServeAPIController) Prepare() {
328 327
 		userAdmin.ModifyTime = 1530786071
329 328
 		var subscibe models.ServeSubscibe
330 329
 		subscibe.ID = 11
331
-		subscibe.OrgId = 9671 //机构id小英9675或4
330
+		subscibe.OrgId = 3877 //机构id小英9675或4
332 331
 		subscibe.PeriodStart = 1538035409
333 332
 		subscibe.PeriodEnd = 1569571409
334 333
 		subscibe.State = 1
@@ -338,7 +337,7 @@ func (this *BaseServeAPIController) Prepare() {
338 337
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339 338
 		subscibes[4] = &subscibe
340 339
 		var adminUserInfo service.AdminUserInfo
341
-		adminUserInfo.CurrentOrgId = 9671 //机构id小英9675或4
340
+		adminUserInfo.CurrentOrgId = 3877 //机构id小英9675或4
342 341
 		adminUserInfo.CurrentAppId = 3244 //4
343 342
 		adminUserInfo.AdminUser = &userAdmin
344 343
 		adminUserInfo.Subscibes = subscibes

+ 254 - 0
controllers/dialysis_api_controller.go View File

@@ -123,6 +123,18 @@ func DialysisApiRegistRouters() {
123 123
 	beego.Router("/api/dialysis/patientsflow", &DialysisApiController{}, "Get:GetDialysisPatientsFlow")
124 124
 
125 125
 	beego.Router("/api/patient/getlongdialysisadvicetoday", &DialysisApiController{}, "Get:GetLongDialysisAdviceToday")
126
+
127
+	beego.Router("/api/patient/getpatientlist", &DialysisApiController{}, "Get:GetPatientList")
128
+
129
+	beego.Router("/api/patient/getprescriptionloglist", &DialysisApiController{}, "Get:GetPrescriptionLogList")
130
+
131
+	beego.Router("/api/patient/getbeforloglist", &DialysisApiController{}, "Get:GetBeforLogList")
132
+
133
+	beego.Router("/api/patient/getdocloglist", &DialysisApiController{}, "Get:GetDocLogList")
134
+
135
+	beego.Router("/api/patient/getmonitorloglist", &DialysisApiController{}, "Get:GetMonitorLogList")
136
+
137
+	beego.Router("/api/patient/getafterloglist", &DialysisApiController{}, "Get:GetAfterLogList")
126 138
 }
127 139
 
128 140
 func (c *DialysisApiController) GetQueueCall() {
@@ -1161,6 +1173,9 @@ func (c *DialysisApiController) PostSoulution() {
1161 1173
 		Chaptalization:             chaptalization,
1162 1174
 	}
1163 1175
 
1176
+	if prescription.Anticoagulant == 0 {
1177
+		prescription.Anticoagulant = 3
1178
+	}
1164 1179
 	//查询最近透析准备表里是否存在 透析器 灌流器
1165 1180
 
1166 1181
 	//splitStr := strings.Split(dialysis_dialyszers, ",")
@@ -1364,6 +1379,9 @@ func (c *DialysisApiController) PostSoulution() {
1364 1379
 		Chaptalization:             chaptalization,
1365 1380
 	}
1366 1381
 
1382
+	if solution.Anticoagulant == 0 {
1383
+		solution.Anticoagulant = 3
1384
+	}
1367 1385
 	//针对河间咸得
1368 1386
 	if adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10090 || adminUserInfo.CurrentOrgId == 3877 {
1369 1387
 
@@ -7182,3 +7200,239 @@ func (this *DialysisApiController) GetLongDialysisAdviceToday() {
7182 7200
 		return
7183 7201
 	}
7184 7202
 }
7203
+
7204
+func (this *DialysisApiController) GetPatientList() {
7205
+
7206
+	orgId := this.GetAdminUserInfo().CurrentOrgId
7207
+
7208
+	keyWord := this.GetString("keyword")
7209
+	patientList, err := service.GetPrescriptionPatientList(orgId, keyWord)
7210
+
7211
+	if err == nil {
7212
+		this.ServeSuccessJSON(map[string]interface{}{
7213
+			"patientList": patientList,
7214
+		})
7215
+		return
7216
+
7217
+	} else {
7218
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
7219
+		return
7220
+	}
7221
+}
7222
+
7223
+func (this *DialysisApiController) GetPrescriptionLogList() {
7224
+
7225
+	patient_id, _ := this.GetInt64("patient_id")
7226
+
7227
+	record_date := this.GetString("record_date")
7228
+
7229
+	page, _ := this.GetInt64("page")
7230
+
7231
+	limit, _ := this.GetInt64("limit")
7232
+
7233
+	orgId := this.GetAdminUserInfo().CurrentOrgId
7234
+
7235
+	timeLayout := "2006-01-02"
7236
+	loc, _ := time.LoadLocation("Local")
7237
+	var recordDateTime int64
7238
+	if len(record_date) > 0 {
7239
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
7240
+		if err != nil {
7241
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
7242
+			return
7243
+		}
7244
+		recordDateTime = theTime.Unix()
7245
+	}
7246
+
7247
+	prescriptionlogList, total, err := service.GetPrescriptionLogList(patient_id, page, limit, recordDateTime, orgId)
7248
+
7249
+	patients, _ := service.GetAllPatientLog(orgId)
7250
+
7251
+	role, _ := service.GetAllDoctorLog(orgId)
7252
+
7253
+	if err == nil {
7254
+		this.ServeSuccessJSON(map[string]interface{}{
7255
+			"prescriptionlogList": prescriptionlogList,
7256
+			"total":               total,
7257
+			"patients":            patients,
7258
+			"role":                role,
7259
+		})
7260
+		return
7261
+
7262
+	} else {
7263
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
7264
+		return
7265
+	}
7266
+}
7267
+
7268
+func (this *DialysisApiController) GetBeforLogList() {
7269
+
7270
+	patient_id, _ := this.GetInt64("patient_id")
7271
+
7272
+	record_date := this.GetString("record_date")
7273
+
7274
+	page, _ := this.GetInt64("page")
7275
+
7276
+	limit, _ := this.GetInt64("limit")
7277
+
7278
+	orgId := this.GetAdminUserInfo().CurrentOrgId
7279
+
7280
+	timeLayout := "2006-01-02"
7281
+	loc, _ := time.LoadLocation("Local")
7282
+	var recordDateTime int64
7283
+	if len(record_date) > 0 {
7284
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
7285
+		if err != nil {
7286
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
7287
+			return
7288
+		}
7289
+		recordDateTime = theTime.Unix()
7290
+	}
7291
+	beforLogList, total, err := service.GetBeforLogList(patient_id, page, limit, recordDateTime, orgId)
7292
+
7293
+	patients, _ := service.GetAllPatientLog(orgId)
7294
+
7295
+	role, _ := service.GetAllDoctorLog(orgId)
7296
+	if err == nil {
7297
+		this.ServeSuccessJSON(map[string]interface{}{
7298
+			"beforLogList": beforLogList,
7299
+			"total":        total,
7300
+			"patients":     patients,
7301
+			"role":         role,
7302
+		})
7303
+		return
7304
+
7305
+	} else {
7306
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
7307
+		return
7308
+	}
7309
+}
7310
+
7311
+func (this *DialysisApiController) GetDocLogList() {
7312
+
7313
+	patient_id, _ := this.GetInt64("patient_id")
7314
+
7315
+	record_date := this.GetString("record_date")
7316
+
7317
+	page, _ := this.GetInt64("page")
7318
+
7319
+	limit, _ := this.GetInt64("limit")
7320
+
7321
+	orgId := this.GetAdminUserInfo().CurrentOrgId
7322
+
7323
+	timeLayout := "2006-01-02"
7324
+	loc, _ := time.LoadLocation("Local")
7325
+	var recordDateTime int64
7326
+	if len(record_date) > 0 {
7327
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
7328
+		if err != nil {
7329
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
7330
+			return
7331
+		}
7332
+		recordDateTime = theTime.Unix()
7333
+	}
7334
+	adviceLogList, total, err := service.GetDocLogList(patient_id, page, limit, recordDateTime, orgId)
7335
+
7336
+	patients, _ := service.GetAllPatientLog(orgId)
7337
+
7338
+	role, _ := service.GetAllDoctorLog(orgId)
7339
+	if err == nil {
7340
+		this.ServeSuccessJSON(map[string]interface{}{
7341
+			"adviceLogList": adviceLogList,
7342
+			"total":         total,
7343
+			"patients":      patients,
7344
+			"role":          role,
7345
+		})
7346
+		return
7347
+
7348
+	} else {
7349
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
7350
+		return
7351
+	}
7352
+}
7353
+
7354
+func (this *DialysisApiController) GetMonitorLogList() {
7355
+
7356
+	patient_id, _ := this.GetInt64("patient_id")
7357
+
7358
+	record_date := this.GetString("record_date")
7359
+
7360
+	page, _ := this.GetInt64("page")
7361
+
7362
+	limit, _ := this.GetInt64("limit")
7363
+
7364
+	orgId := this.GetAdminUserInfo().CurrentOrgId
7365
+
7366
+	timeLayout := "2006-01-02"
7367
+	loc, _ := time.LoadLocation("Local")
7368
+	var recordDateTime int64
7369
+	if len(record_date) > 0 {
7370
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
7371
+		if err != nil {
7372
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
7373
+			return
7374
+		}
7375
+		recordDateTime = theTime.Unix()
7376
+	}
7377
+	monitorLogList, total, err := service.GetMonitorLogList(patient_id, page, limit, recordDateTime, orgId)
7378
+
7379
+	patients, _ := service.GetAllPatientLog(orgId)
7380
+
7381
+	role, _ := service.GetAllDoctorLog(orgId)
7382
+	if err == nil {
7383
+		this.ServeSuccessJSON(map[string]interface{}{
7384
+			"monitorLogList": monitorLogList,
7385
+			"total":          total,
7386
+			"patients":       patients,
7387
+			"role":           role,
7388
+		})
7389
+		return
7390
+
7391
+	} else {
7392
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
7393
+		return
7394
+	}
7395
+}
7396
+
7397
+func (this *DialysisApiController) GetAfterLogList() {
7398
+
7399
+	patient_id, _ := this.GetInt64("patient_id")
7400
+
7401
+	record_date := this.GetString("record_date")
7402
+
7403
+	page, _ := this.GetInt64("page")
7404
+
7405
+	limit, _ := this.GetInt64("limit")
7406
+
7407
+	orgId := this.GetAdminUserInfo().CurrentOrgId
7408
+
7409
+	timeLayout := "2006-01-02"
7410
+	loc, _ := time.LoadLocation("Local")
7411
+	var recordDateTime int64
7412
+	if len(record_date) > 0 {
7413
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
7414
+		if err != nil {
7415
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
7416
+			return
7417
+		}
7418
+		recordDateTime = theTime.Unix()
7419
+	}
7420
+	afterLogList, total, err := service.GetAfterLogList(patient_id, page, limit, recordDateTime, orgId)
7421
+
7422
+	patients, _ := service.GetAllPatientLog(orgId)
7423
+
7424
+	role, _ := service.GetAllDoctorLog(orgId)
7425
+	if err == nil {
7426
+		this.ServeSuccessJSON(map[string]interface{}{
7427
+			"afterLogList": afterLogList,
7428
+			"total":        total,
7429
+			"patients":     patients,
7430
+			"role":         role,
7431
+		})
7432
+		return
7433
+
7434
+	} else {
7435
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
7436
+		return
7437
+	}
7438
+}

+ 2 - 2
controllers/doctor_schedule_api_controller.go View File

@@ -552,9 +552,9 @@ func (this *DoctorScheduleApiController) SaveIsSchedule() {
552 552
 func (this *DoctorScheduleApiController) GetScheduleListTotal() {
553 553
 
554 554
 	start_time, _ := this.GetInt64("start_time")
555
-	fmt.Println(start_time)
555
+
556 556
 	end_time, _ := this.GetInt64("end_time")
557
-	fmt.Println("end_time", end_time)
557
+
558 558
 	adminUserInfo := this.GetAdminUserInfo()
559 559
 	orgId := adminUserInfo.CurrentOrgId
560 560
 	//统计班次

+ 1 - 1
controllers/gobal_config_api_controller.go View File

@@ -2426,7 +2426,7 @@ func (c *GobalConfigApiController) GetExportOutOrderDrugList() {
2426 2426
 	orderId := c.GetString("order_id")
2427 2427
 	ids := strings.Split(orderId, ",")
2428 2428
 	orgId := c.GetAdminUserInfo().CurrentOrgId
2429
-	//list, _ := service.GetExportOutOrderDrugList(ids)
2429
+
2430 2430
 	list, _ := service.GetExportOutOrderDrugListOne(ids)
2431 2431
 	outInfoList, _ := service.GetDrugOutListFlow(ids, orgId)
2432 2432
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)

+ 27 - 8
controllers/his_api_controller.go View File

@@ -1999,7 +1999,7 @@ func (c *HisApiController) CreateHisPrescription() {
1999 1999
 												return
2000 2000
 											}
2001 2001
 
2002
-											if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
2002
+											if adminInfo.CurrentOrgId == 10215 {
2003 2003
 												if prescribing_number > batch_number_all_count {
2004 2004
 													c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
2005 2005
 													return
@@ -2016,7 +2016,7 @@ func (c *HisApiController) CreateHisPrescription() {
2016 2016
 												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2017 2017
 												return
2018 2018
 											}
2019
-											if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
2019
+											if adminInfo.CurrentOrgId == 10215 {
2020 2020
 												if num > batch_number_all_count {
2021 2021
 													c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
2022 2022
 													return
@@ -2085,7 +2085,7 @@ func (c *HisApiController) CreateHisPrescription() {
2085 2085
 														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2086 2086
 														return
2087 2087
 													}
2088
-													if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
2088
+													if adminInfo.CurrentOrgId == 10215 {
2089 2089
 														if prescribing_number > batch_number_all_count {
2090 2090
 															c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
2091 2091
 															return
@@ -2103,7 +2103,7 @@ func (c *HisApiController) CreateHisPrescription() {
2103 2103
 															c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2104 2104
 															return
2105 2105
 														}
2106
-														if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
2106
+														if adminInfo.CurrentOrgId == 10215 {
2107 2107
 															if prescribing_number > batch_number_all_count {
2108 2108
 																c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
2109 2109
 																return
@@ -2159,7 +2159,7 @@ func (c *HisApiController) CreateHisPrescription() {
2159 2159
 														c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
2160 2160
 														return
2161 2161
 													}
2162
-													if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
2162
+													if adminInfo.CurrentOrgId == 10215 {
2163 2163
 														// 查询该药品最后一次出库记录
2164 2164
 														outInfo, _ := service.GetLastDrugWarehouseOutByDrugIdTwenty(drug_id, patient_id, recordDateTime, adviceId)
2165 2165
 
@@ -2319,7 +2319,7 @@ func (c *HisApiController) CreateHisPrescription() {
2319 2319
 														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2320 2320
 														return
2321 2321
 													}
2322
-													if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
2322
+													if adminInfo.CurrentOrgId == 10215 {
2323 2323
 														if prescribing_number > batch_number_all_count {
2324 2324
 															c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
2325 2325
 															return
@@ -2337,7 +2337,7 @@ func (c *HisApiController) CreateHisPrescription() {
2337 2337
 															c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2338 2338
 															return
2339 2339
 														}
2340
-														if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
2340
+														if adminInfo.CurrentOrgId == 10215 {
2341 2341
 															if prescribing_number > batch_number_all_count {
2342 2342
 																c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
2343 2343
 																return
@@ -2386,7 +2386,7 @@ func (c *HisApiController) CreateHisPrescription() {
2386 2386
 														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2387 2387
 														return
2388 2388
 													}
2389
-													if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
2389
+													if adminInfo.CurrentOrgId == 10215 {
2390 2390
 														if (number_count - device_number) > batch_number_count {
2391 2391
 															c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
2392 2392
 															return
@@ -3068,10 +3068,29 @@ func (c *HisApiController) CreateHisPrescription() {
3068 3068
 									if p.Price != lastWarehouse.PackingPrice {
3069 3069
 										p.Price = lastWarehouse.PackingPrice
3070 3070
 									}
3071
+									if p.Unit == "" {
3072
+										goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
3073
+										p.Unit = goodInfoOne.PackingUnit
3074
+									}
3071 3075
 								}
3072 3076
 
3073 3077
 							}
3074 3078
 
3079
+							//if adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10265 {
3080
+							//
3081
+							//	if p.Type == 3 {
3082
+							//		//查询该耗材是否停用
3083
+							//		goodInfoSeven, _ := service.GetGoodByIdIsStop(p.ProjectId, adminInfo.CurrentOrgId)
3084
+							//		//表示该耗材已经停用,不能保存
3085
+							//		if goodInfoSeven.ID == 0 {
3086
+							//			goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
3087
+							//			c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材已经停用,保存失败!")
3088
+							//			return
3089
+							//		}
3090
+							//	}
3091
+							//
3092
+							//}
3093
+
3075 3094
 							service.CreateHisProjectTwo(&p)
3076 3095
 							//记录日志
3077 3096
 							byterequest, _ := json.Marshal(p)

+ 277 - 283
controllers/his_print_api_controller.go View File

@@ -5,15 +5,9 @@ import (
5 5
 	"XT_New/models"
6 6
 	"XT_New/service"
7 7
 	"XT_New/utils"
8
-	"bytes"
9
-	"encoding/json"
10
-	"encoding/xml"
11 8
 	"fmt"
12 9
 	"github.com/astaxie/beego"
13
-	"io/ioutil"
14
-	"net/http"
15 10
 	"os"
16
-	"strconv"
17 11
 	"strings"
18 12
 	"time"
19 13
 )
@@ -32,205 +26,205 @@ func HisPrintApiRegistRouters() {
32 26
 	beego.Router("/api/his/prescription/summary", &HisPrintApiController{}, "get:GetUnChargePrescriptionSummary")
33 27
 	beego.Router("/api/his/label/create", &HisPrintApiController{}, "get:CreateLablePrint")
34 28
 	beego.Router("/api/his/label/get", &HisPrintApiController{}, "get:GetLablePrint")
35
-	beego.Router("/api/his/label/send", &HisPrintApiController{}, "get:SendApplyCode")
29
+	//beego.Router("/api/his/label/send", &HisPrintApiController{}, "get:SendApplyCode")
36 30
 }
37 31
 
38
-func (c *HisPrintApiController) SendApplyCode() {
39
-	list, _ := service.GetAllLisDataFor10191(c.GetAdminUserInfo().CurrentOrgId)
40
-	if len(list) > 0 {
41
-		//插入中间库中
42
-		for _, item := range list {
43
-			if len(item.ApplyCode) == 0 {
44
-				var apply models.JYApply
45
-				apply.BedCode = ""
46
-				apply.PatientName = item.Patient.Name
47
-				idCard := item.Patient.IdCardNo // 身份证号码示例
48
-				age, err := GetAge(idCard)
49
-				if err != nil {
50
-					age = int(item.Patient.Age)
51
-					fmt.Println("计算年龄时出错:", err)
52
-				}
53
-
54
-				apply.Age = strconv.FormatInt(int64(age), 10)
55
-				apply.AgeUnit = "岁"
56
-				if item.Patient.Gender == 1 {
57
-					apply.Sex = "男"
58
-				} else if item.Patient.Gender == 2 {
59
-					apply.Sex = "女"
60
-				} else {
61
-					apply.Sex = "不详"
62
-				}
63
-				apply.RegisterCode = ""
64
-				apply.Diagnosis = ""
65
-				apply.Ward = ""
66
-				role, _ := service.GetAdminUserRole(2398, c.GetAdminUserInfo().CurrentOrgId)
67
-				apply.SendDoctor = role.UserName
68
-				apply.PatientType = 1
69
-				apply.PatientPhone = item.Patient.Phone
70
-				//applys = append(applys, apply)
71
-				var jYApplyDetails []models.CustomerApplyDetail
72
-
73
-				if len(item.ItemIds) > 0 {
74
-					team_ids := strings.Split(item.ItemIds, ",")
75
-					for index, subItem := range team_ids {
76
-						//判断一些需要拆分的组套 血透体检(定量):需要拆分出传染病检查(定性),丙型肝炎抗体测试,血透体检(定量)
77
-						if subItem == "267" {
78
-							//血透体检(定量)
79
-							var jYApplyDetail models.CustomerApplyDetail
80
-							id, _ := strconv.ParseInt(subItem, 10, 64)
81
-							jYApplyDetail.CustomerChargeItemCode = strconv.FormatInt(id, 10)
82
-							jYApplyDetail.RowIndex = int64(index + 1)
83
-							jYApplyDetail.Barcode = ""
84
-							jYApplyDetail.CustomerBarcode = strconv.FormatInt(item.ID, 10)
85
-							jYApplyDetail.Comment = ""
86
-							jYApplyDetail.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
87
-							jYApplyDetails = append(jYApplyDetails, jYApplyDetail)
88
-
89
-							//丙型肝炎抗体测定
90
-							var jYApplyDetail2 models.CustomerApplyDetail
91
-							id2, _ := strconv.ParseInt("26701", 10, 64)
92
-							jYApplyDetail2.CustomerChargeItemCode = strconv.FormatInt(id2, 10)
93
-							jYApplyDetail2.RowIndex = int64(index + 1)
94
-							jYApplyDetail2.Barcode = ""
95
-							jYApplyDetail2.CustomerBarcode = strconv.FormatInt(item.ID, 10)
96
-							jYApplyDetail2.Comment = ""
97
-							jYApplyDetail2.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
98
-							jYApplyDetails = append(jYApplyDetails, jYApplyDetail2)
99
-
100
-							//传染病检查(定性)
101
-							var jYApplyDetail3 models.CustomerApplyDetail
102
-							id3, _ := strconv.ParseInt("26700", 10, 64)
103
-							jYApplyDetail3.CustomerChargeItemCode = strconv.FormatInt(id3, 10)
104
-							jYApplyDetail3.RowIndex = int64(index + 1)
105
-							jYApplyDetail3.Barcode = ""
106
-							jYApplyDetail3.CustomerBarcode = strconv.FormatInt(item.ID, 10)
107
-							jYApplyDetail3.Comment = ""
108
-							jYApplyDetail3.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
109
-							jYApplyDetails = append(jYApplyDetails, jYApplyDetail3)
110
-
111
-						}
112
-
113
-						//判断一些需要拆分的组套 血透体检(定性):需要拆分出传染病检查(定性),丙型肝炎抗体测试,血透体检(定性)
114
-						if subItem == "424" {
115
-							//血透体检(定性)
116
-							var jYApplyDetail models.CustomerApplyDetail
117
-							id, _ := strconv.ParseInt(subItem, 10, 64)
118
-							jYApplyDetail.CustomerChargeItemCode = strconv.FormatInt(id, 10)
119
-							jYApplyDetail.RowIndex = int64(index + 1)
120
-							jYApplyDetail.Barcode = ""
121
-							jYApplyDetail.CustomerBarcode = strconv.FormatInt(item.ID, 10)
122
-							jYApplyDetail.Comment = ""
123
-							jYApplyDetail.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
124
-							jYApplyDetails = append(jYApplyDetails, jYApplyDetail)
125
-
126
-							//丙型肝炎抗体测定
127
-							var jYApplyDetail2 models.CustomerApplyDetail
128
-							id2, _ := strconv.ParseInt("42401", 10, 64)
129
-							jYApplyDetail2.CustomerChargeItemCode = strconv.FormatInt(id2, 10)
130
-							jYApplyDetail2.RowIndex = int64(index + 1)
131
-							jYApplyDetail2.Barcode = ""
132
-							jYApplyDetail2.CustomerBarcode = strconv.FormatInt(item.ID, 10)
133
-							jYApplyDetail2.Comment = ""
134
-							jYApplyDetail2.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
135
-							jYApplyDetails = append(jYApplyDetails, jYApplyDetail2)
136
-
137
-							//传染病检查(定性)
138
-							var jYApplyDetail3 models.CustomerApplyDetail
139
-							id3, _ := strconv.ParseInt("42400", 10, 64)
140
-							jYApplyDetail3.CustomerChargeItemCode = strconv.FormatInt(id3, 10)
141
-							jYApplyDetail3.RowIndex = int64(index + 1)
142
-							jYApplyDetail3.Barcode = ""
143
-							jYApplyDetail3.CustomerBarcode = strconv.FormatInt(item.ID, 10)
144
-							jYApplyDetail3.Comment = ""
145
-							jYApplyDetail3.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
146
-							jYApplyDetails = append(jYApplyDetails, jYApplyDetail3)
147
-
148
-						}
149
-						var jYApplyDetail models.CustomerApplyDetail
150
-						id, _ := strconv.ParseInt(subItem, 10, 64)
151
-						jYApplyDetail.CustomerChargeItemCode = strconv.FormatInt(id, 10)
152
-						jYApplyDetail.RowIndex = int64(index + 1)
153
-						jYApplyDetail.Barcode = ""
154
-						jYApplyDetail.CustomerBarcode = strconv.FormatInt(item.ID, 10)
155
-						jYApplyDetail.Comment = ""
156
-						jYApplyDetail.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
157
-						jYApplyDetails = append(jYApplyDetails, jYApplyDetail)
158
-					}
159
-				}
160
-
161
-				if len(item.ProjectIds) > 0 {
162
-					team_ids := strings.Split(item.ProjectIds, ",")
163
-					for index, subItem := range team_ids {
164
-						var jYApplyDetail models.CustomerApplyDetail
165
-						id, _ := strconv.ParseInt(subItem, 10, 64)
166
-						jYApplyDetail.CustomerChargeItemCode = strconv.FormatInt(id, 10)
167
-						jYApplyDetail.RowIndex = int64(index)
168
-						jYApplyDetail.Barcode = ""
169
-						jYApplyDetail.CustomerBarcode = strconv.FormatInt(item.ID, 10)
170
-						jYApplyDetail.Comment = ""
171
-						jYApplyDetail.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
172
-						jYApplyDetails = append(jYApplyDetails, jYApplyDetail)
173
-					}
174
-				}
175
-				result := PostInspectApply(key, apply, jYApplyDetails)
176
-				if result.Res == 0 {
177
-					item.ApplyCode = result.JYApplyResult.ApplyCode
178
-					jsonData, err := json.Marshal(apply)
179
-					if err != nil {
180
-						fmt.Println("转换为JSON时发生错误:", err)
181
-					}
182
-					jsonStr := string(jsonData)
183
-					jsonData2, err2 := json.Marshal(jYApplyDetails)
184
-					if err2 != nil {
185
-						fmt.Println("转换为JSON时发生错误:", err2)
186
-					}
187
-					jsonStr2 := string(jsonData2)
188
-
189
-					jsonData3, err3 := json.Marshal(result)
190
-					if err3 != nil {
191
-						fmt.Println("转换为JSON时发生错误:", err3)
192
-					}
193
-					jsonStr3 := string(jsonData3)
194
-					saveSuccessLog(jsonStr3, jsonStr+"\r\n"+jsonStr2, "申清单成功日志", "申清单")
195
-					err1 := service.CreateLabelPrint(&item)
196
-					if err1 == nil {
197
-						c.ServeSuccessJSON(map[string]interface{}{
198
-							"msg": "发送成功",
199
-						})
200
-					}
201
-					return
202
-				} else {
203
-					jsonData, err := json.Marshal(apply)
204
-					if err != nil {
205
-						fmt.Println("转换为JSON时发生错误:", err)
206
-
207
-					}
208
-					jsonStr := string(jsonData)
209
-
210
-					jsonData2, err2 := json.Marshal(jYApplyDetails)
211
-					if err2 != nil {
212
-						fmt.Println("转换为JSON时发生错误:", err2)
213
-
214
-					}
215
-					jsonStr2 := string(jsonData2)
216
-
217
-					jsonData3, err3 := json.Marshal(result)
218
-					if err3 != nil {
219
-						fmt.Println("转换为JSON时发生错误:", err3)
220
-
221
-					}
222
-					jsonStr3 := string(jsonData3)
223
-
224
-					SaveErrorLog(jsonStr3, jsonStr+"\r\n"+jsonStr2, "申清单错误日志", "申清单")
225
-
226
-					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
227
-					return
228
-				}
229
-			}
230
-		}
231
-
232
-	}
233
-}
32
+//func (c *HisPrintApiController) SendApplyCode() {
33
+//	list, _ := service.GetAllLisDataFor10191(c.GetAdminUserInfo().CurrentOrgId)
34
+//	if len(list) > 0 {
35
+//		//插入中间库中
36
+//		for _, item := range list {
37
+//			if len(item.ApplyCode) == 0 {
38
+//				var apply models.JYApply
39
+//				apply.BedCode = ""
40
+//				apply.PatientName = item.Patient.Name
41
+//				idCard := item.Patient.IdCardNo // 身份证号码示例
42
+//				age, err := GetAge(idCard)
43
+//				if err != nil {
44
+//					age = int(item.Patient.Age)
45
+//					fmt.Println("计算年龄时出错:", err)
46
+//				}
47
+//
48
+//				apply.Age = strconv.FormatInt(int64(age), 10)
49
+//				apply.AgeUnit = "岁"
50
+//				if item.Patient.Gender == 1 {
51
+//					apply.Sex = "男"
52
+//				} else if item.Patient.Gender == 2 {
53
+//					apply.Sex = "女"
54
+//				} else {
55
+//					apply.Sex = "不详"
56
+//				}
57
+//				apply.RegisterCode = ""
58
+//				apply.Diagnosis = ""
59
+//				apply.Ward = ""
60
+//				role, _ := service.GetAdminUserRole(2398, c.GetAdminUserInfo().CurrentOrgId)
61
+//				apply.SendDoctor = role.UserName
62
+//				apply.PatientType = 1
63
+//				apply.PatientPhone = item.Patient.Phone
64
+//				//applys = append(applys, apply)
65
+//				var jYApplyDetails []models.CustomerApplyDetail
66
+//
67
+//				if len(item.ItemIds) > 0 {
68
+//					team_ids := strings.Split(item.ItemIds, ",")
69
+//					for index, subItem := range team_ids {
70
+//						//判断一些需要拆分的组套 血透体检(定量):需要拆分出传染病检查(定性),丙型肝炎抗体测试,血透体检(定量)
71
+//						if subItem == "267" {
72
+//							//血透体检(定量)
73
+//							var jYApplyDetail models.CustomerApplyDetail
74
+//							id, _ := strconv.ParseInt(subItem, 10, 64)
75
+//							jYApplyDetail.CustomerChargeItemCode = strconv.FormatInt(id, 10)
76
+//							jYApplyDetail.RowIndex = int64(index + 1)
77
+//							jYApplyDetail.Barcode = ""
78
+//							jYApplyDetail.CustomerBarcode = strconv.FormatInt(item.ID, 10)
79
+//							jYApplyDetail.Comment = ""
80
+//							jYApplyDetail.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
81
+//							jYApplyDetails = append(jYApplyDetails, jYApplyDetail)
82
+//
83
+//							//丙型肝炎抗体测定
84
+//							var jYApplyDetail2 models.CustomerApplyDetail
85
+//							id2, _ := strconv.ParseInt("26701", 10, 64)
86
+//							jYApplyDetail2.CustomerChargeItemCode = strconv.FormatInt(id2, 10)
87
+//							jYApplyDetail2.RowIndex = int64(index + 1)
88
+//							jYApplyDetail2.Barcode = ""
89
+//							jYApplyDetail2.CustomerBarcode = strconv.FormatInt(item.ID, 10)
90
+//							jYApplyDetail2.Comment = ""
91
+//							jYApplyDetail2.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
92
+//							jYApplyDetails = append(jYApplyDetails, jYApplyDetail2)
93
+//
94
+//							//传染病检查(定性)
95
+//							var jYApplyDetail3 models.CustomerApplyDetail
96
+//							id3, _ := strconv.ParseInt("26700", 10, 64)
97
+//							jYApplyDetail3.CustomerChargeItemCode = strconv.FormatInt(id3, 10)
98
+//							jYApplyDetail3.RowIndex = int64(index + 1)
99
+//							jYApplyDetail3.Barcode = ""
100
+//							jYApplyDetail3.CustomerBarcode = strconv.FormatInt(item.ID, 10)
101
+//							jYApplyDetail3.Comment = ""
102
+//							jYApplyDetail3.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
103
+//							jYApplyDetails = append(jYApplyDetails, jYApplyDetail3)
104
+//
105
+//						}
106
+//
107
+//						//判断一些需要拆分的组套 血透体检(定性):需要拆分出传染病检查(定性),丙型肝炎抗体测试,血透体检(定性)
108
+//						if subItem == "424" {
109
+//							//血透体检(定性)
110
+//							var jYApplyDetail models.CustomerApplyDetail
111
+//							id, _ := strconv.ParseInt(subItem, 10, 64)
112
+//							jYApplyDetail.CustomerChargeItemCode = strconv.FormatInt(id, 10)
113
+//							jYApplyDetail.RowIndex = int64(index + 1)
114
+//							jYApplyDetail.Barcode = ""
115
+//							jYApplyDetail.CustomerBarcode = strconv.FormatInt(item.ID, 10)
116
+//							jYApplyDetail.Comment = ""
117
+//							jYApplyDetail.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
118
+//							jYApplyDetails = append(jYApplyDetails, jYApplyDetail)
119
+//
120
+//							//丙型肝炎抗体测定
121
+//							var jYApplyDetail2 models.CustomerApplyDetail
122
+//							id2, _ := strconv.ParseInt("42401", 10, 64)
123
+//							jYApplyDetail2.CustomerChargeItemCode = strconv.FormatInt(id2, 10)
124
+//							jYApplyDetail2.RowIndex = int64(index + 1)
125
+//							jYApplyDetail2.Barcode = ""
126
+//							jYApplyDetail2.CustomerBarcode = strconv.FormatInt(item.ID, 10)
127
+//							jYApplyDetail2.Comment = ""
128
+//							jYApplyDetail2.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
129
+//							jYApplyDetails = append(jYApplyDetails, jYApplyDetail2)
130
+//
131
+//							//传染病检查(定性)
132
+//							var jYApplyDetail3 models.CustomerApplyDetail
133
+//							id3, _ := strconv.ParseInt("42400", 10, 64)
134
+//							jYApplyDetail3.CustomerChargeItemCode = strconv.FormatInt(id3, 10)
135
+//							jYApplyDetail3.RowIndex = int64(index + 1)
136
+//							jYApplyDetail3.Barcode = ""
137
+//							jYApplyDetail3.CustomerBarcode = strconv.FormatInt(item.ID, 10)
138
+//							jYApplyDetail3.Comment = ""
139
+//							jYApplyDetail3.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
140
+//							jYApplyDetails = append(jYApplyDetails, jYApplyDetail3)
141
+//
142
+//						}
143
+//						var jYApplyDetail models.CustomerApplyDetail
144
+//						id, _ := strconv.ParseInt(subItem, 10, 64)
145
+//						jYApplyDetail.CustomerChargeItemCode = strconv.FormatInt(id, 10)
146
+//						jYApplyDetail.RowIndex = int64(index + 1)
147
+//						jYApplyDetail.Barcode = ""
148
+//						jYApplyDetail.CustomerBarcode = strconv.FormatInt(item.ID, 10)
149
+//						jYApplyDetail.Comment = ""
150
+//						jYApplyDetail.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
151
+//						jYApplyDetails = append(jYApplyDetails, jYApplyDetail)
152
+//					}
153
+//				}
154
+//
155
+//				if len(item.ProjectIds) > 0 {
156
+//					team_ids := strings.Split(item.ProjectIds, ",")
157
+//					for index, subItem := range team_ids {
158
+//						var jYApplyDetail models.CustomerApplyDetail
159
+//						id, _ := strconv.ParseInt(subItem, 10, 64)
160
+//						jYApplyDetail.CustomerChargeItemCode = strconv.FormatInt(id, 10)
161
+//						jYApplyDetail.RowIndex = int64(index)
162
+//						jYApplyDetail.Barcode = ""
163
+//						jYApplyDetail.CustomerBarcode = strconv.FormatInt(item.ID, 10)
164
+//						jYApplyDetail.Comment = ""
165
+//						jYApplyDetail.TakeSampleTime = time.Unix(item.Ctime, 0).Format("2006-01-02 15:04:05")
166
+//						jYApplyDetails = append(jYApplyDetails, jYApplyDetail)
167
+//					}
168
+//				}
169
+//				result := PostInspectApply(key, apply, jYApplyDetails)
170
+//				if result.Res == 0 {
171
+//					item.ApplyCode = result.JYApplyResult.ApplyCode
172
+//					jsonData, err := json.Marshal(apply)
173
+//					if err != nil {
174
+//						fmt.Println("转换为JSON时发生错误:", err)
175
+//					}
176
+//					jsonStr := string(jsonData)
177
+//					jsonData2, err2 := json.Marshal(jYApplyDetails)
178
+//					if err2 != nil {
179
+//						fmt.Println("转换为JSON时发生错误:", err2)
180
+//					}
181
+//					jsonStr2 := string(jsonData2)
182
+//
183
+//					jsonData3, err3 := json.Marshal(result)
184
+//					if err3 != nil {
185
+//						fmt.Println("转换为JSON时发生错误:", err3)
186
+//					}
187
+//					jsonStr3 := string(jsonData3)
188
+//					saveSuccessLog(jsonStr3, jsonStr+"\r\n"+jsonStr2, "申清单成功日志", "申清单")
189
+//					err1 := service.CreateLabelPrint(&item)
190
+//					if err1 == nil {
191
+//						c.ServeSuccessJSON(map[string]interface{}{
192
+//							"msg": "发送成功",
193
+//						})
194
+//					}
195
+//					return
196
+//				} else {
197
+//					jsonData, err := json.Marshal(apply)
198
+//					if err != nil {
199
+//						fmt.Println("转换为JSON时发生错误:", err)
200
+//
201
+//					}
202
+//					jsonStr := string(jsonData)
203
+//
204
+//					jsonData2, err2 := json.Marshal(jYApplyDetails)
205
+//					if err2 != nil {
206
+//						fmt.Println("转换为JSON时发生错误:", err2)
207
+//
208
+//					}
209
+//					jsonStr2 := string(jsonData2)
210
+//
211
+//					jsonData3, err3 := json.Marshal(result)
212
+//					if err3 != nil {
213
+//						fmt.Println("转换为JSON时发生错误:", err3)
214
+//
215
+//					}
216
+//					jsonStr3 := string(jsonData3)
217
+//
218
+//					SaveErrorLog(jsonStr3, jsonStr+"\r\n"+jsonStr2, "申清单错误日志", "申清单")
219
+//
220
+//					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
221
+//					return
222
+//				}
223
+//			}
224
+//		}
225
+//
226
+//	}
227
+//}
234 228
 
235 229
 func (c *HisPrintApiController) GetLablePrint() {
236 230
 	patient_id, _ := c.GetInt64("patient_id")
@@ -431,86 +425,86 @@ func calculateAge(birthDate time.Time) int {
431 425
 }
432 426
 
433 427
 // 送检单
434
-func PostInspectApply(key string, apply models.JYApply, list []models.CustomerApplyDetail) models.InspectApplyData {
435
-	// 构建SOAP请求数据
436
-	requestData := &models.JYApplyEnvelope{
437
-		Soap: "http://schemas.xmlsoap.org/soap/envelope/",
438
-		Xsi:  "http://www.w3.org/2001/XMLSchema-instance",
439
-		Xsd:  "http://www.w3.org/2001/XMLSchema",
440
-		Body: models.JYApplyBody{
441
-			InspectApplyReq: models.InspectApplyReq{
442
-				XMLName: xml.Name{Local: "InspectApplyByInstituteItemCode", Space: "http://tempuri.org/"},
443
-				ApiKey:  key,
444
-				Apply:   apply,
445
-				ApplyDetailList: struct {
446
-					CustomerApplyDetail []models.CustomerApplyDetail `xml:"CustomerApplyDetail"`
447
-				}{
448
-					CustomerApplyDetail: list,
449
-				},
450
-				ApplyAdditional: nil,
451
-			},
452
-		},
453
-	}
454
-
455
-	// 将SOAP请求数据转换为XML格式
456
-	requestBody, err := xml.Marshal(requestData)
457
-	if err != nil {
458
-		fmt.Println("XML Marshal error:", err)
459
-	}
460
-	fmt.Println(string(requestBody))
461
-
462
-	// 创建POST请求
463
-	url := "http://gpis.cnhiqc.com:9799/InstituteLISService.asmx"
464
-	req, err := http.NewRequest("POST", url, bytes.NewBuffer(requestBody))
465
-	if err != nil {
466
-		fmt.Println("Request creation error:", err)
467
-	}
468
-
469
-	// 设置请求头
470
-	req.Header.Set("Content-Type", "text/xml; charset=utf-8")
471
-	req.Header.Set("Content-Length", "length")
472
-	req.Header.Set("SOAPAction", "http://tempuri.org/InspectApplyByInstituteItemCode")
473
-
474
-	// 发送请求
475
-	client := &http.Client{}
476
-	resp, err := client.Do(req)
477
-	if err != nil {
478
-		fmt.Println("Request error:", err)
479
-	}
480
-	defer resp.Body.Close()
481
-
482
-	// 读取响应数据
483
-	responseBody, err := ioutil.ReadAll(resp.Body)
484
-	if err != nil {
485
-		fmt.Println("Response read error:", err)
486
-
487
-	}
488
-	fmt.Println(string(responseBody))
489
-
490
-	// 解析XML数据
491
-	var envelope_four models.EnvelopeFour
492
-	err2 := xml.Unmarshal(responseBody, &envelope_four)
493
-	if err2 != nil {
494
-		fmt.Println("XML Unmarshal error:", err2)
495
-
496
-	}
497
-
498
-	// 获取GetReportListResult的JSON字符串
499
-	jsonStr := envelope_four.Body.InspectApplyByInstituteItemCodeResponse.InspectApply
500
-
501
-	// 解析JSON字符串到结构体
502
-	var reportData models.InspectApplyData
503
-	err = json.Unmarshal([]byte(jsonStr), &reportData)
504
-
505
-	if err != nil {
506
-		fmt.Println("JSON Unmarshal error:", err)
507
-	}
508
-	if reportData.Res != 0 {
509
-		fmt.Println("Data:", reportData)
510
-		//return reportData.JYApplyResult
511
-	}
512
-	return reportData
513
-}
428
+//func PostInspectApply(key string, apply models.JYApply, list []models.CustomerApplyDetail) models.InspectApplyData {
429
+//	// 构建SOAP请求数据
430
+//	requestData := &models.JYApplyEnvelope{
431
+//		Soap: "http://schemas.xmlsoap.org/soap/envelope/",
432
+//		Xsi:  "http://www.w3.org/2001/XMLSchema-instance",
433
+//		Xsd:  "http://www.w3.org/2001/XMLSchema",
434
+//		Body: models.JYApplyBody{
435
+//			InspectApplyReq: models.InspectApplyReq{
436
+//				XMLName: xml.Name{Local: "InspectApplyByInstituteItemCode", Space: "http://tempuri.org/"},
437
+//				ApiKey:  key,
438
+//				Apply:   apply,
439
+//				ApplyDetailList: struct {
440
+//					CustomerApplyDetail []models.CustomerApplyDetail `xml:"CustomerApplyDetail"`
441
+//				}{
442
+//					CustomerApplyDetail: list,
443
+//				},
444
+//				ApplyAdditional: nil,
445
+//			},
446
+//		},
447
+//	}
448
+//
449
+//	// 将SOAP请求数据转换为XML格式
450
+//	requestBody, err := xml.Marshal(requestData)
451
+//	if err != nil {
452
+//		fmt.Println("XML Marshal error:", err)
453
+//	}
454
+//	fmt.Println(string(requestBody))
455
+//
456
+//	// 创建POST请求
457
+//	url := "http://gpis.cnhiqc.com:9799/InstituteLISService.asmx"
458
+//	req, err := http.NewRequest("POST", url, bytes.NewBuffer(requestBody))
459
+//	if err != nil {
460
+//		fmt.Println("Request creation error:", err)
461
+//	}
462
+//
463
+//	// 设置请求头
464
+//	req.Header.Set("Content-Type", "text/xml; charset=utf-8")
465
+//	req.Header.Set("Content-Length", "length")
466
+//	req.Header.Set("SOAPAction", "http://tempuri.org/InspectApplyByInstituteItemCode")
467
+//
468
+//	// 发送请求
469
+//	client := &http.Client{}
470
+//	resp, err := client.Do(req)
471
+//	if err != nil {
472
+//		fmt.Println("Request error:", err)
473
+//	}
474
+//	defer resp.Body.Close()
475
+//
476
+//	// 读取响应数据
477
+//	responseBody, err := ioutil.ReadAll(resp.Body)
478
+//	if err != nil {
479
+//		fmt.Println("Response read error:", err)
480
+//
481
+//	}
482
+//	fmt.Println(string(responseBody))
483
+//
484
+//	// 解析XML数据
485
+//	var envelope_four models.EnvelopeFour
486
+//	err2 := xml.Unmarshal(responseBody, &envelope_four)
487
+//	if err2 != nil {
488
+//		fmt.Println("XML Unmarshal error:", err2)
489
+//
490
+//	}
491
+//
492
+//	// 获取GetReportListResult的JSON字符串
493
+//	jsonStr := envelope_four.Body.InspectApplyByInstituteItemCodeResponse.InspectApply
494
+//
495
+//	// 解析JSON字符串到结构体
496
+//	var reportData models.InspectApplyData
497
+//	err = json.Unmarshal([]byte(jsonStr), &reportData)
498
+//
499
+//	if err != nil {
500
+//		fmt.Println("JSON Unmarshal error:", err)
501
+//	}
502
+//	if reportData.Res != 0 {
503
+//		fmt.Println("Data:", reportData)
504
+//		//return reportData.JYApplyResult
505
+//	}
506
+//	return reportData
507
+//}
514 508
 
515 509
 func SaveErrorLog(result string, request string, infno string, desc string) {
516 510
 	//org_id, _ := beego.AppConfig.Int64("org_id")

+ 11 - 0
controllers/manager_center_api_controller.go View File

@@ -37,6 +37,7 @@ func ManagerCenterRegistRouters() {
37 37
 	beego.Router("/api/dictionary/updatechildconfig", &ManagerCenterApiController{}, "Post:UpdateChildConfig")
38 38
 	beego.Router("/api/dictionary/deletechildconfig", &ManagerCenterApiController{}, "Post:DeleteChildConfig")
39 39
 	beego.Router("/api/dictionary/updatetemplate", &ManagerCenterApiController{}, "Post:UpdateTemplate")
40
+	beego.Router("/api/dictionary/getmanageconfiglist", &ManagerCenterApiController{}, "get,post:GetManageConfigList")
40 41
 
41 42
 	//经销商
42 43
 	beego.Router("/api/stock/dealer/create", &ManagerCenterApiController{}, "post:CreateDealer")
@@ -681,6 +682,16 @@ func (c *ManagerCenterApiController) GetConfigList() {
681 682
 
682 683
 }
683 684
 
685
+func (c *ManagerCenterApiController) GetManageConfigList() {
686
+	adminUserInfo := c.GetAdminUserInfo()
687
+	configList, _ := service.GetConfigList(adminUserInfo.CurrentOrgId)
688
+	fmt.Println("configListwowowowowowowowowowowowo", configList)
689
+	c.ServeSuccessJSON(map[string]interface{}{
690
+		"configlist": configList,
691
+	})
692
+	return
693
+}
694
+
684 695
 // CreateConfig  创建配置信息
685 696
 func (c *ManagerCenterApiController) CreateConfig() {
686 697
 	adminUserInfo := c.GetAdminUserInfo()

+ 10 - 10
controllers/mobile_api_controllers/check_weight_api_controller.go View File

@@ -543,13 +543,13 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
543 543
 				//记录日志
544 544
 				byterequest, _ := json.Marshal(newprescribe)
545 545
 				prescriptionLog := models.XtDialysisPrescriptionLog{
546
-					UserOrgId:   newprescribe.UserOrgId,
546
+					UserOrgId:   adminUserInfo.Org.Id,
547 547
 					Ctime:       time.Now().Unix(),
548 548
 					Mtime:       0,
549 549
 					ErrLog:      string(byterequest),
550 550
 					AdminUserId: adminUserInfo.AdminUser.Id,
551 551
 					RecordDate:  newprescribe.RecordDate,
552
-					PatientId:   newprescribe.PatientId,
552
+					PatientId:   id,
553 553
 					Source:      "物联网上传",
554 554
 					Status:      1,
555 555
 				}
@@ -634,13 +634,13 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
634 634
 				//记录日志
635 635
 				byterequest, _ := json.Marshal(newprescribe)
636 636
 				prescriptionLog := models.XtDialysisPrescriptionLog{
637
-					UserOrgId:   newprescribe.UserOrgId,
637
+					UserOrgId:   adminUserInfo.Org.Id,
638 638
 					Ctime:       time.Now().Unix(),
639 639
 					Mtime:       0,
640 640
 					ErrLog:      string(byterequest),
641 641
 					AdminUserId: adminUserInfo.AdminUser.Id,
642 642
 					RecordDate:  newprescribe.RecordDate,
643
-					PatientId:   newprescribe.PatientId,
643
+					PatientId:   id,
644 644
 					Source:      "物联网上传",
645 645
 					Status:      1,
646 646
 				}
@@ -676,13 +676,13 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
676 676
 				//记录日志
677 677
 				byterequest, _ := json.Marshal(newprescribe)
678 678
 				prescriptionLog := models.XtDialysisPrescriptionLog{
679
-					UserOrgId:   newprescribe.UserOrgId,
679
+					UserOrgId:   adminUserInfo.Org.Id,
680 680
 					Ctime:       time.Now().Unix(),
681 681
 					Mtime:       0,
682 682
 					ErrLog:      string(byterequest),
683 683
 					AdminUserId: adminUserInfo.AdminUser.Id,
684 684
 					RecordDate:  newprescribe.RecordDate,
685
-					PatientId:   newprescribe.PatientId,
685
+					PatientId:   id,
686 686
 					Source:      "物联网上传",
687 687
 					Status:      1,
688 688
 				}
@@ -717,13 +717,13 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
717 717
 			//记录日志
718 718
 			byterequest, _ := json.Marshal(dialysisPrescribe)
719 719
 			prescriptionLog := models.XtDialysisPrescriptionLog{
720
-				UserOrgId:   dialysisPrescribe.UserOrgId,
720
+				UserOrgId:   adminUserInfo.Org.Id,
721 721
 				Ctime:       time.Now().Unix(),
722 722
 				Mtime:       0,
723 723
 				ErrLog:      string(byterequest),
724 724
 				AdminUserId: adminUserInfo.AdminUser.Id,
725 725
 				RecordDate:  dialysisPrescribe.RecordDate,
726
-				PatientId:   dialysisPrescribe.PatientId,
726
+				PatientId:   id,
727 727
 				Source:      "物联网上传",
728 728
 				Status:      1,
729 729
 			}
@@ -849,13 +849,13 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
849 849
 		//记录日志
850 850
 		byterequest, _ := json.Marshal(evaluation)
851 851
 		beforLog := models.XtAssessmentBeforeDislysisLog{
852
-			UserOrgId:   evaluation.UserOrgId,
852
+			UserOrgId:   adminUserInfo.Org.Id,
853 853
 			Ctime:       time.Now().Unix(),
854 854
 			Mtime:       0,
855 855
 			ErrLog:      string(byterequest),
856 856
 			AdminUserId: adminUserInfo.AdminUser.Id,
857 857
 			RecordDate:  evaluation.AssessmentDate,
858
-			PatientId:   evaluation.PatientId,
858
+			PatientId:   id,
859 859
 			Source:      "物联网上传",
860 860
 			Status:      1,
861 861
 		}

+ 18 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -1631,7 +1631,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
1631 1631
 			Status:      1,
1632 1632
 			ErrLog:      string(byterequest),
1633 1633
 			AdminUserId: adminUserInfo.AdminUser.Id,
1634
-			Ctime:       0,
1634
+			Ctime:       time.Now().Unix(),
1635 1635
 			Mtime:       0,
1636 1636
 			Source:      "手机端修改保存透后评估",
1637 1637
 		}
@@ -9814,3 +9814,20 @@ func (c *DialysisAPIController) GetControlMonitorList() {
9814 9814
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
9815 9815
 	}
9816 9816
 }
9817
+
9818
+func (c *DialysisAPIController) GetAdviceListNoExecution() {
9819
+
9820
+	timeStr := time.Now().Format("2006-01-02")
9821
+	timeLayout := "2006-01-02 15:04:05"
9822
+	timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
9823
+	timenow := timeStringToTime.Unix()
9824
+
9825
+	orgId := c.GetMobileAdminUserInfo().Org.Id
9826
+
9827
+	adviceList, _ := service.GetAdviceListNoExecution(timenow, orgId)
9828
+
9829
+	c.ServeSuccessJSON(map[string]interface{}{
9830
+		"adviceList": adviceList,
9831
+	})
9832
+
9833
+}

+ 36 - 1
controllers/mobile_api_controllers/dialysis_api_controller_extend.go View File

@@ -211,7 +211,7 @@ func (this *DialysisAPIController) AddMonitorRecord() {
211 211
 		PatientId:   record.PatientId,
212 212
 		Module:      1,
213 213
 		AdminUserId: adminInfo.AdminUser.Id,
214
-		Ctime:       0,
214
+		Ctime:       time.Now().Unix(),
215 215
 		Mtime:       0,
216 216
 		Status:      1,
217 217
 		UserOrgId:   record.UserOrgId,
@@ -663,6 +663,24 @@ func (this *DialysisAPIController) AddUrgentSchedule() {
663 663
 				IsExport:     5,
664 664
 			}
665 665
 			createErr := service.CreateScheduleTwo(newSchedule)
666
+
667
+			//记录日志
668
+			byterequest, _ := json.Marshal(newSchedule)
669
+			scheduleLog := models.XtScheduleLog{
670
+				UserOrgId:   adminUserInfo.Org.Id,
671
+				RecordDate:  scheduleDate.Unix(),
672
+				Status:      1,
673
+				PatientId:   patientID,
674
+				Ctime:       time.Now().Unix(),
675
+				Mtime:       0,
676
+				ErrLog:      string(byterequest),
677
+				Source:      "手机端新增排班",
678
+				Module:      1,
679
+				AdminUserId: adminUserInfo.AdminUser.Id,
680
+			}
681
+
682
+			service.CreateScheduleLog(scheduleLog)
683
+
666 684
 			redis := service.RedisClient()
667 685
 			timeStr := time.Now().Format("2006-01-02")
668 686
 			key := "scheduals_" + timeStr + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
@@ -725,6 +743,23 @@ func (this *DialysisAPIController) AddUrgentSchedule() {
725 743
 					daySchedule.ScheduleType = scheduleType
726 744
 					daySchedule.UpdatedTime = time.Now().Unix()
727 745
 					err := service.UpdateSchedule(&daySchedule)
746
+
747
+					//记录日志
748
+					byterequest, _ := json.Marshal(daySchedule)
749
+					scheduleLog := models.XtScheduleLog{
750
+						UserOrgId:   adminUserInfo.Org.Id,
751
+						RecordDate:  scheduleDate.Unix(),
752
+						Status:      1,
753
+						PatientId:   patientID,
754
+						Ctime:       time.Now().Unix(),
755
+						Mtime:       0,
756
+						ErrLog:      string(byterequest),
757
+						Source:      "手机端修改排班",
758
+						Module:      1,
759
+						AdminUserId: adminUserInfo.AdminUser.Id,
760
+					}
761
+					service.CreateScheduleLog(scheduleLog)
762
+
728 763
 					redis := service.RedisClient()
729 764
 
730 765
 					timeStr := time.Now().Format("2006-01-02")

+ 2 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go View File

@@ -201,4 +201,6 @@ func MobileAPIControllersRegisterRouters() {
201 201
 
202 202
 	beego.Router("/m/api/getcontrolmonitorlist", &DialysisAPIController{}, "Get:GetControlMonitorList")
203 203
 
204
+	beego.Router("/m/api/getadvicelistnoexecution", &DialysisAPIController{}, "Get:GetAdviceListNoExecution")
205
+
204 206
 }

+ 67 - 50
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -669,6 +669,23 @@ func (c *PatientApiController) ExecDoctorAdvice() {
669 669
 				if item.ExecutionState == 2 {
670 670
 					advice = item
671 671
 				}
672
+
673
+				//记录日志
674
+				byterequest, _ := json.Marshal(item)
675
+				adviceLog := models.XtDoctorAdviceLog{
676
+					UserOrgId:   item.UserOrgId,
677
+					PatientId:   item.PatientId,
678
+					AdminUserId: adminUserInfo.AdminUser.Id,
679
+					Module:      2,
680
+					ErrLog:      string(byterequest),
681
+					Status:      1,
682
+					Ctime:       time.Now().Unix(),
683
+					Mtime:       0,
684
+					Source:      "手机端执行医嘱",
685
+					RecordDate:  item.AdviceDate,
686
+				}
687
+
688
+				service.CreateDoctorAdviceLog(adviceLog)
672 689
 			}
673 690
 		} else {
674 691
 			advices, _ := service.FindDoctorAdviceByIds(adminUserInfo.Org.Id, ids)
@@ -737,22 +754,6 @@ func (c *PatientApiController) ExecDoctorAdvice() {
737 754
 				}
738 755
 			}
739 756
 			err = service.ExceDoctorAdviceByGroupNo(&advices, groupno, adminUserInfo.Org.Id)
740
-			//记录日志
741
-			byterequest, _ := json.Marshal(advices)
742
-			adviceLog := models.XtDoctorAdviceLog{
743
-				UserOrgId:   advices.UserOrgId,
744
-				PatientId:   advices.PatientId,
745
-				AdminUserId: advices.ExecutionStaff,
746
-				Module:      2,
747
-				ErrLog:      string(byterequest),
748
-				Status:      1,
749
-				Ctime:       time.Now().Unix(),
750
-				Mtime:       0,
751
-				Source:      "手机端执行医嘱",
752
-				RecordDate:  advices.RecordDate,
753
-			}
754
-
755
-			service.CreateDoctorAdviceLog(adviceLog)
756 757
 
757 758
 			key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.PatientId, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":doctor_advices"
758 759
 			redis := service.RedisClient()
@@ -802,11 +803,11 @@ func (c *PatientApiController) ExecDoctorAdvice() {
802 803
 			err = service.BatchExceOldDoctorAdvice(&advices, ids)
803 804
 
804 805
 			//记录日志
805
-			byterequest, _ := json.Marshal(advices)
806
+			byterequest, _ := json.Marshal(advice)
806 807
 			adviceLog := models.XtDoctorAdviceLog{
807
-				UserOrgId:   advices.UserOrgId,
808
-				PatientId:   advices.PatientId,
809
-				AdminUserId: advices.ExecutionStaff,
808
+				UserOrgId:   advice.UserOrgId,
809
+				PatientId:   advice.PatientId,
810
+				AdminUserId: adminUserInfo.AdminUser.Id,
810 811
 				Module:      2,
811 812
 				ErrLog:      string(byterequest),
812 813
 				Status:      1,
@@ -1994,6 +1995,22 @@ func (c *PatientApiController) CheckDoctorAdvice() {
1994 1995
 				if item.CheckState == 0 {
1995 1996
 					advice = item
1996 1997
 				}
1998
+
1999
+				//记录日志
2000
+				byterequest, _ := json.Marshal(advices)
2001
+				adviceLog := models.XtDoctorAdviceLog{
2002
+					UserOrgId:   adminUserInfo.Org.Id,
2003
+					PatientId:   item.PatientId,
2004
+					AdminUserId: adminUserInfo.AdminUser.Id,
2005
+					Module:      3,
2006
+					ErrLog:      string(byterequest),
2007
+					Status:      1,
2008
+					Ctime:       time.Now().Unix(),
2009
+					Mtime:       0,
2010
+					Source:      "手机端核对医嘱",
2011
+					RecordDate:  item.AdviceDate,
2012
+				}
2013
+				service.CreateDoctorAdviceLog(adviceLog)
1997 2014
 			}
1998 2015
 			if advice.CheckState == 1 {
1999 2016
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceChecked)
@@ -2011,6 +2028,22 @@ func (c *PatientApiController) CheckDoctorAdvice() {
2011 2028
 					advice = item
2012 2029
 
2013 2030
 				}
2031
+
2032
+				//记录日志
2033
+				byterequest, _ := json.Marshal(advices)
2034
+				adviceLog := models.XtDoctorAdviceLog{
2035
+					UserOrgId:   adminUserInfo.Org.Id,
2036
+					PatientId:   item.PatientId,
2037
+					AdminUserId: adminUserInfo.AdminUser.Id,
2038
+					Module:      3,
2039
+					ErrLog:      string(byterequest),
2040
+					Status:      1,
2041
+					Ctime:       time.Now().Unix(),
2042
+					Mtime:       0,
2043
+					Source:      "手机端核对医嘱",
2044
+					RecordDate:  item.AdviceDate,
2045
+				}
2046
+				service.CreateDoctorAdviceLog(adviceLog)
2014 2047
 			}
2015 2048
 			if advice.CheckState == 1 {
2016 2049
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceChecked)
@@ -2059,22 +2092,6 @@ func (c *PatientApiController) CheckDoctorAdvice() {
2059 2092
 			}
2060 2093
 			err = service.CheckDoctorAdviceByGroupNo(&advices, groupno, adminUserInfo.Org.Id)
2061 2094
 
2062
-			//记录日志
2063
-			byterequest, _ := json.Marshal(advices)
2064
-			adviceLog := models.XtDoctorAdviceLog{
2065
-				UserOrgId:   adminUserInfo.Org.Id,
2066
-				PatientId:   advices.PatientId,
2067
-				AdminUserId: advices.Checker,
2068
-				Module:      3,
2069
-				ErrLog:      string(byterequest),
2070
-				Status:      1,
2071
-				Ctime:       time.Now().Unix(),
2072
-				Mtime:       0,
2073
-				Source:      "手机端核对医嘱",
2074
-				RecordDate:  advices.AdviceDate,
2075
-			}
2076
-			service.CreateDoctorAdviceLog(adviceLog)
2077
-
2078 2095
 			key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.PatientId, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":doctor_advices"
2079 2096
 			redis := service.RedisClient()
2080 2097
 			//清空key 值
@@ -2451,13 +2468,13 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2451 2468
 			//记录日志
2452 2469
 			byterequest, _ := json.Marshal(newprescribe)
2453 2470
 			prescriptionLog := models.XtDialysisPrescriptionLog{
2454
-				UserOrgId:   newprescribe.UserOrgId,
2471
+				UserOrgId:   adminUserInfo.Org.Id,
2455 2472
 				Ctime:       time.Now().Unix(),
2456 2473
 				Mtime:       0,
2457 2474
 				ErrLog:      string(byterequest),
2458 2475
 				AdminUserId: adminUserInfo.AdminUser.Id,
2459 2476
 				RecordDate:  newprescribe.RecordDate,
2460
-				PatientId:   newprescribe.PatientId,
2477
+				PatientId:   id,
2461 2478
 				Source:      "手机端新增透前评估插入处方",
2462 2479
 				Status:      1,
2463 2480
 			}
@@ -2506,13 +2523,13 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2506 2523
 			//记录日志
2507 2524
 			byterequest, _ := json.Marshal(newprescribe)
2508 2525
 			prescriptionLog := models.XtDialysisPrescriptionLog{
2509
-				UserOrgId:   newprescribe.UserOrgId,
2526
+				UserOrgId:   adminUserInfo.Org.Id,
2510 2527
 				Ctime:       time.Now().Unix(),
2511 2528
 				Mtime:       0,
2512 2529
 				ErrLog:      string(byterequest),
2513 2530
 				AdminUserId: adminUserInfo.AdminUser.Id,
2514 2531
 				RecordDate:  newprescribe.RecordDate,
2515
-				PatientId:   newprescribe.PatientId,
2532
+				PatientId:   id,
2516 2533
 				Source:      "手机端新增透前评估插入处方",
2517 2534
 				Status:      1,
2518 2535
 			}
@@ -2610,13 +2627,13 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2610 2627
 				//记录日志
2611 2628
 				byterequest, _ := json.Marshal(newprescribe)
2612 2629
 				prescriptionLog := models.XtDialysisPrescriptionLog{
2613
-					UserOrgId:   newprescribe.UserOrgId,
2630
+					UserOrgId:   adminUserInfo.Org.Id,
2614 2631
 					Ctime:       time.Now().Unix(),
2615 2632
 					Mtime:       0,
2616 2633
 					ErrLog:      string(byterequest),
2617 2634
 					AdminUserId: adminUserInfo.AdminUser.Id,
2618 2635
 					RecordDate:  newprescribe.RecordDate,
2619
-					PatientId:   newprescribe.PatientId,
2636
+					PatientId:   id,
2620 2637
 					Source:      "手机端新增透前评估插入处方",
2621 2638
 					Status:      1,
2622 2639
 				}
@@ -2660,13 +2677,13 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2660 2677
 				//记录日志
2661 2678
 				byterequest, _ := json.Marshal(newprescribe)
2662 2679
 				prescriptionLog := models.XtDialysisPrescriptionLog{
2663
-					UserOrgId:   newprescribe.UserOrgId,
2680
+					UserOrgId:   adminUserInfo.Org.Id,
2664 2681
 					Ctime:       time.Now().Unix(),
2665 2682
 					Mtime:       0,
2666 2683
 					ErrLog:      string(byterequest),
2667 2684
 					AdminUserId: adminUserInfo.AdminUser.Id,
2668 2685
 					RecordDate:  newprescribe.RecordDate,
2669
-					PatientId:   newprescribe.PatientId,
2686
+					PatientId:   id,
2670 2687
 					Source:      "手机端新增透前评估插入处方",
2671 2688
 					Status:      1,
2672 2689
 				}
@@ -2763,13 +2780,13 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2763 2780
 				//记录日志
2764 2781
 				byterequest, _ := json.Marshal(newprescribe)
2765 2782
 				prescriptionLog := models.XtDialysisPrescriptionLog{
2766
-					UserOrgId:   newprescribe.UserOrgId,
2783
+					UserOrgId:   adminUserInfo.Org.Id,
2767 2784
 					Ctime:       time.Now().Unix(),
2768 2785
 					Mtime:       0,
2769 2786
 					ErrLog:      string(byterequest),
2770 2787
 					AdminUserId: adminUserInfo.AdminUser.Id,
2771 2788
 					RecordDate:  newprescribe.RecordDate,
2772
-					PatientId:   newprescribe.PatientId,
2789
+					PatientId:   id,
2773 2790
 					Source:      "手机端新增透前评估插入处方",
2774 2791
 					Status:      1,
2775 2792
 				}
@@ -2816,13 +2833,13 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2816 2833
 				//记录日志
2817 2834
 				byterequest, _ := json.Marshal(newprescribe)
2818 2835
 				prescriptionLog := models.XtDialysisPrescriptionLog{
2819
-					UserOrgId:   newprescribe.UserOrgId,
2836
+					UserOrgId:   adminUserInfo.Org.Id,
2820 2837
 					Ctime:       time.Now().Unix(),
2821 2838
 					Mtime:       0,
2822 2839
 					ErrLog:      string(byterequest),
2823 2840
 					AdminUserId: adminUserInfo.AdminUser.Id,
2824 2841
 					RecordDate:  newprescribe.RecordDate,
2825
-					PatientId:   newprescribe.PatientId,
2842
+					PatientId:   id,
2826 2843
 					Source:      "手机端新增透前评估插入处方",
2827 2844
 					Status:      1,
2828 2845
 				}
@@ -2920,13 +2937,13 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2920 2937
 				//记录日志
2921 2938
 				byterequest, _ := json.Marshal(newprescribe)
2922 2939
 				prescriptionLog := models.XtDialysisPrescriptionLog{
2923
-					UserOrgId:   newprescribe.UserOrgId,
2940
+					UserOrgId:   adminUserInfo.Org.Id,
2924 2941
 					Ctime:       time.Now().Unix(),
2925 2942
 					Mtime:       0,
2926 2943
 					ErrLog:      string(byterequest),
2927 2944
 					AdminUserId: adminUserInfo.AdminUser.Id,
2928 2945
 					RecordDate:  newprescribe.RecordDate,
2929
-					PatientId:   newprescribe.PatientId,
2946
+					PatientId:   id,
2930 2947
 					Source:      "手机端新增透前评估插入处方",
2931 2948
 					Status:      1,
2932 2949
 				}

+ 88 - 5
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go View File

@@ -56,14 +56,13 @@ func (this *StaffScheduleApiController) GetMobileStaffScheduleList() {
56 56
 	//fmt.Println("end_time",end_time)
57 57
 	start_time_one := this.GetString("start_time_one")
58 58
 	end_time_one := this.GetString("end_time_one")
59
-	fmt.Println("start_time_one--------", len(start_time_one))
60
-	fmt.Println("end_time_one-------", end_time_one)
59
+
61 60
 	timeLayout := "2006-01-02"
62 61
 	loc, _ := time.LoadLocation("Local")
63 62
 	var startTime int64
64 63
 	if len(start_time_one) > 0 {
65 64
 		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_one+" 00:00:00", loc)
66
-		fmt.Println("err-----------", err)
65
+
67 66
 		if err != nil {
68 67
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
69 68
 			return
@@ -80,8 +79,7 @@ func (this *StaffScheduleApiController) GetMobileStaffScheduleList() {
80 79
 		}
81 80
 		endTime = theTime.Unix()
82 81
 	}
83
-	fmt.Println("starti_time233232323232", startTime)
84
-	fmt.Println("end_time2323223232323", endTime)
82
+
85 83
 	staffList, err := service.GetStaffScheduleList(orgId, startTime, endTime)
86 84
 	if err != nil {
87 85
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
@@ -491,8 +489,25 @@ func (this *StaffScheduleApiController) DeleteSchedule() {
491 489
 	id, _ := this.GetInt64("id")
492 490
 	org_id := this.GetMobileAdminUserInfo().Org.Id
493 491
 	err := service.DeleteSchedule(id)
492
+
494 493
 	if err == nil {
495 494
 		schedule, _ := service.GetScheduleNight(org_id, id)
495
+
496
+		//记录日志
497
+		byterequest, _ := json.Marshal(schedule)
498
+		xtScheduleLog := models.XtScheduleLog{
499
+			UserOrgId:   org_id,
500
+			RecordDate:  schedule.ScheduleDate,
501
+			Status:      1,
502
+			PatientId:   schedule.PatientId,
503
+			Ctime:       time.Now().Unix(),
504
+			Mtime:       0,
505
+			ErrLog:      string(byterequest),
506
+			Source:      "手机端删除排班",
507
+			Module:      5,
508
+			AdminUserId: this.GetMobileAdminUserInfo().AdminUser.Id,
509
+		}
510
+		service.CreateScheduleLog(xtScheduleLog)
496 511
 		redis := service.RedisClient()
497 512
 		//处方
498 513
 		keyOne := strconv.FormatInt(org_id, 10) + ":" + strconv.FormatInt(schedule.ScheduleDate, 10) + ":prescriptions_list_all"
@@ -634,12 +649,31 @@ func (this *StaffScheduleApiController) UpdateDialysisPrescription() {
634 649
 }
635 650
 
636 651
 func (this *StaffScheduleApiController) UpdateBloodScheduleMode() {
652
+
637 653
 	id, _ := this.GetInt64("id")
638 654
 	mode_id, _ := this.GetInt64("mode_id")
639 655
 	schedule := models.XtSchedule{
640 656
 		ModeId: mode_id,
641 657
 	}
642 658
 	service.UpdatedScheduleMode(schedule, id)
659
+
660
+	orgId := this.GetMobileAdminUserInfo().Org.Id
661
+	//记录日志
662
+	byterequest, _ := json.Marshal(schedule)
663
+	scheduleLog := models.XtScheduleLog{
664
+		UserOrgId:   orgId,
665
+		RecordDate:  schedule.ScheduleDate,
666
+		Status:      1,
667
+		PatientId:   schedule.PatientId,
668
+		Ctime:       time.Now().Unix(),
669
+		Mtime:       0,
670
+		ErrLog:      string(byterequest),
671
+		Source:      "手机端修改排班模式",
672
+		Module:      5,
673
+		AdminUserId: this.GetMobileAdminUserInfo().AdminUser.Id,
674
+	}
675
+
676
+	service.CreateScheduleLog(scheduleLog)
643 677
 	this.ServeSuccessJSON(map[string]interface{}{
644 678
 		"msg": "保存成功",
645 679
 	})
@@ -663,6 +697,23 @@ func (this *StaffScheduleApiController) UpdateBloodSchedule() {
663 697
 	_, errschedulecode := service.GetPatientScheduleIsExist(start_time, schedule_type, bed_id, orgid)
664 698
 	if errschedulecode == gorm.ErrRecordNotFound {
665 699
 		service.UpdatedSchedule(schedule, patient_id, start_time, schedule_type, bed_id)
700
+
701
+		//记录日志
702
+		byterequest, _ := json.Marshal(schedule)
703
+		scheduleLog := models.XtScheduleLog{
704
+			UserOrgId:   orgid,
705
+			RecordDate:  schedule.ScheduleDate,
706
+			Status:      1,
707
+			PatientId:   schedule.PatientId,
708
+			Ctime:       time.Now().Unix(),
709
+			Mtime:       0,
710
+			ErrLog:      string(byterequest),
711
+			Source:      "手机修改排班班次",
712
+			Module:      5,
713
+			AdminUserId: this.GetMobileAdminUserInfo().AdminUser.Id,
714
+		}
715
+
716
+		service.CreateScheduleLog(scheduleLog)
666 717
 		this.ServeSuccessJSON(map[string]interface{}{
667 718
 			"msgerr": "保存成功",
668 719
 		})
@@ -1132,6 +1183,22 @@ func (c *StaffScheduleApiController) ChangeScheduleBed() {
1132 1183
 		}
1133 1184
 		schedu.DialysisMachineName = DialysisMachineName1
1134 1185
 		err := service.UpdateScheduleById(schedule.ID, schedu, id, sch)
1186
+		//记录日志
1187
+		byterequest, _ := json.Marshal(schedule)
1188
+		scheduleLog := models.XtScheduleLog{
1189
+			UserOrgId:   org_id,
1190
+			RecordDate:  schedule.ScheduleDate,
1191
+			Status:      1,
1192
+			PatientId:   schedule.PatientId,
1193
+			Ctime:       time.Now().Unix(),
1194
+			Mtime:       0,
1195
+			ErrLog:      string(byterequest),
1196
+			Source:      "手机端修改调班",
1197
+			Module:      4,
1198
+			AdminUserId: c.GetMobileAdminUserInfo().AdminUser.Id,
1199
+		}
1200
+
1201
+		service.CreateScheduleLog(scheduleLog)
1135 1202
 		if err == nil {
1136 1203
 			c.ServeSuccessJSON(map[string]interface{}{
1137 1204
 				"msg": "ok",
@@ -1171,6 +1238,22 @@ func (c *StaffScheduleApiController) ChangeScheduleBed() {
1171 1238
 		}
1172 1239
 		var err error
1173 1240
 		err = service.CreateSchedule(&xtSchedule, id)
1241
+		//记录日志
1242
+		byterequest, _ := json.Marshal(schedule)
1243
+		scheduleLog := models.XtScheduleLog{
1244
+			UserOrgId:   org_id,
1245
+			RecordDate:  schedule.ScheduleDate,
1246
+			Status:      1,
1247
+			PatientId:   schedule.PatientId,
1248
+			Ctime:       time.Now().Unix(),
1249
+			Mtime:       0,
1250
+			ErrLog:      string(byterequest),
1251
+			Source:      "手机端新建调班",
1252
+			Module:      1,
1253
+			AdminUserId: c.GetMobileAdminUserInfo().AdminUser.Id,
1254
+		}
1255
+
1256
+		service.CreateScheduleLog(scheduleLog)
1174 1257
 		if err == nil {
1175 1258
 			c.ServeSuccessJSON(map[string]interface{}{
1176 1259
 				"msg": "ok",

+ 66 - 18
controllers/patient_api_controller.go View File

@@ -716,6 +716,36 @@ func (c *PatientApiController) EditLapseto() {
716 716
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
717 717
 		return
718 718
 	}
719
+
720
+	start_time := c.GetString("start_time")
721
+
722
+	end_time := c.GetString("end_time")
723
+	timeLayout := "2006-01-02"
724
+	loc, _ := time.LoadLocation("Local")
725
+
726
+	var startTime int64
727
+	if len(start_time) > 0 {
728
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
729
+
730
+		if err != nil {
731
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
732
+			return
733
+		}
734
+		startTime = theTime.Unix()
735
+	}
736
+	var endTime int64
737
+	if len(end_time) > 0 {
738
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
739
+		if err != nil {
740
+			utils.ErrorLog(err.Error())
741
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
742
+			return
743
+		}
744
+		endTime = theTime.Unix()
745
+	}
746
+
747
+	patient_address := c.GetString("patient_address")
748
+
719 749
 	adminUserInfo := c.GetAdminUserInfo()
720 750
 
721 751
 	patient, _ := service.FindPatientById(adminUserInfo.CurrentOrgId, id)
@@ -740,15 +770,8 @@ func (c *PatientApiController) EditLapseto() {
740 770
 		return
741 771
 	}
742 772
 	lapsetoType := int64(patientBody["lapseto_type"].(float64))
743
-	if lapsetoType <= 0 || lapsetoType > 3 {
744
-		utils.ErrorLog("lapsetoType <= 0 || lapsetoType > 3")
745
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
746
-		return
747
-	}
748
-	lapseto.LapsetoType = lapsetoType
749 773
 
750
-	timeLayout := "2006-01-02 15:04:05"
751
-	loc, _ := time.LoadLocation("Local")
774
+	lapseto.LapsetoType = lapsetoType
752 775
 
753 776
 	if patientBody["lapseto_time"] == nil || reflect.TypeOf(patientBody["lapseto_time"]).String() != "string" {
754 777
 		utils.ErrorLog("lapseto_time")
@@ -756,11 +779,12 @@ func (c *PatientApiController) EditLapseto() {
756 779
 		return
757 780
 	}
758 781
 	lapsetoTime, _ := patientBody["lapseto_time"].(string)
759
-	if len(lapsetoTime) == 0 {
760
-		utils.ErrorLog("len(lapsetoTime) == 0")
761
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotSelectLapsetoTime)
762
-		return
763
-	}
782
+
783
+	//if len(lapsetoTime) == 0 {
784
+	//	utils.ErrorLog("len(lapsetoTime) == 0")
785
+	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotSelectLapsetoTime)
786
+	//	return
787
+	//}
764 788
 
765 789
 	out_reason, _ := patientBody["out_reason"].(string)
766 790
 
@@ -771,11 +795,12 @@ func (c *PatientApiController) EditLapseto() {
771 795
 	//}
772 796
 
773 797
 	lapsetoTimeUnix, err := time.ParseInLocation(timeLayout, lapsetoTime, loc)
774
-	if err != nil {
775
-		utils.ErrorLog("lapsetoTimeUnix")
776
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotSelectLapsetoTime)
777
-		return
778
-	}
798
+
799
+	//if err != nil {
800
+	//	utils.ErrorLog("lapsetoTimeUnix")
801
+	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotSelectLapsetoTime)
802
+	//	return
803
+	//}
779 804
 	lapseto.LapsetoTime = lapsetoTimeUnix.Unix()
780 805
 	lapseto.UpdatedTime = time.Now().Unix()
781 806
 	lapseto.CreatedTime = time.Now().Unix()
@@ -783,6 +808,11 @@ func (c *PatientApiController) EditLapseto() {
783 808
 	patient.Lapseto = lapseto.LapsetoType
784 809
 	patient.OutReason = out_reason
785 810
 	patient.DeathTime = lapsetoTimeUnix.Unix()
811
+
812
+	patient.PatientStartTime = startTime
813
+	patient.PatientEndTime = endTime
814
+	patient.PatientAddress = patient_address
815
+
786 816
 	//if patient.Lapseto == 1 {
787 817
 	//	patientTotal := service.GetLapsetoPatientCount(adminUserInfo.CurrentOrgId, 1)
788 818
 	//	subscibes := adminUserInfo.Subscibes[adminUserInfo.CurrentOrgId]
@@ -806,6 +836,24 @@ func (c *PatientApiController) EditLapseto() {
806 836
 		service.UpdateScheduleItemByPatientId(id)
807 837
 	}
808 838
 
839
+	allergic := models.XtPatientAllergic{
840
+		UserOrgId:      adminUserInfo.CurrentOrgId,
841
+		PatientId:      patient.ID,
842
+		StartTime:      patient.PatientStartTime,
843
+		EndTime:        patient.PatientEndTime,
844
+		PatientSource:  patient.Lapseto,
845
+		PatientAddress: patient.PatientAddress,
846
+		Remake:         patient.Remark,
847
+		Status:         1,
848
+		Ctime:          time.Now().Unix(),
849
+	}
850
+	if lapseto.LapsetoType == 2 || lapseto.LapsetoType == 3 {
851
+		allergic.StartTime = lapseto.LapsetoTime
852
+		allergic.EndTime = lapseto.LapsetoTime
853
+	}
854
+
855
+	service.CreateAllergic(allergic)
856
+
809 857
 	if err != nil {
810 858
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeEditLapsetoFail)
811 859
 		return

+ 445 - 1
controllers/patient_dataconfig_api_controller.go View File

@@ -5,7 +5,9 @@ import (
5 5
 	"XT_New/models"
6 6
 	"XT_New/service"
7 7
 	"XT_New/utils"
8
+	"encoding/json"
8 9
 	"fmt"
10
+	"reflect"
9 11
 	"strconv"
10 12
 	"strings"
11 13
 	"time"
@@ -42,6 +44,10 @@ func PatientDataConfigAPIControllerRegistRouters() {
42 44
 
43 45
 	beego.Router("/api/patient/getpatientallagic", &PatientDataConfigAPIController{}, "Get:GetPatientAllagicList")
44 46
 
47
+	beego.Router("/api/patient/savesitemap", &PatientDataConfigAPIController{}, "Post:SaveSiteMap")
48
+
49
+	beego.Router("/api/patient/getpatientsitemap", &PatientDataConfigAPIController{}, "Get:GetPatientSitemap")
50
+
45 51
 }
46 52
 
47 53
 type PatientDataConfigAPIController struct {
@@ -1147,10 +1153,448 @@ func (this *PatientDataConfigAPIController) GetContextScheduleList() {
1147 1153
 func (this *PatientDataConfigAPIController) GetPatientAllagicList() {
1148 1154
 
1149 1155
 	id, _ := this.GetInt64("id")
1150
-	fmt.Println("id2ooooooooooooooooooo", id)
1151 1156
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1152 1157
 	list, _ := service.GetPatientAllagicList(id, orgId)
1153 1158
 	this.ServeSuccessJSON(map[string]interface{}{
1154 1159
 		"list": list,
1155 1160
 	})
1156 1161
 }
1162
+
1163
+func (this *PatientDataConfigAPIController) SaveSiteMap() {
1164
+
1165
+	dataBody := make(map[string]interface{}, 0)
1166
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
1167
+	if err != nil {
1168
+		utils.ErrorLog(err.Error())
1169
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1170
+		return
1171
+	}
1172
+	patient_id := int64(dataBody["patient_id"].(float64))
1173
+	user_org_id := this.GetAdminUserInfo().CurrentOrgId
1174
+	id := int64(dataBody["id"].(float64))
1175
+
1176
+	if dataBody["a_left"] != nil && reflect.TypeOf(dataBody["a_left"]).String() == "[]interface {}" {
1177
+		prescriptions, _ := dataBody["a_left"].([]interface{})
1178
+
1179
+		service.UpdateValsualAleft(patient_id, user_org_id)
1180
+		for _, item := range prescriptions {
1181
+			var a_num float64
1182
+			var mark_num float64
1183
+			if item.(map[string]interface{})["a_num"] != nil || reflect.TypeOf(item.(map[string]interface{})["a_num"]).String() == "float64" {
1184
+				a_num = item.(map[string]interface{})["a_num"].(float64)
1185
+			}
1186
+			if item.(map[string]interface{})["markNum"] != nil || reflect.TypeOf(item.(map[string]interface{})["markNum"]).String() == "float64" {
1187
+				mark_num = item.(map[string]interface{})["markNum"].(float64)
1188
+			}
1189
+			fmt.Println(a_num, mark_num)
1190
+
1191
+			valsualALeft := models.XtDeviceValsualALeft{
1192
+				ANum:      a_num,
1193
+				MarkNum:   mark_num,
1194
+				UserOrgId: user_org_id,
1195
+				PatientId: patient_id,
1196
+				Ctime:     time.Now().Unix(),
1197
+				Mtime:     time.Now().Unix(),
1198
+				MapId:     0,
1199
+				Status:    1,
1200
+			}
1201
+
1202
+			service.CreateValsualAleft(valsualALeft)
1203
+
1204
+		}
1205
+	}
1206
+
1207
+	is_append := int64(dataBody["is_append"].(float64))
1208
+
1209
+	is_img_v := int64(dataBody["is_img_v"].(float64))
1210
+
1211
+	is_img_a := int64(dataBody["is_img_a"].(float64))
1212
+
1213
+	a_top := dataBody["a_top"].(float64)
1214
+
1215
+	av_bkx := dataBody["av_bkx"].(float64)
1216
+
1217
+	av_bky := dataBody["av_bky"].(float64)
1218
+
1219
+	if dataBody["fangxiang_a"] != nil && reflect.TypeOf(dataBody["fangxiang_a"]).String() == "[]interface {}" {
1220
+		prescriptions, _ := dataBody["fangxiang_a"].([]interface{})
1221
+		service.ValsualMapFangxiangA(patient_id, user_org_id)
1222
+		for _, item := range prescriptions {
1223
+			var a_num float64
1224
+			var mark_num float64
1225
+			var mark_top float64
1226
+			if item.(map[string]interface{})["left"] != nil || reflect.TypeOf(item.(map[string]interface{})["left"]).String() == "float64" {
1227
+				a_num = item.(map[string]interface{})["left"].(float64)
1228
+			}
1229
+			if item.(map[string]interface{})["markNum"] != nil || reflect.TypeOf(item.(map[string]interface{})["markNum"]).String() == "float64" {
1230
+				mark_num = item.(map[string]interface{})["markNum"].(float64)
1231
+			}
1232
+
1233
+			if item.(map[string]interface{})["top"] != nil || reflect.TypeOf(item.(map[string]interface{})["top"]).String() == "float64" {
1234
+				mark_top = item.(map[string]interface{})["top"].(float64)
1235
+			}
1236
+
1237
+			ValsualMapFangxiangA := models.XtDeviceValsualMapFangxiangA{
1238
+
1239
+				PatientId: patient_id,
1240
+				UserOrgId: user_org_id,
1241
+				Status:    1,
1242
+				Left:      a_num,
1243
+				MarkNum:   mark_num,
1244
+				Top:       mark_top,
1245
+				MapId:     0,
1246
+				Ctime:     time.Now().Unix(),
1247
+				Mtime:     time.Now().Unix(),
1248
+			}
1249
+
1250
+			service.CreateValsualMapFangxiangA(ValsualMapFangxiangA)
1251
+		}
1252
+
1253
+	}
1254
+
1255
+	fangxiang_a_num := dataBody["fangxiang_a_num"].(float64)
1256
+	fangxiang_a_top := dataBody["fangxiang_a_top"].(float64)
1257
+
1258
+	fangxiang_v_left := dataBody["fangxiang_v_left"].(float64)
1259
+	fangxiang_v_num := dataBody["fangxiang_v_num"].(float64)
1260
+	fangxiang_v_top := dataBody["fangxiang_v_top"].(float64)
1261
+
1262
+	if dataBody["fangxiang_v"] != nil && reflect.TypeOf(dataBody["fangxiang_v"]).String() == "[]interface {}" {
1263
+		prescriptions, _ := dataBody["fangxiang_v"].([]interface{})
1264
+		service.UpdateValsualMapFangxiangV(patient_id, user_org_id)
1265
+		for _, item := range prescriptions {
1266
+			var a_num float64
1267
+			var mark_num float64
1268
+			var mark_top float64
1269
+			if item.(map[string]interface{})["left"] != nil || reflect.TypeOf(item.(map[string]interface{})["left"]).String() == "float64" {
1270
+				a_num = item.(map[string]interface{})["left"].(float64)
1271
+			}
1272
+			if item.(map[string]interface{})["markNum"] != nil || reflect.TypeOf(item.(map[string]interface{})["markNum"]).String() == "float64" {
1273
+				mark_num = item.(map[string]interface{})["markNum"].(float64)
1274
+			}
1275
+
1276
+			if item.(map[string]interface{})["top"] != nil || reflect.TypeOf(item.(map[string]interface{})["top"]).String() == "float64" {
1277
+				mark_top = item.(map[string]interface{})["top"].(float64)
1278
+			}
1279
+
1280
+			ValsualMapFangxiangV := models.XtDeviceValsualMapFangxiangV{
1281
+
1282
+				PatientId: patient_id,
1283
+				UserOrgId: user_org_id,
1284
+				Status:    1,
1285
+				Left:      a_num,
1286
+				MarkNum:   mark_num,
1287
+				Top:       mark_top,
1288
+				MapId:     0,
1289
+				Ctime:     time.Now().Unix(),
1290
+				Mtime:     time.Now().Unix(),
1291
+			}
1292
+
1293
+			service.CreateValsualMapFangxiangV(ValsualMapFangxiangV)
1294
+		}
1295
+
1296
+	}
1297
+
1298
+	fangxiang_a_left := dataBody["fangxiang_a_left"].(float64)
1299
+
1300
+	if dataBody["fuzhu_a"] != nil && reflect.TypeOf(dataBody["fuzhu_a"]).String() == "[]interface {}" {
1301
+		prescriptions, _ := dataBody["fuzhu_a"].([]interface{})
1302
+		service.UpdateValSualFuzhA(patient_id, user_org_id)
1303
+		for _, item := range prescriptions {
1304
+			var a_left float64
1305
+			var a_markNum float64
1306
+			var a_top float64
1307
+			if item.(map[string]interface{})["a_left"] != nil || reflect.TypeOf(item.(map[string]interface{})["a_left"]).String() == "float64" {
1308
+				a_left = item.(map[string]interface{})["a_left"].(float64)
1309
+			}
1310
+			if item.(map[string]interface{})["a_markNum"] != nil || reflect.TypeOf(item.(map[string]interface{})["a_markNum"]).String() == "float64" {
1311
+				a_markNum = item.(map[string]interface{})["a_markNum"].(float64)
1312
+			}
1313
+
1314
+			if item.(map[string]interface{})["a_top"] != nil || reflect.TypeOf(item.(map[string]interface{})["a_top"]).String() == "float64" {
1315
+				a_top = item.(map[string]interface{})["a_top"].(float64)
1316
+			}
1317
+
1318
+			valsualFuzhuA := models.XtDeviceValsualFuzhuA{
1319
+				PatientId: patient_id,
1320
+				UserOrgId: user_org_id,
1321
+				Status:    1,
1322
+				Ctime:     time.Now().Unix(),
1323
+				Mtime:     time.Now().Unix(),
1324
+				ALeft:     a_left,
1325
+				AMarkNum:  a_markNum,
1326
+				ATop:      a_top,
1327
+				MapId:     0,
1328
+			}
1329
+			service.CreateValSualFuzhA(valsualFuzhuA)
1330
+		}
1331
+	}
1332
+
1333
+	fuzhu_a_left := dataBody["fuzhu_a_left"].(float64)
1334
+	fuzhu_a_num := dataBody["fuzhu_a_num"].(float64)
1335
+	fuzhu_a_top := dataBody["fuzhu_a_top"].(float64)
1336
+
1337
+	left_a := dataBody["left_a"].(float64)
1338
+	left_v := dataBody["left_v"].(float64)
1339
+
1340
+	if dataBody["fuzhu_v"] != nil && reflect.TypeOf(dataBody["fuzhu_v"]).String() == "[]interface {}" {
1341
+		prescriptions, _ := dataBody["fuzhu_v"].([]interface{})
1342
+
1343
+		service.UpdateVasuaLfuzhuV(patient_id, user_org_id)
1344
+		for _, item := range prescriptions {
1345
+			var v_left float64
1346
+			var v_markNum float64
1347
+			var v_top float64
1348
+			if item.(map[string]interface{})["v_left"] != nil || reflect.TypeOf(item.(map[string]interface{})["v_left"]).String() == "float64" {
1349
+				v_left = item.(map[string]interface{})["v_left"].(float64)
1350
+			}
1351
+			if item.(map[string]interface{})["v_markNum"] != nil || reflect.TypeOf(item.(map[string]interface{})["v_markNum"]).String() == "float64" {
1352
+				v_markNum = item.(map[string]interface{})["v_markNum"].(float64)
1353
+			}
1354
+
1355
+			if item.(map[string]interface{})["v_top"] != nil || reflect.TypeOf(item.(map[string]interface{})["v_top"]).String() == "float64" {
1356
+				v_top = item.(map[string]interface{})["v_top"].(float64)
1357
+			}
1358
+
1359
+			fuzhuV := models.XtDeviceValsualFuzhuV{
1360
+				PatientId: patient_id,
1361
+				UserOrgId: user_org_id,
1362
+				Status:    1,
1363
+				Ctime:     time.Now().Unix(),
1364
+				Mtime:     1,
1365
+				VMarkNum:  v_markNum,
1366
+				VLeft:     v_left,
1367
+				VTop:      v_top,
1368
+				MapId:     0,
1369
+			}
1370
+
1371
+			service.CreateVasuaLfuzhuV(fuzhuV)
1372
+
1373
+		}
1374
+	}
1375
+
1376
+	fuzhu_v_left := dataBody["fuzhu_v_left"].(float64)
1377
+	fuzhu_v_num := dataBody["fuzhu_v_num"].(float64)
1378
+	fuzhu_v_top := dataBody["fuzhu_v_top"].(float64)
1379
+
1380
+	scalea_num := dataBody["scalea_num"].(float64)
1381
+	scalev_num := dataBody["scalev_num"].(float64)
1382
+
1383
+	if dataBody["text_arr"] != nil && reflect.TypeOf(dataBody["text_arr"]).String() == "[]interface {}" {
1384
+		prescriptions, _ := dataBody["text_arr"].([]interface{})
1385
+
1386
+		service.UpdateTextArr(patient_id, user_org_id)
1387
+		for _, item := range prescriptions {
1388
+			var left float64
1389
+			var text_markNum string
1390
+			var v_top float64
1391
+			var width float64
1392
+			if item.(map[string]interface{})["left"] != nil || reflect.TypeOf(item.(map[string]interface{})["left"]).String() == "float64" {
1393
+				left = item.(map[string]interface{})["left"].(float64)
1394
+			}
1395
+			if item.(map[string]interface{})["text"] != nil || reflect.TypeOf(item.(map[string]interface{})["text"]).String() == "string" {
1396
+				text_markNum = item.(map[string]interface{})["text"].(string)
1397
+			}
1398
+
1399
+			if item.(map[string]interface{})["top"] != nil || reflect.TypeOf(item.(map[string]interface{})["top"]).String() == "float64" {
1400
+				v_top = item.(map[string]interface{})["top"].(float64)
1401
+			}
1402
+
1403
+			if item.(map[string]interface{})["width"] != nil || reflect.TypeOf(item.(map[string]interface{})["width"]).String() == "float64" {
1404
+				width = item.(map[string]interface{})["width"].(float64)
1405
+			}
1406
+
1407
+			textArr := models.XtDeviceValsualTextArr{
1408
+				PatientId: patient_id,
1409
+				UserOrgId: user_org_id,
1410
+				Ctime:     time.Now().Unix(),
1411
+				Mtime:     0,
1412
+				Status:    1,
1413
+				Left:      left,
1414
+				Text:      text_markNum,
1415
+				Top:       v_top,
1416
+				Width:     width,
1417
+				MapId:     0,
1418
+			}
1419
+
1420
+			service.CreateTextArr(textArr)
1421
+		}
1422
+
1423
+		text_left := dataBody["text_left"].(float64)
1424
+		text_num := dataBody["text_num"].(float64)
1425
+		text_top := dataBody["text_top"].(float64)
1426
+
1427
+		if dataBody["v_left"] != nil && reflect.TypeOf(dataBody["v_left"]).String() == "[]interface {}" {
1428
+			prescriptions, _ := dataBody["v_left"].([]interface{})
1429
+			service.UpdateValsualVleft(patient_id, user_org_id)
1430
+			for _, item := range prescriptions {
1431
+				var v_num float64
1432
+				var markNum float64
1433
+
1434
+				if item.(map[string]interface{})["v_num"] != nil || reflect.TypeOf(item.(map[string]interface{})["v_num"]).String() == "float64" {
1435
+					v_num = item.(map[string]interface{})["v_num"].(float64)
1436
+				}
1437
+				if item.(map[string]interface{})["mark_num"] != nil || reflect.TypeOf(item.(map[string]interface{})["mark_num"]).String() == "float64" {
1438
+					markNum = item.(map[string]interface{})["mark_num"].(float64)
1439
+				}
1440
+
1441
+				valsualVLeft := models.XtDeviceValsualVLeft{
1442
+					PatientId: patient_id,
1443
+					UserOrgId: user_org_id,
1444
+					Status:    1,
1445
+					Ctime:     time.Now().Unix(),
1446
+					Mtime:     time.Now().Unix(),
1447
+					MarkNum:   markNum,
1448
+					VNum:      v_num,
1449
+					MapId:     0,
1450
+				}
1451
+
1452
+				service.CreateValsualVleft(valsualVLeft)
1453
+
1454
+			}
1455
+		}
1456
+
1457
+		if dataBody["aarr"] != nil && reflect.TypeOf(dataBody["aarr"]).String() == "[]interface {}" {
1458
+			prescriptions, _ := dataBody["aarr"].([]interface{})
1459
+			service.UpdateValusalMapArr(patient_id, user_org_id)
1460
+			for _, item := range prescriptions {
1461
+				var mark_num float64
1462
+				var is_status float64
1463
+				var left float64
1464
+				var top float64
1465
+
1466
+				if item.(map[string]interface{})["mark_num"] != nil || reflect.TypeOf(item.(map[string]interface{})["mark_num"]).String() == "float64" {
1467
+					mark_num = item.(map[string]interface{})["mark_num"].(float64)
1468
+				}
1469
+				if item.(map[string]interface{})["is_status"] != nil || reflect.TypeOf(item.(map[string]interface{})["is_status"]).String() == "float64" {
1470
+					is_status = item.(map[string]interface{})["is_status"].(float64)
1471
+				}
1472
+				if item.(map[string]interface{})["left"] != nil || reflect.TypeOf(item.(map[string]interface{})["left"]).String() == "float64" {
1473
+					left = item.(map[string]interface{})["left"].(float64)
1474
+				}
1475
+				if item.(map[string]interface{})["top"] != nil || reflect.TypeOf(item.(map[string]interface{})["top"]).String() == "float64" {
1476
+					top = item.(map[string]interface{})["top"].(float64)
1477
+				}
1478
+
1479
+				mapArr := models.XtDeviceValusalMapArr{
1480
+					PatientId: patient_id,
1481
+					UserOrgId: user_org_id,
1482
+					Status:    1,
1483
+					MarkNum:   mark_num,
1484
+					Left:      left,
1485
+					Top:       top,
1486
+					IsStatus:  is_status,
1487
+					Ctime:     time.Now().Unix(),
1488
+					Mtime:     0,
1489
+				}
1490
+				service.CreateDeviceValusalMapArr(mapArr)
1491
+
1492
+			}
1493
+		}
1494
+
1495
+		if dataBody["varr"] != nil && reflect.TypeOf(dataBody["varr"]).String() == "[]interface {}" {
1496
+			prescriptions, _ := dataBody["varr"].([]interface{})
1497
+			service.UpdateDeviceValusalMapVrr(patient_id, user_org_id)
1498
+			for _, item := range prescriptions {
1499
+				var mark_num float64
1500
+				var is_status float64
1501
+				var left float64
1502
+				var top float64
1503
+
1504
+				if item.(map[string]interface{})["mark_num"] != nil || reflect.TypeOf(item.(map[string]interface{})["mark_num"]).String() == "float64" {
1505
+					mark_num = item.(map[string]interface{})["mark_num"].(float64)
1506
+				}
1507
+				if item.(map[string]interface{})["is_status"] != nil || reflect.TypeOf(item.(map[string]interface{})["is_status"]).String() == "float64" {
1508
+					is_status = item.(map[string]interface{})["is_status"].(float64)
1509
+				}
1510
+				if item.(map[string]interface{})["left"] != nil || reflect.TypeOf(item.(map[string]interface{})["left"]).String() == "float64" {
1511
+					left = item.(map[string]interface{})["left"].(float64)
1512
+				}
1513
+				if item.(map[string]interface{})["top"] != nil || reflect.TypeOf(item.(map[string]interface{})["top"]).String() == "float64" {
1514
+					top = item.(map[string]interface{})["top"].(float64)
1515
+				}
1516
+
1517
+				mapVrr := models.XtDeviceValusalMapVrr{
1518
+					PatientId: patient_id,
1519
+					UserOrgId: user_org_id,
1520
+					Status:    1,
1521
+					MarkNum:   mark_num,
1522
+					Left:      left,
1523
+					Top:       top,
1524
+					IsStatus:  is_status,
1525
+					Ctime:     time.Now().Unix(),
1526
+					Mtime:     0,
1527
+				}
1528
+				service.CreateDeviceValusalMapVrr(mapVrr)
1529
+
1530
+			}
1531
+		}
1532
+
1533
+		v_num := dataBody["v_num"].(float64)
1534
+		v_top := dataBody["v_top"].(float64)
1535
+		xuanzhuan_a := dataBody["xuanzhuan_a"].(float64)
1536
+		xuanzhuan_v := dataBody["xuanzhuan_v"].(float64)
1537
+
1538
+		img_url := dataBody["img_url"].(string)
1539
+
1540
+		deviceValsualMap := models.XtDeviceValsualMap{
1541
+			ID:             id,
1542
+			PatientId:      patient_id,
1543
+			IsAppend:       is_append,
1544
+			IsImgV:         is_img_v,
1545
+			IsImgA:         is_img_a,
1546
+			VNum:           v_num,
1547
+			Status:         1,
1548
+			UserOrgId:      user_org_id,
1549
+			ATop:           a_top,
1550
+			AvBkx:          av_bkx,
1551
+			AvBky:          av_bky,
1552
+			FangxiangALeft: fangxiang_a_left,
1553
+			FangxiangANum:  fangxiang_a_num,
1554
+			FangxiangATop:  fangxiang_a_top,
1555
+			FangxiangVLeft: fangxiang_v_left,
1556
+			FangxiangVNum:  fangxiang_v_num,
1557
+			FangxiangVTop:  fangxiang_v_top,
1558
+			FuzhuALeft:     fuzhu_a_left,
1559
+			FuzhuANum:      fuzhu_a_num,
1560
+			FuzhuATop:      fuzhu_a_top,
1561
+			FuzhuVLeft:     fuzhu_v_left,
1562
+			FuzhuVNum:      fuzhu_v_num,
1563
+			FuzhuVTop:      fuzhu_v_top,
1564
+			ScaleaNum:      scalea_num,
1565
+			ScalevNum:      scalev_num,
1566
+			TextLeft:       text_left,
1567
+			TextNum:        text_num,
1568
+			TextTop:        text_top,
1569
+			VTop:           v_top,
1570
+			XuanzhuanA:     xuanzhuan_a,
1571
+			XuanzhuanV:     xuanzhuan_v,
1572
+			ALeft:          left_a,
1573
+			VLeft:          left_v,
1574
+			ImgUrl:         img_url,
1575
+		}
1576
+
1577
+		err = service.CreateDeviceValsualMap(deviceValsualMap)
1578
+
1579
+		this.ServeSuccessJSON(map[string]interface{}{
1580
+			"deviceValsualMap": deviceValsualMap,
1581
+		})
1582
+
1583
+	}
1584
+}
1585
+
1586
+func (this *PatientDataConfigAPIController) GetPatientSitemap() {
1587
+
1588
+	patient_id, _ := this.GetInt64("patient_id")
1589
+
1590
+	orgId := this.GetAdminUserInfo().CurrentOrgId
1591
+
1592
+	sitemap, _ := service.GetPatientSitemap(patient_id, orgId)
1593
+
1594
+	patients, _ := service.GetPatientByIDOne(orgId, patient_id)
1595
+	this.ServeSuccessJSON(map[string]interface{}{
1596
+		"sitemap":  sitemap,
1597
+		"patients": patients,
1598
+	})
1599
+
1600
+}

+ 3 - 4
controllers/print_data_api_controller.go View File

@@ -37,7 +37,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
37 37
 	idStrs := strings.Split(schIDStr, ",")
38 38
 	adminUserInfo := this.GetAdminUserInfo()
39 39
 
40
-	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 || this.GetAdminUserInfo().CurrentOrgId == 10121 || this.GetAdminUserInfo().CurrentOrgId == 10234 || this.GetAdminUserInfo().CurrentOrgId == 10188 || this.GetAdminUserInfo().CurrentOrgId == 10217 || this.GetAdminUserInfo().CurrentOrgId == 10340 || this.GetAdminUserInfo().CurrentOrgId == 9905 || this.GetAdminUserInfo().CurrentOrgId == 10346 || this.GetAdminUserInfo().CurrentOrgId == 10441 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 10495 {
40
+	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 || this.GetAdminUserInfo().CurrentOrgId == 10121 || this.GetAdminUserInfo().CurrentOrgId == 10234 || this.GetAdminUserInfo().CurrentOrgId == 10188 || this.GetAdminUserInfo().CurrentOrgId == 10217 || this.GetAdminUserInfo().CurrentOrgId == 10340 || this.GetAdminUserInfo().CurrentOrgId == 9905 || this.GetAdminUserInfo().CurrentOrgId == 10346 || this.GetAdminUserInfo().CurrentOrgId == 10441 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 10495 || this.GetAdminUserInfo().CurrentOrgId == 10013 || this.GetAdminUserInfo().CurrentOrgId == 10014 {
41 41
 
42 42
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
43 43
 		for _, item := range schedules {
@@ -97,10 +97,9 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
97 97
 
98 98
 			item.Schedule = &lastSchedule
99 99
 
100
-			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10495 {
100
+			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10495 || this.GetAdminUserInfo().CurrentOrgId == 10013 || this.GetAdminUserInfo().CurrentOrgId == 10014 {
101 101
 
102 102
 				if item.ScheduleDate <= 1672416000 {
103
-
104 103
 					listOne, _ := service.GetDialysisOrderCountEight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
105 104
 
106 105
 					item.Patient.TotalDialysis = listOne.Count
@@ -145,7 +144,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
145 144
 		})
146 145
 	}
147 146
 
148
-	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 && this.GetAdminUserInfo().CurrentOrgId != 10121 && this.GetAdminUserInfo().CurrentOrgId != 10234 && this.GetAdminUserInfo().CurrentOrgId != 10188 && this.GetAdminUserInfo().CurrentOrgId != 10217 && this.GetAdminUserInfo().CurrentOrgId != 10340 && this.GetAdminUserInfo().CurrentOrgId != 9905 && this.GetAdminUserInfo().CurrentOrgId != 10346 && this.GetAdminUserInfo().CurrentOrgId != 10441 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 10495 {
147
+	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 && this.GetAdminUserInfo().CurrentOrgId != 10121 && this.GetAdminUserInfo().CurrentOrgId != 10234 && this.GetAdminUserInfo().CurrentOrgId != 10188 && this.GetAdminUserInfo().CurrentOrgId != 10217 && this.GetAdminUserInfo().CurrentOrgId != 10340 && this.GetAdminUserInfo().CurrentOrgId != 9905 && this.GetAdminUserInfo().CurrentOrgId != 10346 && this.GetAdminUserInfo().CurrentOrgId != 10441 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 10495 && this.GetAdminUserInfo().CurrentOrgId != 10013 && this.GetAdminUserInfo().CurrentOrgId != 10014 {
149 148
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
150 149
 		for _, item := range schedules {
151 150
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)

+ 69 - 0
controllers/schedule_api_controller.go View File

@@ -1558,6 +1558,23 @@ func (c *ScheduleApiController) CreateSchedule() {
1558 1558
 	schedule.IsExport = 1000
1559 1559
 	err = service.CreateScheduleTwo(&schedule)
1560 1560
 
1561
+	//记录日志
1562
+	byterequest, _ := json.Marshal(schedule)
1563
+	scheduleLog := models.XtScheduleLog{
1564
+		UserOrgId:   adminUserInfo.CurrentOrgId,
1565
+		RecordDate:  schedule.ScheduleDate,
1566
+		Status:      1,
1567
+		PatientId:   schedule.PatientId,
1568
+		Ctime:       time.Now().Unix(),
1569
+		Mtime:       0,
1570
+		ErrLog:      string(byterequest),
1571
+		Source:      "电脑端新增排班",
1572
+		Module:      1,
1573
+		AdminUserId: adminUserInfo.AdminUser.Id,
1574
+	}
1575
+
1576
+	service.CreateScheduleLog(scheduleLog)
1577
+
1561 1578
 	key := "scheduals_" + scheduleDate + "_" + strconv.FormatInt(adminUserInfo.CurrentOrgId, 10)
1562 1579
 
1563 1580
 	redis.Set(key, "", time.Second)
@@ -1900,6 +1917,24 @@ func (c *ScheduleApiController) DeleteSchedule() {
1900 1917
 	schedule.Status = 0
1901 1918
 	schedule.UpdatedTime = time.Now().Unix()
1902 1919
 	err = service.UpdateSchedule(schedule)
1920
+
1921
+	//记录日志
1922
+	byterequest, _ := json.Marshal(schedule)
1923
+	scheduleLog := models.XtScheduleLog{
1924
+		UserOrgId:   adminINfo.CurrentOrgId,
1925
+		RecordDate:  schedule.ScheduleDate,
1926
+		Status:      1,
1927
+		PatientId:   schedule.PatientId,
1928
+		Ctime:       time.Now().Unix(),
1929
+		Mtime:       0,
1930
+		ErrLog:      string(byterequest),
1931
+		Source:      "电脑端删除排班",
1932
+		Module:      5,
1933
+		AdminUserId: adminINfo.AdminUser.Id,
1934
+	}
1935
+
1936
+	service.CreateScheduleLog(scheduleLog)
1937
+
1903 1938
 	redis := service.RedisClient()
1904 1939
 
1905 1940
 	//处方
@@ -2026,6 +2061,23 @@ func (c *ScheduleApiController) ChangeSchedule() {
2026 2061
 			return
2027 2062
 		}
2028 2063
 
2064
+		//记录日志
2065
+		byterequest, _ := json.Marshal(schedule)
2066
+		scheduleLog := models.XtScheduleLog{
2067
+			UserOrgId:   adminINfo.CurrentOrgId,
2068
+			RecordDate:  schedule.ScheduleDate,
2069
+			Status:      1,
2070
+			PatientId:   schedule.PatientId,
2071
+			Ctime:       time.Now().Unix(),
2072
+			Mtime:       0,
2073
+			ErrLog:      string(byterequest),
2074
+			Source:      "电脑端改变模式排班",
2075
+			Module:      1,
2076
+			AdminUserId: adminINfo.AdminUser.Id,
2077
+		}
2078
+
2079
+		service.CreateScheduleLog(scheduleLog)
2080
+
2029 2081
 	} else if changeAction == "change_device" {
2030 2082
 		order, err := service.GetOneDialysisOrder(adminINfo.CurrentOrgId, schedule.ScheduleDate, schedule.PatientId)
2031 2083
 		if err != nil {
@@ -2107,6 +2159,23 @@ func (c *ScheduleApiController) ChangeSchedule() {
2107 2159
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePointScheduleExist)
2108 2160
 			return
2109 2161
 		}
2162
+
2163
+		//记录日志
2164
+		byterequest, _ := json.Marshal(schedule)
2165
+		scheduleLog := models.XtScheduleLog{
2166
+			UserOrgId:   adminINfo.CurrentOrgId,
2167
+			RecordDate:  schedule.ScheduleDate,
2168
+			Status:      1,
2169
+			PatientId:   schedule.PatientId,
2170
+			Ctime:       time.Now().Unix(),
2171
+			Mtime:       0,
2172
+			ErrLog:      string(byterequest),
2173
+			Source:      "电脑端改变分区床位",
2174
+			Module:      4,
2175
+			AdminUserId: adminINfo.AdminUser.Id,
2176
+		}
2177
+
2178
+		service.CreateScheduleLog(scheduleLog)
2110 2179
 	} else {
2111 2180
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
2112 2181
 		return

+ 31 - 31
controllers/self_drug_api_congtroller.go View File

@@ -2770,11 +2770,6 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
2770 2770
 		ids = append(ids, it.ID)
2771 2771
 	}
2772 2772
 
2773
-	//infoList, _ := service.GetGoodWarehouseInfoByOrgId(orgId, storehouse_id)
2774
-	//for _, it := range infoList {
2775
-	//	goodIds = append(goodIds, it.GoodId)
2776
-	//}
2777
-
2778 2773
 	stockList, total, err := service.GetGoodStockList(orgId, storehouse_id, good_type, keyword, page, limit, ids)
2779 2774
 
2780 2775
 	if err != nil {
@@ -3001,6 +2996,7 @@ func (this *SelfDrugApiController) GetGoodPurchaseStockQuery() {
3001 2996
 	}
3002 2997
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
3003 2998
 	list, total, err := service.GetGoodPurchaseStockQuery(good_type, keyword, page, limit, orgId, ids, goodIds)
2999
+	storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3004 3000
 	for _, item := range list {
3005 3001
 
3006 3002
 		//获取期初结余数量
@@ -3016,29 +3012,29 @@ func (this *SelfDrugApiController) GetGoodPurchaseStockQuery() {
3016 3012
 		}
3017 3013
 
3018 3014
 		//获取期间增加
3019
-		goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime)
3015
+		goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3020 3016
 		for _, it := range goodWarehouseInfoList {
3021 3017
 			item.WarehousingInfoOne = append(item.WarehousingInfoOne, it)
3022 3018
 		}
3023 3019
 
3024 3020
 		//获取本期增加
3025
-		WarehouseInfoFlowList, _ := service.GetAddStartFlow(item.ID, orgId, startTime, endTime)
3021
+		WarehouseInfoFlowList, _ := service.GetAddStartFlow(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3026 3022
 		for _, it := range WarehouseInfoFlowList {
3027 3023
 			item.StartFlowWarehouseInfo = append(item.StartFlowWarehouseInfo, it)
3028 3024
 		}
3029 3025
 		//获取本期减少
3030
-		reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoList(item.ID, orgId, startTime, endTime)
3026
+		reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3031 3027
 		for _, it := range reduceWarehouseInfoList {
3032 3028
 			item.WarehouseOutInfoStart = append(item.WarehouseOutInfoStart, it)
3033 3029
 		}
3034 3030
 
3035 3031
 		//获取期中减少退库
3036
-		lowInfo, _ := service.GetStartEndCancelFLowInfo(item.ID, orgId, startTime, endTime)
3032
+		lowInfo, _ := service.GetStartEndCancelFLowInfo(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3037 3033
 		for _, it := range lowInfo {
3038 3034
 			item.StartEndCancelFLowInfo = append(item.StartEndCancelFLowInfo, it)
3039 3035
 		}
3040 3036
 		//
3041
-		outInfo, _ := service.FindeWarehouseOutInfo(item.ID, orgId, startTime)
3037
+		outInfo, _ := service.FindeWarehouseOutInfo(item.ID, orgId, startTime, storeConfig.StorehouseOutInfo)
3042 3038
 		for _, it := range outInfo {
3043 3039
 			item.WarehouseOutInfoEnd = append(item.WarehouseOutInfoEnd, it)
3044 3040
 		}
@@ -3101,12 +3097,12 @@ func (this *SelfDrugApiController) GetGoodPurchaseStockQuery() {
3101 3097
 		}
3102 3098
 
3103 3099
 		//期中盘盈
3104
-		profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime)
3100
+		profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3105 3101
 		for _, it := range profit {
3106 3102
 			item.WareStartEndStockInventoryProfit = append(item.WareStartEndStockInventoryProfit, it)
3107 3103
 		}
3108 3104
 		//期中盘亏
3109
-		losses, _ := service.FindeEndStockInventoryLosses(item.ID, orgId, startTime, endTime)
3105
+		losses, _ := service.FindeEndStockInventoryLosses(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3110 3106
 		for _, it := range losses {
3111 3107
 			item.WareStartEndStockInventoryLosses = append(item.WareStartEndStockInventoryLosses, it)
3112 3108
 		}
@@ -3683,55 +3679,57 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3683 3679
 	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
3684 3680
 
3685 3681
 	if orgId == 10265 {
3682
+		//storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3683
+
3686 3684
 		list, total, err := service.GetGoodNewPurchaseStockQuery(good_type, keyword, page, limit, orgId, ids, goodIds)
3687 3685
 
3688 3686
 		for _, item := range list {
3689 3687
 
3690 3688
 			//获取期初结余
3691
-			low, _ := service.GetStartLastFLow(item.ID, orgId, startTime)
3689
+			low, _ := service.GetStartLastFLowTwenty(item.ID, orgId, startTime)
3692 3690
 
3693 3691
 			item.GoodStartFlowInfo = low
3694 3692
 
3695 3693
 			//获取期末结余
3696
-			flow, _ := service.GetEndLastFlow(item.ID, orgId, endTime)
3694
+			flow, _ := service.GetEndLastFlowTwenty(item.ID, orgId, endTime)
3697 3695
 
3698 3696
 			item.GoodEndFlowInfo = flow
3699 3697
 
3700 3698
 			//获取期间增加
3701
-			goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime)
3699
+			goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoListTwenty(item.ID, orgId, startTime, endTime)
3702 3700
 			for _, it := range goodWarehouseInfoList {
3703 3701
 				item.WarehousingInfoOne = append(item.WarehousingInfoOne, it)
3704 3702
 			}
3705 3703
 
3706 3704
 			//获取本期增加
3707
-			WarehouseInfoFlowList, _ := service.GetAddStartFlow(item.ID, orgId, startTime, endTime)
3705
+			WarehouseInfoFlowList, _ := service.GetAddStartFlowTwenty(item.ID, orgId, startTime, endTime)
3708 3706
 			for _, it := range WarehouseInfoFlowList {
3709 3707
 				item.StartFlowWarehouseInfo = append(item.StartFlowWarehouseInfo, it)
3710 3708
 			}
3711 3709
 			//获取本期减少
3712
-			reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoList(item.ID, orgId, startTime, endTime)
3710
+			reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoListTwenty(item.ID, orgId, startTime, endTime)
3713 3711
 			for _, it := range reduceWarehouseInfoList {
3714 3712
 				item.WarehouseOutInfoStart = append(item.WarehouseOutInfoStart, it)
3715 3713
 			}
3716 3714
 
3717 3715
 			//获取期中减少退库
3718
-			lowInfo, _ := service.GetStartEndCancelFLowInfo(item.ID, orgId, startTime, endTime)
3716
+			lowInfo, _ := service.GetStartEndCancelFLowInfoTwenty(item.ID, orgId, startTime, endTime)
3719 3717
 			for _, it := range lowInfo {
3720 3718
 				item.StartEndCancelFLowInfo = append(item.StartEndCancelFLowInfo, it)
3721 3719
 			}
3722 3720
 			//
3723
-			outInfo, _ := service.FindeWarehouseOutInfo(item.ID, orgId, startTime)
3721
+			outInfo, _ := service.FindeWarehouseOutInfoTwenty(item.ID, orgId, startTime)
3724 3722
 			for _, it := range outInfo {
3725 3723
 				item.WarehouseOutInfoEnd = append(item.WarehouseOutInfoEnd, it)
3726 3724
 			}
3727 3725
 
3728 3726
 			//期中盘盈
3729
-			profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime)
3727
+			profit, _ := service.FindeEndStokInventoryProfitTwenty(item.ID, orgId, startTime, endTime)
3730 3728
 			for _, it := range profit {
3731 3729
 				item.WareStartEndStockInventoryProfit = append(item.WareStartEndStockInventoryProfit, it)
3732 3730
 			}
3733 3731
 			//期中盘亏
3734
-			losses, _ := service.FindeEndStockInventoryLosses(item.ID, orgId, startTime, endTime)
3732
+			losses, _ := service.FindeEndStockInventoryLossesTwenty(item.ID, orgId, startTime, endTime)
3735 3733
 			for _, it := range losses {
3736 3734
 				item.WareStartEndStockInventoryLosses = append(item.WareStartEndStockInventoryLosses, it)
3737 3735
 			}
@@ -3751,54 +3749,56 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3751 3749
 
3752 3750
 	if orgId != 10265 {
3753 3751
 		list, total, err := service.GetGoodNewPurchaseStockQueryOne(good_type, keyword, page, limit, orgId, ids, goodIds)
3754
-
3752
+		storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3755 3753
 		for _, item := range list {
3756 3754
 
3757 3755
 			//获取期初结余
3758
-			low, _ := service.GetStartLastFLow(item.ID, orgId, startTime)
3756
+			low, _ := service.GetStartLastFLow(item.ID, orgId, startTime, storeConfig.StorehouseOutInfo)
3759 3757
 
3760 3758
 			item.GoodStartFlowInfo = low
3761 3759
 
3762 3760
 			//获取期末结余
3763
-			flow, _ := service.GetEndLastFlow(item.ID, orgId, endTime)
3761
+			flow, _ := service.GetEndLastFlow(item.ID, orgId, endTime, storeConfig.StorehouseOutInfo)
3764 3762
 
3765 3763
 			item.GoodEndFlowInfo = flow
3766 3764
 
3767 3765
 			//获取期间增加
3768
-			goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime)
3766
+			goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3767
+
3769 3768
 			for _, it := range goodWarehouseInfoList {
3770 3769
 				item.WarehousingInfoOne = append(item.WarehousingInfoOne, it)
3771 3770
 			}
3772 3771
 
3773 3772
 			//获取本期增加
3774
-			WarehouseInfoFlowList, _ := service.GetAddStartFlow(item.ID, orgId, startTime, endTime)
3773
+			WarehouseInfoFlowList, _ := service.GetAddStartFlow(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3774
+
3775 3775
 			for _, it := range WarehouseInfoFlowList {
3776 3776
 				item.StartFlowWarehouseInfo = append(item.StartFlowWarehouseInfo, it)
3777 3777
 			}
3778 3778
 			//获取本期减少
3779
-			reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoList(item.ID, orgId, startTime, endTime)
3779
+			reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3780 3780
 			for _, it := range reduceWarehouseInfoList {
3781 3781
 				item.WarehouseOutInfoStart = append(item.WarehouseOutInfoStart, it)
3782 3782
 			}
3783 3783
 
3784 3784
 			//获取期中减少退库
3785
-			lowInfo, _ := service.GetStartEndCancelFLowInfo(item.ID, orgId, startTime, endTime)
3785
+			lowInfo, _ := service.GetStartEndCancelFLowInfo(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3786 3786
 			for _, it := range lowInfo {
3787 3787
 				item.StartEndCancelFLowInfo = append(item.StartEndCancelFLowInfo, it)
3788 3788
 			}
3789 3789
 			//
3790
-			outInfo, _ := service.FindeWarehouseOutInfo(item.ID, orgId, startTime)
3790
+			outInfo, _ := service.FindeWarehouseOutInfo(item.ID, orgId, startTime, storeConfig.StorehouseOutInfo)
3791 3791
 			for _, it := range outInfo {
3792 3792
 				item.WarehouseOutInfoEnd = append(item.WarehouseOutInfoEnd, it)
3793 3793
 			}
3794 3794
 
3795 3795
 			//期中盘盈
3796
-			profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime)
3796
+			profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3797 3797
 			for _, it := range profit {
3798 3798
 				item.WareStartEndStockInventoryProfit = append(item.WareStartEndStockInventoryProfit, it)
3799 3799
 			}
3800 3800
 			//期中盘亏
3801
-			losses, _ := service.FindeEndStockInventoryLosses(item.ID, orgId, startTime, endTime)
3801
+			losses, _ := service.FindeEndStockInventoryLosses(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3802 3802
 			for _, it := range losses {
3803 3803
 				item.WareStartEndStockInventoryLosses = append(item.WareStartEndStockInventoryLosses, it)
3804 3804
 			}

+ 1 - 0
controllers/sign_api_controller.go View File

@@ -72,6 +72,7 @@ func SignApiRegistRouters() {
72 72
 	beego.Router("/api/device/getenterprisedetail", &SignApiController{}, "Get:GetEnterPriseDetail")
73 73
 
74 74
 	beego.Router("/api/device/uploadprintorder", &SignApiController{}, "Post:UploadPrintOrder")
75
+
75 76
 }
76 77
 
77 78
 // 短信服务接口

+ 1 - 1
controllers/verify_login_controller.go View File

@@ -188,7 +188,7 @@ func (this *VerifyUserLoginAPIController) VerifyToken() {
188 188
 
189 189
 			//查询该机构是否存在医护排班
190 190
 			_, errcode := service.GetDoctorScheduleByOrgId(curOrg.Id)
191
-			fmt.Println("errcode2------------------", errcode)
191
+
192 192
 			//如果没有就插入
193 193
 			if errcode == gorm.ErrRecordNotFound {
194 194
 				err = service.BatchInsertDoctorSchedule(curOrg.Id)

+ 32 - 31
models/good_models.go View File

@@ -35,37 +35,37 @@ func (NewGoodsType) TableName() string {
35 35
 }
36 36
 
37 37
 type GoodInfo struct {
38
-	ID                     int64   `gorm:"column:id" json:"id" form:"id"`
39
-	GoodCode               string  `gorm:"column:good_code" json:"good_code" form:"good_code"`
40
-	SpecificationName      string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
41
-	GoodTypeId             int64   `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
42
-	GoodUnit               int64   `gorm:"column:good_unit" json:"good_unit" form:"good_unit"`
43
-	BuyPrice               float64 `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
44
-	SellPrice              float64 `gorm:"column:sell_price" json:"sell_price" form:"sell_price"`
45
-	Remark                 string  `gorm:"column:remark" json:"remark" form:"remark"`
46
-	Ctime                  int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
47
-	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
48
-	Manufacturer           int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
49
-	Dealer                 int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
50
-	ExpiryDateWarnDayCount int64   `gorm:"column:expiry_date_warn_day_count" json:"expiry_date_warn_day_count" form:"expiry_date_warn_day_count"`
51
-	StockWarnCount         int64   `gorm:"column:stock_warn_count" json:"stock_warn_count" form:"stock_warn_count"`
52
-	IsReuse                int64   `gorm:"column:is_reuse" json:"is_reuse" form:"is_reuse"`
53
-	Status                 int64   `gorm:"column:status" json:"status" form:"status"`
54
-	FilmArea               string  `gorm:"column:film_area" json:"film_area" form:"film_area"`
55
-	IsUse                  int64   `gorm:"column:is_use" json:"is_use" form:"is_use"`
56
-	FilmMaterialQuality    string  `gorm:"column:film_material_quality" json:"film_material_quality" form:"film_material_quality"`
57
-	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
58
-	Modifier               int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
59
-	Creater                int64   `gorm:"column:creater" json:"creater" form:"creater"`
60
-	GoodName               string  `gorm:"column:good_name" json:"good_name" form:"good_name"`
61
-	Pinyin                 string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
62
-	Wubi                   string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
63
-	GoodKind               int64   `gorm:"column:good_kind" json:"good_kind" form:"good_kind"`
64
-	MedicalInsuranceLevel  int64   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
65
-	RetailPrice            float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
66
-	MedicalInsuranceNumber string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
67
-	ProvincesCode          string  `gorm:"column:provinces_code" json:"provinces_code" form:"provinces_code"`
68
-
38
+	ID                          int64                   `gorm:"column:id" json:"id" form:"id"`
39
+	GoodCode                    string                  `gorm:"column:good_code" json:"good_code" form:"good_code"`
40
+	SpecificationName           string                  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
41
+	GoodTypeId                  int64                   `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
42
+	GoodUnit                    int64                   `gorm:"column:good_unit" json:"good_unit" form:"good_unit"`
43
+	BuyPrice                    float64                 `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
44
+	SellPrice                   float64                 `gorm:"column:sell_price" json:"sell_price" form:"sell_price"`
45
+	Remark                      string                  `gorm:"column:remark" json:"remark" form:"remark"`
46
+	Ctime                       int64                   `gorm:"column:ctime" json:"ctime" form:"ctime"`
47
+	Mtime                       int64                   `gorm:"column:mtime" json:"mtime" form:"mtime"`
48
+	Manufacturer                int64                   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
49
+	Dealer                      int64                   `gorm:"column:dealer" json:"dealer" form:"dealer"`
50
+	ExpiryDateWarnDayCount      int64                   `gorm:"column:expiry_date_warn_day_count" json:"expiry_date_warn_day_count" form:"expiry_date_warn_day_count"`
51
+	StockWarnCount              int64                   `gorm:"column:stock_warn_count" json:"stock_warn_count" form:"stock_warn_count"`
52
+	IsReuse                     int64                   `gorm:"column:is_reuse" json:"is_reuse" form:"is_reuse"`
53
+	Status                      int64                   `gorm:"column:status" json:"status" form:"status"`
54
+	FilmArea                    string                  `gorm:"column:film_area" json:"film_area" form:"film_area"`
55
+	IsUse                       int64                   `gorm:"column:is_use" json:"is_use" form:"is_use"`
56
+	FilmMaterialQuality         string                  `gorm:"column:film_material_quality" json:"film_material_quality" form:"film_material_quality"`
57
+	OrgId                       int64                   `gorm:"column:org_id" json:"org_id" form:"org_id"`
58
+	Modifier                    int64                   `gorm:"column:modifier" json:"modifier" form:"modifier"`
59
+	Creater                     int64                   `gorm:"column:creater" json:"creater" form:"creater"`
60
+	GoodName                    string                  `gorm:"column:good_name" json:"good_name" form:"good_name"`
61
+	Pinyin                      string                  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
62
+	Wubi                        string                  `gorm:"column:wubi" json:"wubi" form:"wubi"`
63
+	GoodKind                    int64                   `gorm:"column:good_kind" json:"good_kind" form:"good_kind"`
64
+	MedicalInsuranceLevel       int64                   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
65
+	RetailPrice                 float64                 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
66
+	MedicalInsuranceNumber      string                  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
67
+	ProvincesCode               string                  `gorm:"column:provinces_code" json:"provinces_code" form:"provinces_code"`
68
+	FirstLetter                 string                  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
69 69
 	IsSpecialDiseases           int64                   `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
70 70
 	IsRecord                    int64                   `gorm:"column:is_record" json:"is_record" form:"is_record"`
71 71
 	StatisticsCategory          int64                   `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
@@ -320,6 +320,7 @@ type GoodInformationFourty struct {
320 320
 	OrgId             int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
321 321
 	GoodName          string `gorm:"column:good_name" json:"good_name" form:"good_name"`
322 322
 	Status            int64  `gorm:"column:status" json:"status"`
323
+	PackingUnit       string `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
323 324
 }
324 325
 
325 326
 func (GoodInformationFourty) TableName() string {

+ 1 - 0
models/his_models.go View File

@@ -602,6 +602,7 @@ type HisProject struct {
602 602
 	SingleDose                  string  `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
603 603
 	ExecutionFrequency          string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
604 604
 	IsPrint                     int64   `gorm:"column:is_print" json:"is_print" form:"is_print"`
605
+	FirstLetter                 string  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
605 606
 }
606 607
 
607 608
 func (HisProject) TableName() string {

+ 1 - 0
models/new_stock_models.go View File

@@ -232,6 +232,7 @@ type VmStockFlowTwenty struct {
232 232
 	IsRead              int64              `gorm:"column:is_read" json:"is_read" form:"is_read"`
233 233
 	OverCount           int64              `gorm:"column:over_count" json:"over_count" form:"over_count"`
234 234
 	Ctime               int64              `gorm:"column:ctime" json:"ctime" form:"ctime"`
235
+	StorehouseId        int64              `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
235 236
 	WarehousingInfo     NewWarehousingInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehousingId" json:"xt_warehouse_info"`
236 237
 }
237 238
 

+ 221 - 0
models/patient_models.go View File

@@ -229,6 +229,7 @@ type Patients struct {
229 229
 	InfectiousRemark         string  `gorm:"column:infectious_remark" json:"infectious_remark" form:"infectious_remark"`
230 230
 	AllergicHistory          string  `gorm:"column:allergic_history" json:"allergic_history" form:"allergic_history"`
231 231
 	PatientAddress           string  `gorm:"column:patient_address" json:"patient_address" form:"patient_address"`
232
+	FirstLetter              string  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
232 233
 }
233 234
 
234 235
 func (Patients) TableName() string {
@@ -2107,3 +2108,223 @@ type XtMonitorRecordLog struct {
2107 2108
 func (XtMonitorRecordLog) TableName() string {
2108 2109
 	return "xt_monitor_record_log"
2109 2110
 }
2111
+
2112
+type XtScheduleLog struct {
2113
+	ID          int64  `gorm:"column:id" json:"id" form:"id"`
2114
+	UserOrgId   int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2115
+	RecordDate  int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
2116
+	Status      int64  `gorm:"column:status" json:"status" form:"status"`
2117
+	PatientId   int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2118
+	Ctime       int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2119
+	Mtime       int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2120
+	ErrLog      string `gorm:"column:err_log" json:"err_log" form:"err_log"`
2121
+	Source      string `gorm:"column:source" json:"source" form:"source"`
2122
+	Module      int64  `gorm:"column:module" json:"module" form:"module"`
2123
+	AdminUserId int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
2124
+}
2125
+
2126
+func (XtScheduleLog) TableName() string {
2127
+	return "xt_schedule_log"
2128
+}
2129
+
2130
+type XtDeviceValsualMap struct {
2131
+	ID                           int64                           `gorm:"column:id" json:"id" form:"id"`
2132
+	PatientId                    int64                           `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2133
+	IsAppend                     int64                           `gorm:"column:is_append" json:"is_append" form:"is_append"`
2134
+	IsImgV                       int64                           `gorm:"column:is_img_v" json:"is_img_v" form:"is_img_v"`
2135
+	IsImgA                       int64                           `gorm:"column:is_img_a" json:"is_img_a" form:"is_img_a"`
2136
+	VNum                         float64                         `gorm:"column:v_num" json:"v_num" form:"v_num"`
2137
+	Status                       int64                           `gorm:"column:status" json:"status" form:"status"`
2138
+	UserOrgId                    int64                           `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2139
+	ATop                         float64                         `gorm:"column:a_top" json:"a_top" form:"a_top"`
2140
+	AvBkx                        float64                         `gorm:"column:av_bkx" json:"av_bkx" form:"av_bkx"`
2141
+	AvBky                        float64                         `gorm:"column:av_bky" json:"av_bky" form:"av_bky"`
2142
+	FangxiangALeft               float64                         `gorm:"column:fangxiang_a_left" json:"fangxiang_a_left" form:"fangxiang_a_left"`
2143
+	FangxiangANum                float64                         `gorm:"column:fangxiang_a_num" json:"fangxiang_a_num" form:"fangxiang_a_num"`
2144
+	FangxiangATop                float64                         `gorm:"column:fangxiang_a_top" json:"fangxiang_a_top" form:"fangxiang_a_top"`
2145
+	FangxiangVLeft               float64                         `gorm:"column:fangxiang_v_left" json:"fangxiang_v_left" form:"fangxiang_v_left"`
2146
+	FangxiangVNum                float64                         `gorm:"column:fangxiang_v_num" json:"fangxiang_v_num" form:"fangxiang_v_num"`
2147
+	FangxiangVTop                float64                         `gorm:"column:fangxiang_v_top" json:"fangxiang_v_top" form:"fangxiang_v_top"`
2148
+	FuzhuALeft                   float64                         `gorm:"column:fuzhu_a_left" json:"fuzhu_a_left" form:"fuzhu_a_left"`
2149
+	FuzhuANum                    float64                         `gorm:"column:fuzhu_a_num" json:"fuzhu_a_num" form:"fuzhu_a_num"`
2150
+	FuzhuATop                    float64                         `gorm:"column:fuzhu_a_top" json:"fuzhu_a_top" form:"fuzhu_a_top"`
2151
+	FuzhuVLeft                   float64                         `gorm:"column:fuzhu_v_left" json:"fuzhu_v_left" form:"fuzhu_v_left"`
2152
+	FuzhuVNum                    float64                         `gorm:"column:fuzhu_v_num" json:"fuzhu_v_num" form:"fuzhu_v_num"`
2153
+	FuzhuVTop                    float64                         `gorm:"column:fuzhu_v_top" json:"fuzhu_v_top" form:"fuzhu_v_top"`
2154
+	ScaleaNum                    float64                         `gorm:"column:scalea_num" json:"scalea_num" form:"scalea_num"`
2155
+	ScalevNum                    float64                         `gorm:"column:scalev_num" json:"scalev_num" form:"scalev_num"`
2156
+	TextLeft                     float64                         `gorm:"column:text_left" json:"text_left" form:"text_left"`
2157
+	TextNum                      float64                         `gorm:"column:text_num" json:"text_num" form:"text_num"`
2158
+	TextTop                      float64                         `gorm:"column:text_top" json:"text_top" form:"text_top"`
2159
+	VTop                         float64                         `gorm:"column:v_top" json:"v_top" form:"v_top"`
2160
+	XuanzhuanA                   float64                         `gorm:"column:xuanzhuan_a" json:"xuanzhuan_a" form:"xuanzhuan_a"`
2161
+	XuanzhuanV                   float64                         `gorm:"column:xuanzhuan_v" json:"xuanzhuan_v" form:"xuanzhuan_v"`
2162
+	ALeft                        float64                         `gorm:"column:a_left" json:"a_left" form:"a_left"`
2163
+	VLeft                        float64                         `gorm:"column:v_left" json:"v_left" form:"v_left"`
2164
+	ImgUrl                       string                          `gorm:"column:img_url" json:"img_url" form:"img_url"`
2165
+	XtDeviceValsualALeft         []*XtDeviceValsualALeft         `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualALeft"`
2166
+	XtDeviceValsualMapFangxiangA []*XtDeviceValsualMapFangxiangA `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualMapFangxiangA"`
2167
+	XtDeviceValsualMapFangxiangV []*XtDeviceValsualMapFangxiangV `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualMapFangxiangV"`
2168
+	XtDeviceValsualFuzhuA        []*XtDeviceValsualFuzhuA        `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualFuzhuA"`
2169
+	XtDeviceValsualFuzhuV        []*XtDeviceValsualFuzhuV        `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualFuzhuV"`
2170
+	XtDeviceValsualTextArr       []*XtDeviceValsualTextArr       `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualTextArr"`
2171
+	XtDeviceValsualVLeft         []*XtDeviceValsualVLeft         `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"XtDeviceValsualVLeft"`
2172
+	DeviceValusalMapArr          []*XtDeviceValusalMapArr        `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValusalMapArr"`
2173
+	XtDeviceValusalMapVrr        []*XtDeviceValusalMapVrr        `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValusalMapVrr"`
2174
+}
2175
+
2176
+func (XtDeviceValsualMap) TableName() string {
2177
+	return "xt_device_valsual_map"
2178
+}
2179
+
2180
+type XtDeviceValsualALeft struct {
2181
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2182
+	ANum      float64 `gorm:"column:a_num" json:"a_num" form:"a_num"`
2183
+	MarkNum   float64 `gorm:"column:mark_num" json:"mark_num" form:"mark_num"`
2184
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2185
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2186
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2187
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2188
+	MapId     int64   `gorm:"column:map_id" json:"map_id" form:"map_id"`
2189
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2190
+}
2191
+
2192
+func (XtDeviceValsualALeft) TableName() string {
2193
+	return "xt_device_valsual_a_left"
2194
+}
2195
+
2196
+type XtDeviceValsualMapFangxiangA struct {
2197
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2198
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2199
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2200
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2201
+	Left      float64 `gorm:"column:left" json:"left" form:"left"`
2202
+	MarkNum   float64 `gorm:"column:mark_num" json:"mark_num" form:"mark_num"`
2203
+	Top       float64 `gorm:"column:top" json:"top" form:"top"`
2204
+	MapId     int64   `gorm:"column:map_id" json:"map_id" form:"map_id"`
2205
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2206
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2207
+}
2208
+
2209
+func (XtDeviceValsualMapFangxiangA) TableName() string {
2210
+	return "xt_device_valsual_map_fangxiang_a"
2211
+}
2212
+
2213
+type XtDeviceValsualMapFangxiangV struct {
2214
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2215
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2216
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2217
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2218
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2219
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2220
+	MarkNum   float64 `gorm:"column:mark_num" json:"mark_num" form:"mark_num"`
2221
+	Left      float64 `gorm:"column:left" json:"left" form:"left"`
2222
+	Top       float64 `gorm:"column:top" json:"top" form:"top"`
2223
+	MapId     int64   `gorm:"column:map_id" json:"map_id" form:"map_id"`
2224
+}
2225
+
2226
+func (XtDeviceValsualMapFangxiangV) TableName() string {
2227
+	return "xt_device_valsual_map_fangxiang_v"
2228
+}
2229
+
2230
+type XtDeviceValsualFuzhuA struct {
2231
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2232
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2233
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2234
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2235
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2236
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2237
+	ALeft     float64 `gorm:"column:a_left" json:"a_left" form:"a_left"`
2238
+	AMarkNum  float64 `gorm:"column:a_mark_num" json:"a_mark_num" form:"a_mark_num"`
2239
+	ATop      float64 `gorm:"column:a_top" json:"a_top" form:"a_top"`
2240
+	MapId     int64   `gorm:"column:map_id" json:"map_id" form:"map_id"`
2241
+}
2242
+
2243
+func (XtDeviceValsualFuzhuA) TableName() string {
2244
+	return "xt_device_valsual_fuzhu_a"
2245
+}
2246
+
2247
+type XtDeviceValsualFuzhuV struct {
2248
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2249
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2250
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2251
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2252
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2253
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2254
+	VMarkNum  float64 `gorm:"column:v_mark_num" json:"v_mark_num" form:"v_mark_num"`
2255
+	VLeft     float64 `gorm:"column:v_left" json:"v_left" form:"v_left"`
2256
+	VTop      float64 `gorm:"column:v_top" json:"v_top" form:"v_top"`
2257
+	MapId     int64   `gorm:"column:map_id" json:"map_id" form:"map_id"`
2258
+}
2259
+
2260
+func (XtDeviceValsualFuzhuV) TableName() string {
2261
+	return "xt_device_valsual_fuzhu_v"
2262
+}
2263
+
2264
+type XtDeviceValsualTextArr struct {
2265
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2266
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2267
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2268
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2269
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2270
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2271
+	Left      float64 `gorm:"column:left" json:"left" form:"left"`
2272
+	Text      string  `gorm:"column:text" json:"text" form:"text"`
2273
+	Top       float64 `gorm:"column:top" json:"top" form:"top"`
2274
+	Width     float64 `gorm:"column:width" json:"width" form:"width"`
2275
+	MapId     int64   `gorm:"column:map_id" json:"map_id" form:"map_id"`
2276
+}
2277
+
2278
+func (XtDeviceValsualTextArr) TableName() string {
2279
+	return "xt_device_valsual_text_arr"
2280
+}
2281
+
2282
+type XtDeviceValsualVLeft struct {
2283
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2284
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2285
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2286
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2287
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2288
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2289
+	MarkNum   float64 `gorm:"column:mark_num" json:"mark_num" form:"mark_num"`
2290
+	VNum      float64 `gorm:"column:v_num" json:"v_num" form:"v_num"`
2291
+	MapId     int64   `gorm:"column:map_id" json:"map_id" form:"map_id"`
2292
+}
2293
+
2294
+func (XtDeviceValsualVLeft) TableName() string {
2295
+	return "xt_device_valsual_v_left"
2296
+}
2297
+
2298
+type XtDeviceValusalMapArr struct {
2299
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2300
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2301
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2302
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2303
+	MarkNum   float64 `gorm:"column:mark_num" json:"mark_num" form:"mark_num"`
2304
+	Left      float64 `gorm:"column:left" json:"left" form:"left"`
2305
+	Top       float64 `gorm:"column:top" json:"top" form:"top"`
2306
+	IsStatus  float64 `gorm:"column:is_status" json:"is_status" form:"is_status"`
2307
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2308
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2309
+}
2310
+
2311
+func (XtDeviceValusalMapArr) TableName() string {
2312
+	return "xt_device_valusal_map_arr"
2313
+}
2314
+
2315
+type XtDeviceValusalMapVrr struct {
2316
+	ID        int64   `gorm:"column:id" json:"id" form:"id"`
2317
+	PatientId int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2318
+	UserOrgId int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2319
+	Status    int64   `gorm:"column:status" json:"status" form:"status"`
2320
+	MarkNum   float64 `gorm:"column:mark_num" json:"mark_num" form:"mark_num"`
2321
+	Left      float64 `gorm:"column:left" json:"left" form:"left"`
2322
+	Top       float64 `gorm:"column:top" json:"top" form:"top"`
2323
+	IsStatus  float64 `gorm:"column:is_status" json:"is_status" form:"is_status"`
2324
+	Ctime     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
2325
+	Mtime     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
2326
+}
2327
+
2328
+func (XtDeviceValusalMapVrr) TableName() string {
2329
+	return "xt_device_valusal_map_vrr"
2330
+}

+ 34 - 30
models/self_drug_models.go View File

@@ -586,6 +586,8 @@ type BloodDrugWarehouseOutInfo struct {
586 586
 	DoseUnit                string  `json:"dose_unit"`
587 587
 	LastPrice               float64 `json:"last_price"`
588 588
 	StorehouseId            int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
589
+	InPrice                 float64 `gorm:"column:price" json:"in_price" form:"price"`
590
+	WarehousingInfoId       int64   `gorm:"column:warehousing_info_id" json:"warehousing_info_id" form:"warehousing_info_id"`
589 591
 }
590 592
 
591 593
 type XtMonitorConfig struct {
@@ -650,6 +652,7 @@ type StDrugWarehouseInfo struct {
650 652
 	PackingUnit      string  `json:"packing_unit"`
651 653
 	Dosage           int64   `json:"dosage"`
652 654
 	LimaxUnit        string  `json:"limax_unit"`
655
+	WarehousingTime  int64   `gorm:"column:warehousing_time" json:"warehousing_time" form:"warehousing_time"`
653 656
 }
654 657
 
655 658
 type VmDrugWarehouseOutInfo struct {
@@ -929,36 +932,37 @@ type VmDrugInventory struct {
929 932
 }
930 933
 
931 934
 type SgjDrugWarehouseOutInfo struct {
932
-	ID                      int64      `gorm:"column:id" json:"id" form:"id"`
933
-	WarehouseOutId          int64      `gorm:"column:warehouse_out_id" json:"warehouse_out_id" form:"warehouse_out_id"`
934
-	DrugId                  int64      `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
935
-	WarehousingOutTarget    int64      `gorm:"column:warehousing_out_target" json:"warehousing_out_target" form:"warehousing_out_target"`
936
-	Count                   int64      `gorm:"column:count" json:"count" form:"count"`
937
-	CountUnit               string     `gorm:"column:count_unit" json:"count_unit" form:"count_unit"`
938
-	Price                   float64    `gorm:"column:price" json:"price" form:"price"`
939
-	TotalPrice              float64    `gorm:"column:total_price" json:"total_price" form:"total_price"`
940
-	ProductDate             int64      `gorm:"column:product_date" json:"product_date" form:"product_date"`
941
-	ExpiryDate              int64      `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
942
-	Mtime                   int64      `gorm:"column:mtime" json:"mtime" form:"mtime"`
943
-	Ctime                   int64      `gorm:"column:ctime" json:"ctime" form:"ctime"`
944
-	Status                  int64      `gorm:"column:status" json:"status" form:"status"`
945
-	OrgId                   int64      `gorm:"column:org_id" json:"org_id" form:"org_id"`
946
-	Remark                  string     `gorm:"column:remark" json:"remark" form:"remark"`
947
-	IsCancel                int64      `gorm:"column:is_cancel" json:"is_cancel" form:"is_cancel"`
948
-	WarehouseOutOrderNumber string     `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number" form:"warehouse_out_order_number"`
949
-	Type                    int64      `gorm:"column:type" json:"type" form:"type"`
950
-	Dealer                  int64      `gorm:"column:dealer" json:"dealer" form:"dealer"`
951
-	Manufacturer            int64      `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
952
-	IsSys                   int64      `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
953
-	SysRecordTime           int64      `gorm:"column:sys_record_time" json:"sys_record_time" form:"sys_record_time"`
954
-	RetailPrice             float64    `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
955
-	RetailTotalPrice        float64    `gorm:"column:retail_total_price" json:"retail_total_price" form:"retail_total_price"`
956
-	WarehouseInfoId         int64      `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
957
-	Number                  string     `gorm:"column:number" json:"number" form:"number"`
958
-	BatchNumber             string     `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
959
-	PatientId               int64      `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
960
-	IsCheck                 int64      `gorm:"column:is_check" json:"is_check" form:"is_check"`
961
-	XtBaseDrug              XtBaseDrug `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" `
935
+	ID                      int64               `gorm:"column:id" json:"id" form:"id"`
936
+	WarehouseOutId          int64               `gorm:"column:warehouse_out_id" json:"warehouse_out_id" form:"warehouse_out_id"`
937
+	DrugId                  int64               `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
938
+	WarehousingOutTarget    int64               `gorm:"column:warehousing_out_target" json:"warehousing_out_target" form:"warehousing_out_target"`
939
+	Count                   int64               `gorm:"column:count" json:"count" form:"count"`
940
+	CountUnit               string              `gorm:"column:count_unit" json:"count_unit" form:"count_unit"`
941
+	Price                   float64             `gorm:"column:price" json:"price" form:"price"`
942
+	TotalPrice              float64             `gorm:"column:total_price" json:"total_price" form:"total_price"`
943
+	ProductDate             int64               `gorm:"column:product_date" json:"product_date" form:"product_date"`
944
+	ExpiryDate              int64               `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
945
+	Mtime                   int64               `gorm:"column:mtime" json:"mtime" form:"mtime"`
946
+	Ctime                   int64               `gorm:"column:ctime" json:"ctime" form:"ctime"`
947
+	Status                  int64               `gorm:"column:status" json:"status" form:"status"`
948
+	OrgId                   int64               `gorm:"column:org_id" json:"org_id" form:"org_id"`
949
+	Remark                  string              `gorm:"column:remark" json:"remark" form:"remark"`
950
+	IsCancel                int64               `gorm:"column:is_cancel" json:"is_cancel" form:"is_cancel"`
951
+	WarehouseOutOrderNumber string              `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number" form:"warehouse_out_order_number"`
952
+	Type                    int64               `gorm:"column:type" json:"type" form:"type"`
953
+	Dealer                  int64               `gorm:"column:dealer" json:"dealer" form:"dealer"`
954
+	Manufacturer            int64               `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
955
+	IsSys                   int64               `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
956
+	SysRecordTime           int64               `gorm:"column:sys_record_time" json:"sys_record_time" form:"sys_record_time"`
957
+	RetailPrice             float64             `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
958
+	RetailTotalPrice        float64             `gorm:"column:retail_total_price" json:"retail_total_price" form:"retail_total_price"`
959
+	WarehouseInfoId         int64               `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
960
+	Number                  string              `gorm:"column:number" json:"number" form:"number"`
961
+	BatchNumber             string              `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
962
+	PatientId               int64               `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
963
+	IsCheck                 int64               `gorm:"column:is_check" json:"is_check" form:"is_check"`
964
+	XtBaseDrug              XtBaseDrug          `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" `
965
+	XtDrugWarehouseInfo     XtDrugWarehouseInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseInfoId"`
962 966
 }
963 967
 
964 968
 func (SgjDrugWarehouseOutInfo) TableName() string {

+ 75 - 44
models/stock_models.go View File

@@ -106,12 +106,26 @@ type StWarehousingInfo struct {
106 106
 	LicenseNumber         string  `gorm:"column:license_number" json:"license_number" form:"license_number"`
107 107
 	StorehouseId          int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
108 108
 	SecondWarehouseInfoId int64   `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
109
+	WarehousingTime       string  `json:"warehousing_time"`
109 110
 }
110 111
 
111 112
 func (StWarehousingInfo) TableName() string {
112 113
 	return "xt_warehouse_info"
113 114
 }
114 115
 
116
+type XtWarehouse struct {
117
+	ID               int64  `gorm:"column:id" json:"id" form:"id"`
118
+	WarehousingOrder string `gorm:"column:warehousing_order" json:"warehousing_order" form:"warehousing_order"`
119
+	OperationTime    int64  `gorm:"column:operation_time" json:"operation_time" form:"operation_time"`
120
+	OrgId            int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
121
+	Status           int64  `gorm:"column:status" json:"status" form:"status"`
122
+	WarehousingTime  int64  `gorm:"column:warehousing_time" json:"warehousing_time" form:"warehousing_time"`
123
+}
124
+
125
+func (XtWarehouse) TableName() string {
126
+	return "xt_warehouse"
127
+}
128
+
115 129
 type WarehousingInfo struct {
116 130
 	ID                        int64       `gorm:"column:id" json:"id"`
117 131
 	WarehousingId             int64       `gorm:"column:warehousing_id" json:"warehousing_id"`
@@ -229,50 +243,51 @@ func (WarehouseOut) TableName() string {
229 243
 }
230 244
 
231 245
 type WarehouseOutInfo struct {
232
-	ID                      int64           `gorm:"column:id" json:"id"`
233
-	WarehouseOutId          int64           `gorm:"column:warehouse_out_id" json:"warehouse_out_id"`
234
-	WarehouseInfotId        int64           `gorm:"column:warehouse_info_id" json:"warehouse_info_id"`
235
-	GoodId                  int64           `gorm:"column:good_id" json:"good_id"`
236
-	GoodTypeId              int64           `gorm:"column:good_type_id" json:"good_type_id"`
237
-	WarehousingOutTarget    int64           `gorm:"column:warehousing_out_target" json:"warehousing_out_target"`
238
-	Count                   int64           `gorm:"column:count" json:"count"`
239
-	Price                   float64         `gorm:"column:price" json:"price"`
240
-	TotalPrice              float64         `gorm:"column:total_price" json:"total_price"`
241
-	ProductDate             int64           `gorm:"column:product_date" json:"product_date"`
242
-	ExpiryDate              int64           `gorm:"column:expiry_date" json:"expiry_date"`
243
-	Mtime                   int64           `gorm:"column:mtime" json:"mtime"`
244
-	Ctime                   int64           `gorm:"column:ctime" json:"ctime"`
245
-	Status                  int64           `gorm:"column:status" json:"status"`
246
-	OrgId                   int64           `gorm:"column:org_id" json:"org_id"`
247
-	Remark                  string          `gorm:"column:remark" json:"remark"`
248
-	IsCancel                int64           `gorm:"column:is_cancel" json:"is_cancel"`
249
-	WarehouseOut            WarehouseOut    `ForeignKey:WarehouseOutId json:"WarehouseOut"`
250
-	WarehouseOutOrderNumber string          `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number"`
251
-	GoodInfo                GoodInfo        `gorm:"ForeignKey:ID;AssociationForeignKey:GoodId" `
252
-	Type                    int64           `gorm:"column:type" json:"type"`
253
-	Dealer                  int64           `gorm:"column:dealer" json:"dealer"`
254
-	Manufacturer            int64           `gorm:"column:manufacturer" json:"manufacturer"`
255
-	IsSys                   int64           `gorm:"column:is_sys" json:"is_sys"`
256
-	SysRecordTime           int64           `gorm:"column:sys_record_time" json:"sys_record_time"`
257
-	PatientId               int64           `gorm:"column:patient_id" json:"patient_id"`
258
-	Number                  string          `gorm:"column:number" json:"number" form:"number"`
259
-	LicenseNumber           string          `gorm:"column:license_number" json:"license_number" form:"license_number"`
260
-	ConsumableType          int64           `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
261
-	ProjectId               int64           `gorm:"column:project_id" json:"project_id" form:"project_id"`
262
-	SupplyCancelOutId       int64           `gorm:"column:supply_cancel_out_id" json:"supply_cancel_out_id" form:"supply_cancel_out_id"`
263
-	SupplyWarehouseId       int64           `gorm:"column:supply_warehouse_id" json:"supply_warehouse_id" form:"supply_warehouse_id"`
264
-	IsSource                int64           `gorm:"column:is_source" json:"is_source" form:"is_source"`
265
-	StorehouseId            int64           `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
266
-	SecondWarehouseInfoId   int64           `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
267
-	AdminUserId             int64           `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
268
-	BuyPrice                float64         `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
269
-	StockCount              string          `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
270
-	IsCheck                 int64           `gorm:"column:is_check" json:"is_check" form:"is_check"`
271
-	RegisterNumber          string          `gorm:"column:register_number" json:"register_number" form:"register_number"`
272
-	WarehousingInfo         WarehousingInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseInfotId" `
273
-	VmStockFlow             VmStockFlow     `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseOutDetailId" json:"stock_flow"`
274
-	OverCount               int64           `gorm:"column:over_count" json:"over_count" form:"over_count"`
275
-	OrderId                 int64           `gorm:"column:order_id" json:"order_id" form:"order_id"`
246
+	ID                      int64                `gorm:"column:id" json:"id"`
247
+	WarehouseOutId          int64                `gorm:"column:warehouse_out_id" json:"warehouse_out_id"`
248
+	WarehouseInfotId        int64                `gorm:"column:warehouse_info_id" json:"warehouse_info_id"`
249
+	GoodId                  int64                `gorm:"column:good_id" json:"good_id"`
250
+	GoodTypeId              int64                `gorm:"column:good_type_id" json:"good_type_id"`
251
+	WarehousingOutTarget    int64                `gorm:"column:warehousing_out_target" json:"warehousing_out_target"`
252
+	Count                   int64                `gorm:"column:count" json:"count"`
253
+	Price                   float64              `gorm:"column:price" json:"price"`
254
+	TotalPrice              float64              `gorm:"column:total_price" json:"total_price"`
255
+	ProductDate             int64                `gorm:"column:product_date" json:"product_date"`
256
+	ExpiryDate              int64                `gorm:"column:expiry_date" json:"expiry_date"`
257
+	Mtime                   int64                `gorm:"column:mtime" json:"mtime"`
258
+	Ctime                   int64                `gorm:"column:ctime" json:"ctime"`
259
+	Status                  int64                `gorm:"column:status" json:"status"`
260
+	OrgId                   int64                `gorm:"column:org_id" json:"org_id"`
261
+	Remark                  string               `gorm:"column:remark" json:"remark"`
262
+	IsCancel                int64                `gorm:"column:is_cancel" json:"is_cancel"`
263
+	WarehouseOut            WarehouseOut         `ForeignKey:WarehouseOutId json:"WarehouseOut"`
264
+	WarehouseOutOrderNumber string               `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number"`
265
+	GoodInfo                GoodInfo             `gorm:"ForeignKey:ID;AssociationForeignKey:GoodId" `
266
+	Type                    int64                `gorm:"column:type" json:"type"`
267
+	Dealer                  int64                `gorm:"column:dealer" json:"dealer"`
268
+	Manufacturer            int64                `gorm:"column:manufacturer" json:"manufacturer"`
269
+	IsSys                   int64                `gorm:"column:is_sys" json:"is_sys"`
270
+	SysRecordTime           int64                `gorm:"column:sys_record_time" json:"sys_record_time"`
271
+	PatientId               int64                `gorm:"column:patient_id" json:"patient_id"`
272
+	Number                  string               `gorm:"column:number" json:"number" form:"number"`
273
+	LicenseNumber           string               `gorm:"column:license_number" json:"license_number" form:"license_number"`
274
+	ConsumableType          int64                `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
275
+	ProjectId               int64                `gorm:"column:project_id" json:"project_id" form:"project_id"`
276
+	SupplyCancelOutId       int64                `gorm:"column:supply_cancel_out_id" json:"supply_cancel_out_id" form:"supply_cancel_out_id"`
277
+	SupplyWarehouseId       int64                `gorm:"column:supply_warehouse_id" json:"supply_warehouse_id" form:"supply_warehouse_id"`
278
+	IsSource                int64                `gorm:"column:is_source" json:"is_source" form:"is_source"`
279
+	StorehouseId            int64                `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
280
+	SecondWarehouseInfoId   int64                `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
281
+	AdminUserId             int64                `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
282
+	BuyPrice                float64              `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
283
+	StockCount              string               `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
284
+	IsCheck                 int64                `gorm:"column:is_check" json:"is_check" form:"is_check"`
285
+	RegisterNumber          string               `gorm:"column:register_number" json:"register_number" form:"register_number"`
286
+	WarehousingInfo         WarehousingInfo      `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseInfotId" `
287
+	VmStockFlow             VmStockFlow          `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseOutDetailId" json:"stock_flow"`
288
+	OverCount               int64                `gorm:"column:over_count" json:"over_count" form:"over_count"`
289
+	OrderId                 int64                `gorm:"column:order_id" json:"order_id" form:"order_id"`
290
+	WarehousingInfoNight    WarehousingInfoNight `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseInfotId"`
276 291
 }
277 292
 
278 293
 func (WarehouseOutInfo) TableName() string {
@@ -541,6 +556,7 @@ type WarehouseOutInfoOne struct {
541 556
 	BuyPrice                    float64 `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
542 557
 	StockCount                  string  `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
543 558
 	RegisterNumber              string  `gorm:"column:register_number" json:"register_number" form:"register_number"`
559
+	WarehouseOutTime            int64   `gorm:"column:warehouse_out_time" json:"warehouse_out_time" form:"warehouse_out_time"`
544 560
 }
545 561
 
546 562
 type WarehouseOutInfoTwo struct {
@@ -1553,6 +1569,7 @@ type StartWarehousingInfo struct {
1553 1569
 	WarehousingCount int64   `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
1554 1570
 	WarehousingUnit  string  `gorm:"column:warehousing_unit" json:"warehousing_unit" form:"warehousing_unit"`
1555 1571
 	PackingPrice     float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
1572
+	StorehouseId     int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
1556 1573
 }
1557 1574
 
1558 1575
 func (StartWarehousingInfo) TableName() string {
@@ -1656,3 +1673,17 @@ type NewWarehousingInfo struct {
1656 1673
 func (NewWarehousingInfo) TableName() string {
1657 1674
 	return "xt_warehouse_info"
1658 1675
 }
1676
+
1677
+type WarehousingInfoNight struct {
1678
+	ID              int64   `gorm:"column:id" json:"id"`
1679
+	StockCount      int64   `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
1680
+	StorehouseId    int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
1681
+	WarehouseInfoId int64   `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
1682
+	PackingPrice    float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
1683
+	Price           float64 `gorm:"column:price" json:"price"`
1684
+	Number          string  `gorm:"column:number" json:"number"`
1685
+}
1686
+
1687
+func (WarehousingInfoNight) TableName() string {
1688
+	return "xt_warehouse_info"
1689
+}

+ 2 - 2
service/common_service.go View File

@@ -481,7 +481,7 @@ func GetDialysisAgeData(orgID int64, lapsetotype int64, sourcetype int64) (count
481 481
 
482 482
 func GetCurentOrgPatients(orgid int64) (patients []*models.BloodXtPatients, err error) {
483 483
 
484
-	err = XTReadDB().Where("user_org_id = ? and status =1 and lapseto = 1", orgid).Order("created_time desc").Find(&patients).Error
484
+	err = XTReadDB().Where("user_org_id = ? and status =1", orgid).Order("created_time desc").Find(&patients).Error
485 485
 	return patients, err
486 486
 }
487 487
 
@@ -3488,7 +3488,7 @@ func GetModeIdCount(startime int64, endtime int64, orgid int64, page int64, limi
3488 3488
 
3489 3489
 func GetScheduleModeIdCount(startime int64, endtime int64, orgid int64, page int64, limit int64) (order []*models.BloodDialysisModeIdCount, err error) {
3490 3490
 
3491
-	db := XTReadDB().Table("xt_schedule as s")
3491
+	db := XTReadDB().Table("xt_schedule as s").Where("s.status = 1")
3492 3492
 	if orgid > 0 {
3493 3493
 		db = db.Where("s.user_org_id = ?", orgid)
3494 3494
 	}

+ 2 - 2
service/dialysis_service.go View File

@@ -1527,7 +1527,7 @@ func SaveHisProject(advice *models.HisPrescriptionProject) (err error) {
1527 1527
 }
1528 1528
 
1529 1529
 func FindAllHisProjectById(orgID int64, patient_id int64, record_time int64) (advice []*models.HisPrescriptionProject, err error) {
1530
-	err = readDb.Model(&models.HisPrescriptionProject{}).Preload("HisProject", "status = 1 and user_org_id = ?", orgID).Preload("GoodInfo", "status = 1 and org_id = ?", orgID).Where("user_org_id=? and status=1 and patient_id = ? AND record_date = ?", orgID, patient_id, record_time).Find(&advice).Error
1530
+	err = readDb.Model(&models.HisPrescriptionProject{}).Preload("HisProject", "status = 1 and user_org_id = ?", orgID).Preload("XtHisProjectTeam", "user_org_id=? and status=1", orgID).Preload("GoodInfo", "status = 1 and org_id = ?", orgID).Where("user_org_id=? and status=1 and patient_id = ? AND record_date = ?", orgID, patient_id, record_time).Find(&advice).Error
1531 1531
 	return
1532 1532
 }
1533 1533
 
@@ -1848,7 +1848,7 @@ func GetSchedulePrintList(page int64, limit int64, schedulType int64, partitionT
1848 1848
 	if len(keywords) > 0 {
1849 1849
 		db = db.Where("p.name like ?", likeKey)
1850 1850
 	}
1851
-	err = db.Count(&total).Select("x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.status,p.name").Offset(limit * (page - 1)).Limit(limit).Order("x.schedule_date desc").Find(&list).Error
1851
+	err = db.Count(&total).Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.status,p.name").Offset(limit * (page - 1)).Limit(limit).Order("x.schedule_date desc").Find(&list).Error
1852 1852
 
1853 1853
 	return list, total, err
1854 1854
 }

+ 1 - 1
service/drug_stock_service.go View File

@@ -273,6 +273,6 @@ func GetDrugOutOrderInfoPrintList(startime int64, endtime int64, orgid int64) (l
273 273
 	if orgid > 0 {
274 274
 		db = db.Where("org_id = ?", orgid)
275 275
 	}
276
-	err = db.Preload("XtBaseDrug", "status = 1 and org_id = ?", orgid).Find(&list).Error
276
+	err = db.Preload("XtDrugWarehouseInfo", "status=1 and org_id =?", orgid).Preload("XtBaseDrug", "status = 1 and org_id = ?", orgid).Find(&list).Error
277 277
 	return list, err
278 278
 }

+ 143 - 6
service/gobal_config_service.go View File

@@ -366,10 +366,11 @@ func GetDrugOutOrder(startime int64, endtime int64, orgid int64, orderType int64
366 366
 
367 367
 	likeKey := "%" + keyword + "%"
368 368
 	offset := (page - 1) * limit
369
-	db := XTReadDB().Table("xt_drug_warehouse_out_info as x").Where("x.status =1 and x.is_check = 1")
370
-	dbOne := XTReadDB().Table("xt_base_drug as b").Where("b.status =1")
371
-	dbTwo := XTReadDB().Table("xt_drug_warehouse_out as t").Where("t.status = 1")
372
-	fmt.Print(dbOne, dbTwo)
369
+	db := XTReadDB().Table("sgj_xt.xt_drug_warehouse_out_info as x").Where("x.status =1 and x.is_check = 1")
370
+	dbOne := XTReadDB().Table("sgj_xt.xt_base_drug as b").Where("b.status =1")
371
+	dbTwo := XTReadDB().Table("sgj_xt.xt_drug_warehouse_out as t").Where("t.status = 1")
372
+	dbThree := XTReadDB().Table("sgj_xt.xt_drug_warehouse_info as p").Where("p.status=1")
373
+	fmt.Print(dbOne, dbTwo, dbThree)
373 374
 	if startime > 0 {
374 375
 		db = db.Where("x.sys_record_time >=?", startime)
375 376
 	}
@@ -393,10 +394,11 @@ func GetDrugOutOrder(startime int64, endtime int64, orgid int64, orderType int64
393 394
 		db = db.Where("x.warehouse_out_order_number like ? or b.drug_name like ?  or r.user_name like ?", likeKey, likeKey, likeKey)
394 395
 	}
395 396
 
397
+	db = db.Joins("left join sgj_xt.xt_drug_warehouse_info as p on p.id =x.warehouse_info_id")
396 398
 	if manufacturerId > 0 {
397
-		err = db.Select("x.id,x.warehouse_out_id,x.drug_id,x.warehousing_out_target,x.count,x.count_unit,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.remark,x.is_cancel,x.warehouse_out_order_number,x.type,x.dealer,x.manufacturer,x.is_sys,x.sys_record_time,x.retail_price,x.retail_total_price,x.storehouse_id,b.drug_name,b.drug_spec,b.drug_type,b.min_unit,b.max_unit,b.min_number,b.dose,b.dose_unit,b.last_price,t.creater").Joins("left join xt_base_drug as b on b.id = x.drug_id and b.org_id = ? and b.status =1", orgid).Joins("left join xt_drug_warehouse_out as t on t.id = x.warehouse_out_id and t.org_id = ? and t.status  =1", orgid).Where("t.manufacturer = ?", manufacturerId).Order("x.ctime desc").Count(&total).Offset(offset).Limit(limit).Scan(&outinfo).Error
399
+		err = db.Select("x.id,x.warehouse_out_id,x.drug_id,x.warehousing_out_target,x.count,x.count_unit,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.remark,x.is_cancel,x.warehouse_out_order_number,x.type,x.dealer,x.manufacturer,x.is_sys,x.sys_record_time,x.retail_price,x.retail_total_price,x.storehouse_id,b.drug_name,b.drug_spec,b.drug_type,b.min_unit,b.max_unit,b.min_number,b.dose,b.dose_unit,b.last_price,t.creater,p.price").Joins("left join xt_base_drug as b on b.id = x.drug_id and b.org_id = ? and b.status =1", orgid).Joins("left join xt_drug_warehouse_out as t on t.id = x.warehouse_out_id and t.org_id = ? and t.status  =1", orgid).Where("t.manufacturer = ?", manufacturerId).Order("x.ctime desc").Count(&total).Offset(offset).Limit(limit).Scan(&outinfo).Error
398 400
 	} else {
399
-		err = db.Select("x.id,x.warehouse_out_id,x.drug_id,x.warehousing_out_target,x.count,x.count_unit,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.remark,x.is_cancel,x.warehouse_out_order_number,x.type,x.dealer,x.manufacturer,x.is_sys,x.sys_record_time,x.retail_price,x.retail_total_price,x.storehouse_id,b.drug_name,b.drug_spec,b.drug_type,b.min_unit,b.max_unit,b.min_number,b.dose,b.dose_unit,b.last_price,t.creater").Joins("left join xt_base_drug as b on b.id = x.drug_id and b.org_id = ? and b.status =1", orgid).Joins("left join xt_drug_warehouse_out as t on t.id = x.warehouse_out_id and t.org_id = ? and t.status  =1", orgid).Order("x.ctime desc").Count(&total).Offset(offset).Limit(limit).Scan(&outinfo).Error
401
+		err = db.Select("x.id,x.warehouse_out_id,x.drug_id,x.warehousing_out_target,x.count,x.count_unit,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.remark,x.is_cancel,x.warehouse_out_order_number,x.type,x.dealer,x.manufacturer,x.is_sys,x.sys_record_time,x.retail_price,x.retail_total_price,x.storehouse_id,b.drug_name,b.drug_spec,b.drug_type,b.min_unit,b.max_unit,b.min_number,b.dose,b.dose_unit,b.last_price,t.creater,p.price").Joins("left join xt_base_drug as b on b.id = x.drug_id and b.org_id = ? and b.status =1", orgid).Joins("left join xt_drug_warehouse_out as t on t.id = x.warehouse_out_id and t.org_id = ? and t.status  =1", orgid).Order("x.ctime desc").Count(&total).Offset(offset).Limit(limit).Scan(&outinfo).Error
400 402
 	}
401 403
 
402 404
 	return outinfo, total, err
@@ -1146,3 +1148,138 @@ func CheckMobileInformation(id int64, application_status int64, checker int64, c
1146 1148
 	err := XTWriteDB().Model(&models.XtDialysisInformation{}).Where("id = ? and status= 1", id).Update(map[string]interface{}{"application_status": application_status, "checker": checker, "check_time": checker_time}).Error
1147 1149
 	return err
1148 1150
 }
1151
+
1152
+func GetPrescriptionPatientList(orgID int64, keywords string) (patient []*models.Patients, err error) {
1153
+	fmt.Println("keyworsosososo", keywords)
1154
+	db := readDb.Model(&models.Patients{}).Where("user_org_id=? and status=1", orgID)
1155
+	if len(keywords) > 0 {
1156
+		likekey := "%" + keywords + "%"
1157
+		err = db.Where("(name LIKE ?)", likekey).Find(&patient).Error
1158
+	} else {
1159
+		err = db.Find(&patient).Error
1160
+	}
1161
+	return
1162
+}
1163
+
1164
+func GetPrescriptionLogList(patient_id int64, page int64, limit int64, record_date int64, orgId int64) (prescriptionlog []*models.XtDialysisPrescriptionLog, total int64, err error) {
1165
+
1166
+	offset := (page - 1) * limit
1167
+
1168
+	db := XTReadDB().Model(prescriptionlog).Where("status =1")
1169
+
1170
+	if patient_id > 0 {
1171
+		db = db.Where("patient_id = ?", patient_id)
1172
+	}
1173
+
1174
+	if record_date > 0 {
1175
+		db = db.Where("record_date = ?", record_date)
1176
+	}
1177
+	if orgId > 0 {
1178
+		db = db.Where("user_org_id = ? ", orgId)
1179
+	}
1180
+
1181
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_date desc").Find(&prescriptionlog).Error
1182
+
1183
+	return prescriptionlog, total, err
1184
+
1185
+}
1186
+
1187
+func GetBeforLogList(patient_id int64, page int64, limit int64, record_date int64, orgId int64) (befor []*models.XtAssessmentBeforeDislysisLog, total int64, err error) {
1188
+
1189
+	offset := (page - 1) * limit
1190
+
1191
+	db := XTReadDB().Model(befor).Where("status =1")
1192
+
1193
+	if patient_id > 0 {
1194
+		db = db.Where("patient_id = ?", patient_id)
1195
+	}
1196
+
1197
+	if record_date > 0 {
1198
+		db = db.Where("record_date = ?", record_date)
1199
+	}
1200
+	if orgId > 0 {
1201
+		db = db.Where("user_org_id = ? ", orgId)
1202
+	}
1203
+
1204
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_date desc").Find(&befor).Error
1205
+
1206
+	return befor, total, err
1207
+}
1208
+
1209
+func GetAllPatientLog(orgid int64) (patients []*models.VMMonitorPatients, err error) {
1210
+
1211
+	err = XTReadDB().Where("user_org_id = ? and status =1", orgid).Find(&patients).Error
1212
+
1213
+	return patients, err
1214
+}
1215
+
1216
+func GetAllDoctorLog(orgid int64) (appRole []*models.App_Role, err error) {
1217
+	err = UserReadDB().Where("org_id = ? AND status = 1", orgid).Find(&appRole).Error
1218
+	return appRole, err
1219
+}
1220
+
1221
+func GetDocLogList(patient_id int64, page int64, limit int64, record_date int64, orgId int64) (doctorlist []*models.XtDoctorAdviceLog, total int64, err error) {
1222
+
1223
+	offset := (page - 1) * limit
1224
+
1225
+	db := XTReadDB().Model(doctorlist).Where("status =1")
1226
+
1227
+	if patient_id > 0 {
1228
+		db = db.Where("patient_id = ?", patient_id)
1229
+	}
1230
+
1231
+	if record_date > 0 {
1232
+		db = db.Where("record_date = ?", record_date)
1233
+	}
1234
+	if orgId > 0 {
1235
+		db = db.Where("user_org_id = ? ", orgId)
1236
+	}
1237
+
1238
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_date desc").Find(&doctorlist).Error
1239
+
1240
+	return doctorlist, total, err
1241
+}
1242
+
1243
+func GetMonitorLogList(patient_id int64, page int64, limit int64, record_date int64, orgId int64) (monitorlist []*models.XtMonitorRecordLog, total int64, err error) {
1244
+
1245
+	offset := (page - 1) * limit
1246
+
1247
+	db := XTReadDB().Model(monitorlist).Where("status =1")
1248
+
1249
+	if patient_id > 0 {
1250
+		db = db.Where("patient_id = ?", patient_id)
1251
+	}
1252
+
1253
+	if record_date > 0 {
1254
+		db = db.Where("record_date = ?", record_date)
1255
+	}
1256
+	if orgId > 0 {
1257
+		db = db.Where("user_org_id = ? ", orgId)
1258
+	}
1259
+
1260
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_date desc").Find(&monitorlist).Error
1261
+
1262
+	return monitorlist, total, err
1263
+}
1264
+
1265
+func GetAfterLogList(patient_id int64, page int64, limit int64, record_date int64, orgId int64) (afterlist []*models.XtMonitorRecordLog, total int64, err error) {
1266
+
1267
+	offset := (page - 1) * limit
1268
+
1269
+	db := XTReadDB().Model(afterlist).Where("status =1")
1270
+
1271
+	if patient_id > 0 {
1272
+		db = db.Where("patient_id = ?", patient_id)
1273
+	}
1274
+
1275
+	if record_date > 0 {
1276
+		db = db.Where("record_date = ?", record_date)
1277
+	}
1278
+	if orgId > 0 {
1279
+		db = db.Where("user_org_id = ? ", orgId)
1280
+	}
1281
+
1282
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_date desc").Find(&afterlist).Error
1283
+
1284
+	return afterlist, total, err
1285
+}

+ 18 - 9
service/his_service.go View File

@@ -107,15 +107,15 @@ func (VMHisOrder) TableName() string {
107 107
 }
108 108
 
109 109
 type Patients struct {
110
-	ID           int64  `gorm:"column:id" json:"id" form:"id"`
111
-	UserOrgId    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
112
-	Name         string `gorm:"column:name" json:"name" form:"name"`
113
-	Status       int64  `gorm:"column:status" json:"status" form:"status"`
114
-	IdCardNo     string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
115
-	ScheduleType int64  `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
116
-	Phone        int64  `gorm:"column:phone" json:"phone" form:"phone"`
117
-	Gender       int64  `gorm:"column:gender" json:"gender" form:"gender"`
118
-
110
+	ID                    int64                 `gorm:"column:id" json:"id" form:"id"`
111
+	UserOrgId             int64                 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
112
+	Name                  string                `gorm:"column:name" json:"name" form:"name"`
113
+	Status                int64                 `gorm:"column:status" json:"status" form:"status"`
114
+	IdCardNo              string                `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
115
+	ScheduleType          int64                 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
116
+	Phone                 int64                 `gorm:"column:phone" json:"phone" form:"phone"`
117
+	Gender                int64                 `gorm:"column:gender" json:"gender" form:"gender"`
118
+	FirstLetter           string                `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
119 119
 	Schedule              Schedule              `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"schedule"`
120 120
 	HisPatient            HisPatient            `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"his_patient"`
121 121
 	HisPrescription       []*HisPrescription    `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"prescription"`
@@ -202,6 +202,7 @@ type PatientTwo struct {
202 202
 	Schedule              Schedule              `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"schedule"`
203 203
 	HisPatient            []*HisPatientTwo      `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"his_patient"`
204 204
 	VMHisPrescriptionInfo VMHisPrescriptionInfo `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"info"`
205
+	FirstLetter           string                `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
205 206
 }
206 207
 
207 208
 func (PatientTwo) TableName() string {
@@ -805,6 +806,7 @@ type BaseDrugLib struct {
805 806
 	IsUser                      int64   `gorm:"column:is_user" json:"is_user" form:"is_user"`
806 807
 	SumCount                    int64   `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
807 808
 	SumInCount                  int64   `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
809
+	FirstLetter                 string  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
808 810
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
809 811
 	OtherDrugWarehouseInfo []*OtherDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"stock_in"`
810 812
 	VMDrugSalesReturnInfo  []*VMDrugSalesReturnInfo  `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"sales_return"`
@@ -2815,3 +2817,10 @@ func GetChargeHisPatientList(org_id int64, record_date int64) (order []*HisOrder
2815 2817
 	err = readDb.Model(&models.HisOrder{}).Preload("Patients", "status = 1").Where("settle_accounts_date = ? and user_org_id = ? AND status = 1 and order_status = 2", record_date, org_id).Find(&order).Error
2816 2818
 	return
2817 2819
 }
2820
+
2821
+func GetGoodByIdIsStop(good_id int64, org_id int64) (models.GoodInfoSeven, error) {
2822
+
2823
+	goodInfoSeven := models.GoodInfoSeven{}
2824
+	err = XTReadDB().Where("org_id = ? and status = 1 and find_in_set('停用',good_status) = 0 and id =?", org_id, good_id).Find(&goodInfoSeven).Error
2825
+	return goodInfoSeven, err
2826
+}

+ 1 - 1
service/manage_service.go View File

@@ -1775,7 +1775,7 @@ func GetRegistrationDisinfectList(limit int64, page int64, start_time int64, end
1775 1775
 	if user_org_id > 0 {
1776 1776
 		db = db.Where("user_org_id = ?", user_org_id)
1777 1777
 	}
1778
-	err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1778
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_date desc").Find(&list).Error
1779 1779
 	return list, total, err
1780 1780
 }
1781 1781
 

+ 5 - 1
service/new_stock_service.go View File

@@ -119,7 +119,11 @@ func GetGoodStockList(orgId int64, storehouse_id int64, good_type int64, keyword
119 119
 		return db.Where("status = 1 and org_id = ? and is_check = 1", orgId)
120 120
 	})
121 121
 
122
-	err = db.Count(&total).Offset(offset).Limit(limit).Order("x.ctime desc").Find(&good).Error
122
+	if orgId == 10489 {
123
+		err = db.Count(&total).Offset(offset).Limit(limit).Order("x.sum_count desc").Find(&good).Error
124
+	} else {
125
+		err = db.Count(&total).Offset(offset).Limit(limit).Order("x.ctime desc").Find(&good).Error
126
+	}
123 127
 
124 128
 	return good, total, err
125 129
 }

+ 113 - 92
service/new_warehouse_service.go View File

@@ -51,9 +51,9 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
51 51
 			return errThree
52 52
 		}
53 53
 
54
-		if orgID == 10265 {
55
-			UpdateGoodInfoByPrice(warehouse.GoodId, orgID, warehouse.Price, warehouse.PackingPrice)
56
-		}
54
+		//if orgID == 10265 {
55
+		//	UpdateGoodInfoByPrice(warehouse.GoodId, orgID, warehouse.Price, warehouse.PackingPrice)
56
+		//}
57 57
 
58 58
 		//更新his_prescripton_project出库状态值
59 59
 		UpdateHisPrescriptionProjectStatus(goods.GoodId, record_time, orgID, patient_id)
@@ -1268,7 +1268,7 @@ func BloodDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *
1268 1268
 }
1269 1269
 
1270 1270
 // 药品自动出库 递归方式
1271
-func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *models.DrugWarehouseOut, drup *models.BaseDrugLib, advice *models.HisDoctorAdviceInfo, hisprescribingNumber float64) (err error) {
1271
+func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *models.DrugWarehouseOut, drup *models.BaseDrugLib, advice *models.HisDoctorAdviceInfo, hisprescribingNumber float64, unit string) (err error) {
1272 1272
 
1273 1273
 	drugError := models.XtDrugError{
1274 1274
 		UserOrgId:             orgID,
@@ -1304,7 +1304,10 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1304 1304
 
1305 1305
 	}
1306 1306
 
1307
-	if advice.PrescribingNumberUnit == drup.MaxUnit {
1307
+	fmt.Println("总数量", countone)
1308
+	fmt.Println("单位1", unit)
1309
+	fmt.Println("单位2", drup.MaxUnit)
1310
+	if unit == drup.MaxUnit {
1308 1311
 		deliver_number_one = countone * drup.MinNumber
1309 1312
 
1310 1313
 	} else {
@@ -1312,8 +1315,6 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1312 1315
 
1313 1316
 	}
1314 1317
 
1315
-	fmt.Println(deliver_number_one)
1316
-
1317 1318
 	if advice.PrescribingNumberUnit == drup.MaxUnit {
1318 1319
 		drug_price = drup.RetailPrice
1319 1320
 	}
@@ -1389,6 +1390,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1389 1390
 
1390 1391
 	}
1391 1392
 
1393
+	fmt.Println("库存数量2嚄噢嚄噢噢哦哦嚄噢嚄o", stock_number)
1394
+	fmt.Println("出库数咯哦我我我我嚄嚄嚄嚄", deliver_number)
1392 1395
 	// 当库存数量大于或等于出库数量的话,则正常出库该批次
1393 1396
 	if stock_number >= deliver_number {
1394 1397
 
@@ -1517,95 +1520,67 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1517 1520
 			sum_count += its.StockMaxNumber + its.StockMinNumber
1518 1521
 		}
1519 1522
 
1520
-		warehouseOutInfo := &models.DrugWarehouseOutInfo{
1521
-			WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1522
-			WarehouseOutId:          warehouseout.ID,
1523
-			Status:                  1,
1524
-			Ctime:                   advice.RecordDate,
1525
-			Mtime:                   time.Now().Unix(),
1526
-			Remark:                  warehouse.Remark,
1527
-			OrgId:                   orgID,
1528
-			Type:                    1,
1529
-			Manufacturer:            warehouse.Manufacturer,
1530
-			Dealer:                  warehouse.Dealer,
1531
-			IsSys:                   1,
1532
-			SysRecordTime:           advice.RecordDate,
1533
-			DrugId:                  advice.DrugId,
1534
-			Number:                  warehouse.Number,
1535
-			BatchNumber:             warehouse.BatchNumber,
1536
-			Price:                   warehouse.RetailPrice,
1537
-			CountUnit:               drup.MinUnit,
1538
-			RetailPrice:             warehouse.RetailPrice,
1539
-			ProductDate:             warehouse.ProductDate,
1540
-			ExpiryDate:              warehouse.ExpiryDate,
1541
-			PatientId:               advice.PatientId,
1542
-			Count:                   deliver_number, //出最小单位
1543
-			WarehouseInfoId:         warehouse.ID,
1544
-			SupplyWarehouseId:       warehouse.SupplyWarehouseId,
1545
-			StorehouseId:            storeConfig.DrugStorehouseOut,
1546
-			IsCheck:                 1,
1547
-			OverCount:               sum_count,
1548
-			AdviceId:                advice.ID,
1549
-		}
1523
+		if orgID != 10188 && orgID != 10217 && orgID != 3877 && orgID != 9671 {
1524
+			warehouseOutInfo := &models.DrugWarehouseOutInfo{
1525
+				WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1526
+				WarehouseOutId:          warehouseout.ID,
1527
+				Status:                  1,
1528
+				Ctime:                   advice.RecordDate,
1529
+				Mtime:                   time.Now().Unix(),
1530
+				Remark:                  warehouse.Remark,
1531
+				OrgId:                   orgID,
1532
+				Type:                    1,
1533
+				Manufacturer:            warehouse.Manufacturer,
1534
+				Dealer:                  warehouse.Dealer,
1535
+				IsSys:                   1,
1536
+				SysRecordTime:           advice.RecordDate,
1537
+				DrugId:                  advice.DrugId,
1538
+				Number:                  warehouse.Number,
1539
+				BatchNumber:             warehouse.BatchNumber,
1540
+				Price:                   warehouse.RetailPrice,
1541
+				CountUnit:               drup.MinUnit,
1542
+				RetailPrice:             warehouse.RetailPrice,
1543
+				ProductDate:             warehouse.ProductDate,
1544
+				ExpiryDate:              warehouse.ExpiryDate,
1545
+				PatientId:               advice.PatientId,
1546
+				Count:                   deliver_number, //出最小单位
1547
+				WarehouseInfoId:         warehouse.ID,
1548
+				SupplyWarehouseId:       warehouse.SupplyWarehouseId,
1549
+				StorehouseId:            storeConfig.DrugStorehouseOut,
1550
+				IsCheck:                 1,
1551
+				OverCount:               sum_count,
1552
+				AdviceId:                advice.ID,
1553
+			}
1550 1554
 
1551
-		//查询今日该药品该患者是否有出库数据
1552
-		lastDrugOutInfo, _ := GetNewDrugWarehouseOutInfoSix(advice.DrugId, advice.PatientId, advice.RecordDate, advice.UserOrgId, advice.ID, warehouse.ID)
1553
-		if lastDrugOutInfo.ID == 0 {
1554
-			errOne := AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1555
-			if errOne != nil {
1556
-				drugError := models.XtDrugError{
1557
-					UserOrgId:             orgID,
1558
-					DrugId:                advice.DrugId,
1559
-					RecordDate:            advice.AdviceDate,
1560
-					PatientId:             advice.PatientId,
1561
-					Remark:                "创建出库单失败",
1562
-					Status:                1,
1563
-					Ctime:                 time.Now().Unix(),
1564
-					Mtime:                 0,
1565
-					SumCount:              0,
1566
-					Prescribingnumber:     advice.PrescribingNumber,
1567
-					PrescribingNumberUnit: advice.PrescribingNumberUnit,
1555
+			//查询今日该药品该患者是否有出库数据
1556
+			lastDrugOutInfo, _ := GetNewDrugWarehouseOutInfoSix(advice.DrugId, advice.PatientId, advice.RecordDate, advice.UserOrgId, advice.ID, warehouse.ID)
1557
+			if lastDrugOutInfo.ID == 0 {
1558
+				errOne := AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1559
+				if errOne != nil {
1560
+					drugError := models.XtDrugError{
1561
+						UserOrgId:             orgID,
1562
+						DrugId:                advice.DrugId,
1563
+						RecordDate:            advice.AdviceDate,
1564
+						PatientId:             advice.PatientId,
1565
+						Remark:                "创建出库单失败",
1566
+						Status:                1,
1567
+						Ctime:                 time.Now().Unix(),
1568
+						Mtime:                 0,
1569
+						SumCount:              0,
1570
+						Prescribingnumber:     advice.PrescribingNumber,
1571
+						PrescribingNumberUnit: advice.PrescribingNumberUnit,
1572
+					}
1573
+					CreateDrugError(drugError)
1568 1574
 				}
1569
-				CreateDrugError(drugError)
1570
-				return errOne
1571 1575
 			}
1572
-		}
1573
-		if lastDrugOutInfo.ID > 0 {
1576
+			if lastDrugOutInfo.ID > 0 {
1574 1577
 
1575
-			//删除在新增
1576
-			UpdateDrugWarehouseOutInfoTen(lastDrugOutInfo.PatientId, lastDrugOutInfo.SysRecordTime, advice.ID)
1578
+				//删除在新增
1579
+				UpdateDrugWarehouseOutInfoTen(lastDrugOutInfo.PatientId, lastDrugOutInfo.SysRecordTime, advice.ID)
1577 1580
 
1578
-			AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1581
+				AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1579 1582
 
1580
-			//var his_count int64
1581
-			//if lastDrugOutInfo.CountUnit == drup.MaxUnit {
1582
-			//	his_count = lastDrugOutInfo.Count * drup.MinNumber
1583
-			//}
1584
-			//if lastDrugOutInfo.CountUnit == drup.MinUnit {
1585
-			//	his_count = lastDrugOutInfo.Count
1586
-			//}
1587
-			//fmt.Println("deliver_number", deliver_number)
1588
-			//fmt.Println("his_countwowowoowow", his_count)
1589
-			//if deliver_number != his_count {
1590
-			//	errThree := UpdateSigleDrugWarehouseOutInfo(lastDrugOutInfo.ID, warehouseOutInfo)
1591
-			//	if errThree != nil {
1592
-			//		drugError := models.XtDrugError{
1593
-			//			UserOrgId:             orgID,
1594
-			//			DrugId:                advice.DrugId,
1595
-			//			RecordDate:            advice.AdviceDate,
1596
-			//			PatientId:             advice.PatientId,
1597
-			//			Remark:                "更新出库单失败",
1598
-			//			Status:                1,
1599
-			//			Ctime:                 time.Now().Unix(),
1600
-			//			Mtime:                 0,
1601
-			//			SumCount:              0,
1602
-			//			Prescribingnumber:     advice.PrescribingNumber,
1603
-			//			PrescribingNumberUnit: advice.PrescribingNumberUnit,
1604
-			//		}
1605
-			//		CreateDrugError(drugError)
1606
-			//		return errThree
1607
-			//	}
1608
-			//}
1583
+			}
1609 1584
 		}
1610 1585
 
1611 1586
 		var out_count int64
@@ -1622,8 +1597,51 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1622 1597
 			cancel_count += item.Count
1623 1598
 		}
1624 1599
 
1600
+		fmt.Println("总出口数量", deliver_number_one)
1601
+		fmt.Println("出库数量", out_count)
1602
+		fmt.Println("退款数来的发阿道夫", cancel_count)
1603
+
1604
+		fmt.Println("查收嗖嗖嗖哦", deliver_number_one-(out_count-cancel_count))
1625 1605
 		if deliver_number_one-(out_count-cancel_count) >= 0 {
1626
-			if (deliver_number - out_count - cancel_count) != 0 {
1606
+			if (deliver_number_one - out_count - cancel_count) != 0 {
1607
+
1608
+				if orgID == 10217 || orgID == 10188 || orgID == 3877 || orgID == 9671 {
1609
+					warehouseOutInfo := &models.DrugWarehouseOutInfo{
1610
+						WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1611
+						WarehouseOutId:          warehouseout.ID,
1612
+						Status:                  1,
1613
+						Ctime:                   advice.RecordDate,
1614
+						Mtime:                   time.Now().Unix(),
1615
+						Remark:                  warehouse.Remark,
1616
+						OrgId:                   orgID,
1617
+						Type:                    1,
1618
+						Manufacturer:            warehouse.Manufacturer,
1619
+						Dealer:                  warehouse.Dealer,
1620
+						IsSys:                   1,
1621
+						SysRecordTime:           advice.RecordDate,
1622
+						DrugId:                  advice.DrugId,
1623
+						Number:                  warehouse.Number,
1624
+						BatchNumber:             warehouse.BatchNumber,
1625
+						Price:                   warehouse.RetailPrice,
1626
+						CountUnit:               drup.MinUnit,
1627
+						RetailPrice:             warehouse.RetailPrice,
1628
+						ProductDate:             warehouse.ProductDate,
1629
+						ExpiryDate:              warehouse.ExpiryDate,
1630
+						PatientId:               advice.PatientId,
1631
+						Count:                   deliver_number_one - (out_count - cancel_count), //出最小单位
1632
+						WarehouseInfoId:         warehouse.ID,
1633
+						SupplyWarehouseId:       warehouse.SupplyWarehouseId,
1634
+						StorehouseId:            storeConfig.DrugStorehouseOut,
1635
+						IsCheck:                 1,
1636
+						OverCount:               sum_count,
1637
+						AdviceId:                advice.ID,
1638
+					}
1639
+
1640
+					AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1641
+
1642
+				}
1643
+				lastDrugOutInfo, _ := GetNewDrugWarehouseOutInfoSix(advice.DrugId, advice.PatientId, advice.RecordDate, advice.UserOrgId, advice.ID, warehouse.ID)
1644
+
1627 1645
 				drugflow := models.DrugFlow{
1628 1646
 					WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1629 1647
 					WarehouseOutId:          warehouseout.ID,
@@ -1947,6 +1965,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1947 1965
 			StockMinNumber:    0,
1948 1966
 			BatchNumber:       warehouse.BatchNumber,
1949 1967
 			MaxUnit:           warehouse.MaxUnit,
1968
+			MinUnit:           drup.MinUnit,
1950 1969
 			WarehousingInfoId: warehouse.WarehousingInfoId,
1951 1970
 			SupplyWarehouseId: warehouse.SupplyWarehouseId,
1952 1971
 			StorehouseId:      storeConfig.DrugStorehouseOut,
@@ -2140,6 +2159,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
2140 2159
 			cancel_count += item.Count
2141 2160
 		}
2142 2161
 
2162
+		fmt.Println("deliver_nbumbwowowoowowow", deliver_number)
2163
+		fmt.Println("out_coutnwoowowowowowow", out_count)
2143 2164
 		//如果本次出库数据大于历史出库数据 新增1条流水
2144 2165
 		if deliver_number > (out_count - cancel_count) {
2145 2166
 
@@ -2372,7 +2393,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
2372 2393
 		advice.PrescribingNumber = float64(prescribingNumber_two_temp)
2373 2394
 		advice.PrescribingNumberUnit = drup.MinUnit
2374 2395
 
2375
-		BloodHisDrugDeliverInfo(orgID, overPlusNumber, warehouseout, drup, advice, hisprescribingNumber)
2396
+		BloodHisDrugDeliverInfo(orgID, overPlusNumber, warehouseout, drup, advice, hisprescribingNumber, unit)
2376 2397
 	}
2377 2398
 
2378 2399
 	return

+ 7 - 6
service/patient_schedule_template_service.go View File

@@ -890,12 +890,13 @@ func SavePatientScheduleTemplateMode4To3(templateMode *models.PatientScheduleTem
890 890
 }
891 891
 
892 892
 type SchTemplatePatient struct {
893
-	ID         int64  `gorm:"column:id" json:"id" form:"id"`
894
-	UserOrgId  int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
895
-	Name       string `gorm:"column:name" json:"name" form:"name"`
896
-	Lapseto    int64  `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
897
-	Status     int64  `gorm:"column:status" json:"status" form:"status"`
898
-	DialysisNo string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
893
+	ID           int64  `gorm:"column:id" json:"id" form:"id"`
894
+	UserOrgId    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
895
+	Name         string `gorm:"column:name" json:"name" form:"name"`
896
+	Lapseto      int64  `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
897
+	Status       int64  `gorm:"column:status" json:"status" form:"status"`
898
+	DialysisNo   string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
899
+	IsInfectious int64  `gorm:"column:is_infectious" json:"is_infectious"`
899 900
 }
900 901
 
901 902
 func (SchTemplatePatient) TableName() string {

+ 144 - 4
service/patient_service.go View File

@@ -768,14 +768,14 @@ func CreatePatientsNew(patientsNew *models.XtPatientsNew) error {
768 768
 
769 769
 func CreateAllergic(allergic models.XtPatientAllergic) error {
770 770
 
771
-	err := XTWriteDB().Model(&allergic).Create(&allergic).Error
771
+	err := XTWriteDB().Create(&allergic).Error
772 772
 
773 773
 	return err
774 774
 }
775 775
 
776 776
 func EditPatientLapseto(patient *models.Patients, lapseto *models.PatientLapseto) (err error) {
777 777
 	utx := writeDb.Begin()
778
-	err = utx.Model(&models.Patients{}).Where("id=?", patient.ID).Update(map[string]interface{}{"lapseto": patient.Lapseto, "out_reason": patient.OutReason, "death_time": patient.DeathTime}).Error
778
+	err = utx.Model(&models.Patients{}).Where("id=?", patient.ID).Update(map[string]interface{}{"lapseto": patient.Lapseto, "out_reason": patient.OutReason, "death_time": patient.DeathTime, "patient_start_time": patient.PatientStartTime, "patient_end_time": patient.PatientEndTime, "patient_address": patient.PatientAddress}).Error
779 779
 	//err = utx.Model(&models.PatientLapseto{}).Where("id=?", patient.ID).Update(map[string]interface{}{"lapseto_type": patient.Lapseto, "lapseto_time": time.Now().Unix(), "updated_time": time.Now().Unix()}).Error
780 780
 	if err != nil {
781 781
 		utx.Rollback()
@@ -1609,8 +1609,8 @@ func MobileGetMonitorsWithPatient(orgID int64, keyword string, page int) ([]*mod
1609 1609
 }
1610 1610
 
1611 1611
 func GetPatientByKeyWord(orgID int64, keywords string) (patient []*models.Patients, err error) {
1612
-	db := readDb.Model(&models.Patients{}).Where("user_org_id=? and status=1 and lapseto = 1", orgID)
1613
-	fmt.Println("keywords22222223322332322332322323323", keywords)
1612
+	db := readDb.Model(&models.Patients{}).Where("user_org_id=? and status=1", orgID)
1613
+
1614 1614
 	if len(keywords) > 0 {
1615 1615
 		likekey := "%" + keywords + "%"
1616 1616
 		err = db.Where("name LIKE ? OR dialysis_no LIKE ? ", likekey, likekey).Find(&patient).Error
@@ -3074,3 +3074,143 @@ func GetBaseDrugByName(drug_name string, org_id int64) (models.BaseDrugLibSeven,
3074 3074
 
3075 3075
 	return libSeven, err
3076 3076
 }
3077
+
3078
+func CreateDeviceValsualMap(valsualMap models.XtDeviceValsualMap) error {
3079
+
3080
+	err := XTWriteDB().Save(&valsualMap).Error
3081
+
3082
+	return err
3083
+}
3084
+
3085
+func GetPatientSitemap(patient_id int64, user_org_id int64) (models.XtDeviceValsualMap, error) {
3086
+
3087
+	valsualMap := models.XtDeviceValsualMap{}
3088
+	err := XTReadDB().Where("patient_id = ? and status =1 and user_org_id = ?", patient_id, user_org_id).Preload("XtDeviceValsualALeft", "status=1 and user_org_id =?", user_org_id).Preload("XtDeviceValsualVLeft", "status=1 and user_org_id =?", user_org_id).Preload("XtDeviceValsualMapFangxiangA", "status=1 and user_org_id =?", user_org_id).Preload("XtDeviceValsualMapFangxiangV", "status=1 and user_org_id =?", user_org_id).Preload("XtDeviceValsualFuzhuA", "status=1 and user_org_id =?", user_org_id).Preload("XtDeviceValsualFuzhuV", "status=1 and user_org_id =?", user_org_id).Preload("XtDeviceValsualTextArr", "status=1 and user_org_id =?", user_org_id).Preload("DeviceValusalMapArr", "status=1 and user_org_id =?", user_org_id).Preload("XtDeviceValusalMapVrr", "status=1 and user_org_id =?", user_org_id).Find(&valsualMap).Error
3089
+	return valsualMap, err
3090
+}
3091
+
3092
+func UpdateSiteMap(valsualMap models.XtDeviceValsualMap) error {
3093
+
3094
+	err := XTWriteDB().Save(&valsualMap).Error
3095
+	return err
3096
+}
3097
+
3098
+func CreateValsualAleft(left models.XtDeviceValsualALeft) error {
3099
+
3100
+	err := XTWriteDB().Create(&left).Error
3101
+	return err
3102
+}
3103
+
3104
+func UpdateValsualAleft(patient_id int64, user_org_id int64) error {
3105
+
3106
+	err := XTWriteDB().Model(&models.XtDeviceValsualALeft{}).Where("patient_id = ? and user_org_id = ? and status =1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3107
+	return err
3108
+}
3109
+
3110
+func CreateValsualMapFangxiangA(a models.XtDeviceValsualMapFangxiangA) error {
3111
+
3112
+	err := XTWriteDB().Create(&a).Error
3113
+	return err
3114
+}
3115
+
3116
+func UpdateValsualMapFangxiangA(patient_id int64, user_org_id int64) error {
3117
+
3118
+	err := XTWriteDB().Model(&models.XtDeviceValsualMapFangxiangA{}).Where("patient_id = ? and user_org_id = ? and status =1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3119
+	return err
3120
+}
3121
+
3122
+func CreateValsualMapFangxiangV(v models.XtDeviceValsualMapFangxiangV) error {
3123
+
3124
+	err := XTWriteDB().Create(&v).Error
3125
+	return err
3126
+}
3127
+
3128
+func UpdateValsualMapFangxiangV(patient_id int64, user_org_id int64) error {
3129
+
3130
+	err := XTWriteDB().Model(&models.XtDeviceValsualMapFangxiangV{}).Where("patient_id = ? and user_org_id = ? and status=1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3131
+	return err
3132
+}
3133
+
3134
+func ValsualMapFangxiangA(patient_id int64, user_org_id int64) error {
3135
+
3136
+	err := XTWriteDB().Model(models.XtDeviceValsualMapFangxiangA{}).Where("patient_id = ? and user_org_id = ? and status=1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3137
+	return err
3138
+}
3139
+
3140
+func CreateValSualFuzhA(a models.XtDeviceValsualFuzhuA) error {
3141
+
3142
+	err := XTReadDB().Create(&a).Error
3143
+	return err
3144
+}
3145
+
3146
+func UpdateValSualFuzhA(patient_id int64, user_org_id int64) error {
3147
+
3148
+	err := XTWriteDB().Model(&models.XtDeviceValsualFuzhuA{}).Where("patient_id =? and user_org_id = ? and status=1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3149
+	return err
3150
+}
3151
+
3152
+func CreateVasuaLfuzhuV(v models.XtDeviceValsualFuzhuV) error {
3153
+
3154
+	err := XTReadDB().Create(&v).Error
3155
+	return err
3156
+}
3157
+
3158
+func UpdateVasuaLfuzhuV(patient_id int64, user_org_id int64) error {
3159
+
3160
+	err := XTWriteDB().Model(&models.XtDeviceValsualFuzhuV{}).Where("patient_id = ? and user_org_id =? and status=1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3161
+	return err
3162
+}
3163
+
3164
+func CreateTextArr(arr models.XtDeviceValsualTextArr) error {
3165
+
3166
+	err := XTReadDB().Create(&arr).Error
3167
+	return err
3168
+}
3169
+
3170
+func UpdateTextArr(patient_id int64, user_org_id int64) error {
3171
+
3172
+	err := XTWriteDB().Model(&models.XtDeviceValsualTextArr{}).Where("patient_id = ? and user_org_id = ? and status=1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3173
+	return err
3174
+}
3175
+
3176
+func CreateValsualVleft(left models.XtDeviceValsualVLeft) error {
3177
+
3178
+	err = XTReadDB().Create(&left).Error
3179
+	return err
3180
+}
3181
+
3182
+func UpdateValsualVleft(patient_id int64, user_org_id int64) error {
3183
+
3184
+	err := XTWriteDB().Model(&models.XtDeviceValsualVLeft{}).Where("patient_id = ? and user_org_id =? and status=1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3185
+	return err
3186
+}
3187
+
3188
+func UpdateValusalMapArr(patient_id int64, user_org_id int64) error {
3189
+
3190
+	err := XTWriteDB().Model(&models.XtDeviceValusalMapArr{}).Where("patient_id =? and user_org_id =? and status=1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3191
+	return err
3192
+}
3193
+
3194
+func CreateDeviceValusalMapArr(vrr models.XtDeviceValusalMapArr) error {
3195
+
3196
+	err := XTWriteDB().Create(&vrr).Error
3197
+	return err
3198
+}
3199
+
3200
+func UpdateDeviceValusalMapVrr(patient_id int64, user_org_id int64) error {
3201
+
3202
+	err := XTWriteDB().Model(&models.XtDeviceValusalMapVrr{}).Where("patient_id = ? and user_org_id =? and status=1", patient_id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
3203
+	return err
3204
+}
3205
+
3206
+func CreateDeviceValusalMapVrr(vrr models.XtDeviceValusalMapVrr) error {
3207
+
3208
+	err := XTWriteDB().Create(&vrr).Error
3209
+	return err
3210
+}
3211
+
3212
+func GetAdviceListNoExecution(advice_date int64, user_org_id int64) (advice []*models.XtDoctorAdvice, err error) {
3213
+
3214
+	err = XTReadDB().Where("advice_date = ? and user_org_id = ? and status =1 and execution_state = 2", advice_date, user_org_id).Find(&advice).Error
3215
+	return advice, err
3216
+}

+ 4 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go View File

@@ -302,7 +302,10 @@ func GetWarehouseOutInfoPrintList(orgid int64, startime int64, endtime int64) (o
302 302
 
303 303
 	db := p_service.XTReadDB().Table("xt_warehouse_out_info as x").Where("x.status = 1")
304 304
 	table := p_service.XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
305
+
306
+	tableOne := p_service.XTReadDB().Table("xt_warehouse_info as p").Where("p.status = 1")
305 307
 	fmt.Println(table)
308
+	fmt.Println("tableOne", tableOne)
306 309
 	if orgid > 0 {
307 310
 		db = db.Where("x.org_id = ?", orgid)
308 311
 	}
@@ -312,7 +315,7 @@ func GetWarehouseOutInfoPrintList(orgid int64, startime int64, endtime int64) (o
312 315
 	if endtime > 0 {
313 316
 		db = db.Where("x.sys_record_time<=?", endtime)
314 317
 	}
315
-	err = db.Select("x.patient_id,x.sys_record_time,x.good_id,sum(x.count) as count,x.ctime,t.good_name,t.specification_name,t.packing_unit,t.retail_price,t.packing_price,t.buy_price,t.manufacturer,t.dealer").Joins("left join xt_good_information as t on t.id = x.good_id").Group("x.good_id").Scan(&out).Error
318
+	err = db.Select("x.patient_id,x.sys_record_time,x.good_id,sum(x.count) as count,x.ctime,t.good_name,t.specification_name,t.packing_unit,t.retail_price,t.packing_price,t.buy_price,t.manufacturer,t.dealer,p.price").Joins("left join xt_warehouse_info as p on p.id =x.warehouse_info_id").Joins("left join xt_good_information as t on t.id = x.good_id").Group("x.good_id").Scan(&out).Error
316 319
 	return out, err
317 320
 }
318 321
 

+ 7 - 0
service/schedule_service.go View File

@@ -1725,3 +1725,10 @@ func GetNumberListById(id int64, org_id int64) (number []*models.DeviceNumber, e
1725 1725
 
1726 1726
 	return number, err
1727 1727
 }
1728
+
1729
+func CreateScheduleLog(log models.XtScheduleLog) error {
1730
+
1731
+	err := XTWriteDB().Create(&log).Error
1732
+
1733
+	return err
1734
+}

+ 202 - 25
service/self_drug_service.go View File

@@ -1850,10 +1850,6 @@ func GetDrugStockCountList(orgId int64, storehouse_id int64, good_type int64, ke
1850 1850
 		db = db.Preload("DrugWarehouseInfo", "org_id = ? and status = 1 and is_check = 1", orgId)
1851 1851
 	}
1852 1852
 
1853
-	//if len(goodIds) > 0 {
1854
-	//	db = db.Where("id in(?)", goodIds)
1855
-	//}
1856
-
1857 1853
 	if len(keyword) > 0 {
1858 1854
 		db = db.Where("drug_name like ? or manufacturer in(?)", likeKey, ids)
1859 1855
 	}
@@ -1861,19 +1857,36 @@ func GetDrugStockCountList(orgId int64, storehouse_id int64, good_type int64, ke
1861 1857
 	if orgId > 0 {
1862 1858
 		db = db.Where("x.org_id = ?", orgId)
1863 1859
 	}
1864
-	err = db.Preload("XtDrugStockCount", func(db *gorm.DB) *gorm.DB {
1865
-		if storehouse_id > 0 {
1866
-			db = db.Where("storehouse_id = ?", storehouse_id)
1867
-		}
1868
-		return db.Where("status = 1 and user_org_id = ?", orgId)
1869 1860
 
1870
-	}).Preload("DrugStockCount", func(db *gorm.DB) *gorm.DB {
1871
-		if storehouse_id > 0 {
1872
-			db = db.Where("storehouse_id = ?", storehouse_id)
1873
-		}
1874
-		return db.Where("status = 1 and user_org_id = ?", orgId).Group("drug_id,storehouse_id")
1861
+	if orgId == 10489 {
1862
+		err = db.Preload("XtDrugStockCount", func(db *gorm.DB) *gorm.DB {
1863
+			if storehouse_id > 0 {
1864
+				db = db.Where("storehouse_id = ?", storehouse_id)
1865
+			}
1866
+			return db.Where("status = 1 and user_org_id = ?", orgId)
1867
+
1868
+		}).Preload("DrugStockCount", func(db *gorm.DB) *gorm.DB {
1869
+			if storehouse_id > 0 {
1870
+				db = db.Where("storehouse_id = ?", storehouse_id)
1871
+			}
1872
+			return db.Where("status = 1 and user_org_id = ?", orgId).Group("drug_id,storehouse_id")
1873
+
1874
+		}).Count(&total).Offset(offset).Limit(limit).Order("x.sum_count desc").Find(&drug).Error
1875
+	} else {
1876
+		err = db.Preload("XtDrugStockCount", func(db *gorm.DB) *gorm.DB {
1877
+			if storehouse_id > 0 {
1878
+				db = db.Where("storehouse_id = ?", storehouse_id)
1879
+			}
1880
+			return db.Where("status = 1 and user_org_id = ?", orgId)
1875 1881
 
1876
-	}).Count(&total).Offset(offset).Limit(limit).Order("x.ctime desc").Find(&drug).Error
1882
+		}).Preload("DrugStockCount", func(db *gorm.DB) *gorm.DB {
1883
+			if storehouse_id > 0 {
1884
+				db = db.Where("storehouse_id = ?", storehouse_id)
1885
+			}
1886
+			return db.Where("status = 1 and user_org_id = ?", orgId).Group("drug_id,storehouse_id")
1887
+
1888
+		}).Count(&total).Offset(offset).Limit(limit).Order("x.ctime desc").Find(&drug).Error
1889
+	}
1877 1890
 
1878 1891
 	return drug, total, err
1879 1892
 }
@@ -1904,6 +1917,7 @@ func GetDrugWarehouseOutInfoByIdList(good_id int64, limit int64, page int64, org
1904 1917
 func GetAllGoodListSeven(orgid int64) (good []*models.GoodInfoSeven, err error) {
1905 1918
 
1906 1919
 	err = XTReadDB().Where("org_id = ? and status = 1", orgid).Find(&good).Error
1920
+
1907 1921
 	return good, err
1908 1922
 }
1909 1923
 
@@ -2012,7 +2026,7 @@ func GetEndGoodWarehouseInfoList(good_id int64, orgid int64, endtime int64) (inf
2012 2026
 	return info, err
2013 2027
 }
2014 2028
 
2015
-func GetAddGoodWarehouseInfoList(good_id int64, orgid int64, startime int64, endtime int64) (info []*models.StartWarehousingInfo, err error) {
2029
+func GetAddGoodWarehouseInfoList(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (info []*models.StartWarehousingInfo, err error) {
2016 2030
 	db := XTReadDB().Model(&info).Where("status = 1 and is_check =1")
2017 2031
 	if good_id > 0 {
2018 2032
 		db = db.Where("good_id = ?", good_id)
@@ -2026,12 +2040,33 @@ func GetAddGoodWarehouseInfoList(good_id int64, orgid int64, startime int64, end
2026 2040
 	if endtime > 0 {
2027 2041
 		db = db.Where("ctime <=?", endtime)
2028 2042
 	}
2043
+	if storehouse_id > 0 {
2044
+		db = db.Where("storehouse_id = ?", storehouse_id)
2045
+	}
2029 2046
 	err = db.Find(&info).Error
2030 2047
 	return info, err
2031 2048
 }
2032 2049
 
2033
-func GetAddStartFlow(good_id int64, orgid int64, startime int64, endtime int64) (info []*models.VmStockFlowTwenty, err error) {
2034
-	db := XTReadDB().Model(&info).Where("status = 1 and consumable_type =1")
2050
+func GetAddGoodWarehouseInfoListTwenty(good_id int64, orgid int64, startime int64, endtime int64) (info []*models.StartWarehousingInfo, err error) {
2051
+	db := XTReadDB().Model(&info).Where("status = 1 and is_check =1")
2052
+	if good_id > 0 {
2053
+		db = db.Where("good_id = ?", good_id)
2054
+	}
2055
+	if orgid > 0 {
2056
+		db = db.Where("org_id = ?", orgid)
2057
+	}
2058
+	if startime > 0 {
2059
+		db = db.Where("ctime >=?", startime)
2060
+	}
2061
+	if endtime > 0 {
2062
+		db = db.Where("ctime <=?", endtime)
2063
+	}
2064
+	err = db.Find(&info).Error
2065
+	return info, err
2066
+}
2067
+
2068
+func GetAddStartFlow(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (info []*models.VmStockFlowTwenty, err error) {
2069
+	db := XTReadDB().Model(&info).Where("status = 1 and (consumable_type =1 or consumable_type = 13)")
2035 2070
 	if good_id > 0 {
2036 2071
 		db = db.Where("good_id = ?", good_id)
2037 2072
 	}
@@ -2044,11 +2079,54 @@ func GetAddStartFlow(good_id int64, orgid int64, startime int64, endtime int64)
2044 2079
 	if endtime > 0 {
2045 2080
 		db = db.Where("ctime <=?", endtime)
2046 2081
 	}
2082
+	if storehouse_id > 0 {
2083
+		db = db.Where("storehouse_id =?", storehouse_id)
2084
+	}
2047 2085
 	err = db.Find(&info).Error
2048 2086
 	return info, err
2049 2087
 }
2050 2088
 
2051
-func GetReduceWarehouseInfoList(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2089
+func GetAddStartFlowTwenty(good_id int64, orgid int64, startime int64, endtime int64) (info []*models.VmStockFlowTwenty, err error) {
2090
+	db := XTReadDB().Model(&info).Where("status = 1 and (consumable_type =1)")
2091
+	if good_id > 0 {
2092
+		db = db.Where("good_id = ?", good_id)
2093
+	}
2094
+	if orgid > 0 {
2095
+		db = db.Where("user_org_id = ?", orgid)
2096
+	}
2097
+	if startime > 0 {
2098
+		db = db.Where("ctime >=?", startime)
2099
+	}
2100
+	if endtime > 0 {
2101
+		db = db.Where("ctime <=?", endtime)
2102
+	}
2103
+
2104
+	err = db.Find(&info).Error
2105
+	return info, err
2106
+}
2107
+
2108
+func GetReduceWarehouseInfoList(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2109
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 2 or consumable_type = 3 or consumable_type= 15)")
2110
+	if good_id > 0 {
2111
+		db = db.Where("good_id = ?", good_id)
2112
+	}
2113
+	if orgid > 0 {
2114
+		db = db.Where("user_org_id = ?", orgid)
2115
+	}
2116
+	if startime > 0 {
2117
+		db = db.Where("ctime >=?", startime)
2118
+	}
2119
+	if endtime > 0 {
2120
+		db = db.Where("ctime <=?", endtime)
2121
+	}
2122
+	if storehouse_id > 0 {
2123
+		db = db.Where("storehouse_id = ?", storehouse_id)
2124
+	}
2125
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2126
+	return outinfo, err
2127
+}
2128
+
2129
+func GetReduceWarehouseInfoListTwenty(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2052 2130
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 2 or consumable_type = 3 or consumable_type= 15)")
2053 2131
 	if good_id > 0 {
2054 2132
 		db = db.Where("good_id = ?", good_id)
@@ -2066,7 +2144,28 @@ func GetReduceWarehouseInfoList(good_id int64, orgid int64, startime int64, endt
2066 2144
 	return outinfo, err
2067 2145
 }
2068 2146
 
2069
-func GetStartEndCancelFLowInfo(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2147
+func GetStartEndCancelFLowInfo(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2148
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 7)")
2149
+	if good_id > 0 {
2150
+		db = db.Where("good_id = ?", good_id)
2151
+	}
2152
+	if orgid > 0 {
2153
+		db = db.Where("user_org_id = ?", orgid)
2154
+	}
2155
+	if startime > 0 {
2156
+		db = db.Where("ctime >=?", startime)
2157
+	}
2158
+	if endtime > 0 {
2159
+		db = db.Where("ctime <=?", endtime)
2160
+	}
2161
+	if storehouse_id > 0 {
2162
+		db = db.Where("storehouse_id =?", storehouse_id)
2163
+	}
2164
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2165
+	return outinfo, err
2166
+}
2167
+
2168
+func GetStartEndCancelFLowInfoTwenty(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2070 2169
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 7)")
2071 2170
 	if good_id > 0 {
2072 2171
 		db = db.Where("good_id = ?", good_id)
@@ -2179,7 +2278,7 @@ func FindEndCancelInfo(good_id int64, orgid int64, endtime int64) (info []*model
2179 2278
 	return info, err
2180 2279
 }
2181 2280
 
2182
-func FindeWarehouseOutInfo(good_id int64, orgid int64, startime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2281
+func FindeWarehouseOutInfo(good_id int64, orgid int64, startime int64, storehouse_id int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2183 2282
 
2184 2283
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 2 or consumable_type = 3 or consumable_type = 15)")
2185 2284
 	if good_id > 0 {
@@ -2191,6 +2290,26 @@ func FindeWarehouseOutInfo(good_id int64, orgid int64, startime int64) (outinfo
2191 2290
 	if startime > 0 {
2192 2291
 		db = db.Where("ctime <?", startime)
2193 2292
 	}
2293
+	if storehouse_id > 0 {
2294
+		db = db.Where("storehouse_id= ?", storehouse_id)
2295
+	}
2296
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2297
+	return outinfo, err
2298
+}
2299
+
2300
+func FindeWarehouseOutInfoTwenty(good_id int64, orgid int64, startime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2301
+
2302
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 2 or consumable_type = 3 or consumable_type = 15)")
2303
+	if good_id > 0 {
2304
+		db = db.Where("good_id = ?", good_id)
2305
+	}
2306
+	if orgid > 0 {
2307
+		db = db.Where("user_org_id = ?", orgid)
2308
+	}
2309
+	if startime > 0 {
2310
+		db = db.Where("ctime <?", startime)
2311
+	}
2312
+
2194 2313
 	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2195 2314
 	return outinfo, err
2196 2315
 }
@@ -2211,7 +2330,7 @@ func FindeStartStockInventoryProfit(good_id int64, orgid int64, startime int64)
2211 2330
 	return outinfo, err
2212 2331
 }
2213 2332
 
2214
-func FindeEndStokInventoryProfit(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2333
+func FindeEndStokInventoryProfit(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2215 2334
 
2216 2335
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 10)")
2217 2336
 	if good_id > 0 {
@@ -2226,11 +2345,55 @@ func FindeEndStokInventoryProfit(good_id int64, orgid int64, startime int64, end
2226 2345
 	if endtime < 0 {
2227 2346
 		db = db.Where("ctime <=?", endtime)
2228 2347
 	}
2348
+	if storehouse_id > 0 {
2349
+		db = db.Where("storehouse_id = ?", storehouse_id)
2350
+	}
2229 2351
 	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2230 2352
 	return outinfo, err
2231 2353
 }
2232 2354
 
2233
-func FindeEndStockInventoryLosses(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2355
+func FindeEndStokInventoryProfitTwenty(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2356
+
2357
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 10)")
2358
+	if good_id > 0 {
2359
+		db = db.Where("good_id = ?", good_id)
2360
+	}
2361
+	if orgid > 0 {
2362
+		db = db.Where("user_org_id = ?", orgid)
2363
+	}
2364
+	if startime > 0 {
2365
+		db = db.Where("ctime >=?", startime)
2366
+	}
2367
+	if endtime < 0 {
2368
+		db = db.Where("ctime <=?", endtime)
2369
+	}
2370
+
2371
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2372
+	return outinfo, err
2373
+}
2374
+
2375
+func FindeEndStockInventoryLosses(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2376
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 11)")
2377
+	if good_id > 0 {
2378
+		db = db.Where("good_id = ?", good_id)
2379
+	}
2380
+	if orgid > 0 {
2381
+		db = db.Where("user_org_id = ?", orgid)
2382
+	}
2383
+	if startime > 0 {
2384
+		db = db.Where("ctime >=?", startime)
2385
+	}
2386
+	if endtime < 0 {
2387
+		db = db.Where("ctime <=?", endtime)
2388
+	}
2389
+	if storehouse_id > 0 {
2390
+		db = db.Where("storehouse_id = ?", storehouse_id)
2391
+	}
2392
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2393
+	return outinfo, err
2394
+}
2395
+
2396
+func FindeEndStockInventoryLossesTwenty(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2234 2397
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 11)")
2235 2398
 	if good_id > 0 {
2236 2399
 		db = db.Where("good_id = ?", good_id)
@@ -2244,6 +2407,7 @@ func FindeEndStockInventoryLosses(good_id int64, orgid int64, startime int64, en
2244 2407
 	if endtime < 0 {
2245 2408
 		db = db.Where("ctime <=?", endtime)
2246 2409
 	}
2410
+
2247 2411
 	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2248 2412
 	return outinfo, err
2249 2413
 }
@@ -2645,14 +2809,27 @@ func GetGoodNewPurchaseStockQueryOne(good_type int64, keyword string, page int64
2645 2809
 	return goodinfo, total, err
2646 2810
 }
2647 2811
 
2648
-func GetStartLastFLow(goodid int64, orgid int64, startime int64) (models.VmStockFlowTwenty, error) {
2812
+func GetStartLastFLow(goodid int64, orgid int64, startime int64, storehouse_id int64) (models.VmStockFlowTwenty, error) {
2813
+
2814
+	flwo := models.VmStockFlowTwenty{}
2815
+	err := XTReadDB().Where("good_id = ? and user_org_id = ? and status = 1 and ctime < ? and storehouse_id = ?", goodid, orgid, startime, storehouse_id).Last(&flwo).Error
2816
+	return flwo, err
2817
+}
2818
+
2819
+func GetStartLastFLowTwenty(goodid int64, orgid int64, startime int64) (models.VmStockFlowTwenty, error) {
2649 2820
 
2650 2821
 	flwo := models.VmStockFlowTwenty{}
2651 2822
 	err := XTReadDB().Where("good_id = ? and user_org_id = ? and status = 1 and ctime < ?", goodid, orgid, startime).Last(&flwo).Error
2652 2823
 	return flwo, err
2653 2824
 }
2654 2825
 
2655
-func GetEndLastFlow(goodid int64, orgid int64, endtime int64) (models.VmStockFlowTwenty, error) {
2826
+func GetEndLastFlow(goodid int64, orgid int64, endtime int64, storehouse_id int64) (models.VmStockFlowTwenty, error) {
2827
+	flwo := models.VmStockFlowTwenty{}
2828
+	err := XTReadDB().Where("good_id = ? and user_org_id = ? and status = 1 and ctime <= ? and storehouse_id= ?", goodid, orgid, endtime, storehouse_id).Last(&flwo).Error
2829
+	return flwo, err
2830
+}
2831
+
2832
+func GetEndLastFlowTwenty(goodid int64, orgid int64, endtime int64) (models.VmStockFlowTwenty, error) {
2656 2833
 	flwo := models.VmStockFlowTwenty{}
2657 2834
 	err := XTReadDB().Where("good_id = ? and user_org_id = ? and status = 1 and ctime <= ?", goodid, orgid, endtime).Last(&flwo).Error
2658 2835
 	return flwo, err

+ 23 - 16
service/sign_service.go View File

@@ -273,15 +273,13 @@ func CreateUploadPact(contractcode string, contractname string, signcount int64,
273 273
 
274 274
 	maprequest := make(map[string]interface{})
275 275
 
276
-	//maprequest["contractCode"] = "102020620701056856"
277
-
278 276
 	maprequest["contractName"] = "电脑购买交易合同"
279 277
 
280 278
 	maprequest["signCount"] = 10
281 279
 
282 280
 	maprequest["docName"] = "日本员工保密协议"
283 281
 
284
-	file := "C:/Users/28169/Desktop/打印单.pdf"
282
+	file := "C:/Users/28169/Desktop/2.pdf"
285 283
 
286 284
 	fileBytes, err := ioutil.ReadFile(file) // 读取file
287 285
 
@@ -481,7 +479,7 @@ func AddContractSignatory(contractId string, signers string, contract models.New
481 479
 	signFiles := make(map[string]interface{})
482 480
 
483 481
 	//创建合同返回
484
-	signFiles["docId"] = "157595002862567873"
482
+	signFiles["docId"] = "158807311102510183"
485 483
 
486 484
 	inputDataArr := make([]map[string]interface{}, 0)
487 485
 
@@ -491,8 +489,8 @@ func AddContractSignatory(contractId string, signers string, contract models.New
491 489
 		xySignControls["key"] = "1"
492 490
 		xySignControls["type"] = "autograph"
493 491
 		xySignControls["pageNum"] = 1
494
-		xySignControls["positionX"] = "100F"
495
-		xySignControls["positionY"] = "100F"
492
+		xySignControls["positionX"] = "120F"
493
+		xySignControls["positionY"] = "120F"
496 494
 		inputDataArr = append(inputDataArr, xySignControls)
497 495
 
498 496
 	}
@@ -503,7 +501,7 @@ func AddContractSignatory(contractId string, signers string, contract models.New
503 501
 		keywordSignControls["key"] = "2"
504 502
 		keywordSignControls["type"] = "date"
505 503
 		keywordSignControls["pageNum"] = 1
506
-		keywordSignControls["keyword"] = "医生签名"
504
+		keywordSignControls["keyword"] = "王志文"
507 505
 		keywordSignControls["offsetX"] = "100F"
508 506
 		keywordSignControls["offsetY"] = "100F"
509 507
 		inputDataArrTwo = append(inputDataArrTwo, keywordSignControls)
@@ -528,7 +526,7 @@ func AddContractSignatory(contractId string, signers string, contract models.New
528 526
 	inputDataArrFour = append(inputDataArrFour, signersFiles)
529 527
 
530 528
 	maprequest := make(map[string]interface{})
531
-	maprequest["contractId"] = "157595002862567872"
529
+	maprequest["contractId"] = "158807311102510182"
532 530
 	maprequest["signers"] = inputDataArrFour
533 531
 
534 532
 	byterequest, _ := json.Marshal(maprequest)
@@ -605,21 +603,21 @@ func CreateBackStageSign(contractId string, signers string) string {
605 603
 
606 604
 	fmt.Println("signContorlwqowowo", signControl)
607 605
 	signFiles["signControl"] = signControl
608
-	signFiles["docId"] = "157595002862567873"
606
+	signFiles["docId"] = "158807311102510183"
609 607
 	inputDataArrThree := make([]map[string]interface{}, 0)
610 608
 	inputDataArrThree = append(inputDataArrThree, signFiles)
611 609
 
612 610
 	signer := make(map[string]interface{})
613 611
 
614 612
 	//添加合同签署人接口返回
615
-	signer["signerId"] = "157595142449004996"
613
+	signer["signerId"] = "158807462500107405"
616 614
 	signer["isUserWishes"] = true
617 615
 	signer["userWishesWay"] = 1
618
-	signer["codeNumber"] = "msg202308261800395745892"
619
-	signer["verifyCode"] = "452399"
616
+	signer["codeNumber"] = "msg202309081937527315153"
617
+	signer["verifyCode"] = "252234"
620 618
 	signer["signFiles"] = inputDataArrThree
621 619
 	maprequest := make(map[string]interface{})
622
-	maprequest["contractId"] = "157595002862567872"
620
+	maprequest["contractId"] = "158807311102510182"
623 621
 	maprequest["signer"] = signer
624 622
 
625 623
 	byterequest, _ := json.Marshal(maprequest)
@@ -665,7 +663,7 @@ func GetVerificationCode() string {
665 663
 	serviceCode := beego.AppConfig.String("serviceCode")
666 664
 
667 665
 	maprequest := make(map[string]interface{})
668
-	maprequest["contractId"] = "157595002862567872"
666
+	maprequest["contractId"] = "158807311102510182"
669 667
 	maprequest["userId"] = "PBRLMBFVIRR3BV8JGGOX9C7N"
670 668
 
671 669
 	byterequest, _ := json.Marshal(maprequest)
@@ -1165,7 +1163,7 @@ func GetContractId() string {
1165 1163
 	serviceCode := beego.AppConfig.String("serviceCode")
1166 1164
 
1167 1165
 	maprequest := make(map[string]interface{})
1168
-	maprequest["contractId"] = "157475501840007476"
1166
+	maprequest["contractId"] = "158799561907766048"
1169 1167
 	maprequest["responseContractFile"] = true
1170 1168
 
1171 1169
 	fmt.Println("request23222222222222222", maprequest)
@@ -1261,7 +1259,7 @@ func GetEnterPriseDetail() (string, string) {
1261 1259
 	serviceCode := beego.AppConfig.String("serviceCode")
1262 1260
 
1263 1261
 	maprequest := make(map[string]interface{})
1264
-	maprequest["contractId"] = "157594023610024377"
1262
+	maprequest["contractId"] = "158807311102510182"
1265 1263
 
1266 1264
 	byterequest, _ := json.Marshal(maprequest)
1267 1265
 	reader := bytes.NewReader(byterequest)
@@ -1374,3 +1372,12 @@ func CreateNewUploadPact(name string) string {
1374 1372
 	fmt.Println("strwwoowowow", str)
1375 1373
 	return str
1376 1374
 }
1375
+
1376
+func GetDataConfigDisinfectionFluid(org_id int64) (models.Dataconfig, error) {
1377
+
1378
+	dataconfig := models.Dataconfig{}
1379
+
1380
+	err := XTReadDB().Where("org_id = ? and status =1 and id =12536", org_id).Find(&dataconfig).Error
1381
+
1382
+	return dataconfig, err
1383
+}

+ 10 - 4
service/stock_service.go View File

@@ -2939,6 +2939,7 @@ func FindStockOutDetailList(orgId int64, page int64, limit int64, startTime int6
2939 2939
 	}
2940 2940
 
2941 2941
 	db = db.Preload("WarehouseOut", "status = 1 AND org_id = ?", orgId)
2942
+	db = db.Preload("WarehousingInfoNight", "status=1 and org_id = ?", orgId)
2942 2943
 	db = db.Preload("GoodInfo", "status = 1 AND org_id = ?", orgId)
2943 2944
 	db = db.Count(&total)
2944 2945
 	offset := (page - 1) * limit
@@ -4421,7 +4422,8 @@ func GetExprotStockListTwenty(orgid int64, orderid []string, startime int64, end
4421 4422
 	if storehouse_id > 0 {
4422 4423
 		db = db.Where("x.storehouse_id = ?", storehouse_id)
4423 4424
 	}
4424
-	err = db.Select("x.id,x.good_id,x.good_type_id,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.dealer,x.manufacturer,x.remark,x.license_number,t.good_name,t.packing_unit,t.specification_name").Joins("left join xt_good_information as t on t.id = x.good_id").Scan(&info).Error
4425
+
4426
+	err = db.Select("x.id,x.good_id,x.good_type_id,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.dealer,x.manufacturer,x.remark,x.license_number,t.good_name,t.packing_unit,t.specification_name,p.warehousing_time").Joins("left join xt_warehouse as p on p.id =x.warehousing_id").Joins("left join xt_good_information as t on t.id = x.good_id").Scan(&info).Error
4425 4427
 
4426 4428
 	return info, err
4427 4429
 }
@@ -4449,7 +4451,8 @@ func GetOutExprotList(orgid int64, ids []string, startime int64, endtime int64)
4449 4451
 
4450 4452
 	db := XTReadDB().Table("xt_warehouse_out_info as x").Where("x.status =1 ")
4451 4453
 	table := XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
4452
-	fmt.Println(table)
4454
+	tableOne := XTReadDB().Table("xt_warehouse_out as p").Where("p.status=1")
4455
+	fmt.Println(table, tableOne)
4453 4456
 	if orgid > 0 {
4454 4457
 		db = db.Where("x.org_id = ?", orgid)
4455 4458
 	}
@@ -4464,7 +4467,7 @@ func GetOutExprotList(orgid int64, ids []string, startime int64, endtime int64)
4464 4467
 		db = db.Where("x.ctime<=?", endtime)
4465 4468
 	}
4466 4469
 
4467
-	err = db.Select("x.id,x.warehouse_out_id,x.good_id,x.good_type_id,x.warehousing_out_target,x.count,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.remark,x.number,x.license_number,t.good_name,t.specification_name,t.min_number,t.packing_price,t.min_unit,t.packing_unit,x.manufacturer,x.dealer").Joins("left join xt_good_information as t on t.id = x.good_id").Scan(&out).Error
4470
+	err = db.Select("x.id,x.warehouse_out_id,x.good_id,x.good_type_id,x.warehousing_out_target,x.count,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.remark,x.number,x.license_number,t.good_name,t.specification_name,t.min_number,t.packing_price,t.min_unit,t.packing_unit,x.manufacturer,x.dealer,p.warehouse_out_time").Joins("left join xt_warehouse_out as p on p.id =x.warehouse_out_id").Joins("left join xt_good_information as t on t.id = x.good_id").Scan(&out).Error
4468 4471
 	return out, err
4469 4472
 
4470 4473
 }
@@ -4888,11 +4891,14 @@ func ExportDrugList(warehouse_out_id []string) (out []*models.StDrugWarehouseInf
4888 4891
 	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status =1")
4889 4892
 
4890 4893
 	table := XTReadDB().Table("xt_base_drug as b").Where("b.status = 1")
4894
+
4895
+	tableOne := XTReadDB().Table("xt_drug_warehouse as p")
4891 4896
 	fmt.Println("table", table)
4897
+	fmt.Println("tableOne", tableOne)
4892 4898
 	if len(warehouse_out_id) > 0 {
4893 4899
 		db = db.Where("x.warehousing_id in(?)", warehouse_out_id)
4894 4900
 	}
4895
-	err = db.Select("x.id,x.warehousing_id,x.drug_id,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.warehouseing_unit,x.max_unit,x.min_unit,x.stock_max_number,x.stock_min_number,x.price,x.dealer,x.manufacturer,x.warehousing_order,x.batch_number,b.dose,b.dose_unit,b.min_number,b.min_unit,b.max_unit,b.drug_name,b.drug_type").Joins("left join xt_base_drug as b on b.id = x.drug_id").Scan(&out).Error
4901
+	err = db.Select("x.id,x.warehousing_id,x.drug_id,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.warehouseing_unit,x.max_unit,x.min_unit,x.stock_max_number,x.stock_min_number,x.price,x.dealer,x.manufacturer,x.warehousing_order,x.batch_number,b.dose,b.dose_unit,b.min_number,b.min_unit,b.max_unit,b.drug_name,b.drug_type,p.warehousing_time").Joins("left join xt_drug_warehouse as p on p.id =x.warehousing_id").Joins("left join xt_base_drug as b on b.id = x.drug_id").Scan(&out).Error
4896 4902
 	return out, err
4897 4903
 }
4898 4904
 

+ 1 - 1
service/warhouse_service.go View File

@@ -619,7 +619,7 @@ func HisDrugsDelivery(orgID int64, creater int64, advice *models.HisDoctorAdvice
619 619
 		if drup.ID > 0 {
620 620
 			prescribingNumber := advice.PrescribingNumber
621 621
 
622
-			BloodHisDrugDeliverInfo(orgID, prescribingNumber, &out, &drup, advice, prescribingNumber)
622
+			BloodHisDrugDeliverInfo(orgID, prescribingNumber, &out, &drup, advice, prescribingNumber, advice.PrescribingNumberUnit)
623 623
 
624 624
 		} else {
625 625
 			return errors.New("药品信息不存在")