Browse Source

历史排班

28169 1 year ago
parent
commit
d1ec17062c

+ 17 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -9814,3 +9814,20 @@ func (c *DialysisAPIController) GetControlMonitorList() {
9814 9814
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
9815 9815
 	}
9816 9816
 }
9817
+
9818
+func (c *DialysisAPIController) GetAdviceListNoExecution() {
9819
+
9820
+	timeStr := time.Now().Format("2006-01-02")
9821
+	timeLayout := "2006-01-02 15:04:05"
9822
+	timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
9823
+	timenow := timeStringToTime.Unix()
9824
+
9825
+	orgId := c.GetMobileAdminUserInfo().Org.Id
9826
+
9827
+	adviceList, _ := service.GetAdviceListNoExecution(timenow, orgId)
9828
+
9829
+	c.ServeSuccessJSON(map[string]interface{}{
9830
+		"adviceList": adviceList,
9831
+	})
9832
+
9833
+}

+ 2 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go View File

@@ -201,4 +201,6 @@ func MobileAPIControllersRegisterRouters() {
201 201
 
202 202
 	beego.Router("/m/api/getcontrolmonitorlist", &DialysisAPIController{}, "Get:GetControlMonitorList")
203 203
 
204
+	beego.Router("/m/api/getadvicelistnoexecution", &DialysisAPIController{}, "Get:GetAdviceListNoExecution")
205
+
204 206
 }

+ 1 - 1
service/dialysis_service.go View File

@@ -1527,7 +1527,7 @@ func SaveHisProject(advice *models.HisPrescriptionProject) (err error) {
1527 1527
 }
1528 1528
 
1529 1529
 func FindAllHisProjectById(orgID int64, patient_id int64, record_time int64) (advice []*models.HisPrescriptionProject, err error) {
1530
-	err = readDb.Model(&models.HisPrescriptionProject{}).Preload("HisProject", "status = 1 and user_org_id = ?", orgID).Preload("GoodInfo", "status = 1 and org_id = ?", orgID).Where("user_org_id=? and status=1 and patient_id = ? AND record_date = ?", orgID, patient_id, record_time).Find(&advice).Error
1530
+	err = readDb.Model(&models.HisPrescriptionProject{}).Preload("HisProject", "status = 1 and user_org_id = ?", orgID).Preload("XtHisProjectTeam", "user_org_id=? and status=1", orgID).Preload("GoodInfo", "status = 1 and org_id = ?", orgID).Where("user_org_id=? and status=1 and patient_id = ? AND record_date = ?", orgID, patient_id, record_time).Find(&advice).Error
1531 1531
 	return
1532 1532
 }
1533 1533
 

+ 6 - 0
service/patient_service.go View File

@@ -3208,3 +3208,9 @@ func CreateDeviceValusalMapVrr(vrr models.XtDeviceValusalMapVrr) error {
3208 3208
 	err := XTWriteDB().Create(&vrr).Error
3209 3209
 	return err
3210 3210
 }
3211
+
3212
+func GetAdviceListNoExecution(advice_date int64, user_org_id int64) (advice []*models.XtDoctorAdvice, err error) {
3213
+
3214
+	err = XTReadDB().Where("advice_date = ? and user_org_id = ? and status =1 and execution_state = 2", advice_date, user_org_id).Find(&advice).Error
3215
+	return advice, err
3216
+}