csx hace 3 años
padre
commit
415f5bb778

+ 8 - 4
controllers/his_api_controller.go Ver fichero

@@ -540,14 +540,16 @@ func (c *HisApiController) CreateHisPrescription() {
540 540
 
541 541
 								if prescribingNumberUnit == drug.MinUnit {
542 542
 									if prescribing_number > drug.Total {
543
-										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
543
+										c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
544
+										//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
544 545
 										return
545 546
 									}
546 547
 								} else {
547 548
 									if prescribingNumberUnit == drug.MaxUnit {
548 549
 										num := prescribing_number * float64(drug.MinNumber)
549 550
 										if num > drug.Total {
550
-											c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
551
+											c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
552
+											//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
551 553
 											return
552 554
 										}
553 555
 									}
@@ -591,7 +593,9 @@ func (c *HisApiController) CreateHisPrescription() {
591 593
 										return
592 594
 									}
593 595
 									if totals > good.Total {
594
-										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
596
+										c.ServeDynamicFailJsonSend(good.GoodName + "库存不足")
597
+
598
+										//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
595 599
 										return
596 600
 									}
597 601
 
@@ -1889,7 +1893,7 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
1889 1893
 					advice.Checker = hisAdvice.Checker
1890 1894
 					advice.CheckState = hisAdvice.CheckState
1891 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 Ver fichero

@@ -1,7 +0,0 @@
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 Ver fichero

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

+ 0 - 9
controllers/new_mobile_api_controllers/new_self_drug_api_router.go Ver fichero

@@ -1,9 +0,0 @@
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 Ver fichero

@@ -2363,7 +2363,7 @@ func (this *ScheduleApiController) GetBloodScheduleList() {
2363 2363
 
2364 2364
 	orgId := this.GetAdminUserInfo().CurrentOrgId
2365 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 2367
 		if err != nil {
2368 2368
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2369 2369
 			return

+ 0 - 1
routers/router.go Ver fichero

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

+ 10 - 5
service/schedule_service.go Ver fichero

@@ -564,7 +564,7 @@ func GetWeekDaySchedule(orgID int64, scheduleDate int64, scheduleDates *time.Tim
564 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 569
 	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
570 570
 	if orgid > 0 {
@@ -576,17 +576,20 @@ func GetWeekDayScheduleById(orgid int64, scheduleDate int64, scheduleType int64)
576 576
 	if scheduleType > 0 {
577 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 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 584
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
582 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 587
 	}).Find(&list).Error
585 588
 
586 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 594
 	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
592 595
 	if orgid > 0 {
@@ -599,12 +602,14 @@ func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int
599 602
 		db = db.Where("x.schedule_type = ?", scheduleType)
600 603
 	}
601 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 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 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 614
 	return list, err
610 615
 }