Browse Source

Merge branch '20220812' of http://git.shengws.com/csx/XT_New into 20220812

test_user 2 years ago
parent
commit
01edbcf1bb

+ 6 - 1
controllers/dialysis_record_api_controller.go View File

@@ -1145,7 +1145,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1145 1145
 		}
1146 1146
 
1147 1147
 		//只针对广慈医院
1148
-		if template.TemplateId == 26 || template.TemplateId == 25 || template.TemplateId == 28 || adminUserInfo.CurrentOrgId == 9987 || adminUserInfo.CurrentOrgId == 9526 || template.TemplateId == 32 || adminUserInfo.CurrentOrgId == 9918 || adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 4 {
1148
+		if template.TemplateId == 26 || template.TemplateId == 25 || template.TemplateId == 28 || adminUserInfo.CurrentOrgId == 9987 || adminUserInfo.CurrentOrgId == 9526 || template.TemplateId == 32 || adminUserInfo.CurrentOrgId == 9918 || adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 4 || adminUserInfo.CurrentOrgId == 10447 {
1149 1149
 			// 查询病人是否有透前评估数据
1150 1150
 			befor, errcode := service.GetAssessmentBefor(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1151 1151
 			//如果有数据就插入
@@ -1370,6 +1370,11 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1370 1370
 			tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume / 1000
1371 1371
 		}
1372 1372
 		tempassessmentAfterDislysis.ActualDisplacement = endmonitorRecords.DisplacementQuantity
1373
+
1374
+		//新化博翔
1375
+		if adminUserInfo.CurrentOrgId == 10447 || adminUserInfo.CurrentOrgId == 9675 {
1376
+			tempassessmentAfterDislysis.Temperature = endmonitorRecords.Temperature
1377
+		}
1373 1378
 	}
1374 1379
 
1375 1380
 	if adminUserInfo.CurrentOrgId == 9583 {

+ 11 - 4
controllers/his_api_controller.go View File

@@ -878,6 +878,8 @@ func (c *HisApiController) GetHisPrescriptionConfig() {
878 878
 		diagnose, _ := service.FindAllDiagnose(adminInfo.CurrentOrgId)
879 879
 		additions, _ := service.FindAllAddition(adminInfo.CurrentOrgId)
880 880
 
881
+		//获取是否开启保存耗材出库的开关
882
+		goodOutOpen, _ := service.GetGoodOutOpenConfigOne(adminInfo.CurrentOrgId)
881 883
 		c.ServeSuccessJSON(map[string]interface{}{
882 884
 			"drugs":            drugs,
883 885
 			"advices_template": advices,
@@ -889,6 +891,7 @@ func (c *HisApiController) GetHisPrescriptionConfig() {
889 891
 			"additions":        additions,
890 892
 			"diagnose":         diagnose,
891 893
 			"manufacturers":    manufacturers,
894
+			"goodOutOpen":      goodOutOpen,
892 895
 		})
893 896
 	}
894 897
 	if adminInfo.CurrentOrgId != 9675 && adminInfo.CurrentOrgId != 9671 && adminInfo.CurrentOrgId != 10215 {
@@ -919,6 +922,8 @@ func (c *HisApiController) GetHisPrescriptionConfig() {
919 922
 		sick, _ := service.FindAllSick(adminInfo.CurrentOrgId)
920 923
 		diagnose, _ := service.FindAllDiagnose(adminInfo.CurrentOrgId)
921 924
 		additions, _ := service.FindAllAddition(adminInfo.CurrentOrgId)
925
+		//获取是否开启保存耗材出库的开关
926
+		goodOutOpen, _ := service.GetGoodOutOpenConfigOne(adminInfo.CurrentOrgId)
922 927
 
923 928
 		c.ServeSuccessJSON(map[string]interface{}{
924 929
 			"drugs":            drugs,
@@ -931,6 +936,7 @@ func (c *HisApiController) GetHisPrescriptionConfig() {
931 936
 			"additions":        additions,
932 937
 			"diagnose":         diagnose,
933 938
 			"manufacturers":    manufacturers,
939
+			"goodOutOpen":      goodOutOpen,
934 940
 		})
935 941
 	}
936 942
 }
@@ -2344,6 +2350,7 @@ func (c *HisApiController) CreateHisPrescription() {
2344 2350
 					}
2345 2351
 					//查询是否生成出库单
2346 2352
 					out, _ := service.FindPrescriptionWarehouseOut(adminInfo.CurrentOrgId, nowtime)
2353
+
2347 2354
 					if out.ID == 0 {
2348 2355
 						service.AddSigleWarehouseOut(&warehouseOut)
2349 2356
 					}
@@ -5539,7 +5546,7 @@ type Custom struct {
5539 5546
 	ItemId           int64
5540 5547
 }
5541 5548
 
5542
-//获取个人信息----挂号-----上传就诊信息
5549
+// 获取个人信息----挂号-----上传就诊信息
5543 5550
 func (c *HisApiController) GetRegisterInfo() {
5544 5551
 	id, _ := c.GetInt64("id")
5545 5552
 	record_time := c.GetString("record_time")
@@ -5710,7 +5717,7 @@ func (c *HisApiController) GetRegisterInfo() {
5710 5717
 
5711 5718
 }
5712 5719
 
5713
-//上传明细----结算
5720
+// 上传明细----结算
5714 5721
 func (c *HisApiController) GetUploadInfo() {
5715 5722
 	id, _ := c.GetInt64("id")
5716 5723
 	record_time := c.GetString("record_time")
@@ -6555,7 +6562,7 @@ func (c *HisApiController) GetUploadInfo() {
6555 6562
 	}
6556 6563
 }
6557 6564
 
6558
-//退款
6565
+// 退款
6559 6566
 func (c *HisApiController) Refund() {
6560 6567
 	order_id, _ := c.GetInt64("order_id")
6561 6568
 	order, _ := service.GetHisOrderByID(order_id)
@@ -9359,7 +9366,7 @@ func RemoveRepeatedTeam(arr []*models.HisOrderInfoTwo) (newArr []*models.HisOrde
9359 9366
 	return
9360 9367
 }
9361 9368
 
9362
-//修改处方退库操作 参数传修改之前的处方数据
9369
+// 修改处方退库操作 参数传修改之前的处方数据
9363 9370
 func DeleteDrugWarehosueInfo(advice models.HisDoctorAdviceInfo) (err error) {
9364 9371
 
9365 9372
 	if advice.ExecutionState == 1 {

+ 11 - 2
controllers/mobile_api_controllers/check_weight_api_controller.go View File

@@ -270,7 +270,10 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
270 270
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
271 271
 
272 272
 	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 27 || template.TemplateId == 34 || template.TemplateId == 30 || template.TemplateId == 32 || template.TemplateId == 36 || template.TemplateId == 40 || template.TemplateId == 38 || template.TemplateId == 43 || template.TemplateId == 46 || template.TemplateId == 53 || template.TemplateId == 48 || adminUserInfo.Org.Id == 10345 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10138 || adminUserInfo.Org.Id == 10278 {
273
-		dewater_amount = dewater_amount * 1000
273
+		if adminUserInfo.Org.Id != 10447 {
274
+			dewater_amount = dewater_amount * 1000
275
+		}
276
+
274 277
 	}
275 278
 
276 279
 	if dewater_amount < 0 {
@@ -383,6 +386,12 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
383 386
 				newprescribe.Bicarbonate = 31.1
384 387
 				newprescribe.DialysateFlow = 500
385 388
 			}
389
+			// 针对新化博翔
390
+			if adminUserInfo.Org.Id == 10447 {
391
+				newprescribe.DisplaceLiquiPart = 1
392
+				newprescribe.DisplaceLiquiValue = 32
393
+				newprescribe.DialysateFlow = 500
394
+			}
386 395
 			//插入透析处方
387 396
 			err := service.AddSigleRecord(&newprescribe)
388 397
 			key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
@@ -662,7 +671,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
662 671
 				if adminUserInfo.Org.Id == 10318 {
663 672
 					evaluation.Remark = "患者已确认无发热,无流行病学接触史"
664 673
 				}
665
-				if adminUserInfo.Org.Id == 10340 {
674
+				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10447 {
666 675
 					evaluation.BreathingRate = "20"
667 676
 				}
668 677
 				if adminUserInfo.Org.Id == 10445 {

+ 13 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -1891,6 +1891,10 @@ func (c *DialysisAPIController) Finish() {
1891 1891
 		} else {
1892 1892
 			tempassessmentAfterDislysis.ActualDisplacement = endmonitorRecords.DisplacementQuantity
1893 1893
 		}
1894
+		//新化博翔
1895
+		if adminUserInfo.Org.Id == 10447 {
1896
+			tempassessmentAfterDislysis.Temperature = endmonitorRecords.Temperature
1897
+		}
1894 1898
 
1895 1899
 	}
1896 1900
 
@@ -2537,6 +2541,13 @@ func (this *DialysisAPIController) StartDialysis() {
2537 2541
 			record.PulseFrequency = befor.PulseFrequency
2538 2542
 			record.BreathingRate = befor.BreathingRate
2539 2543
 		}
2544
+		//新化博翔
2545
+		if adminUserInfo.Org.Id == 10447 {
2546
+			befor, _ := service.GetAssessmentBeforThrity(adminUserInfo.Org.Id, patientID, recordDate.Unix())
2547
+			record.SystolicBloodPressure = befor.SystolicBloodPressure
2548
+			record.DiastolicBloodPressure = befor.DiastolicBloodPressure
2549
+			record.BreathingRate = befor.BreathingRate
2550
+		}
2540 2551
 		err := service.CreateMonitor(&record)
2541 2552
 
2542 2553
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":monitor_records"
@@ -4433,6 +4444,8 @@ func (c *DialysisAPIController) CreateConsumables() {
4433 4444
 			}
4434 4445
 		}
4435 4446
 
4447
+		fmt.Println("active------------------------------------", active)
4448
+		fmt.Println("len------------------------------", len(goods))
4436 4449
 		//新增
4437 4450
 		if active == 1 && len(goods) > 0 {
4438 4451
 			for _, item := range dialysisBefor {

+ 5 - 0
controllers/mobile_api_controllers/login_api_controller.go View File

@@ -6,6 +6,7 @@ import (
6 6
 	"XT_New/service"
7 7
 	"XT_New/utils"
8 8
 	"encoding/json"
9
+	"fmt"
9 10
 	"io/ioutil"
10 11
 	"net/http"
11 12
 	"net/url"
@@ -144,9 +145,13 @@ func (this *LoginAPIController) LoginByPwd() {
144 145
 
145 146
 		//设置cookie
146 147
 		mobile = mobile + "-" + strconv.FormatInt(org.Id, 10) + "-" + strconv.FormatInt(appRole.Id, 10)
148
+		fmt.Println("mobile-------------------------------------------------------", mobile)
147 149
 		token := utils.GenerateLoginToken(mobile)
150
+		fmt.Println("token-------------------------------------------------------", token)
148 151
 		expiration, _ := beego.AppConfig.Int64("mobile_token_expiration_second")
149 152
 		this.Ctx.SetCookie("token_cookie", token, expiration, "/")
153
+
154
+		fmt.Println("cookie获取--------------------------------------------------", this.Ctx.GetCookie("token_cookie"))
150 155
 		var configList interface{}
151 156
 		var dict_config_list interface{}
152 157
 

+ 11 - 2
controllers/print_data_api_controller.go View File

@@ -37,7 +37,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
37 37
 	idStrs := strings.Split(schIDStr, ",")
38 38
 	adminUserInfo := this.GetAdminUserInfo()
39 39
 
40
-	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 {
40
+	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 {
41 41
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
42 42
 		for _, item := range schedules {
43 43
 
@@ -72,6 +72,13 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
72 72
 			advice, _ := service.GetBatchDoctorAdvice(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
73 73
 			item.Advices = advice
74 74
 
75
+			//获取His医嘱
76
+			doctorAdvice, _ := service.GetHisBatchDoctorAdvice(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
77
+			item.HisAdvices = doctorAdvice
78
+
79
+			//获取项目
80
+			project, _ := service.GetHisBatchProject(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
81
+			item.HisPrescriptionProject = project
75 82
 			//双人核对
76 83
 			dobuleCheck, _ := service.GetBatchDobuleCheck(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
77 84
 			item.DoubleCheck = dobuleCheck
@@ -101,6 +108,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
101 108
 
102 109
 			}
103 110
 		}
111
+
104 112
 		if getScheduleErr != nil {
105 113
 			this.ErrorLog("获取打印透析记录失败:%v", getScheduleErr)
106 114
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -108,6 +116,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
108 116
 		}
109 117
 
110 118
 		medicalStaffs, getMedicalStaffErr := service.GetMedicalStaffs(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId)
119
+
111 120
 		if getMedicalStaffErr != nil {
112 121
 			this.ErrorLog("获取医护人员失败:%v", getMedicalStaffErr)
113 122
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -127,7 +136,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
127 136
 		})
128 137
 	}
129 138
 
130
-	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 {
139
+	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 {
131 140
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
132 141
 		for _, item := range schedules {
133 142
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)

+ 2 - 1
controllers/stock_in_api_controller.go View File

@@ -6278,6 +6278,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
6278 6278
 				Dealer:                  dealer_id,
6279 6279
 				LicenseNumber:           warehouseInfo.LicenseNumber,
6280 6280
 				GoodTypeId:              good.GoodTypeId,
6281
+				SysRecordTime:           time.Now().Unix(),
6281 6282
 			}
6282 6283
 
6283 6284
 			stockFlow := models.VmStockFlow{
@@ -6288,7 +6289,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
6288 6289
 				Count:                   list.StockCount - item.Count,
6289 6290
 				UserOrgId:               warehouseInfo.OrgId,
6290 6291
 				PatientId:               0,
6291
-				SystemTime:              0,
6292
+				SystemTime:              time.Now().Unix(),
6292 6293
 				ConsumableType:          2,
6293 6294
 				IsSys:                   2,
6294 6295
 				WarehousingOrder:        "",

+ 1 - 0
models/self_drug_models.go View File

@@ -957,6 +957,7 @@ type SgjDrugWarehouseOutInfo struct {
957 957
 	Number                  string     `gorm:"column:number" json:"number" form:"number"`
958 958
 	BatchNumber             string     `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
959 959
 	PatientId               int64      `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
960
+	IsCheck                 int64      `gorm:"column:is_check" json:"is_check" form:"is_check"`
960 961
 	XtBaseDrug              XtBaseDrug `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" `
961 962
 }
962 963
 

+ 1 - 1
service/drug_stock_service.go View File

@@ -263,7 +263,7 @@ func GetDrugOutOrderPrintList(startime int64, endtime int64, orgid int64) (list
263 263
 
264 264
 func GetDrugOutOrderInfoPrintList(startime int64, endtime int64, orgid int64) (list []*models.SgjDrugWarehouseOutInfo, err error) {
265 265
 
266
-	db := XTReadDB().Table("xt_drug_warehouse_out_info").Where("status = 1")
266
+	db := XTReadDB().Table("xt_drug_warehouse_out_info").Where("status = 1 and is_check=1")
267 267
 	if startime > 0 {
268 268
 		db = db.Where("ctime >=?", startime)
269 269
 	}

+ 21 - 19
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go View File

@@ -819,25 +819,27 @@ func (PatientVMOne) TableName() string {
819 819
 }
820 820
 
821 821
 type ScheduleVMSix struct {
822
-	ID                       int64                       `gorm:"column:id" json:"id"`
823
-	PatientID                int64                       `gorm:"column:patient_id" json:"patient_id"`
824
-	ScheduleDate             int64                       `gorm:"column:schedule_date" json:"schedule_date"`
825
-	BedID                    int64                       `gorm:"column:bed_id" json:"bed_id"`
826
-	PartitionId              int64                       `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
827
-	Patient                  *PatientVMSix               `gorm:"ForeignKey:PatientID" json:"patient"`
828
-	DialysisOrder            DialysisOrderVM             `gorm:"ForeignKey:DialysisDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"dialysis_order"`
829
-	Prescription             PrescriptionVM              `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"prescription"`
830
-	ReceiveAssessment        ReceiveAssessmentVM         `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"receive_assessment"`
831
-	XtReceiveTreatmentAsses  *XtReceiveTreatmentAsses    `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"xt_receive_assessment"`
832
-	AssessmentBeforeDislysis AssessmentBeforeDislysisVM  `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_before_dislysis"`
833
-	AssessmentAfterDislysis  AssessmentAfterDislysisVM   `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_after_dislysis"`
834
-	MonitoringRecords        []*MonitoringRecordVM       `gorm:"ForeignKey:MonitoringDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"monitor_records"`
835
-	DeviceNumber             *DeviceNumberVM             `gorm:"ForeignKey:BedID" json:"device_number"`
836
-	DeviceZone               *DeviceZoneVM               `gorm:"ForeignKey:PartitionId" json:"device_zone"`
837
-	Advices                  []*DoctorAdviceVM           `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientId" json:"advices"`
838
-	DoubleCheck              *DoubleCheckVM              `gorm:"ForeignKey:CheckDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"check"`
839
-	Summer                   *SummerVM                   `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"summer"`
840
-	LastAfterWeight          XtAssessmentAfterDislysisVM `gorm:"ForeignKey:PatientID;AssociationForeignKey:PatientID" json:"lastafterweight"`
822
+	ID                       int64                            `gorm:"column:id" json:"id"`
823
+	PatientID                int64                            `gorm:"column:patient_id" json:"patient_id"`
824
+	ScheduleDate             int64                            `gorm:"column:schedule_date" json:"schedule_date"`
825
+	BedID                    int64                            `gorm:"column:bed_id" json:"bed_id"`
826
+	PartitionId              int64                            `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
827
+	Patient                  *PatientVMSix                    `gorm:"ForeignKey:PatientID" json:"patient"`
828
+	DialysisOrder            DialysisOrderVM                  `gorm:"ForeignKey:DialysisDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"dialysis_order"`
829
+	Prescription             PrescriptionVM                   `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"prescription"`
830
+	ReceiveAssessment        ReceiveAssessmentVM              `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"receive_assessment"`
831
+	XtReceiveTreatmentAsses  *XtReceiveTreatmentAsses         `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"xt_receive_assessment"`
832
+	AssessmentBeforeDislysis AssessmentBeforeDislysisVM       `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_before_dislysis"`
833
+	AssessmentAfterDislysis  AssessmentAfterDislysisVM        `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"assessment_after_dislysis"`
834
+	MonitoringRecords        []*MonitoringRecordVM            `gorm:"ForeignKey:MonitoringDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"monitor_records"`
835
+	DeviceNumber             *DeviceNumberVM                  `gorm:"ForeignKey:BedID" json:"device_number"`
836
+	DeviceZone               *DeviceZoneVM                    `gorm:"ForeignKey:PartitionId" json:"device_zone"`
837
+	Advices                  []*DoctorAdviceVM                `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientId" json:"advices"`
838
+	DoubleCheck              *DoubleCheckVM                   `gorm:"ForeignKey:CheckDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"check"`
839
+	Summer                   *SummerVM                        `gorm:"ForeignKey:AssessmentDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"summer"`
840
+	LastAfterWeight          XtAssessmentAfterDislysisVM      `gorm:"ForeignKey:PatientID;AssociationForeignKey:PatientID" json:"lastafterweight"`
841
+	HisAdvices               []*models.HisDoctorAdviceInfo    `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"his_advices"`
842
+	HisPrescriptionProject   []*models.HisPrescriptionProject `gorm:"ForeignKey:RecordDate,PatientID;AssociationForeignKey:ScheduleDate,PatientID" json:"his_project"`
841 843
 	Count                    int64
842 844
 }
843 845
 

+ 12 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go View File

@@ -448,6 +448,18 @@ func GetBatchDoctorAdvice(orgid int64, patient_id int64, advice_date int64) (Doc
448 448
 	return DoctorAdviceVM, err
449 449
 }
450 450
 
451
+func GetHisBatchDoctorAdvice(orgid int64, patient_id int64, advice_date int64) (advice []*models.HisDoctorAdviceInfo, err error) {
452
+
453
+	err = p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and advice_date = ? and status = 1", orgid, patient_id, advice_date).Order("start_time asc, groupno desc, id asc").Find(&advice).Error
454
+	return advice, err
455
+}
456
+
457
+func GetHisBatchProject(orgid int64, patient_id int64, advice_date int64) (project []*models.HisPrescriptionProject, err error) {
458
+
459
+	err = p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and record_date = ? and status= 1", orgid, patient_id, advice_date).Find(&project).Error
460
+	return project, err
461
+}
462
+
451 463
 func GetBatchDobuleCheck(orgid int64, patient_id int64, check_date int64) (*DoubleCheckVM, error) {
452 464
 
453 465
 	doubleCheckVM := DoubleCheckVM{}

+ 17 - 10
service/stock_service.go View File

@@ -39,7 +39,7 @@ func FindAllDealerTotal(orgId int64) (total int64) {
39 39
 	return
40 40
 }
41 41
 
42
-//获取经销商的名称
42
+// 获取经销商的名称
43 43
 func FindAllDealerName(orgId int64) (tmp []*models.Dealer, err error) {
44 44
 	err = readDb.Model(&models.Dealer{}).Where("org_id = ? and status = 1", orgId).Find(&tmp).Error
45 45
 	return
@@ -91,7 +91,7 @@ func ModifyManufacturer(manufacturer *models.Manufacturer) error {
91 91
 	return err
92 92
 }
93 93
 
94
-//获取生产厂商名称
94
+// 获取生产厂商名称
95 95
 func FindAllManufacturerName(orgid int64) (tmp []*models.Manufacturer, err error) {
96 96
 	err = readDb.Model(&models.Manufacturer{}).Where("org_id = ? and status = 1", orgid).Find(&tmp).Error
97 97
 	return
@@ -3606,10 +3606,10 @@ func GetAllDealerList(orgid int64) (list []*models.Dealer, err error) {
3606 3606
 	return list, err
3607 3607
 }
3608 3608
 
3609
-//func GetAllDealerListTX(orgid int64,tx *gorm.DB) (list []*models.Dealer, err error) {
3610
-//	err = tx.Where("org_id = ? and status = 1", orgid).Find(&list).Error
3611
-//	return list, err
3612
-//}
3609
+//	func GetAllDealerListTX(orgid int64,tx *gorm.DB) (list []*models.Dealer, err error) {
3610
+//		err = tx.Where("org_id = ? and status = 1", orgid).Find(&list).Error
3611
+//		return list, err
3612
+//	}
3613 3613
 func GetDealerByName(orgid int64, name string) (*models.Dealer, error) {
3614 3614
 	var dealer models.Dealer
3615 3615
 	var err error
@@ -6515,7 +6515,7 @@ func GetAllDrugFlowById(drugid int64, patient_id int64, advicedate int64, orgid
6515 6515
 	return info, err
6516 6516
 }
6517 6517
 
6518
-//耗材加库存
6518
+// 耗材加库存
6519 6519
 func ModifyGoodAddInformation(good_id int64, sum_count int64, orgid int64) (models.GoodInfo, error) {
6520 6520
 
6521 6521
 	info := models.GoodInfo{}
@@ -6583,7 +6583,7 @@ func GetWarehouseInfoByIdTwenty(id int64, orgid int64) (models.WarehousingInfo,
6583 6583
 	return info, err
6584 6584
 }
6585 6585
 
6586
-//药品加库存
6586
+// 药品加库存
6587 6587
 func ModifyDrugAddInformation(drug_id int64, sum_count int64, orgid int64) (models.BaseDrugLib, error) {
6588 6588
 
6589 6589
 	info := models.BaseDrugLib{}
@@ -8372,7 +8372,7 @@ func DeleteGoodFlow(good_id int64, sys_record_time int64, org_id int64, project_
8372 8372
 func FindPrescriptionWarehouseOut(org_id int64, warehouse_out_time int64) (models.WarehouseOut, error) {
8373 8373
 
8374 8374
 	out := models.WarehouseOut{}
8375
-	err = readDb.Model(&models.WarehouseOut{}).Where("org_id = ?  and status = 1 and warehouse_out_time = ?", org_id, warehouse_out_time).Find(&out).Error
8375
+	err = readDb.Model(&models.WarehouseOut{}).Where("org_id = ?  and status = 1 and warehouse_out_time = ? and is_sys=1", org_id, warehouse_out_time).Find(&out).Error
8376 8376
 	return out, err
8377 8377
 
8378 8378
 }
@@ -8380,7 +8380,7 @@ func FindPrescriptionWarehouseOut(org_id int64, warehouse_out_time int64) (model
8380 8380
 func FindLastPrescriptionWarehouseOut(org_id int64, warehouse_out_time int64) (models.WarehouseOut, error) {
8381 8381
 
8382 8382
 	out := models.WarehouseOut{}
8383
-	err = readDb.Model(&models.WarehouseOut{}).Where("org_id = ?  and status = 1 and warehouse_out_time = ?", org_id, warehouse_out_time).Last(&out).Error
8383
+	err = readDb.Model(&models.WarehouseOut{}).Where("org_id = ?  and status = 1 and warehouse_out_time = ? and is_sys=1", org_id, warehouse_out_time).Last(&out).Error
8384 8384
 	return out, err
8385 8385
 
8386 8386
 }
@@ -8495,3 +8495,10 @@ func GetNewWarehouseOutInfoList(start_time int64, end_time int64, orgid int64, g
8495 8495
 	err = db.Preload("GoodInfo", "org_id = ? and status = 1", orgid).Find(&info).Error
8496 8496
 	return info, err
8497 8497
 }
8498
+
8499
+func GetGoodOutOpenConfigOne(user_org_id int64) (models.XtGoodOutConfig, error) {
8500
+
8501
+	config := models.XtGoodOutConfig{}
8502
+	err := XTReadDB().Where("user_org_id = ? and status = 1", user_org_id).Find(&config).Error
8503
+	return config, err
8504
+}

+ 1 - 1
service/warhouse_service.go View File

@@ -9884,7 +9884,7 @@ func ConsumablesDeliveryTwelve(orgID int64, record_time int64, goods *models.War
9884 9884
 	//	return errors.New("库存数量不足")
9885 9885
 	//}
9886 9886
 
9887
-	if warehouse.StockCount-maxNumber > 0 {
9887
+	if warehouse.StockCount-maxNumber >= 0 {
9888 9888
 		warehouse.StockCount = warehouse.StockCount - maxNumber
9889 9889
 	} else {
9890 9890
 		warehouse.StockCount = warehouse.StockCount