瀏覽代碼

2024/6/17

28169 11 月之前
父節點
當前提交
284601ba69

+ 13 - 8
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

8107
 		}
8107
 		}
8108
 	}
8108
 	}
8109
 
8109
 
8110
-	//出库逻辑
8111
-	err = service.ConsumablesDeliveryTotal(adminInfo.Org.Id, patient_id, record_time, beforePrepares, newBeforePrepares, adminInfo.AdminUser.Id)
8112
-
8113
-	if err != nil {
8114
-		utils.ErrorLog(err.Error())
8115
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8116
-		return
8117
-
8110
+	for _, item := range beforePrepares {
8111
+		//查询该耗材今日出库了多少
8112
+		service.GetHistoryWarehouseOutInfo(item.PatientId, adminInfo.Org.Id, record_time)
8118
 	}
8113
 	}
8119
 
8114
 
8115
+	////出库逻辑
8116
+	//err = service.ConsumablesDeliveryTotal(adminInfo.Org.Id, patient_id, record_time, beforePrepares, newBeforePrepares, adminInfo.AdminUser.Id)
8117
+	//
8118
+	//if err != nil {
8119
+	//	utils.ErrorLog(err.Error())
8120
+	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8121
+	//	return
8122
+	//
8123
+	//}
8124
+
8120
 	finish := models.XtDialysisFinish{
8125
 	finish := models.XtDialysisFinish{
8121
 		IsFinish:   1,
8126
 		IsFinish:   1,
8122
 		UserOrgId:  adminInfo.Org.Id,
8127
 		UserOrgId:  adminInfo.Org.Id,

+ 5 - 2
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

3021
 
3021
 
3022
 	patient, _ := service.GetPatientDetailTwo(patient_id)
3022
 	patient, _ := service.GetPatientDetailTwo(patient_id)
3023
 
3023
 
3024
+	referenceList, _ := service.GetInSpctionRerefce(project_id, org_id)
3025
+
3024
 	inspection, _ := service.GetInspectionGroupByRecordDate(patient.BloodId, project_id, org_id)
3026
 	inspection, _ := service.GetInspectionGroupByRecordDate(patient.BloodId, project_id, org_id)
3025
 
3027
 
3026
 	if len(inspection) > 0 {
3028
 	if len(inspection) > 0 {
3035
 	patients, _ := service.GetPatientByIDOne(org_id, patient.BloodId)
3037
 	patients, _ := service.GetPatientByIDOne(org_id, patient.BloodId)
3036
 
3038
 
3037
 	this.ServeSuccessJSON(map[string]interface{}{
3039
 	this.ServeSuccessJSON(map[string]interface{}{
3038
-		"inspection": inspection,
3039
-		"patients":   patients,
3040
+		"inspection":    inspection,
3041
+		"patients":      patients,
3042
+		"referenceList": referenceList,
3040
 	})
3043
 	})
3041
 }
3044
 }

+ 7 - 0
service/dialysis_service.go 查看文件

2499
 
2499
 
2500
 	return advice, err
2500
 	return advice, err
2501
 }
2501
 }
2502
+
2503
+func GetHistoryWarehouseOutInfo(patient_id int64, user_org_id int64, record_time int64) (outInfo []*models.WarehouseOutInfo, err error) {
2504
+
2505
+	err = XTReadDB().Where("patient_id = ? and user_org_id = ? and sys_record_time = ? and status =1", patient_id, user_org_id, record_time).Find(&outInfo).Error
2506
+
2507
+	return outInfo, err
2508
+}

+ 6 - 0
service/inspection_service.go 查看文件

396
 
396
 
397
 }
397
 }
398
 
398
 
399
+func GetInSpctionRerefce(project_id int64, user_org_id int64) (inspct []*models.InspectionReference, err error) {
400
+
401
+	err = XTReadDB().Where("project_id = ? and (org_id = ? or org_id=0) and status =1", project_id, user_org_id).Find(&inspct).Error
402
+	return inspct, err
403
+}
404
+
399
 func GetInspectionGroupByRecordDate(patient_id int64, project_id int64, org_id int64) (inspetion []*models.Inspection, err error) {
405
 func GetInspectionGroupByRecordDate(patient_id int64, project_id int64, org_id int64) (inspetion []*models.Inspection, err error) {
400
 
406
 
401
 	err = XTReadDB().Where("patient_id = ? and project_id = ? and org_id = ? and status=1", patient_id, project_id, org_id).Order("inspect_date asc").Limit(10).Group("inspect_date").Find(&inspetion).Error
407
 	err = XTReadDB().Where("patient_id = ? and project_id = ? and org_id = ? and status=1", patient_id, project_id, org_id).Order("inspect_date asc").Limit(10).Group("inspect_date").Find(&inspetion).Error