Pārlūkot izejas kodu

库存调拨修改

28169 2 gadus atpakaļ
vecāks
revīzija
0d22ffd72a
2 mainītis faili ar 22 papildinājumiem un 20 dzēšanām
  1. 13 13
      models/new_monitor.go
  2. 9 7
      service/patient_service.go

+ 13 - 13
models/new_monitor.go Parādīt failu

@@ -57,13 +57,12 @@ func (VMMonitorDialysisOrder) TableName() string {
57 57
 }
58 58
 
59 59
 type VMDialysisPrescription struct {
60
-	ID                    int64   `gorm:"column:id" json:"id"`
61
-	UserOrgId             int64   `gorm:"column:user_org_id" json:"user_org_id"`
62
-	PatientId             int64   `gorm:"column:patient_id" json:"patient_id"`
63
-	Status                int64   `gorm:"column:status" json:"status"`
64
-	RecordDate            int64   `gorm:"column:record_date" json:"record_date"`
65
-	TargetUltrafiltration float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration"`
66
-
60
+	ID                         int64   `gorm:"column:id" json:"id"`
61
+	UserOrgId                  int64   `gorm:"column:user_org_id" json:"user_org_id"`
62
+	PatientId                  int64   `gorm:"column:patient_id" json:"patient_id"`
63
+	Status                     int64   `gorm:"column:status" json:"status"`
64
+	RecordDate                 int64   `gorm:"column:record_date" json:"record_date"`
65
+	TargetUltrafiltration      float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration"`
67 66
 	HemodialysisPipelines      string  `gorm:"column:hemodialysis_pipelines" json:"hemodialysis_pipelines" form:"hemodialysis_pipelines"`
68 67
 	HemodialysisPipelinesCount float64 `gorm:"column:hemodialysis_pipelines_count" json:"hemodialysis_pipelines_count" form:"hemodialysis_pipelines_count"`
69 68
 	PunctureNeedle             string  `gorm:"column:puncture_needle" json:"puncture_needle" form:"puncture_needle"`
@@ -91,12 +90,13 @@ func (VMPredialysisEvaluation) TableName() string {
91 90
 }
92 91
 
93 92
 type VMAssessmentAfterDislysis struct {
94
-	ID             int64   `gorm:"column:id" json:"id"`
95
-	UserOrgId      int64   `gorm:"column:user_org_id" json:"user_org_id"`
96
-	PatientId      int64   `gorm:"column:patient_id" json:"patient_id"`
97
-	AssessmentDate int64   `gorm:"column:assessment_date" json:"assessment_date"`
98
-	WeightAfter    float64 `gorm:"column:weight_after" json:"weight_after"`
99
-	Status         int64   `gorm:"column:status" json:"status"`
93
+	ID                    int64   `gorm:"column:id" json:"id"`
94
+	UserOrgId             int64   `gorm:"column:user_org_id" json:"user_org_id"`
95
+	PatientId             int64   `gorm:"column:patient_id" json:"patient_id"`
96
+	AssessmentDate        int64   `gorm:"column:assessment_date" json:"assessment_date"`
97
+	WeightAfter           float64 `gorm:"column:weight_after" json:"weight_after"`
98
+	Status                int64   `gorm:"column:status" json:"status"`
99
+	ActualUltrafiltration float64 `gorm:"column:actual_ultrafiltration" json:"actual_ultrafiltration" form:"actual_ultrafiltration"`
100 100
 }
101 101
 
102 102
 func (VMAssessmentAfterDislysis) TableName() string {

+ 9 - 7
service/patient_service.go Parādīt failu

@@ -11,7 +11,7 @@ import (
11 11
 	"github.com/jinzhu/gorm"
12 12
 )
13 13
 
14
-//GetPatientList 返回患者的列表
14
+// GetPatientList 返回患者的列表
15 15
 func GetPatientList(orgID int64, keywords string, page, limit, schedulType, bindingState, lapseto, source, startTime, endTime, contagion, reimbursementWay, isscheduling, isprescription int64, isStartTime, isEndTime bool) (patients []*models.Patients, total int64, err error) {
16 16
 
17 17
 	db := readDb.Table("xt_patients as p").Where("p.status=1")
@@ -79,7 +79,7 @@ func GetPatientList(orgID int64, keywords string, page, limit, schedulType, bind
79 79
 
80 80
 }
81 81
 
82
-//GetAllPatientList 返回全部患者的列表
82
+// GetAllPatientList 返回全部患者的列表
83 83
 func GetAllPatientList(orgID int64) (patients []*models.Patients, total int64, err error) {
84 84
 
85 85
 	db := readDb.Table("xt_patients as p").Where("p.user_org_id=? and p.status=1", orgID)
@@ -103,7 +103,7 @@ func GetAllPatientListSix(orgID int64) (patients []*models.MSchedualPatientList,
103 103
 	return patients, err
104 104
 }
105 105
 
106
-//GetAllPatientList 返回全部患者的列表
106
+// GetAllPatientList 返回全部患者的列表
107 107
 func GetAllPatientListByList(orgID int64) (patients []*models.MSchedualPatientList, err error) {
108 108
 	redis := RedisClient()
109 109
 	defer redis.Close()
@@ -557,10 +557,10 @@ func FindPatientByIdTwo(orgID int64, id int64) (patient models.XtPatientsNew, er
557 557
 	return
558 558
 }
559 559
 
560
-//func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
560
+// func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
561 561
 // err = readDb.Model(&models.Patients{}).Preload("Contagions", "status = 1").Preload("Diseases", "status = 1").Where("id = ? and user_org_id=? and status=1", id, orgID).First(&patient).Error
562 562
 // return
563
-//}
563
+// }
564 564
 func FindPatientByIdWithDiseases(orgID int64, id int64) (patient models.Patients, err error) {
565 565
 	redis := RedisClient()
566 566
 	defer redis.Close()
@@ -919,7 +919,7 @@ func UpdatePatientDialysisSolution(solution *models.DialysisSolution) (err error
919 919
 	return
920 920
 }
921 921
 
922
-//GetPatientDialysisSolutionList 返回患者透析方案的列表
922
+// GetPatientDialysisSolutionList 返回患者透析方案的列表
923 923
 func GetPatientDialysisSolutionList(orgID int64, patientID int64, page, limit int64) (solutions []*models.DialysisSolution, total int64, err error) {
924 924
 
925 925
 	offset := (page - 1) * limit
@@ -964,7 +964,7 @@ func GetPatientDialysisSolutionList(orgID int64, patientID int64, page, limit in
964 964
 	return
965 965
 }
966 966
 
967
-//GetPatientDryWeightAdjustList 返回患者调整干体重的列表
967
+// GetPatientDryWeightAdjustList 返回患者调整干体重的列表
968 968
 func GetPatientDryWeightAdjustList(orgID int64, patientID int64, page int64, limit int64) (weights []*models.DryWeightAdjust, total int64, err error) {
969 969
 	db := readDb.Table("xt_dry_weight_adjust as dwa").Where("dwa.status=1")
970 970
 	if orgID > 0 {
@@ -2363,6 +2363,7 @@ func GetAllPrescriptionByList(orgID int64, scheduleDate int64) (prescriptions []
2363 2363
 	redis := RedisClient()
2364 2364
 	defer redis.Close()
2365 2365
 	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(scheduleDate, 10) + ":prescriptions_list_all"
2366
+	redis.Set(key, "", time.Second)
2366 2367
 	prescriptions_list_all, _ := redis.Get(key).Result()
2367 2368
 
2368 2369
 	if len(prescriptions_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
@@ -2461,6 +2462,7 @@ func GetAllAssessmentAfterDislysisByListOne(orgID int64, scheduleDate int64) (as
2461 2462
 	redis := RedisClient()
2462 2463
 	defer redis.Close()
2463 2464
 	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(scheduleDate, 10) + ":assessment_after_dislysis_list_all"
2465
+	redis.Set(key, "", time.Second)
2464 2466
 	assessment_after_dislysis__all, _ := redis.Get(key).Result()
2465 2467
 
2466 2468
 	if len(assessment_after_dislysis__all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis