Kaynağa Gözat

历史排班

28169 10 ay önce
ebeveyn
işleme
19968668bf

+ 5 - 5
controllers/base_api_controller.go Dosyayı Görüntüle

@@ -73,7 +73,7 @@ func (this *BaseAuthAPIController) Prepare() {
73 73
 		var userAdmin models.AdminUser
74 74
 		userAdmin.Id = 16919
75 75
 		userAdmin.Mobile = "15717313968"
76
-		userAdmin.Id = 16919 //4,809
76
+		userAdmin.Id = 10612 //4,809
77 77
 		userAdmin.Mobile = "12222222222"
78 78
 		userAdmin.IsSuperAdmin = true
79 79
 		userAdmin.Status = 1
@@ -81,7 +81,7 @@ func (this *BaseAuthAPIController) Prepare() {
81 81
 		userAdmin.ModifyTime = 1530786071
82 82
 		var subscibe models.ServeSubscibe
83 83
 		subscibe.ID = 11
84
-		subscibe.OrgId = 10612 //机构id 10344
84
+		subscibe.OrgId = 10460 //机构id 10344
85 85
 		subscibe.PeriodStart = 1547447814
86 86
 		subscibe.PeriodEnd = 1550039814
87 87
 		subscibe.State = 1
@@ -91,7 +91,7 @@ func (this *BaseAuthAPIController) Prepare() {
91 91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
92 92
 		subscibes[4] = &subscibe
93 93
 		var adminUserInfo service.AdminUserInfo
94
-		adminUserInfo.CurrentOrgId = 10612 //机构id小英9675或4
94
+		adminUserInfo.CurrentOrgId = 10460 //机构id小英9675或4
95 95
 		adminUserInfo.CurrentAppId = 17282 //4
96 96
 		adminUserInfo.AdminUser = &userAdmin
97 97
 		adminUserInfo.Subscibes = subscibes
@@ -326,7 +326,7 @@ func (this *BaseServeAPIController) Prepare() {
326 326
 		userAdmin.ModifyTime = 1530786071
327 327
 		var subscibe models.ServeSubscibe
328 328
 		subscibe.ID = 11
329
-		subscibe.OrgId = 10612 //机构id小英10344或4
329
+		subscibe.OrgId = 10460 //机构id小英10344或4
330 330
 		subscibe.PeriodStart = 1538035409
331 331
 		subscibe.PeriodEnd = 1569571409
332 332
 		subscibe.State = 1
@@ -336,7 +336,7 @@ func (this *BaseServeAPIController) Prepare() {
336 336
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
337 337
 		subscibes[4] = &subscibe
338 338
 		var adminUserInfo service.AdminUserInfo
339
-		adminUserInfo.CurrentOrgId = 10612 //机构id小英9675或4
339
+		adminUserInfo.CurrentOrgId = 10460 //机构id小英9675或4
340 340
 		adminUserInfo.CurrentAppId = 17282 //4
341 341
 		adminUserInfo.AdminUser = &userAdmin
342 342
 		adminUserInfo.Subscibes = subscibes

+ 1 - 0
controllers/dialysis_api_controller.go Dosyayı Görüntüle

@@ -2149,6 +2149,7 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
2149 2149
 	assessment.AccumulatedBloodVolume = data.AccumulatedBloodVolume
2150 2150
 	assessment.TransfusionVolume = data.TransfusionVolume
2151 2151
 	assessment.Condenser = data.Condenser
2152
+	assessment.LastAfterWeight = data.LastAfterWeight
2152 2153
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
2153 2154
 
2154 2155
 	if assessment.ID > 0 {

+ 12 - 2
controllers/doctor_schedule_api_controller.go Dosyayı Görüntüle

@@ -38,6 +38,8 @@ func DoctorScheduleRouters() {
38 38
 	beego.Router("/api/schedule/changeoption", &DoctorScheduleApiController{}, "Get:ChangeOption")
39 39
 	beego.Router("/api/schedule/getchartlist", &DoctorScheduleApiController{}, "Get:GetChartlist")
40 40
 
41
+	beego.Router("/api/deletestaffschedulebyid", &DoctorScheduleApiController{}, "Get:DeleteStaffScheduleById")
42
+
41 43
 }
42 44
 
43 45
 func (this *DoctorScheduleApiController) SaveDoctorSchedules() {
@@ -335,9 +337,7 @@ func (this *DoctorScheduleApiController) AddSchedule() {
335 337
 func (this *DoctorScheduleApiController) GetStaffScheduleList() {
336 338
 
337 339
 	start_time, _ := this.GetInt64("start_time")
338
-	fmt.Println("start_time", start_time)
339 340
 	end_time, _ := this.GetInt64("end_time")
340
-	fmt.Println("end_time", end_time)
341 341
 	orgId := this.GetAdminUserInfo().CurrentOrgId
342 342
 	staffList, err := service.GetStaffScheduleList(orgId, start_time, end_time)
343 343
 	if err != nil {
@@ -656,3 +656,13 @@ func (this *DoctorScheduleApiController) GetChartlist() {
656 656
 		"workDaylist": workDaylist,
657 657
 	})
658 658
 }
659
+
660
+func (this *DoctorScheduleApiController) DeleteStaffScheduleById() {
661
+
662
+	id, _ := this.GetInt64("id")
663
+	orgId := this.GetAdminUserInfo().CurrentOrgId
664
+	service.DeleteStaffScheduleById(id, orgId)
665
+	this.ServeSuccessJSON(map[string]interface{}{
666
+		"msg": "ok",
667
+	})
668
+}

+ 8 - 8
controllers/inspection_api_controller.go Dosyayı Görüntüle

@@ -152,17 +152,17 @@ func (c *InspectionApiController) PatientInspectionReference() {
152 152
 	referenceMap := make(map[string]*models.InspectionReferenceMap, 0)
153 153
 
154 154
 	for _, reference := range references {
155
-		if _, exist := referenceMap[reference.Project]; !exist {
156
-			referenceMap[reference.Project] = new(models.InspectionReferenceMap)
157
-			referenceMap[reference.Project].Project = reference.Project
158
-			referenceMap[reference.Project].ProjectId = reference.ProjectId
159
-			referenceMap[reference.Project].ProjectName = reference.ProjectName
155
+		if _, exist := referenceMap[reference.ProjectName]; !exist {
156
+			referenceMap[reference.ProjectName] = new(models.InspectionReferenceMap)
157
+			referenceMap[reference.ProjectName].Project = reference.Project
158
+			referenceMap[reference.ProjectName].ProjectId = reference.ProjectId
159
+			referenceMap[reference.ProjectName].ProjectName = reference.ProjectName
160 160
 			if _, cexit := countsMap[reference.ProjectId]; cexit {
161
-				referenceMap[reference.Project].Count = countsMap[reference.ProjectId]
161
+				referenceMap[reference.ProjectName].Count = countsMap[reference.ProjectId]
162 162
 			}
163
-			referenceMap[reference.Project].InspectionReference = make([]models.InspectionReference, 0)
163
+			referenceMap[reference.ProjectName].InspectionReference = make([]models.InspectionReference, 0)
164 164
 		}
165
-		referenceMap[reference.Project].InspectionReference = append(referenceMap[reference.Project].InspectionReference, *reference)
165
+		referenceMap[reference.ProjectName].InspectionReference = append(referenceMap[reference.ProjectName].InspectionReference, *reference)
166 166
 
167 167
 	}
168 168
 

+ 34 - 2
controllers/mobile_api_controllers/check_weight_api_controller.go Dosyayı Görüntüle

@@ -545,8 +545,21 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
545 545
 					lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)
546 546
 					newprescribe.Remark = lastDialysisPrescription.Remark
547 547
 				}
548
-				err := service.AddSigleRecord(&newprescribe)
549
-
548
+				//err := service.AddSigleRecord(&newprescribe)
549
+				var err error
550
+				if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 10599 {
551
+					prescriptionTwenty, _ := service.GetLastDialysisPrescriptionTwenty(newprescribe.PatientId, newprescribe.RecordDate, newprescribe.UserOrgId)
552
+					if prescriptionTwenty.ID == 0 {
553
+						//插入透析处方
554
+						service.AddSigleRecord(&newprescribe)
555
+					} else {
556
+						//插入透析处方
557
+						service.UpdateAddSigleRecord(prescriptionTwenty.ID, newprescribe.TargetUltrafiltration)
558
+					}
559
+				} else {
560
+					//插入透析处方
561
+					err = service.AddSigleRecord(&newprescribe)
562
+				}
550 563
 				//记录日志
551 564
 				byterequest, _ := json.Marshal(newprescribe)
552 565
 				prescriptionLog := models.XtDialysisPrescriptionLog{
@@ -1246,42 +1259,61 @@ func (c *CheckWeightApiController) GetPatientInfoDialysis() {
1246 1259
 	switch sc["mode"] {
1247 1260
 	case 1:
1248 1261
 		sc["mode"] = "HD"
1262
+		break
1249 1263
 	case 2:
1250 1264
 		sc["mode"] = "HDF"
1265
+		break
1251 1266
 	case 3:
1252 1267
 		sc["mode"] = "HD+HP"
1268
+		break
1253 1269
 	case 4:
1254 1270
 		sc["mode"] = "HP"
1271
+		break
1255 1272
 	case 5:
1256 1273
 		sc["mode"] = "HF"
1274
+		break
1257 1275
 	case 6:
1258 1276
 		sc["mode"] = "SCUF"
1277
+		break
1259 1278
 	case 7:
1260 1279
 		sc["mode"] = "IUF"
1280
+		break
1261 1281
 	case 8:
1262 1282
 		sc["mode"] = "HFHD"
1283
+		break
1263 1284
 	case 9:
1264 1285
 		sc["mode"] = "HFHD+HP"
1286
+		break
1265 1287
 	case 10:
1266 1288
 		sc["mode"] = "PHF"
1289
+		break
1267 1290
 	case 11:
1268 1291
 		sc["mode"] = "HFR"
1292
+		break
1269 1293
 	case 12:
1270 1294
 		sc["mode"] = "HDF+HP"
1295
+		break
1271 1296
 	case 13:
1272 1297
 		sc["mode"] = "CRRT"
1298
+		break
1273 1299
 	case 14:
1274 1300
 		sc["mode"] = "腹水回输"
1301
+		break
1275 1302
 	case 15:
1276 1303
 		sc["mode"] = "HD前置换"
1304
+		break
1277 1305
 	case 16:
1278 1306
 		sc["mode"] = "HD后置换"
1307
+		break
1279 1308
 	case 17:
1280 1309
 		sc["mode"] = "HDF前置换"
1310
+		break
1281 1311
 	case 18:
1282 1312
 		sc["mode"] = "HDF后置换"
1313
+		break
1283 1314
 	default:
1284 1315
 		sc["mode"] = "HD"
1316
+		break
1285 1317
 	}
1286 1318
 
1287 1319
 	// 获取患者透前干体重或者获取患者透前体重

+ 18 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go Dosyayı Görüntüle

@@ -602,6 +602,10 @@ func (this *DialysisAPIController) DialysisRecord() {
602 602
 	}
603 603
 
604 604
 	lastDialysisPrescription, _ := service.GetLastDialysisPrescription(patientID, adminInfo.Org.Id)
605
+
606
+	lastAssesmentBeforDialysis, _ := service.GetLastAssessmentBeforDialysis(patientID, adminInfo.Org.Id)
607
+
608
+	dryWeightList, _ := service.GetPatientDryList(patientID, adminInfo.Org.Id)
605 609
 	returnData := map[string]interface{}{
606 610
 		"patient":                        patient,
607 611
 		"schedual":                       schedual,
@@ -637,6 +641,8 @@ func (this *DialysisAPIController) DialysisRecord() {
637 641
 		"lastOrder":                      lastOrder,
638 642
 		"remind_lists":                   remind_lists,
639 643
 		"lastDialysisPrescription":       lastDialysisPrescription,
644
+		"lastAssesmentBeforDialysis":     lastAssesmentBeforDialysis,
645
+		"dryWeightList":                  dryWeightList,
640 646
 	}
641 647
 
642 648
 	this.ServeSuccessJSON(returnData)
@@ -1390,7 +1396,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
1390 1396
 	pip_coagulation := c.GetString("pip_coagulation")
1391 1397
 	accumulated_blood_volume := c.GetString("accumulated_blood_volume")
1392 1398
 	transfusion_volume := c.GetString("transfusion_volume")
1393
-
1399
+	last_after_weight := c.GetString("last_after_weight")
1394 1400
 	if id <= 0 {
1395 1401
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1396 1402
 		return
@@ -1499,6 +1505,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
1499 1505
 		PipCoagulation:               pip_coagulation,
1500 1506
 		AccumulatedBloodVolume:       accumulated_blood_volume,
1501 1507
 		TransfusionVolume:            transfusion_volume,
1508
+		LastAfterWeight:              last_after_weight,
1502 1509
 	}
1503 1510
 
1504 1511
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
@@ -8300,7 +8307,7 @@ func (c *DialysisAPIController) GetPatientDialysisRecordList() {
8300 8307
 	//	})
8301 8308
 	//	return
8302 8309
 	//}
8303
-	if org_id == 9538 || org_id == 10101 {
8310
+	if org_id == 9538 || org_id == 10101 || org_id == 10353 {
8304 8311
 		list, _ := service.GetPatientDialysisRecordList(id, startdateunix, enddateunix)
8305 8312
 		c.ServeSuccessJSON(map[string]interface{}{
8306 8313
 			"list": list,
@@ -10473,3 +10480,12 @@ func (c *DialysisAPIController) GetAdviceListNoExecution() {
10473 10480
 	})
10474 10481
 
10475 10482
 }
10483
+
10484
+func (c *DialysisAPIController) GetLastAcceptRecrods() {
10485
+
10486
+	patient_id, _ := c.GetInt64("patient_id")
10487
+	recrods, _ := service.GetLastAcceptRecrods(patient_id)
10488
+	c.ServeSuccessJSON(map[string]interface{}{
10489
+		"recrods": recrods,
10490
+	})
10491
+}

+ 2 - 2
controllers/mobile_api_controllers/dialysis_api_controller_extend.go Dosyayı Görüntüle

@@ -684,7 +684,7 @@ func (this *DialysisAPIController) AddUrgentSchedule() {
684 684
 			}
685 685
 
686 686
 			service.CreateScheduleLog(scheduleLog)
687
-
687
+			service.UpdateRepeatSchStatus(adminUserInfo.Org.Id, scheduleDate.Unix())
688 688
 			redis := service.RedisClient()
689 689
 			timeStr := time.Now().Format("2006-01-02")
690 690
 			key := "scheduals_" + timeStr + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
@@ -763,9 +763,9 @@ func (this *DialysisAPIController) AddUrgentSchedule() {
763 763
 						AdminUserId: adminUserInfo.AdminUser.Id,
764 764
 					}
765 765
 					service.CreateScheduleLog(scheduleLog)
766
+					service.UpdateRepeatSchStatus(adminUserInfo.Org.Id, scheduleDate.Unix())
766 767
 
767 768
 					redis := service.RedisClient()
768
-
769 769
 					timeStr := time.Now().Format("2006-01-02")
770 770
 					key := "scheduals_" + timeStr + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
771 771
 					redis.Set(key, "", time.Second)

+ 2 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go Dosyayı Görüntüle

@@ -206,4 +206,6 @@ func MobileAPIControllersRegisterRouters() {
206 206
 
207 207
 	beego.Router("/m/api/getadvicelistnoexecution", &DialysisAPIController{}, "Get:GetAdviceListNoExecution")
208 208
 
209
+	beego.Router("/m/api/getlastacceptrecrods", &DialysisAPIController{}, "Get:GetLastAcceptRecrods")
210
+
209 211
 }

+ 3 - 1
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go Dosyayı Görüntüle

@@ -932,6 +932,7 @@ func (c *StaffScheduleApiController) CreateMobileSchedulePatient() {
932 932
 
933 933
 	redis := service.RedisClient()
934 934
 	err = service.CreateScheduleTwo(&schedule)
935
+	service.UpdateRepeatSchStatus(adminUserInfo.Org.Id, schedule.ScheduleDate)
935 936
 	key := "scheduals_" + scheduleDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
936 937
 	redis.Set(key, "", time.Second)
937 938
 	defer redis.Close()
@@ -1205,7 +1206,7 @@ func (c *StaffScheduleApiController) ChangeScheduleBed() {
1205 1206
 			Module:      4,
1206 1207
 			AdminUserId: c.GetMobileAdminUserInfo().AdminUser.Id,
1207 1208
 		}
1208
-
1209
+		service.UpdateRepeatSchStatus(org_id, schedule_date)
1209 1210
 		service.CreateScheduleLog(scheduleLog)
1210 1211
 		if err == nil {
1211 1212
 			c.ServeSuccessJSON(map[string]interface{}{
@@ -1246,6 +1247,7 @@ func (c *StaffScheduleApiController) ChangeScheduleBed() {
1246 1247
 		}
1247 1248
 		var err error
1248 1249
 		err = service.CreateSchedule(&xtSchedule, id)
1250
+		service.UpdateRepeatSchStatus(org_id, schedule_date)
1249 1251
 		//记录日志
1250 1252
 		byterequest, _ := json.Marshal(schedule)
1251 1253
 		scheduleLog := models.XtScheduleLog{

+ 120 - 0
controllers/self_drug_api_congtroller.go Dosyayı Görüntüle

@@ -120,6 +120,8 @@ func SelfDrugRouters() {
120 120
 
121 121
 	//康允新版本
122 122
 	beego.Router("/api/stock/getpurchaseDrugQueryList", &SelfDrugApiController{}, "Get:GetPurchaseDrugQueryList")
123
+
124
+	beego.Router("/api/stock/getpurchasestockquerylist", &SelfDrugApiController{}, "Get:GetPurchaseStockQueryList")
123 125
 }
124 126
 
125 127
 func (this *SelfDrugApiController) GetCurrentPatient() {
@@ -4255,3 +4257,121 @@ func (this *SelfDrugApiController) GetPurchaseDrugQueryList() {
4255 4257
 		"drugTypeList":     drugTypeList,
4256 4258
 	})
4257 4259
 }
4260
+
4261
+func (this *SelfDrugApiController) GetPurchaseStockQueryList() {
4262
+
4263
+	good_type, _ := this.GetInt64("good_type")
4264
+
4265
+	keyword := this.GetString("keyword")
4266
+
4267
+	page, _ := this.GetInt64("page")
4268
+
4269
+	limit, _ := this.GetInt64("limit")
4270
+
4271
+	start_time := this.GetString("start_time")
4272
+	end_time := this.GetString("end_time")
4273
+	orgId := this.GetAdminUserInfo().CurrentOrgId
4274
+	timeLayout := "2006-01-02"
4275
+	loc, _ := time.LoadLocation("Local")
4276
+	var startTime int64
4277
+
4278
+	if len(start_time) > 0 {
4279
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
4280
+		if err != nil {
4281
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
4282
+			return
4283
+		}
4284
+		startTime = theTime.Unix()
4285
+	}
4286
+
4287
+	var endTime int64
4288
+	if len(end_time) > 0 {
4289
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
4290
+		if err != nil {
4291
+			utils.ErrorLog(err.Error())
4292
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
4293
+			return
4294
+		}
4295
+		endTime = theTime.Unix()
4296
+	}
4297
+	var ids []int64
4298
+	var goodIds []int64
4299
+	infoList, _ := service.GetGoodWarehouseInfoByOrgIdTwo(orgId)
4300
+	for _, it := range infoList {
4301
+		goodIds = append(goodIds, it.GoodId)
4302
+	}
4303
+
4304
+	manufacturers, _ := service.GetManufacturerListByKeyword(orgId, keyword)
4305
+	for _, it := range manufacturers {
4306
+		ids = append(ids, it.ID)
4307
+	}
4308
+	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
4309
+
4310
+	list, total, err := service.GetPurchaseStockQueryList(good_type, keyword, page, limit, orgId, ids, goodIds)
4311
+	storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
4312
+	for _, item := range list {
4313
+
4314
+		//获取期初结余
4315
+		low, _ := service.GetStartLastFLow(item.ID, orgId, startTime, storeConfig.StorehouseOutInfo)
4316
+
4317
+		item.GoodStartFlowInfo = low
4318
+
4319
+		//获取期末结余
4320
+		flow, _ := service.GetEndLastFlow(item.ID, orgId, endTime, storeConfig.StorehouseOutInfo)
4321
+
4322
+		item.GoodEndFlowInfo = flow
4323
+
4324
+		//获取期间增加
4325
+		goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
4326
+
4327
+		for _, it := range goodWarehouseInfoList {
4328
+			item.WarehousingInfoOne = append(item.WarehousingInfoOne, it)
4329
+		}
4330
+
4331
+		//获取本期增加
4332
+		WarehouseInfoFlowList, _ := service.GetAddStartFlow(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
4333
+
4334
+		for _, it := range WarehouseInfoFlowList {
4335
+			item.StartFlowWarehouseInfo = append(item.StartFlowWarehouseInfo, it)
4336
+		}
4337
+		//获取本期减少
4338
+		reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
4339
+		for _, it := range reduceWarehouseInfoList {
4340
+			item.WarehouseOutInfoStart = append(item.WarehouseOutInfoStart, it)
4341
+		}
4342
+
4343
+		//获取期中减少退库
4344
+		lowInfo, _ := service.GetStartEndCancelFLowInfo(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
4345
+		for _, it := range lowInfo {
4346
+			item.StartEndCancelFLowInfo = append(item.StartEndCancelFLowInfo, it)
4347
+		}
4348
+		//
4349
+		outInfo, _ := service.FindeWarehouseOutInfo(item.ID, orgId, startTime, storeConfig.StorehouseOutInfo)
4350
+		for _, it := range outInfo {
4351
+			item.WarehouseOutInfoEnd = append(item.WarehouseOutInfoEnd, it)
4352
+		}
4353
+
4354
+		//期中盘盈
4355
+		profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
4356
+		for _, it := range profit {
4357
+			item.WareStartEndStockInventoryProfit = append(item.WareStartEndStockInventoryProfit, it)
4358
+		}
4359
+		//期中盘亏
4360
+		losses, _ := service.FindeEndStockInventoryLosses(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
4361
+		for _, it := range losses {
4362
+			item.WareStartEndStockInventoryLosses = append(item.WareStartEndStockInventoryLosses, it)
4363
+		}
4364
+	}
4365
+
4366
+	if err != nil {
4367
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取患者信息失败")
4368
+		return
4369
+	}
4370
+
4371
+	this.ServeSuccessJSON(map[string]interface{}{
4372
+		"list":             list,
4373
+		"manufacturerList": manufacturerList,
4374
+		"total":            total,
4375
+	})
4376
+
4377
+}

+ 1 - 0
models/dialysis.go Dosyayı Görüntüle

@@ -657,6 +657,7 @@ type AssessmentAfterDislysis struct {
657 657
 	AccumulatedBloodVolume          string  `gorm:"column:accumulated_blood_volume" json:"accumulated_blood_volume" form:"accumulated_blood_volume"`
658 658
 	TransfusionVolume               string  `gorm:"column:transfusion_volume" json:"transfusion_volume" form:"transfusion_volume"`
659 659
 	Condenser                       string  `gorm:"column:condenser" json:"condenser" form:"condenser"`
660
+	LastAfterWeight                 string  `gorm:"column:last_after_weight" json:"last_after_weight" form:"last_after_weight"`
660 661
 }
661 662
 
662 663
 func (AssessmentAfterDislysis) TableName() string {

+ 1 - 0
models/drug_stock.go Dosyayı Görüntüle

@@ -456,6 +456,7 @@ type DrugFlow struct {
456 456
 	XtDrugWarehouseOutInfo    XtDrugWarehouseOutInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseOutDetailId"json:"xt_drug_warehouse_out_info" `
457 457
 	OrderId                   int64                  `gorm:"column:order_id" json:"order_id" form:"order_id"`
458 458
 	FlushOverCount            int64                  `gorm:"column:flush_over_count" json:"flush_over_count" form:"flush_over_count"`
459
+	Remark                    string                 `gorm:"column:remark" json:"remark" form:"remark"`
459 460
 }
460 461
 
461 462
 func (DrugFlow) TableName() string {

+ 1 - 0
models/stock_models.go Dosyayı Görüntüle

@@ -678,6 +678,7 @@ type VmStockFlow struct {
678 678
 	IsCheck                   int64           `gorm:"column:is_check" json:"is_check" form:"is_check"`
679 679
 	OverCount                 int64           `gorm:"column:over_count" json:"over_count" form:"over_count"`
680 680
 	OrderId                   int64           `gorm:"column:order_id" json:"order_id" form:"order_id"`
681
+	Remark                    string          `gorm:"column:remark" json:"remark" form:"remark"`
681 682
 }
682 683
 
683 684
 func (VmStockFlow) TableName() string {

+ 6 - 0
service/dialysis_parameter_service.go Dosyayı Görüntüle

@@ -332,6 +332,12 @@ func GetLastAssessmentBeforDialysis(patientid int64, orgid int64) (models.Predia
332 332
 	return evaluation, err
333 333
 }
334 334
 
335
+func GetPatientDryList(patientid int64, orgid int64) (dryweight []*models.SgjPatientDryweight, err error) {
336
+
337
+	err = XTReadDB().Where("patient_id =? and user_org_id =? and status=1", patientid, orgid).Order("ctime desc").Limit(6).Find(&dryweight).Error
338
+	return dryweight, err
339
+}
340
+
335 341
 func GetDialysisPrescriptionList(patientid int64, orgid int64, startime int64) (models.DialysisPrescriptionParameter, error) {
336 342
 	prescription := models.DialysisPrescriptionParameter{}
337 343
 	err := XTReadDB().Model(&prescription).Where("patient_id = ? and user_org_id = ? and status = 1 and record_date = ?", patientid, orgid, startime).Find(&prescription).Error

+ 1 - 1
service/dialysis_service.go Dosyayı Görüntüle

@@ -224,7 +224,7 @@ func AddSigleRecord(prescription *models.DialysisPrescription) (err error) {
224 224
 
225 225
 func UpdateAddSigleRecord(id int64, target_ultrafiltration float64) error {
226 226
 
227
-	err := XTWriteDB().Model(&models.DialysisPrescription{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"target_ultrafiltration": target_ultrafiltration}).Error
227
+	err := XTWriteDB().Model(&models.DialysisPrescription{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"target_ultrafiltration": target_ultrafiltration, "prescription_water": target_ultrafiltration}).Error
228 228
 	return err
229 229
 }
230 230
 

+ 8 - 0
service/doctor_schedule_service.go Dosyayı Görüntüle

@@ -818,3 +818,11 @@ func GetMobileScheduleListByScheduleDate(org_id int64, schedule_date int64) (sch
818 818
 
819 819
 	return schedule, err
820 820
 }
821
+
822
+func DeleteStaffScheduleById(id int64, user_org_id int64) (err error) {
823
+
824
+	schedule := models.StaffSchedule{}
825
+
826
+	err = XTWriteDB().Model(&schedule).Where("id = ? and user_org_id =? and status=1", id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
827
+	return err
828
+}

+ 7 - 0
service/patient_service.go Dosyayı Görüntüle

@@ -3397,3 +3397,10 @@ func GetDialysisOrderCountTenEight(patient_id int64, recordDate int64) (models.V
3397 3397
 	err := XTReadDB().Where("patient_id = ? and dialysis_date = ? and status = 1", patient_id, recordDate).Last(&order).Error
3398 3398
 	return order, err
3399 3399
 }
3400
+
3401
+func GetLastAcceptRecrods(patient_id int64) (models.ReceiveTreatmentAsses, error) {
3402
+
3403
+	treatmentAsses := models.ReceiveTreatmentAsses{}
3404
+	err := XTReadDB().Where("patient_id = ? and status= 1 and admission_number!=''", patient_id).Last(&treatmentAsses).Error
3405
+	return treatmentAsses, err
3406
+}

+ 2 - 2
service/pharmacy_service.go Dosyayı Görüntüle

@@ -891,7 +891,7 @@ func DispensingMedicineOne(orgid, patient_id, stime, etime, creater int64) (err
891 891
 
892 892
 func GetHisPatientNoMedical(user_org_id int64, patient_id int64, startime int64, end_time int64) (advice []*models.HisDoctorAdviceInfo, err error) {
893 893
 
894
-	err = XTReadDB().Where("user_org_id =? and patient_id = ? and advice_date>=? and advice_date<=? and is_medicine =0", user_org_id, patient_id, startime, end_time).Find(&advice).Error
894
+	err = XTReadDB().Where("user_org_id =? and patient_id = ? and advice_date>=? and advice_date<=? and is_medicine =0 and status=1", user_org_id, patient_id, startime, end_time).Find(&advice).Error
895 895
 	return advice, err
896 896
 }
897 897
 
@@ -909,7 +909,7 @@ func UpdateHisPrescription(id int64) (err error) {
909 909
 
910 910
 func GetDocAdviceList(user_org_id int64, patient_id int64, startime int64, end_time int64) (advice []*models.DoctorAdvice, err error) {
911 911
 
912
-	err = XTReadDB().Where("user_org_id =? and patient_id = ? and advice_date>=? and advice_date<=? and is_medicine =0", user_org_id, patient_id, startime, end_time).Find(&advice).Error
912
+	err = XTReadDB().Where("user_org_id =? and patient_id = ? and advice_date>=? and advice_date<=? and is_medicine =0 and status=1", user_org_id, patient_id, startime, end_time).Find(&advice).Error
913 913
 	return advice, err
914 914
 
915 915
 }

+ 23 - 0
service/self_drug_service.go Dosyayı Görüntüle

@@ -2989,3 +2989,26 @@ func UpdateDrugStockInCountOne(drugId int64, storehouseId int64, over_count int6
2989 2989
 	err := XTWriteDB().Model(&models.XtDrugStockCount{}).Where("drug_id =? and storehouse_id =? and status=1 and user_org_id =?", drugId, storehouseId, user_org_id).Update(map[string]interface{}{"sum_act_out_count": over_count}).Error
2990 2990
 	return err
2991 2991
 }
2992
+
2993
+func GetPurchaseStockQueryList(good_type int64, keyword string, page int64, limit int64, orgid int64, ids []int64, goodIds []int64) (goodinfo []*models.GoodInfoTwenty, total int64, err error) {
2994
+
2995
+	db := XTReadDB().Model(&goodinfo).Where("status = 1")
2996
+	offset := (page - 1) * limit
2997
+	likeKey := "%" + keyword + "%"
2998
+	if good_type > 0 {
2999
+		db = db.Where("good_type_id = ?", good_type)
3000
+	}
3001
+
3002
+	if orgid > 0 {
3003
+		db = db.Where("org_id = ?", orgid)
3004
+	}
3005
+	if len(ids) > 0 {
3006
+		db = db.Where("id in(?)", goodIds)
3007
+	}
3008
+	if len(keyword) > 0 {
3009
+		db = db.Where("good_name like ? or manufacturer in(?)", likeKey, ids)
3010
+	}
3011
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("good_number desc").Find(&goodinfo).Error
3012
+
3013
+	return goodinfo, total, err
3014
+}

+ 4 - 0
service/warhouse_service.go Dosyayı Görüntüle

@@ -5586,6 +5586,7 @@ func ConsumablesDeliveryThirty(orgID int64, record_time int64, goods *models.War
5586 5586
 			IsCheck:                 1,
5587 5587
 			OverCount:               sum_count,
5588 5588
 			RegisterNumber:          goods.RegisterNumber,
5589
+			Remark:                  goods.Remark,
5589 5590
 		}
5590 5591
 		//创建出库流水
5591 5592
 		errflow := CreateStockFlowOne(stockFlow)
@@ -5734,6 +5735,7 @@ func ConsumablesDeliveryThirty(orgID int64, record_time int64, goods *models.War
5734 5735
 			IsCheck:                 1,
5735 5736
 			OverCount:               sum_count,
5736 5737
 			RegisterNumber:          goods.RegisterNumber,
5738
+			Remark:                  goods.Remark,
5737 5739
 		}
5738 5740
 		//创建出库流水
5739 5741
 		errflow := CreateStockFlowOne(stockFlow)
@@ -6011,6 +6013,7 @@ func AutoDrugDeliverInfoFourtyOne(orgID int64, prescribingNumber int64, warehous
6011 6013
 			WarehousingId:           warehouse.ID,
6012 6014
 			SystemTime:              advice.SysRecordTime,
6013 6015
 			PatientId:               advice.PatientId,
6016
+			Remark:                  advice.Remark,
6014 6017
 		}
6015 6018
 		if warehouse.RetailPrice == 0 {
6016 6019
 			drugflow.Price = advice.Price
@@ -6081,6 +6084,7 @@ func AutoDrugDeliverInfoFourtyOne(orgID int64, prescribingNumber int64, warehous
6081 6084
 			WarehousingDetailId:     warehouse.ID,
6082 6085
 			SystemTime:              advice.SysRecordTime,
6083 6086
 			PatientId:               advice.PatientId,
6087
+			Remark:                  advice.Remark,
6084 6088
 		}
6085 6089
 
6086 6090
 		CreateDrugFlowOne(drugflow)