瀏覽代碼

2024/6/17

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

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

@@ -8107,16 +8107,21 @@ func (c *DialysisAPIController) CreateOtherStockOutInfo() {
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 8125
 	finish := models.XtDialysisFinish{
8121 8126
 		IsFinish:   1,
8122 8127
 		UserOrgId:  adminInfo.Org.Id,

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

@@ -3021,6 +3021,8 @@ func (this *NewDialysisApiController) GetInspectionByProject() {
3021 3021
 
3022 3022
 	patient, _ := service.GetPatientDetailTwo(patient_id)
3023 3023
 
3024
+	referenceList, _ := service.GetInSpctionRerefce(project_id, org_id)
3025
+
3024 3026
 	inspection, _ := service.GetInspectionGroupByRecordDate(patient.BloodId, project_id, org_id)
3025 3027
 
3026 3028
 	if len(inspection) > 0 {
@@ -3035,7 +3037,8 @@ func (this *NewDialysisApiController) GetInspectionByProject() {
3035 3037
 	patients, _ := service.GetPatientByIDOne(org_id, patient.BloodId)
3036 3038
 
3037 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,3 +2499,10 @@ func GetAllAdviceList(patient_id int64, advice_date int64, user_org_id int64) (a
2499 2499
 
2500 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,6 +396,12 @@ func GetInspectionByProjectId(patient_id int64, org_id int64, project_id int64)
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 405
 func GetInspectionGroupByRecordDate(patient_id int64, project_id int64, org_id int64) (inspetion []*models.Inspection, err error) {
400 406
 
401 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