Browse Source

库存调拨修改

28169 2 years ago
parent
commit
a1cda2bd91

+ 4 - 1
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 {

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

@@ -2546,6 +2546,7 @@ func (this *DialysisAPIController) StartDialysis() {
2546 2546
 			befor, _ := service.GetAssessmentBeforThrity(adminUserInfo.Org.Id, patientID, recordDate.Unix())
2547 2547
 			record.SystolicBloodPressure = befor.SystolicBloodPressure
2548 2548
 			record.DiastolicBloodPressure = befor.DiastolicBloodPressure
2549
+			record.BreathingRate = befor.BreathingRate
2549 2550
 		}
2550 2551
 		err := service.CreateMonitor(&record)
2551 2552
 
@@ -4443,6 +4444,8 @@ func (c *DialysisAPIController) CreateConsumables() {
4443 4444
 			}
4444 4445
 		}
4445 4446
 
4447
+		fmt.Println("active------------------------------------", active)
4448
+		fmt.Println("len------------------------------", len(goods))
4446 4449
 		//新增
4447 4450
 		if active == 1 && len(goods) > 0 {
4448 4451
 			for _, item := range dialysisBefor {

+ 9 - 0
controllers/print_data_api_controller.go View File

@@ -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)

+ 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{}