XMLWAN 4 år sedan
förälder
incheckning
346d7b682e

+ 10 - 10
controllers/manage_api_controller.go Visa fil

210
 		DeviceName:          device_name,
210
 		DeviceName:          device_name,
211
 		ManufactureFactory:  manufacture_factory,
211
 		ManufactureFactory:  manufacture_factory,
212
 		ServiceManufacturer: service_manufacturer,
212
 		ServiceManufacturer: service_manufacturer,
213
-		UnitType:            unit_type,
213
+		UnitType:            unittype,
214
 		UseSection:          use_section,
214
 		UseSection:          use_section,
215
 		SectionNumber:       section_number,
215
 		SectionNumber:       section_number,
216
 		BuyDate:             buydate,
216
 		BuyDate:             buydate,
294
 	//fmt.Println("生产厂家", manufacture_factory)
294
 	//fmt.Println("生产厂家", manufacture_factory)
295
 	service_manufacturer := dataBody["service_manufacturer"].(string)
295
 	service_manufacturer := dataBody["service_manufacturer"].(string)
296
 	//fmt.Println("维修厂家", service_manufacturer)
296
 	//fmt.Println("维修厂家", service_manufacturer)
297
-	unittype := int64(dataBody["unit_type"].(float64))
298
-	unit_type := strconv.FormatInt(unittype, 10)
297
+	unit_type := int64(dataBody["unit_type"].(float64))
298
+	//unit_type := strconv.FormatInt(unittype, 10)
299
 	fmt.Println("设备型号", unit_type)
299
 	fmt.Println("设备型号", unit_type)
300
 
300
 
301
 	use_section := dataBody["use_section"].(string)
301
 	use_section := dataBody["use_section"].(string)
435
 	//fmt.Println("生产厂家", manufacture_factory)
435
 	//fmt.Println("生产厂家", manufacture_factory)
436
 	service_manufacturer := dataBody["service_manufacturer"].(string)
436
 	service_manufacturer := dataBody["service_manufacturer"].(string)
437
 	//fmt.Println("维修厂家", service_manufacturer)
437
 	//fmt.Println("维修厂家", service_manufacturer)
438
-	unittype := int64(dataBody["unit_type"].(float64))
439
-	unit_type := strconv.FormatInt(unittype, 10)
438
+	unit_type := int64(dataBody["unit_type"].(float64))
439
+	//unit_type := strconv.FormatInt(unittype, 10)
440
 	//fmt.Println("设备型号", unit_type)
440
 	//fmt.Println("设备型号", unit_type)
441
 	use_section := dataBody["use_section"].(string)
441
 	use_section := dataBody["use_section"].(string)
442
 	//fmt.Println("使用科室", use_section)
442
 	//fmt.Println("使用科室", use_section)
568
 	service_manufacturer := dataBody["service_manufacturer"].(string)
568
 	service_manufacturer := dataBody["service_manufacturer"].(string)
569
 	//fmt.Println("维修厂家", service_manufacturer)
569
 	//fmt.Println("维修厂家", service_manufacturer)
570
 	unittype := int64(dataBody["unit_type"].(float64))
570
 	unittype := int64(dataBody["unit_type"].(float64))
571
-	unit_type := strconv.FormatInt(unittype, 10)
571
+	//unit_type := strconv.FormatInt(unittype, 10)
572
 	//fmt.Println("设备型号", unit_type)
572
 	//fmt.Println("设备型号", unit_type)
573
 	use_section := dataBody["use_section"].(string)
573
 	use_section := dataBody["use_section"].(string)
574
 	//fmt.Println("使用科室", use_section)
574
 	//fmt.Println("使用科室", use_section)
635
 		DeviceName:          device_name,
635
 		DeviceName:          device_name,
636
 		ManufactureFactory:  manufacture_factory,
636
 		ManufactureFactory:  manufacture_factory,
637
 		ServiceManufacturer: service_manufacturer,
637
 		ServiceManufacturer: service_manufacturer,
638
-		UnitType:            unit_type,
638
+		UnitType:            unittype,
639
 		UseSection:          use_section,
639
 		UseSection:          use_section,
