csx 3 år sedan
förälder
incheckning
415f5bb778

+ 8 - 4
controllers/his_api_controller.go Visa fil

540
 
540
 
541
 								if prescribingNumberUnit == drug.MinUnit {
541
 								if prescribingNumberUnit == drug.MinUnit {
542
 									if prescribing_number > drug.Total {
542
 									if prescribing_number > drug.Total {
543
-										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
543
+										c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
544
+										//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
544
 										return
545
 										return
545
 									}
546
 									}
546
 								} else {
547
 								} else {
547
 									if prescribingNumberUnit == drug.MaxUnit {
548
 									if prescribingNumberUnit == drug.MaxUnit {
548
 										num := prescribing_number * float64(drug.MinNumber)
549
 										num := prescribing_number * float64(drug.MinNumber)
549
 										if num > drug.Total {
550
 										if num > drug.Total {
550
-											c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
551
+											c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
552
+											//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
551
 											return
553
 											return
552
 										}
554
 										}
553
 									}
555
 									}
591
 										return
593
 										return
592
 									}
594
 									}
593
 									if totals > good.Total {
595
 									if totals > good.Total {
594
-										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
596
+										c.ServeDynamicFailJsonSend(good.GoodName + "库存不足")
597
+
598
+										//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
595
 										return
599
 										return
596
 									}
600
 									}
597
 
601
 
1889
 					advice.Checker = hisAdvice.Checker
1893
 					advice.Checker = hisAdvice.Checker
1890
 					advice.CheckState = hisAdvice.CheckState
1894
 					advice.CheckState = hisAdvice.CheckState
1891
 					advice.StartTime = hisAdvice.StartTime
1895
 					advice.StartTime = hisAdvice.StartTime
1892
-					advice.Groupno = hisAdvice.Groupno
1896
+					//advice.Groupno = hisAdvice.Groupno
1893
 
1897
 
1894
 				}
1898
 				}
1895
 			}
1899
 			}

+ 0 - 7
controllers/mobile_api_controllers/advice_api_controller.go Visa fil

1
-package mobile_api_controllers
2
-
3
-type AdviceAPIController struct {
4
-	MobileBaseAPIAuthController
5
-}
6
-
7
-// /m/api/dialysis/advices [get]

+ 9 - 4
controllers/new_mobile_api_controllers/mobile_his_api_controller.go Visa fil

324
 
324
 
325
 								if prescribingNumberUnit == drug.MinUnit {
325
 								if prescribingNumberUnit == drug.MinUnit {
326
 									if prescribing_number > drug.Total {
326
 									if prescribing_number > drug.Total {
327
-										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
327
+										c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
328
+										//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
328
 										return
329
 										return
329
 									}
330
 									}
330
 								} else {
331
 								} else {
331
 									if prescribingNumberUnit == drug.MaxUnit {
332
 									if prescribingNumberUnit == drug.MaxUnit {
332
 										num := prescribing_number * float64(drug.MinNumber)
333
 										num := prescribing_number * float64(drug.MinNumber)
333
 										if num > drug.Total {
334
 										if num > drug.Total {
334
-											c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
335
+											c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
336
+
337
+											//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
335
 											return
338
 											return
336
 										}
339
 										}
337
 									}
340
 									}
374
 										return
377
 										return
375
 									}
378
 									}
376
 									if totals > good.Total {
379
 									if totals > good.Total {
377
-										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
380
+										c.ServeDynamicFailJsonSend(good.GoodName + "库存不足")
381
+
382
+										//c.ServeFailJSONWithSGJErro,rCode(enums.ErrorCodeOutOfStockParamWrong)
378
 										return
383
 										return
379
 									}
384
 									}
380
 
385
 
724
 					advice.CheckTime = hisAdvice.CheckTime
729
 					advice.CheckTime = hisAdvice.CheckTime
725
 					advice.Checker = hisAdvice.Checker
730
 					advice.Checker = hisAdvice.Checker
726
 					advice.CheckState = hisAdvice.CheckState
731
 					advice.CheckState = hisAdvice.CheckState
727
-					advice.Groupno = hisAdvice.Groupno
732
+					//advice.Groupno = hisAdvice.Groupno
728
 					//advice.StartTime = hisAdvice.StartTime
733
 					//advice.StartTime = hisAdvice.StartTime
729
 
734
 
730
 				}
735
 				}

