28169 il y a 2 semaines
Parent
révision
88dfb56f09

BIN
XT_New.exe Voir le fichier


+ 4 - 4
controllers/base_api_controller.go Voir le fichier

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10028 //机构id
86
+		subscibe.OrgId = 10644 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10028 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10644 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 12123 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10028 //机构id小英9675或4
332
+		subscibe.OrgId = 10644 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10028 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10644 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 12123 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 5 - 5
controllers/dialysis_api_controller.go Voir le fichier

@@ -2331,7 +2331,7 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
2331 2331
 	patient, _ := c.GetInt64("patient", 0)
2332 2332
 	recordDateStr := c.GetString("record_date")
2333 2333
 	record_time := c.GetString("record_time")
2334
-	fmt.Println(recordDateStr)
2334
+
2335 2335
 	if patient <= 0 {
2336 2336
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
2337 2337
 		return
@@ -2355,8 +2355,6 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
2355 2355
 
2356 2356
 	startDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", record_time)
2357 2357
 
2358
-	fmt.Println("startDate0000000000000000000000000000", startDate.Unix())
2359
-
2360 2358
 	// data := make(map[string]interface{}, 0)
2361 2359
 	var data models.AssessmentAfterDislysis
2362 2360
 	var err error
@@ -5884,8 +5882,10 @@ func (this *DialysisApiController) GetTodayMonitor() {
5884 5882
 			}
5885 5883
 
5886 5884
 			if adminInfo.CurrentOrgId == 10735 {
5887
-				ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
5888
-				record.UltrafiltrationVolume = ultrafiltration_volume / 2
5885
+
5886
+				ultrafiltration_volume := math.Floor(float64(record.OperateTime+1800-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
5887
+				record.UltrafiltrationVolume = ultrafiltration_volume
5888
+
5889 5889
 			}
5890 5890
 
5891 5891
 		}

+ 1 - 1
controllers/dialysis_record_api_controller.go Voir le fichier

@@ -1842,7 +1842,7 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1842 1842
 		service.CreateDialysisFinish(finishS)
1843 1843
 	}
1844 1844
 
1845
-	if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10340 || adminUserInfo.CurrentOrgId == 10414 || adminUserInfo.CurrentOrgId == 10432 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 9829 || adminUserInfo.CurrentOrgId == 10440 {
1845
+	if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10340 || adminUserInfo.CurrentOrgId == 10414 || adminUserInfo.CurrentOrgId == 10432 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 9829 || adminUserInfo.CurrentOrgId == 10440 || adminUserInfo.CurrentOrgId == 10735 {
1846 1846
 
1847 1847
 		evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1848 1848
 		if evaluation.SystolicBloodPressure == 0 {

+ 13 - 3
controllers/drug_stock_api_contorller.go Voir le fichier

@@ -1180,7 +1180,12 @@ func (c *StockDrugApiController) CreateDrugWarehouseOut() {
1180 1180
 	}
1181 1181
 
1182 1182
 	if warehouse_out_id == 0 {
1183
-		service.AddSigleDrugWarehouseOut(&warehouseOut)
1183
+		//查询是否生成出库单
1184
+		outIsExit, _ := service.GetDrugWarehouseOutIsExit(adminUserInfo.CurrentOrgId, 0, operation_time, warehousing_out_order)
1185
+		if outIsExit.ID == 0 {
1186
+			service.AddSigleDrugWarehouseOut(&warehouseOut)
1187
+		}
1188
+
1184 1189
 	}
1185 1190
 	if warehouse_out_id > 0 {
1186 1191
 		service.UpdateSingleDrugWarehouseOut(warehouse_out_id, storehouse_id)
@@ -1329,8 +1334,13 @@ func (c *StockDrugApiController) CreateDrugWarehouseOut() {
1329 1334
 	//调用出库逻辑
1330 1335
 	for _, item := range warehousingOutInfo {
1331 1336
 		if item.ID == 0 {
1332
-			errOne := service.AddSigleDrugWarehouseOutInfo(item)
1333
-			fmt.Println(errOne)
1337
+			//查询改耗材是否出库
1338
+			outInfo, _ := service.GetDrugsIsExsit(item.DrugId, item.SysRecordTime, item.OrgId, lastWarehouseOut.ID)
1339
+			if outInfo.ID == 0 {
1340
+				errOne := service.AddSigleDrugWarehouseOutInfo(item)
1341
+				fmt.Println(errOne)
1342
+			}
1343
+
1334 1344
 		}
1335 1345
 		if item.ID > 0 {
1336 1346
 			service.UpdatedDrugWarehouseInfo(item, item.ID)

+ 1 - 1
controllers/his_api_controller.go Voir le fichier

@@ -3390,7 +3390,7 @@ func (c *HisApiController) CreateHisPrescription() {
3390 3390
 	var adviceList []models.HisDoctorAdviceInfo
3391 3391
 	var projectList []models.HisPrescriptionProject
3392 3392
 
3393
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10635 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 || adminInfo.CurrentOrgId == 10721 || adminInfo.CurrentOrgId == 10726 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10571 || adminInfo.CurrentOrgId == 10724 || adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10653 {
3393
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10635 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 || adminInfo.CurrentOrgId == 10721 || adminInfo.CurrentOrgId == 10726 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10571 || adminInfo.CurrentOrgId == 10724 || adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10653 || adminInfo.CurrentOrgId == 10567 {
3394 3394
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3395 3395
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3396 3396
 

+ 1 - 1
controllers/mobile_api_controllers/check_weight_api_controller.go Voir le fichier

@@ -985,7 +985,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
985 985
 		}
986 986
 
987 987
 		//针对古镇乐生
988
-		if adminUserInfo.Org.Id == 10727 || adminUserInfo.Org.Id == 10731 {
988
+		if adminUserInfo.Org.Id == 10731 {
989 989
 
990 990
 			dewater_amount = (evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight) * 1000
991 991
 			lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)

+ 31 - 4
controllers/mobile_api_controllers/dialysis_api_controller.go Voir le fichier

@@ -3047,7 +3047,7 @@ func (c *DialysisAPIController) Finish() {
3047 3047
 
3048 3048
 	}
3049 3049
 
3050
-	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10440 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 10693 || adminUserInfo.Org.Id == 10702 {
3050
+	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10440 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 10693 || adminUserInfo.Org.Id == 10702 || adminUserInfo.Org.Id == 10735 {
3051 3051
 		evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
3052 3052
 
3053 3053
 		if adminUserInfo.Org.Id != 10702 {
@@ -3189,6 +3189,12 @@ func (c *DialysisAPIController) Finish() {
3189 3189
 		tempassessmentAfterDislysis.Temperature = endmonitorRecords.Temperature
3190 3190
 		tempassessmentAfterDislysis.BreathingRate = endmonitorRecords.BreathingRate
3191 3191
 	}
3192
+	if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10735 {
3193
+		tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
3194
+		tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
3195
+		tempassessmentAfterDislysis.Temperature = endmonitorRecords.Temperature
3196
+		tempassessmentAfterDislysis.BreathingRate = endmonitorRecords.BreathingRate
3197
+	}
3192 3198
 
3193 3199
 	if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10598 {
3194 3200
 		tempassessmentAfterDislysis.SystolicBloodPressure = 0
@@ -4188,6 +4194,16 @@ func (this *DialysisAPIController) StartDialysis() {
4188 4194
 			record.BloodFlowVolume = prescription.BloodFlowVolume
4189 4195
 		}
4190 4196
 
4197
+		//胶州少海医院
4198
+		if adminUserInfo.Org.Id == 10735 {
4199
+			befor, _ := service.GetAssessmentBeforThrity(adminUserInfo.Org.Id, patientID, recordDate.Unix())
4200
+			dialysisPrescription, _ := service.GetDialysisPrescription(patientID, adminUserInfo.Org.Id, recordDate.Unix())
4201
+			record.BreathingRate = befor.BreathingRate
4202
+			record.BloodFlowVolume = dialysisPrescription.BloodFlowVolume
4203
+			record.Temperature = befor.Temperature
4204
+			record.PulseFrequency = befor.PulseFrequency
4205
+		}
4206
+
4191 4207
 		if adminUserInfo.Org.Id != 10683 {
4192 4208
 			err = service.CreateMonitor(&record)
4193 4209
 		}
@@ -5269,7 +5285,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
5269 5285
 
5270 5286
 			if adminInfo.Org.Id == 10206 {
5271 5287
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 1000 / float64(totalMin) * 60 * 1000)
5272
-				fmt.Println("ultrafiltration_rate------------------", ultrafiltration_rate)
5288
+
5273 5289
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
5274 5290
 			}
5275 5291
 			//if template.TemplateId == 47 {
@@ -5298,8 +5314,19 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
5298 5314
 			}
5299 5315
 			//胶州少海医院
5300 5316
 			if adminInfo.Org.Id == 10735 {
5301
-				ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
5302
-				record.UltrafiltrationVolume = ultrafiltration_volume / 2
5317
+
5318
+				lastMonitorRecordList, _ := service.GetLastMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
5319
+				if lastMonitorRecordList.ID > 0 {
5320
+					record.UltrafiltrationRate = lastMonitorRecordList.UltrafiltrationRate
5321
+					ultrafiltration_volume := math.Floor(float64(record.OperateTime+1800-fristrecord.OperateTime) / 3600 * lastMonitorRecordList.UltrafiltrationRate)
5322
+
5323
+					record.UltrafiltrationVolume = ultrafiltration_volume
5324
+				} else {
5325
+					ultrafiltration_volume := math.Floor(float64(record.OperateTime+1800-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
5326
+
5327
+					record.UltrafiltrationVolume = ultrafiltration_volume
5328
+				}
5329
+
5303 5330
 			}
5304 5331
 
5305 5332
 		}

+ 11 - 0
controllers/mobile_api_controllers/patient_api_controller.go Voir le fichier

@@ -4301,6 +4301,17 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
4301 4301
 
4302 4302
 	}
4303 4303
 
4304
+	//揭阳
4305
+	if adminUserInfo.Org.Id == 10597 {
4306
+		if evaluation.ID == 0 {
4307
+			dialysisPrescribeOne, _ := service.MobileGetDialysisPrescribeOne(adminUserInfo.Org.Id, id, theAssessmentDateTime)
4308
+			if dialysisPrescribeOne.ID > 0 && evaluation.ID > 0 {
4309
+				dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
4310
+				service.UpdateMobileGetDialysisPrescribe(dialysisPrescribeOne.ID, dewater_amount)
4311
+			}
4312
+		}
4313
+	}
4314
+
4304 4315
 	err = service.UpadatePredialysisEvaluation(&evaluation)
4305 4316
 
4306 4317
 	//记录日志

+ 15 - 9
controllers/patient_api_controller.go Voir le fichier

@@ -4530,7 +4530,7 @@ func (c *PatientApiController) DeleteGroupAdvice() {
4530 4530
 		}
4531 4531
 	}
4532 4532
 
4533
-	err := service.DeleteGroupAdviceOne(adminUserInfo.CurrentOrgId, groupNo, adminUserInfo.AdminUser.Id)
4533
+	err := service.DeleteGroupAdvice(adminUserInfo.CurrentOrgId, groupNo, adminUserInfo.AdminUser.Id)
4534 4534
 
4535 4535
 	byterequest, _ := json.Marshal(advice)
4536 4536
 	doctorAdviceLog := models.XtDoctorAdviceLog{
@@ -8568,6 +8568,10 @@ func (this *PatientApiController) GetAutoPatientContent() {
8568 8568
 	//获取透析处方
8569 8569
 	prescription, _ := service.GetAutoDialysisPrescription(patient_id, startTime, endTime, orgId)
8570 8570
 
8571
+	maxPrescription, _ := service.GetAutoMaxDialysisPrescription(patient_id, startTime, endTime, orgId)
8572
+
8573
+	minPrescription, _ := service.GetAutoMinDialysisPrescription(patient_id, startTime, endTime, orgId)
8574
+
8571 8575
 	berfor, _ := service.GetAutoAssessmentBefor(patient_id, startTime, endTime, orgId)
8572 8576
 
8573 8577
 	monitorList, _ := service.GetAutoMonitorList(patient_id, startTime, endTime, orgId)
@@ -8583,14 +8587,16 @@ func (this *PatientApiController) GetAutoPatientContent() {
8583 8587
 	longAdvice, _ := service.GetLongDoctorAdvice(orgId, patient_id, startTime, endTime)
8584 8588
 
8585 8589
 	this.ServeSuccessJSON(map[string]interface{}{
8586
-		"prescription":  prescription,
8587
-		"berfor":        berfor,
8588
-		"monitorList":   monitorList,
8589
-		"dryweightList": dryweightList,
8590
-		"inpectionList": inpectionList,
8591
-		"dialysisOrder": dialysisOrder,
8592
-		"patient":       patient,
8593
-		"longAdvice":    longAdvice,
8590
+		"prescription":    prescription,
8591
+		"berfor":          berfor,
8592
+		"monitorList":     monitorList,
8593
+		"dryweightList":   dryweightList,
8594
+		"inpectionList":   inpectionList,
8595
+		"dialysisOrder":   dialysisOrder,
8596
+		"patient":         patient,
8597
+		"longAdvice":      longAdvice,
8598
+		"maxPrescription": maxPrescription,
8599
+		"minPrescription": minPrescription,
8594 8600
 	})
8595 8601
 
8596 8602
 }

+ 0 - 5
controllers/self_drug_api_congtroller.go Voir le fichier

@@ -3880,10 +3880,6 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3880 3880
 	}
3881 3881
 	var ids []int64
3882 3882
 	var goodIds []int64
3883
-	//infoList, _ := service.GetGoodWarehouseInfoByOrgIdTwo(orgId)
3884
-	//for _, it := range infoList {
3885
-	//	goodIds = append(goodIds, it.GoodId)
3886
-	//}
3887 3883
 
3888 3884
 	if len(keyword) > 0 {
3889 3885
 		manufacturers, _ := service.GetManufacturerListByKeyword(orgId, keyword)
@@ -4034,7 +4030,6 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
4034 4030
 			//期间减少
4035 4031
 			banceOutList, _ := service.GetInitOutBanceList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
4036 4032
 
4037
-			//banceOutList, _ := service.GetInitOutBanceTenty(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
4038 4033
 			for _, it := range banceOutList {
4039 4034
 				item.WarehouseOutInfoTenty = append(item.WarehouseOutInfoTenty, it)
4040 4035
 			}

+ 0 - 1
models/new_stock_models.go Voir le fichier

@@ -242,7 +242,6 @@ type VmStockFlowTwenty struct {
242 242
 	Price               float64            `gorm:"column:price" json:"price" form:"price"`
243 243
 	WarehousingDetailId int64              `gorm:"column:warehousing_detail_id" json:"warehousing_detail_id" form:"warehousing_detail_id"`
244 244
 	BuyPrice            float64            `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
245
-	IsRead              int64              `gorm:"column:is_read" json:"is_read" form:"is_read"`
246 245
 	OverCount           int64              `gorm:"column:over_count" json:"over_count" form:"over_count"`
247 246
 	Ctime               int64              `gorm:"column:ctime" json:"ctime" form:"ctime"`
248 247
 	StorehouseId        int64              `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`

+ 17 - 15
models/stock_models.go Voir le fichier

@@ -115,13 +115,14 @@ func (StWarehousingInfo) TableName() string {
115 115
 }
116 116
 
117 117
 type StWarehousingInfoOne struct {
118
-	ID               int64  `gorm:"column:id" json:"id"`
119
-	GoodId           int64  `gorm:"column:good_id" json:"good_id"`
120
-	WarehousingCount int64  `gorm:"column:warehousing_count" json:"warehousing_count"`
121
-	WarehousingUnit  string `gorm:"column:warehousing_unit" json:"warehousing_unit"`
122
-	PackingUnit      string `json:"packing_unit"`
123
-	StorehouseId     int64  `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
124
-	OrgId            int64  `gorm:"column:org_id" json:"org_id"`
118
+	ID               int64   `gorm:"column:id" json:"id"`
119
+	GoodId           int64   `gorm:"column:good_id" json:"good_id"`
120
+	WarehousingCount int64   `gorm:"column:warehousing_count" json:"warehousing_count"`
121
+	WarehousingUnit  string  `gorm:"column:warehousing_unit" json:"warehousing_unit"`
122
+	PackingUnit      string  `json:"packing_unit"`
123
+	StorehouseId     int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
124
+	OrgId            int64   `gorm:"column:org_id" json:"org_id"`
125
+	Price            float64 `gorm:"column:price" json:"price" form:"price"`
125 126
 }
126 127
 
127 128
 func (StWarehousingInfoOne) TableName() string {
@@ -1731,14 +1732,15 @@ func (WarehousingInfoNight) TableName() string {
1731 1732
 }
1732 1733
 
1733 1734
 type WarehouseOutInfoTenty struct {
1734
-	ID            int64 `gorm:"column:id" json:"id" form:"id"`
1735
-	GoodId        int64 `gorm:"column:good_id" json:"good_id" form:"good_id"`
1736
-	Count         int64 `gorm:"column:count" json:"count" form:"count"`
1737
-	Mtime         int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
1738
-	Ctime         int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
1739
-	Status        int64 `gorm:"column:status" json:"status" form:"status"`
1740
-	OrgId         int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
1741
-	SysRecordTime int64 `gorm:"column:sys_record_time" json:"sys_record_time" form:"sys_record_time"`
1735
+	ID            int64   `gorm:"column:id" json:"id" form:"id"`
1736
+	GoodId        int64   `gorm:"column:good_id" json:"good_id" form:"good_id"`
1737
+	Count         int64   `gorm:"column:count" json:"count" form:"count"`
1738
+	Mtime         int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
1739
+	Ctime         int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
1740
+	Status        int64   `gorm:"column:status" json:"status" form:"status"`
1741
+	OrgId         int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
1742
+	SysRecordTime int64   `gorm:"column:sys_record_time" json:"sys_record_time" form:"sys_record_time"`
1743
+	Price         float64 `gorm:"column:price" json:"price" form:"price"`
1742 1744
 }
1743 1745
 
1744 1746
 func (WarehouseOutInfoTenty) TableName() string {

+ 13 - 0
service/patient_service.go Voir le fichier

@@ -4560,6 +4560,19 @@ func GetAutoDialysisPrescription(patient_id int64, start_time int64, end_time in
4560 4560
 	return prescription, err
4561 4561
 }
4562 4562
 
4563
+func GetAutoMaxDialysisPrescription(patient_id int64, start_time int64, end_time int64, org_id int64) (models.DialysisPrescription, error) {
4564
+
4565
+	prescription := models.DialysisPrescription{}
4566
+	err := XTReadDB().Raw("select MAX(anticoagulant_zongliang) from xt_dialysis_prescripiton where patient_id = ? and record_date>=? and record_date<=? and org_id = ?", patient_id, start_time, end_time, org_id).Scan(&prescription).Error
4567
+	return prescription, err
4568
+}
4569
+
4570
+func GetAutoMinDialysisPrescription(patient_id int64, start_time int64, end_time int64, org_id int64) (models.DialysisPrescription, error) {
4571
+	prescription := models.DialysisPrescription{}
4572
+	err := XTReadDB().Raw("select Min(anticoagulant_zongliang) from xt_dialysis_prescripiton where patient_id = ? and record_date>=? and record_date<=? and org_id = ?", patient_id, start_time, end_time, org_id).Scan(&prescription).Error
4573
+	return prescription, err
4574
+}
4575
+
4563 4576
 func GetAutoAssessmentBefor(patient_id int64, start_time int64, end_time int64, org_id int64) (berfor []*models.XtAssessmentBeforeDislysis, err error) {
4564 4577
 
4565 4578
 	db := XTReadDB().Model(&berfor).Where("status=1")

+ 15 - 0
service/stock_service.go Voir le fichier

@@ -1604,6 +1604,14 @@ func UpdateSingleWarehoseOut(id int64, storehouse_id int64) error {
1604 1604
 	return err
1605 1605
 }
1606 1606
 
1607
+func GetDrugWarehouseOutIsExit(org_id int64, is_sys int, record_time int64, warehousing_out_order string) (models.DrugWarehouseOut, error) {
1608
+
1609
+	drugWarehouseOut := models.DrugWarehouseOut{}
1610
+	err := XTReadDB().Where("is_sys = ? AND status = 1 AND org_id = ? AND warehouse_out_time = ? and warehouse_out_order_number = ?", is_sys, org_id, record_time, warehousing_out_order).Find(&drugWarehouseOut).Error
1611
+
1612
+	return drugWarehouseOut, err
1613
+}
1614
+
1607 1615
 func AddSigleDrugWarehouseOut(warehouseOut *models.DrugWarehouseOut) error {
1608 1616
 	err := writeDb.Create(&warehouseOut).Error
1609 1617
 	return err
@@ -3526,6 +3534,13 @@ func GetGoodsIsExsit(good_id int64, sys_record_time int64, org_id int64, warehou
3526 3534
 	return outInfo, err
3527 3535
 }
3528 3536
 
3537
+func GetDrugsIsExsit(drug_id int64, sys_record_time int64, org_id int64, warehouse_out_id int64) (models.XtDrugWarehouseOutInfo, error) {
3538
+
3539
+	outInfo := models.XtDrugWarehouseOutInfo{}
3540
+	err := XTReadDB().Where("drug_id = ? and sys_record_time = ? and org_id = ? and is_sys =0 and status = 1 and warehouse_out_id = ?", drug_id, sys_record_time, org_id, warehouse_out_id).Find(&outInfo).Error
3541
+	return outInfo, err
3542
+}
3543
+
3529 3544
 func AddSigleWarehouseOutInfo(info *models.WarehouseOutInfo) error {
3530 3545
 
3531 3546
 	err := writeDb.Create(&info).Error