640
 		SectionNumber:       section_number,
640
 		SectionNumber:       section_number,
641
 		BuyDate:             buydate,
641
 		BuyDate:             buydate,
2651
 	fmt.Println("生产厂家", manufacture_factory)
2651
 	fmt.Println("生产厂家", manufacture_factory)
2652
 	service_manufacturer := dataBody["service_manufacturer"].(string)
2652
 	service_manufacturer := dataBody["service_manufacturer"].(string)
2653
 	fmt.Println("维修厂家", service_manufacturer)
2653
 	fmt.Println("维修厂家", service_manufacturer)
2654
-	unittype := int64(dataBody["unit_type"].(float64))
2655
-	unit_type := strconv.FormatInt(unittype, 10)
2656
-	fmt.Println("设备型号", unit_type)
2654
+	unit_type := int64(dataBody["unit_type"].(float64))
2655
+	//unit_type := strconv.FormatInt(unittype, 10)
2656
+	//fmt.Println("设备型号", unit_type)
2657
 	use_section := dataBody["use_section"].(string)
2657
 	use_section := dataBody["use_section"].(string)
2658
 	fmt.Println("使用科室", use_section)
2658
 	fmt.Println("使用科室", use_section)
2659
 	section_number := dataBody["section_number"].(string)
2659
 	section_number := dataBody["section_number"].(string)

+ 7 - 4
controllers/new_mobile_api_controllers/new_manage_api_controller.go Visa fil

38
 	scheduleweek, _ := this.GetInt64("schedule_week")
38
 	scheduleweek, _ := this.GetInt64("schedule_week")
39
 	fmt.Println(scheduleweek)
39
 	fmt.Println(scheduleweek)
40
 	scheduledate, _ := this.GetInt64("schedule_date")
40
 	scheduledate, _ := this.GetInt64("schedule_date")
41
+
42
+	//根据床位号获取设备型号
43
+	unitType, _ := service.GetUnitType(bedid, orgid)
41
 	//查询使用登记最后一条消毒记录
44
 	//查询使用登记最后一条消毒记录
42
 	infomation, err := service.GetLaseDeviceInfomation(orgid, bedid, scheduledate)
45
 	infomation, err := service.GetLaseDeviceInfomation(orgid, bedid, scheduledate)
43
 	fmt.Println("infomation========", infomation)
46
 	fmt.Println("infomation========", infomation)
44
 	fmt.Println("err-------", err)
47
 	fmt.Println("err-------", err)