+ 0 - 9
controllers/new_mobile_api_controllers/new_self_drug_api_router.go Visa fil

1
-package new_mobile_api_controllers
2
-
3
-import "github.com/astaxie/beego"
4
-
5
-func NewDrugApiControllersRegisterRouters() {
6
-
7
-	beego.Router("/m/api/drug/getselfmedicallist", &NewDrugApiController{}, "Get:GetSelfMedicalList")
8
-	beego.Router("/m/api/getdrugdescbydrugname", &NewDrugApiController{}, "Get:GetDrugDescByDrugName")
9
-}

+ 1 - 1
controllers/schedule_api_controller.go Visa fil

2363
 
2363
 
2364
 	orgId := this.GetAdminUserInfo().CurrentOrgId
2364
 	orgId := this.GetAdminUserInfo().CurrentOrgId
2365
 	if week_type > 0 {
2365
 	if week_type > 0 {
2366
-		list, err := service.GetWeekDayScheduleById(orgId, targetDay.Unix(), week_time)
2366
+		list, err := service.GetWeekDayScheduleById(orgId, targetDay.Unix(), week_time, zone)
2367
 		if err != nil {
2367
 		if err != nil {
2368
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2368
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2369
 			return
2369
 			return

+ 0 - 1
routers/router.go Visa fil

2
 
2
 
3
 import (
3
 import (
4
 	"XT_New/controllers"
4
 	"XT_New/controllers"
5
-	//admin_api "XT_New/controllers/admin_api_controllers"
6
 	m_api "XT_New/controllers/mobile_api_controllers"
5
 	m_api "XT_New/controllers/mobile_api_controllers"
7
 	new_m_api "XT_New/controllers/new_mobile_api_controllers"
6
 	new_m_api "XT_New/controllers/new_mobile_api_controllers"
8
 	"github.com/astaxie/beego"
7
 	"github.com/astaxie/beego"

+ 10 - 5
service/schedule_service.go Visa fil

564
 	return
564
 	return
565
 }
565
 }
566
 
566
 
567
-func GetWeekDayScheduleById(orgid int64, scheduleDate int64, scheduleType int64) (list []*models.VmSchedulesRemind, err error) {
567
+func GetWeekDayScheduleById(orgid int64, scheduleDate int64, scheduleType int64, zone int64) (list []*models.VmSchedulesRemind, err error) {
568
 
568
 
569
 	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
569
 	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
570
 	if orgid > 0 {
570
 	if orgid > 0 {
576
 	if scheduleType > 0 {
576
 	if scheduleType > 0 {
577
 		db = db.Where("x.schedule_type = ?", scheduleType)
577
 		db = db.Where("x.schedule_type = ?", scheduleType)
578
 	}
578
 	}
579
+	if zone > 0 {
580
+		db = db.Where("x.partition_id = ?", zone)
581
+	}
579
 
582
 
580
 	err = db.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.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
583
 	err = db.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.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
581
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
584
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
582
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
585
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
583
-		return db.Where("status =1").Order("id asc")
586
+		return db.Where("status =1").Order("id desc")
584
 	}).Find(&list).Error
587
 	}).Find(&list).Error
585
 
588
 
586
 	return list, err
589
 	return list, err
587
 }
590
 }
588
 
591
 
589
-func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int64, startDate int64, zone int64) (list []*models.VmSchedules, err error) {
592
+func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int64, startDate int64, zone int64) (list []*models.VmSchedulesRemind, err error) {
590
 
593
 
591
 	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
594
 	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
592
 	if orgid > 0 {
595
 	if orgid > 0 {
599
 		db = db.Where("x.schedule_type = ?", scheduleType)
602
 		db = db.Where("x.schedule_type = ?", scheduleType)
600
 	}
603
 	}
601
 	if zone > 0 {
604
 	if zone > 0 {
602
-		db = db.Where("s.partition_id = ?", zone)
605
+		db = db.Where("x.partition_id = ?", zone)
603
 	}
606
 	}
604
 
607
 
605
 	err = db.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.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
608
 	err = db.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.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
606
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
609
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
607
-	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", "user_org_id =? and status = 1", orgid).Find(&list).Error
610
+	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
611
+		return db.Where("status =1").Order("id desc")
612
+	}).Find(&list).Error
608
 
613
 
609
 	return list, err
614
 	return list, err
610
 }
615
 }