Browse Source

11月8日库存管理

XMLWAN 3 years ago
parent
commit
91ce6aad61
3 changed files with 13 additions and 12 deletions
  1. 1 1
      conf/app.conf
  2. 11 10
      models/device_models.go
  3. 1 1
      service/doctor_schedule_service.go

+ 1 - 1
conf/app.conf View File

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9531
2
+httpport = 9529
3 3
 runmode = dev
4 4
 
5 5
 #

+ 11 - 10
models/device_models.go View File

@@ -1056,16 +1056,17 @@ type VmXtSchedule struct {
1056 1056
 }
1057 1057
 
1058 1058
 type PatientDeviceNumber struct {
1059
-	ID       int64           `gorm:"column:id" json:"id" form:"id"`
1060
-	OrgId    int64           `gorm:"column:org_id" json:"org_id" form:"org_id"`
1061
-	Number   string          `gorm:"column:number" json:"number" form:"number"`
1062
-	GroupId  int64           `gorm:"column:group_id" json:"group_id" form:"group_id"`
1063
-	ZoneId   int64           `gorm:"column:zone_id" json:"zone_id" form:"zone_id"`
1064
-	Status   int64           `gorm:"column:status" json:"status" form:"status"`
1065
-	Ctime    int64           `gorm:"column:ctime" json:"ctime" form:"ctime"`
1066
-	Mtime    int64           `gorm:"column:mtime" json:"mtime" form:"mtime"`
1067
-	Sort     int64           `gorm:"column:sort" json:"sort" form:"sort"`
1068
-	Schedule []*BlodSchedule `json:"schedule" gorm:"foreignkey:BedId;AssociationForeignKey:ID;"`
1059
+	ID         int64           `gorm:"column:id" json:"id" form:"id"`
1060
+	OrgId      int64           `gorm:"column:org_id" json:"org_id" form:"org_id"`
1061
+	Number     string          `gorm:"column:number" json:"number" form:"number"`
1062
+	GroupId    int64           `gorm:"column:group_id" json:"group_id" form:"group_id"`
1063
+	ZoneId     int64           `gorm:"column:zone_id" json:"zone_id" form:"zone_id"`
1064
+	Status     int64           `gorm:"column:status" json:"status" form:"status"`
1065
+	Ctime      int64           `gorm:"column:ctime" json:"ctime" form:"ctime"`
1066
+	Mtime      int64           `gorm:"column:mtime" json:"mtime" form:"mtime"`
1067
+	Sort       int64           `gorm:"column:sort" json:"sort" form:"sort"`
1068
+	DeviceZone DeviceZone      `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:ZoneId;"`
1069
+	Schedule   []*BlodSchedule `json:"schedule" gorm:"foreignkey:BedId;AssociationForeignKey:ID;"`
1069 1070
 }
1070 1071
 
1071 1072
 func (PatientDeviceNumber) TableName() string {

+ 1 - 1
service/doctor_schedule_service.go View File

@@ -607,7 +607,7 @@ func GetPatientScheduleByBed(schedule_date int64, zoneid int64, orgid int64) (li
607 607
 	if orgid > 0 {
608 608
 		db = db.Where("x.org_id = ?", orgid)
609 609
 	}
610
-	err = db.Select("x.id,x.number,x.sort,x.group_id,x.zone_id,x.sort").Preload("Schedule", func(db *gorm.DB) *gorm.DB {
610
+	err = db.Select("x.id,x.number,x.sort,x.group_id,x.zone_id,x.sort").Preload("DeviceZone", "status = 1").Preload("Schedule", func(db *gorm.DB) *gorm.DB {
611 611
 		return XTReadDB().Model(&models.BlodSchedule{}).Where("status = 1 AND user_org_id = ? and schedule_date = ?", orgid, schedule_date).Preload("VmBloodPatients", "status = 1 and user_org_id = ?", orgid).Preload("BloodDialysisOrder", "status = 1").Preload("BloodDialysisPrescription", "status = 1")
612 612
 	}).Find(&list).Error
613 613