45
 	if err == gorm.ErrRecordNotFound {
48
 	if err == gorm.ErrRecordNotFound {
46
 		//查询改设备是否有消毒计划
49
 		//查询改设备是否有消毒计划
47
-		plan, errcode := service.GetDisInfectionTime(orgid, bedid, scheduletype, scheduleweek)
50
+		plan, errcode := service.GetDisInfectionTime(orgid, unitType.UnitType, scheduletype, scheduleweek)
48
 		//如果没有消毒计划,去查询该设备的上次消毒时间
51
 		//如果没有消毒计划,去查询该设备的上次消毒时间
49
 		if errcode == gorm.ErrRecordNotFound {
52
 		if errcode == gorm.ErrRecordNotFound {
50
 			infor, errco := service.GetLaseDeviceInfomationTwo(orgid, bedid)
53
 			infor, errco := service.GetLaseDeviceInfomationTwo(orgid, bedid)
128
 	fmt.Println("透析减少", dislysis.WeightLoss)
131
 	fmt.Println("透析减少", dislysis.WeightLoss)
129
 	//			//根据床位号获取设备id
132
 	//			//根据床位号获取设备id
130
 	addmacher, _ := service.GetEquimentIDTwo(bedid, orgid)
133
 	addmacher, _ := service.GetEquimentIDTwo(bedid, orgid)
131
-	unitype, _ := strconv.ParseInt(addmacher.UnitType, 10, 64)
132
-	fmt.Println(unitype)
133
-	plan, errplan := service.GetDisinfectionTwo(unitype, scheduletype, orgid)
134
+	//unitype, _ := strconv.ParseInt(addmacher.UnitType, 10, 64)
135
+	//fmt.Println(unitype)
136
+	plan, errplan := service.GetDisinfectionTwo(addmacher.UnitType, scheduletype, orgid)
134
 	//counts, errplan := service.GetUserTotalCount(orgid, bedid)
137
 	//counts, errplan := service.GetUserTotalCount(orgid, bedid)
135
 	//var usertoal  int64
138
 	//var usertoal  int64
136
 	//fmt.Println(usertoal)
139
 	//fmt.Println(usertoal)

+ 1 - 1
models/device_models.go Visa fil

215
 	DeviceName          string `gorm:"column:device_name" json:"device_name" form:"device_name"`
215
 	DeviceName          string `gorm:"column:device_name" json:"device_name" form:"device_name"`
216
 	ManufactureFactory  string `gorm:"column:manufacture_factory" json:"manufacture_factory" form:"manufacture_factory"`
216
 	ManufactureFactory  string `gorm:"column:manufacture_factory" json:"manufacture_factory" form:"manufacture_factory"`
217
 	ServiceManufacturer string `gorm:"column:service_manufacturer" json:"service_manufacturer" form:"service_manufacturer"`
217
 	ServiceManufacturer string `gorm:"column:service_manufacturer" json:"service_manufacturer" form:"service_manufacturer"`
218
-	UnitType            string `gorm:"column:unit_type" json:"unit_type" form:"unit_type"`
218
+	UnitType            int64  `gorm:"column:unit_type" json:"unit_type" form:"unit_type"`
219
 	UseSection          string `gorm:"column:use_section" json:"use_section" form:"use_section"`
219
 	UseSection          string `gorm:"column:use_section" json:"use_section" form:"use_section"`
220
 	SectionNumber       string `gorm:"column:section_number" json:"section_number" form:"section_number"`
220
 	SectionNumber       string `gorm:"column:section_number" json:"section_number" form:"section_number"`
221
 	BuyDate             int64  `gorm:"column:buy_date" json:"buy_date" form:"buy_date"`
221
 	BuyDate             int64  `gorm:"column:buy_date" json:"buy_date" form:"buy_date"`

+ 2 - 2
service/auto_create_week_disinfection.go Visa fil

82
 				fmt.Print("透析时长", dislysis.ActualTreatmentHour+'h'+dislysis.ActualTreatmentMinute+'m'+'i'+'n')
82
 				fmt.Print("透析时长", dislysis.ActualTreatmentHour+'h'+dislysis.ActualTreatmentMinute+'m'+'i'+'n')
83
 				//			//根据床位号获取设备id
83
 				//			//根据床位号获取设备id
84
 				addmacher, _ := GetEquimentID(schedules.BedId, it.UserOrgId)
84
 				addmacher, _ := GetEquimentID(schedules.BedId, it.UserOrgId)
85
-				unitype, err := strconv.ParseInt(addmacher.UnitType, 10, 64)
85
+				//unitype, err := strconv.ParseInt(addmacher.UnitType, 10, 64)
86
 				fmt.Println(" 设备id", addmacher.ID)
86
 				fmt.Println(" 设备id", addmacher.ID)
87
 				//根据设备id获取设备类型
87
 				//根据设备id获取设备类型
88
 				//equimentname, _ := GetAddmacher(addmacher.ID, it.UserOrgId)
88
 				//equimentname, _ := GetAddmacher(addmacher.ID, it.UserOrgId)
89
 
89
 
90
 				fmt.Println("班次", it.SchedualType)
90
 				fmt.Println("班次", it.SchedualType)
91
 				//查看该设备是否有消毒计划,无怎返回,有则添加
91
 				//查看该设备是否有消毒计划,无怎返回,有则添加
92
-				plan, errplan := GetDisinfection(unitype, it.SchedualType, it.UserOrgId)
92
+				plan, errplan := GetDisinfection(addmacher.UnitType, it.SchedualType, it.UserOrgId)
93
 				fmt.Print("plan", plan)
93
 				fmt.Print("plan", plan)
94
 				fmt.Println("错误是什么", errplan)
94
 				fmt.Println("错误是什么", errplan)
95
 				if errplan == gorm.ErrRecordNotFound {
95
 				if errplan == gorm.ErrRecordNotFound {

+ 2 - 2
service/auto_create_week_plan.go Visa fil

77
 				fmt.Println("透后", err)
77
 				fmt.Println("透后", err)
78
 				//			//根据床位号获取设备id
78
 				//			//根据床位号获取设备id
79
 				addmacher, _ := GetEquimentID(schedules.BedId, it.UserOrgId)
79
 				addmacher, _ := GetEquimentID(schedules.BedId, it.UserOrgId)
80
-				unitype, err := strconv.ParseInt(addmacher.UnitType, 10, 64)
80
+				//unitype, err := strconv.ParseInt(addmacher.UnitType, 10, 64)
81
 				fmt.Println(" 设备id", addmacher.ID)
81
 				fmt.Println(" 设备id", addmacher.ID)
82
 				//根据设备id获取设备类型
82
 				//根据设备id获取设备类型
83
 				//equimentname, _ := GetAddmacher(addmacher.ID, it.UserOrgId)
83
 				//equimentname, _ := GetAddmacher(addmacher.ID, it.UserOrgId)
84
 
84
 
85
 				fmt.Println("班次", it.SchedualType)
85
 				fmt.Println("班次", it.SchedualType)
86
 				//查看该设备是否有消毒计划,无怎返回,有则添加
86
 				//查看该设备是否有消毒计划,无怎返回,有则添加
87
-				plan, errplan := GetDisinfection(unitype, it.SchedualType, it.UserOrgId)
87
+				plan, errplan := GetDisinfection(addmacher.UnitType, it.SchedualType, it.UserOrgId)
88
 				fmt.Print("plan", plan)
88
 				fmt.Print("plan", plan)
89
 				fmt.Println("错误", errplan)
89
 				fmt.Println("错误", errplan)
90
 				if errplan == gorm.ErrRecordNotFound {
90
 				if errplan == gorm.ErrRecordNotFound {

+ 9 - 2
service/manage_service.go Visa fil

1138
 	return addmacher, err
1138
 	return addmacher, err
1139
 }
1139
 }
1140
 
1140
 
1141
-func GetDisInfectionTime(orgid int64, bedid int64, scheduletype int64, scheduleweek int64) (*models.DevicePlan, error) {
1141
+func GetDisInfectionTime(orgid int64, unitype int64, scheduletype int64, scheduleweek int64) (*models.DevicePlan, error) {
1142
 	plan := models.DevicePlan{}
1142
 	plan := models.DevicePlan{}
1143
-	err = UserReadDB().Model(&plan).Where("user_org_id = ? and bed_id = ? and classtime = ? and time = ? and status = 1", orgid, bedid, scheduletype, scheduleweek).Find(&plan).Error
1143
+	err = UserReadDB().Model(&plan).Where("user_org_id = ? and device_type = ? and classtime = ? and time = ? and status = 1", orgid, unitype, scheduletype, scheduleweek).Find(&plan).Error
1144
 	if err == gorm.ErrRecordNotFound {
1144
 	if err == gorm.ErrRecordNotFound {
1145
 		return nil, err
1145
 		return nil, err
1146
 	}
1146
 	}
1150
 	return &plan, nil
1150
 	return &plan, nil
1151
 }
1151
 }
1152
 
1152
 
1153
+func GetUnitType(bedid int64, orgid int64) (models.DeviceAddmacher, error) {
1154
+
1155
+	addmacher := models.DeviceAddmacher{}
1156
+	err := UserReadDB().Model(&addmacher).Where("bed_id = ? and user_org_id = ? and status = 1", bedid, orgid).Find(&addmacher).Error
1157
+	return addmacher, err
1158
+}
1159
+
1153
 func GetLaseDeviceInfomation(orgid int64, bedid int64, date int64) (*models.DeviceInformation, error) {
1160
 func GetLaseDeviceInfomation(orgid int64, bedid int64, date int64) (*models.DeviceInformation, error) {
1154
 
1161
 
1155
 	information := models.DeviceInformation{}
1162
 	information := models.DeviceInformation{}