28169 1 месяц назад
Родитель
Сommit
63c6d114de

Двоичные данные
XT_New.exe Просмотреть файл


+ 4 - 4
controllers/base_api_controller.go Просмотреть файл

@@ -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 = 10164 //机构id
86
+		subscibe.OrgId = 10567 //机构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 = 10164 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10567 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 10697 //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 = 10164 //机构id小英9675或4
332
+		subscibe.OrgId = 10567 //机构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 = 10164 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10567 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 16787 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 14 - 1
controllers/dialysis_api_controller.go Просмотреть файл

@@ -4481,6 +4481,15 @@ func (c *DialysisApiController) GetDialysisOrder() {
4481 4481
 	//接诊评估
4482 4482
 	receiverTreatmentAccess, _ := service.FindReceiverTreatmentAccessRecordById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4483 4483
 
4484
+	if receiverTreatmentAccess.Condition == 1 {
4485
+		if len(receiverTreatmentAccess.AdmissionNumber) == 0 || receiverTreatmentAccess.AdmissionNumber == "" {
4486
+			lastAcceptTreatment, _ := service.GetLastAcceptTreatment(adminUserInfo.CurrentOrgId, patientInfo.ID)
4487
+			receiverTreatmentAccess.AdmissionNumber = lastAcceptTreatment.AdmissionNumber
4488
+			receiverTreatmentAccess.HisDepartment = lastAcceptTreatment.HisDepartment
4489
+			receiverTreatmentAccess.HisBed = lastAcceptTreatment.HisBed
4490
+		}
4491
+	}
4492
+
4484 4493
 	check, _ := service.FindDoubleCheckById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4485 4494
 
4486 4495
 	if adminUserInfo.CurrentOrgId != 10101 && adminUserInfo.CurrentOrgId != 10445 && adminUserInfo.CurrentOrgId != 10345 {
@@ -4859,12 +4868,14 @@ func (c *DialysisApiController) GetLongAdviceOne() {
4859 4868
 		for _, advice := range advices_two {
4860 4869
 			p, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
4861 4870
 			now := p.Unix()
4871
+
4862 4872
 			dayStr := strconv.FormatInt(advice.DayCount, 10)
4863 4873
 			dayStr2 := "-" + dayStr
4864 4874
 			count, _ := strconv.ParseInt(dayStr2, 10, 64)
4865 4875
 			oldTime := time.Now().AddDate(0, 0, int(count)).Unix()
4876
+			fmt.Println("oldTime--------------------------", oldTime)
4866 4877
 			advices, _ := service.FindAllDoctorAdviceByTime(now, oldTime, patient_id, adminUserInfo.CurrentOrgId, advice.TemplateId)
4867
-
4878
+			fmt.Println("advices-------------------------", advices)
4868 4879
 			for _, ad := range advices {
4869 4880
 				advice_three = append(advice_three, ad)
4870 4881
 			}
@@ -4952,10 +4963,12 @@ func (c *DialysisApiController) GetLongAdviceTwo() {
4952 4963
 		for _, advice := range advices_two {
4953 4964
 			p, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
4954 4965
 			now := p.Unix()
4966
+			fmt.Println("now-------------------------", now)
4955 4967
 			dayStr := strconv.FormatInt(advice.DayCount, 10)
4956 4968
 			dayStr2 := "-" + dayStr
4957 4969
 			count, _ := strconv.ParseInt(dayStr2, 10, 64)
4958 4970
 			oldTime := time.Now().AddDate(0, 0, int(count)).Unix()
4971
+			fmt.Println("oldTime--------------------------", oldTime)
4959 4972
 			advices, _ := service.FindAllDoctorAdviceByTime(now, oldTime, patient_id, adminUserInfo.CurrentOrgId, advice.TemplateId)
4960 4973
 
4961 4974
 			for _, ad := range advices {

+ 2 - 1
controllers/drug_stock_api_contorller.go Просмотреть файл

@@ -3515,6 +3515,7 @@ func (c *StockDrugApiController) GetDrugOutOrderPrint() {
3515 3515
 	start_time := c.GetString("start_time")
3516 3516
 	end_time := c.GetString("end_time")
3517 3517
 	order_type, _ := c.GetInt64("order_type")
3518
+	storehouse_id, _ := c.GetInt64("storehouse_id")
3518 3519
 	timeLayout := "2006-01-02"
3519 3520
 	loc, _ := time.LoadLocation("Local")
3520 3521
 
@@ -3543,7 +3544,7 @@ func (c *StockDrugApiController) GetDrugOutOrderPrint() {
3543 3544
 	dealerList, _ := service.GetAllDealerList(orgId)
3544 3545
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
3545 3546
 	if order_type == 2 {
3546
-		list, err := service.GetDrugOutOrderInfoPrintList(startTime, endTime, orgId)
3547
+		list, err := service.GetDrugOutOrderInfoPrintList(startTime, endTime, orgId, storehouse_id)
3547 3548
 		if err == nil {
3548 3549
 			c.ServeSuccessJSON(map[string]interface{}{
3549 3550
 				"list":             list,

+ 81 - 8
controllers/mobile_api_controllers/dialysis_api_controller.go Просмотреть файл

@@ -1327,14 +1327,6 @@ func (c *DialysisAPIController) PostAcceptsAssessment() {
1327 1327
 		//}
1328 1328
 		// 查询信息规挡的设置天数
1329 1329
 
1330
-		if adminUserInfo.Org.Id == 10340 {
1331
-			if condition == 1 {
1332
-				lastAcceptTreatment, _ := service.GetLastAcceptTreatment(adminUserInfo.Org.Id, id)
1333
-				if receiveTreatmentAsses.AdmissionNumber == "" {
1334
-					receiveTreatmentAsses.AdmissionNumber = lastAcceptTreatment.AdmissionNumber
1335
-				}
1336
-			}
1337
-		}
1338 1330
 		infor, _ := service.GetDialysisInformationSetting(adminUserInfo.Org.Id)
1339 1331
 		if infor.ID > 0 && infor.WeekDay > 0 {
1340 1332
 
@@ -1363,6 +1355,15 @@ func (c *DialysisAPIController) PostAcceptsAssessment() {
1363 1355
 
1364 1356
 		receiveTreatmentAsses.Modifier = adminUserInfo.AdminUser.Id
1365 1357
 		receiveTreatmentAsses.ID = receiveTreatment.ID
1358
+
1359
+		if adminUserInfo.Org.Id == 10340 {
1360
+			if condition == 1 {
1361
+				lastAcceptTreatment, _ := service.GetLastAcceptTreatment(adminUserInfo.Org.Id, id)
1362
+				if receiveTreatmentAsses.AdmissionNumber == "" {
1363
+					receiveTreatmentAsses.AdmissionNumber = lastAcceptTreatment.AdmissionNumber
1364
+				}
1365
+			}
1366
+		}
1366 1367
 		err := service.UpadateReceiveTreatmentAsses(&receiveTreatmentAsses)
1367 1368
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":receive_treatment_asses"
1368 1369
 		redis := service.RedisClient()
@@ -5115,6 +5116,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
5115 5116
 		defer redis.Close()
5116 5117
 
5117 5118
 	}
5119
+
5118 5120
 	// 查询信息规挡的设置天数
5119 5121
 
5120 5122
 	infor, _ := service.GetDialysisInformationSetting(adminUserInfo.Org.Id)
@@ -5140,6 +5142,77 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
5140 5142
 		}
5141 5143
 	}
5142 5144
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)
5145
+	//修改床位后重新生成消毒计划
5146
+	if adminUserInfo.Org.Id == 10340 {
5147
+		//根据床位号获取设备型号
5148
+		unitType, _ := service.GetUnitType(dialysisRecord.BedID, dialysisRecord.UserOrgId)
5149
+		//查询使用消毒最后一条消毒记录
5150
+		_, err := service.GetLaseDeviceInfomation(dialysisRecord.UserOrgId, dialysisRecord.BedID, dialysisRecord.DialysisDate, dialysisRecord.SchedualType)
5151
+		fmt.Println("err", err)
5152
+		if err == gorm.ErrRecordNotFound {
5153
+			//查找排班
5154
+			scheduleByPatient, _ := service.GetScheduleByPatient(dialysisRecord.PatientId, dialysisRecord.DialysisDate, dialysisRecord.UserOrgId)
5155
+			//查询改设备是否有消毒计划
5156
+			plan, errcode := service.GetDisInfectionTime(dialysisRecord.UserOrgId, unitType.UnitType, dialysisRecord.SchedualType, scheduleByPatient.ScheduleWeek)
5157
+
5158
+			//根据床位号获取设备id
5159
+			addmacher, _ := service.GetEquimentIDTwo(dialysisRecord.BedID, dialysisRecord.UserOrgId)
5160
+
5161
+			//查询病人信息
5162
+			patients, _ := service.GetPatientInfoMation(dialysisRecord.PatientId)
5163
+			var con = ""
5164
+			if patients.IsInfectious == 0 {
5165
+				con = ""
5166
+			}
5167
+			if patients.IsInfectious == 1 {
5168
+				con = "无"
5169
+			}
5170
+			if patients.IsInfectious == 2 {
5171
+				con = "有"
5172
+			}
5173
+
5174
+			if errcode == nil {
5175
+				var end_time int64
5176
+				end_time = dialysisRecord.EndTime + plan.DisinfecTime*60
5177
+				//新增消毒
5178
+				information := models.DeviceInformation{
5179
+					Date:                  dialysisRecord.DialysisDate,
5180
+					Zone:                  dialysisRecord.ZoneId,
5181
+					Class:                 dialysisRecord.SchedualType,
5182
+					BedNumber:             dialysisRecord.BedID,
5183
+					PatientId:             dialysisRecord.PatientId,
5184
+					DialysisMode:          scheduleByPatient.ModeId,
5185
+					LongTime:              strconv.FormatInt(plan.DisinfecTime, 10),
5186
+					Disinfection:          1,
5187
+					DialysisConcentration: 1,
5188
+					DisinfectionStatus:    1,
5189
+					Move:                  1,
5190
+					UserOrgId:             dialysisRecord.UserOrgId,
5191
+					DisinfectType:         plan.Way,
5192
+					DisinfectantType:      plan.MachineDisinfectant,
5193
+					FluidPath:             plan.DisinfectanWay, //液路消毒方式
5194
+					Disinfectant:          plan.Disinfectant,
5195
+					Ctime:                 time.Now().Unix(),
5196
+					Status:                1,
5197
+					SignName:              nurseID,
5198
+					EquimentId:            addmacher.ID,
5199
+					DisinfectionResidue:   2,
5200
+					Bed:                   addmacher.BedNumber,
5201
+					StartTime:             dialysisRecord.StartTime,
5202
+					EndTime:               dialysisRecord.EndTime,
5203
+					Contagion:             con,
5204
+					WeightLoss:            0,
5205
+					Hyperfiltratio:        0,
5206
+					DialysisHour:          "",
5207
+					MachineRun:            1,
5208
+					DisinfecStartime:      dialysisRecord.EndTime,
5209
+					DisinfecEndtime:       end_time,
5210
+				}
5211
+				err := service.CreateInformationTwo(&information)
5212
+				fmt.Println("报错", err)
5213
+			}
5214
+		}
5215
+	}
5143 5216
 	order, _ := service.GetLastPatientOrder(record_id)
5144 5217
 	service.UpdateMobilePatient(adminUserInfo.Org.Id, order.PatientId, schedule_remark)
5145 5218
 	redis := service.RedisClient()

+ 13 - 4
controllers/mobile_api_controllers/patient_api_controller.go Просмотреть файл

@@ -1375,7 +1375,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1375 1375
 
1376 1376
 							if medical.IsUse != 1 {
1377 1377
 								if (list.Count*medical.MinNumber + list.StockMinNumber) == 0 {
1378
-									if advice.UserOrgId != 10278 {
1378
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 {
1379 1379
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1380 1380
 										advice.ExecutionTime = 0
1381 1381
 										advice.ExecutionState = 2
@@ -1391,7 +1391,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1391 1391
 
1392 1392
 								}
1393 1393
 								if prescribing_number_total > total {
1394
-									if advice.UserOrgId != 10278 {
1394
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 {
1395 1395
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1396 1396
 										advice.ExecutionTime = 0
1397 1397
 										advice.ExecutionState = 2
@@ -1547,7 +1547,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1547 1547
 							}
1548 1548
 							if medical.IsUse != 1 {
1549 1549
 								if (list.Count*medical.MinNumber + list.StockMinNumber) == 0 {
1550
-									if advice.UserOrgId != 10278 {
1550
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 {
1551 1551
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1552 1552
 										advice.ExecutionTime = 0
1553 1553
 										advice.ExecutionState = 2
@@ -1561,7 +1561,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1561 1561
 									return
1562 1562
 								}
1563 1563
 								if prescribing_number_total > total {
1564
-									if advice.UserOrgId != 10278 {
1564
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 {
1565 1565
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1566 1566
 										advice.ExecutionTime = 0
1567 1567
 										advice.ExecutionState = 2
@@ -5680,6 +5680,15 @@ func (c *PatientApiController) GetPrintDialysisOrder() {
5680 5680
 	//接诊评估
5681 5681
 	receiverTreatmentAccess, _ := service.FindReceiverTreatmentAccessRecordById(adminUserInfo.Org.Id, patientInfo.ID, xttime)
5682 5682
 
5683
+	if receiverTreatmentAccess.Condition == 1 {
5684
+		if len(receiverTreatmentAccess.AdmissionNumber) == 0 || receiverTreatmentAccess.AdmissionNumber == "" {
5685
+			lastAcceptTreatment, _ := service.GetLastAcceptTreatment(adminUserInfo.Org.Id, patientInfo.ID)
5686
+			receiverTreatmentAccess.AdmissionNumber = lastAcceptTreatment.AdmissionNumber
5687
+			receiverTreatmentAccess.HisDepartment = lastAcceptTreatment.HisDepartment
5688
+			receiverTreatmentAccess.HisBed = lastAcceptTreatment.HisBed
5689
+		}
5690
+	}
5691
+
5683 5692
 	//相关操作对应的操作人
5684 5693
 	//operators, _ := service.GetAdminUserES(adminUserInfo.Org.Id, adminUserInfo.App.Id, operatorIDs)
5685 5694
 	operators, err := service.GetAllStarfEs(adminUserInfo.Org.Id)

+ 6 - 4
controllers/patient_api_controller.go Просмотреть файл

@@ -1054,11 +1054,13 @@ func (c *PatientApiController) GetPatient() {
1054 1054
 	infections, _ := service.GetAllInfectionRecord(infectiousRecord.InspectDate, adminUserInfo.CurrentOrgId, patient.ID, infectiousRecord.ProjectId)
1055 1055
 	diseases := service.GetPatientDiseases(patient.ID)
1056 1056
 	contagions := service.GetPatientContagions(patient.ID)
1057
+	patientVascularAccessOne, _ := service.GetPatientVascularAccessOne(patient.ID)
1057 1058
 	c.ServeSuccessJSON(map[string]interface{}{
1058
-		"patient":    patient,
1059
-		"diseases":   diseases,
1060
-		"contagions": contagions,
1061
-		"infections": infections,
1059
+		"patient":                  patient,
1060
+		"diseases":                 diseases,
1061
+		"contagions":               contagions,
1062
+		"infections":               infections,
1063
+		"patientVascularAccessOne": patientVascularAccessOne,
1062 1064
 	})
1063 1065
 	return
1064 1066
 }

+ 8 - 0
controllers/print_data_api_controller.go Просмотреть файл

@@ -51,6 +51,14 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
51 51
 			item.Prescription = prescription
52 52
 			//接诊评估
53 53
 			receiveTreatmentAsses, _ := service.GetBatchReceiveTreatmentAsses(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
54
+			if receiveTreatmentAsses.Condition == 1 {
55
+				if len(receiveTreatmentAsses.AdmissionNumber) == 0 || receiveTreatmentAsses.AdmissionNumber == "" {
56
+					lastAcceptTreatment, _ := service.GetLastAcceptTreatment(adminUserInfo.CurrentOrgId, item.PatientID)
57
+					receiveTreatmentAsses.AdmissionNumber = lastAcceptTreatment.AdmissionNumber
58
+					receiveTreatmentAsses.HisDepartment = lastAcceptTreatment.HisDepartment
59
+					receiveTreatmentAsses.HisBed = lastAcceptTreatment.HisBed
60
+				}
61
+			}
54 62
 			item.ReceiveAssessment = receiveTreatmentAsses
55 63
 
56 64
 			//透前评估

+ 8 - 0
controllers/stock_in_api_controller.go Просмотреть файл

@@ -408,6 +408,8 @@ func (c *StockManagerApiController) CreateWarehouse() {
408 408
 				license_number, _ := items["license_number"].(string)
409 409
 
410 410
 				register_number, _ := items["register_number"].(string)
411
+
412
+				good_code, _ := items["good_code"].(string)
411 413
 				//入库单表格
412 414
 				warehouseInfo := &models.WarehousingInfo{
413 415
 					ID:               id,
@@ -434,6 +436,7 @@ func (c *StockManagerApiController) CreateWarehouse() {
434 436
 					StorehouseId:     storehouse_id,
435 437
 					IsCheck:          2,
436 438
 					RegisterNumber:   register_number,
439
+					GoodCode:         good_code,
437 440
 				}
438 441
 				warehousingInfo = append(warehousingInfo, warehouseInfo)
439 442
 
@@ -684,6 +687,7 @@ func (c *StockManagerApiController) EditWarehouse() {
684 687
 				dealer := int64(items["dealer"].(float64))
685 688
 				license_number, _ := items["license_number"].(string)
686 689
 				register_number, _ := items["register_number"].(string)
690
+				good_code, _ := items["good_code"].(string)
687 691
 				if items["id"] == nil || reflect.TypeOf(items["id"]).String() != "float64" {
688 692
 					utils.ErrorLog("id")
689 693
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -716,6 +720,7 @@ func (c *StockManagerApiController) EditWarehouse() {
716 720
 						StorehouseId:     storehouse_id,
717 721
 						IsCheck:          2,
718 722
 						RegisterNumber:   register_number,
723
+						GoodCode:         good_code,
719 724
 					}
720 725
 					warehousingInfo = append(warehousingInfo, warehouseInfo)
721 726
 
@@ -744,6 +749,7 @@ func (c *StockManagerApiController) EditWarehouse() {
744 749
 						PackingPrice:     packing_price,
745 750
 						StorehouseId:     storehouse_id,
746 751
 						RegisterNumber:   register_number,
752
+						GoodCode:         good_code,
747 753
 					}
748 754
 					upDateWarehousingInfo = append(upDateWarehousingInfo, warehouseInfo)
749 755
 
@@ -769,6 +775,7 @@ func (c *StockManagerApiController) EditWarehouse() {
769 775
 						WarehousingDetailId: warehouseInfo.ID,
770 776
 						StorehouseId:        storehouse_id,
771 777
 						RegisterNumber:      register_number,
778
+						GoodCode:            good_code,
772 779
 					}
773 780
 
774 781
 					stockFlow = append(stockFlow, flow)
@@ -7645,6 +7652,7 @@ func (this *StockManagerApiController) CheckWarehouseInfo() {
7645 7652
 				IsCheck:                 1,
7646 7653
 				OverCount:               flush_count,
7647 7654
 				OperateTime:             time.Now().Unix(),
7655
+				GoodCode:                item.GoodCode,
7648 7656
 			}
7649 7657
 			//创建出库流水
7650 7658
 			service.CreateStockFlowOne(stockFlow)

+ 2 - 0
models/new_stock_models.go Просмотреть файл

@@ -174,6 +174,7 @@ type NewBaseDrugOne struct {
174 174
 	MedicalInsuranceNumber string                 `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
175 175
 	DrugType               int64                  `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
176 176
 	MedicalInsuranceLevel  int64                  `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
177
+	IsSelfDrug             int64                  `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
177 178
 }
178 179
 
179 180
 func (NewBaseDrugOne) TableName() string {
@@ -424,6 +425,7 @@ type VmBaseDrugTwenty struct {
424 425
 	Ctime                            int64             `gorm:"column:ctime" json:"ctime" form:"ctime"`
425 426
 	Mtime                            int64             `gorm:"column:mtime" json:"mtime" form:"mtime"`
426 427
 	OrgId                            int64             `gorm:"column:org_id" json:"org_id" form:"org_id"`
428
+	IsSelfDrug                       int64             `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
427 429
 	MedicalInsuranceNumber           string            `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
428 430
 	DrugFlowWarehouseInfo            []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_flow_info"`
429 431
 	DrugActFlowWarehouseInfo         []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_act_flow_info"`

+ 4 - 0
models/stock_models.go Просмотреть файл

@@ -107,6 +107,7 @@ type StWarehousingInfo struct {
107 107
 	StorehouseId          int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
108 108
 	SecondWarehouseInfoId int64   `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
109 109
 	WarehousingTime       string  `json:"warehousing_time"`
110
+	PackingPrice          float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
110 111
 }
111 112
 
112 113
 func (StWarehousingInfo) TableName() string {
@@ -176,6 +177,7 @@ type WarehousingInfo struct {
176 177
 	RegisterNumber            string      `gorm:"column:register_number" json:"register_number" form:"register_number"`
177 178
 	ManafacturerName          string      `gorm:"column:manafacturer_name" json:"manafacturer_name" form:"manafacturer_name"`
178 179
 	DealerName                string      `gorm:"column:dealer_name" json:"dealer_name" form:"dealer_name"`
180
+	GoodCode                  string      `gorm:"column:good_code" json:"good_code" form:"good_code"`
179 181
 }
180 182
 
181 183
 func (WarehousingInfo) TableName() string {
@@ -700,6 +702,7 @@ type VmStockFlow struct {
700 702
 	Remark                    string          `gorm:"column:remark" json:"remark" form:"remark"`
701 703
 	FlushOverCount            int64           `gorm:"column:flush_over_count" json:"flush_over_count" form:"flush_over_count"`
702 704
 	OperateTime               int64           `gorm:"column:operate_time" json:"operate_time" form:"operate_time"`
705
+	GoodCode                  string          `gorm:"column:good_code" json:"good_code" form:"good_code"`
703 706
 }
704 707
 
705 708
 func (VmStockFlow) TableName() string {
@@ -1541,6 +1544,7 @@ type VmWarehousingInfoSix struct {
1541 1544
 	StorehouseId              int64    `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
1542 1545
 	SecondWarehouseInfoId     int64    `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
1543 1546
 	RegisterNumber            string   `gorm:"column:register_number" json:"register_number" form:"register_number"`
1547
+	GoodCode                  string   `gorm:"column:good_code" json:"good_code" form:"good_code"`
1544 1548
 }
1545 1549
 
1546 1550
 func (VmWarehousingInfoSix) TableName() string {

+ 4 - 1
service/drug_stock_service.go Просмотреть файл

@@ -261,7 +261,7 @@ func GetDrugOutOrderPrintList(startime int64, endtime int64, orgid int64) (list
261 261
 	return list, err
262 262
 }
263 263
 
264
-func GetDrugOutOrderInfoPrintList(startime int64, endtime int64, orgid int64) (list []*models.SgjDrugWarehouseOutInfo, err error) {
264
+func GetDrugOutOrderInfoPrintList(startime int64, endtime int64, orgid int64, storehouse_id int64) (list []*models.SgjDrugWarehouseOutInfo, err error) {
265 265
 
266 266
 	db := XTReadDB().Table("xt_drug_warehouse_out_info").Where("status = 1 and is_check=1")
267 267
 	if startime > 0 {
@@ -273,6 +273,9 @@ func GetDrugOutOrderInfoPrintList(startime int64, endtime int64, orgid int64) (l
273 273
 	if orgid > 0 {
274 274
 		db = db.Where("org_id = ?", orgid)
275 275
 	}
276
+	if storehouse_id > 0 {
277
+		db = db.Where("storehouse_id=?", storehouse_id)
278
+	}
276 279
 	err = db.Preload("XtDrugWarehouseInfo", "status=1 and org_id =?", orgid).Preload("XtBaseDrug", "status = 1 and org_id = ?", orgid).Find(&list).Error
277 280
 	return list, err
278 281
 }

+ 6 - 0
service/his_project_service.go Просмотреть файл

@@ -788,6 +788,12 @@ func GetPatientVascularAccess(patient_id int64) (models.XtPatientVascularAccess,
788 788
 	return access, err
789 789
 }
790 790
 
791
+func GetPatientVascularAccessOne(patient_id int64) (models.XtPatientVascularAccess, error) {
792
+	access := models.XtPatientVascularAccess{}
793
+	err = XTReadDB().Where("patient_id = ? and status = 1 and user_status =1", patient_id).Last(&access).Error
794
+	return access, err
795
+}
796
+
791 797
 func CreateHisProjectTh11o(project models.HisProject) error {
792 798
 
793 799
 	err := XTWriteDB().Model(&project).Create(&project).Error

+ 2 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go Просмотреть файл

@@ -491,6 +491,8 @@ type ReceiveAssessmentVM struct {
491 491
 	IsPrecaution                 int64  `gorm:"column:is_precaution" json:"is_precaution"`
492 492
 	AdmissionNumber              string `gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
493 493
 	UserOrgId                    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
494
+	HisDepartment                string `gorm:"column:his_department" json:"his_department" form:"his_department"`
495
+	HisBed                       string `gorm:"column:his_bed" json:"his_bed" form:"his_bed"`
494 496
 }
495 497
 
496 498
 func (ReceiveAssessmentVM) TableName() string {

+ 7 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go Просмотреть файл

@@ -431,6 +431,13 @@ func GetBatchReceiveTreatmentAsses(orgid int64, patient_id int64, record_date in
431 431
 	return receiveAssessmentVM, err
432 432
 }
433 433
 
434
+func GetLastAcceptTreatment(user_org_id int64, patient_id int64) (models.ReceiveTreatmentAsses, error) {
435
+
436
+	treatmentAsses := models.ReceiveTreatmentAsses{}
437
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and status=1 and admission_number<>''", user_org_id, patient_id).Last(&treatmentAsses).Error
438
+	return treatmentAsses, err
439
+}
440
+
434 441
 func GetBatchAssessmentBeforeDislysisVM(orgid int64, patient_id int64, assessment_date int64) (AssessmentBeforeDislysisVM, error) {
435 442
 
436 443
 	AssessmentBeforeDislysisVM := AssessmentBeforeDislysisVM{}

+ 3 - 3
service/self_drug_service.go Просмотреть файл

@@ -1880,7 +1880,7 @@ func GetDrugStockCountList(orgId int64, storehouse_id int64, good_type int64, ke
1880 1880
 
1881 1881
 	offset := (page - 1) * limit
1882 1882
 	likeKey := "%" + keyword + "%"
1883
-	db := XTReadDB().Table("xt_base_drug as x").Where("x.status = 1 AND find_in_set('停用',x.drug_status) = 0")
1883
+	db := XTReadDB().Table("xt_base_drug as x").Where("x.status = 1 AND find_in_set('停用',x.drug_status) = 0 and x.is_self_drug!=1")
1884 1884
 	if good_type == 2 {
1885 1885
 		db = db.Where("x.sum_count<=x.drug_stock_limit")
1886 1886
 	}
@@ -1899,7 +1899,7 @@ func GetDrugStockCountList(orgId int64, storehouse_id int64, good_type int64, ke
1899 1899
 	}
1900 1900
 
1901 1901
 	if len(keyword) > 0 {
1902
-		db = db.Where("drug_name like ? or manufacturer in(?)", likeKey, ids)
1902
+		db = db.Where("x.drug_name like ? or x.manufacturer in(?)", likeKey, ids)
1903 1903
 	}
1904 1904
 
1905 1905
 	if orgId > 0 {
@@ -2903,7 +2903,7 @@ func GetEndLastFlowTwenty(goodid int64, orgid int64, endtime int64) (models.VmSt
2903 2903
 
2904 2904
 func GetDrugNewPurchaseStockQuery(good_type int64, keyword string, page int64, limit int64, orgid int64, startime int64, endtime int64, ids []int64, infos []int64) (druginfo []*models.VmBaseDrugTwenty, total int64, err error) {
2905 2905
 
2906
-	db := XTReadDB().Model(&druginfo).Where("status = 1")
2906
+	db := XTReadDB().Model(&druginfo).Where("status = 1 and is_self_drug!=1")
2907 2907
 	offset := (page - 1) * limit
2908 2908
 	likeKey := "%" + keyword + "%"
2909 2909
 	if good_type > 0 {

+ 6 - 6
service/stock_service.go Просмотреть файл

@@ -467,7 +467,7 @@ func CreateWarehousingInfo(warehousingInfo []*models.WarehousingInfo) (err error
467 467
 			insertParams := make([]string, 0)
468 468
 			insertData := make([]interface{}, 0)
469 469
 			for _, info := range warehousingInfo {
470
-				insertParams = append(insertParams, "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")
470
+				insertParams = append(insertParams, "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")
471 471
 				insertData = append(insertData, info.WarehousingId)
472 472
 				insertData = append(insertData, info.GoodId)
473 473
 				insertData = append(insertData, info.GoodTypeId)
@@ -490,6 +490,7 @@ func CreateWarehousingInfo(warehousingInfo []*models.WarehousingInfo) (err error
490 490
 				insertData = append(insertData, info.LicenseNumber)
491 491
 				insertData = append(insertData, info.PackingPrice)
492 492
 				insertData = append(insertData, info.StorehouseId)
493
+				insertData = append(insertData, info.GoodCode)
493 494
 			}
494 495
 			thisSQL += strings.Join(insertParams, ", ")
495 496
 			err = utx.Exec(thisSQL, insertData...).Error
@@ -6214,10 +6215,9 @@ func GetLastWarehouseInfo(goodid int64) (models.WarehousingInfo, error) {
6214 6215
 	return info, err
6215 6216
 }
6216 6217
 
6217
-func GetLastWarehouseInfoTwo(goodid int64, storehouse_id int64, user_org_id int64) (models.WarehousingInfo, error) {
6218
+func GetLastWarehouseInfoTwo(goodid int64, storehouse_id int64, user_org_id int64) (info []*models.WarehousingInfo, err error) {
6218 6219
 
6219
-	info := models.WarehousingInfo{}
6220
-	err := XTReadDB().Model(&info).Where("good_id = ? and status = 1 and storehouse_id=? and org_id = ?  and stock_count > 0", goodid, storehouse_id, user_org_id).Order("ctime").First(&info).Error
6220
+	err = XTReadDB().Model(&info).Where("good_id = ? and status = 1 and storehouse_id=? and org_id = ?  and stock_count > 0", goodid, storehouse_id, user_org_id).Order("ctime").First(&info).Error
6221 6221
 	return info, err
6222 6222
 }
6223 6223
 
@@ -6917,7 +6917,7 @@ func UpdateWarehouseInfoByGoodId(info models.WarehousingInfo, id int64) error {
6917 6917
 
6918 6918
 func UpdateWarehouseInfoByGoodIdOne(info *models.WarehousingInfo, id int64) error {
6919 6919
 
6920
-	err := XTWriteDB().Model(&info).Where("id =? and status = 1", id).Updates(map[string]interface{}{"warehousing_count": info.WarehousingCount, "stock_count": info.StockCount, "price": info.Price, "number": info.Number, "product_date": info.ProductDate, "expiry_date": info.ExpiryDate, "license_number": info.LicenseNumber, "manufacturer": info.Manufacturer, "dealer": info.Dealer, "remark": info.Remark, "packing_price": info.PackingPrice, "storehouse_id": info.StorehouseId, "register_number": info.RegisterNumber, "good_id": info.GoodId}).Error
6920
+	err := XTWriteDB().Model(&info).Where("id =? and status = 1", id).Updates(map[string]interface{}{"warehousing_count": info.WarehousingCount, "stock_count": info.StockCount, "price": info.Price, "number": info.Number, "product_date": info.ProductDate, "expiry_date": info.ExpiryDate, "license_number": info.LicenseNumber, "manufacturer": info.Manufacturer, "dealer": info.Dealer, "remark": info.Remark, "packing_price": info.PackingPrice, "storehouse_id": info.StorehouseId, "register_number": info.RegisterNumber, "good_id": info.GoodId, "good_code": info.GoodCode}).Error
6921 6921
 	return err
6922 6922
 }
6923 6923
 
@@ -8032,7 +8032,7 @@ func FindLastWarehousing(order string) (info models.Warehousing, err error) {
8032 8032
 
8033 8033
 func UpdateWarehouseDetail(info *models.WarehousingInfo, id int64) error {
8034 8034
 
8035
-	err := XTWriteDB().Model(&models.WarehousingInfo{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"good_id": info.GoodId, "good_type_id": info.GoodTypeId, "number": info.Number, "product_date": info.ProductDate, "expiry_date": info.ExpiryDate, "warehousing_count": info.WarehousingCount, "warehousing_unit": info.WarehousingUnit, "price": info.Price, "total_price": info.TotalPrice, "dealer": info.Dealer, "manufacturer": info.Manufacturer, "remark": info.Remark, "license_number": info.LicenseNumber, "packing_price": info.PackingPrice, "register_number": info.RegisterNumber, "storehouse_id": info.StorehouseId}).Error
8035
+	err := XTWriteDB().Model(&models.WarehousingInfo{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"good_id": info.GoodId, "good_type_id": info.GoodTypeId, "number": info.Number, "product_date": info.ProductDate, "expiry_date": info.ExpiryDate, "warehousing_count": info.WarehousingCount, "warehousing_unit": info.WarehousingUnit, "price": info.Price, "total_price": info.TotalPrice, "dealer": info.Dealer, "manufacturer": info.Manufacturer, "remark": info.Remark, "license_number": info.LicenseNumber, "packing_price": info.PackingPrice, "register_number": info.RegisterNumber, "storehouse_id": info.StorehouseId, "good_code": info.GoodCode}).Error
8036 8036
 	return err
8037 8037
 }
8038 8038