Quellcode durchsuchen

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

陈少旭 vor 9 Monaten
Ursprung
Commit
252d35a24e

BIN
XT_New.exe Datei anzeigen


+ 4 - 4
controllers/base_api_controller.go Datei anzeigen

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

Datei-Diff unterdrückt, da er zu groß ist
+ 904 - 967
controllers/mobile_api_controllers/dialysis_api_controller.go


+ 94 - 0
controllers/mobile_api_controllers/patient_api_controller.go Datei anzeigen

@@ -1812,6 +1812,100 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1812 1812
 					}
1813 1813
 				}
1814 1814
 
1815
+				//针对异常未出库问题的脚本
1816
+				//if adminInfo.Org.Id == 10402 {
1817
+				//
1818
+				//	newadviceInfo := &models.HisDoctorAdviceInfo{
1819
+				//		ID:                    advice.ID,
1820
+				//		UserOrgId:             advice.UserOrgId,
1821
+				//		PatientId:             advice.PatientId,
1822
+				//		HisPatientId:          advice.HisPatientId,
1823
+				//		AdviceType:            advice.AdviceType,
1824
+				//		AdviceDate:            advice.AdviceDate,
1825
+				//		StartTime:             advice.StartTime,
1826
+				//		AdviceName:            advice.AdviceName,
1827
+				//		AdviceDesc:            advice.AdviceDesc,
1828
+				//		ReminderDate:          advice.ReminderDate,
1829
+				//		SingleDose:            advice.SingleDose,
1830
+				//		SingleDoseUnit:        advice.SingleDoseUnit,
1831
+				//		PrescribingNumber:     advice.PrescribingNumber,
1832
+				//		PrescribingNumberUnit: advice.PrescribingNumberUnit,
1833
+				//		DeliveryWay:           advice.DeliveryWay,
1834
+				//		ExecutionFrequency:    advice.ExecutionFrequency,
1835
+				//		AdviceDoctor:          advice.AdviceDoctor,
1836
+				//		Status:                advice.Status,
1837
+				//		CreatedTime:           advice.CreatedTime,
1838
+				//		UpdatedTime:           advice.UpdatedTime,
1839
+				//		AdviceAffirm:          advice.AdviceAffirm,
1840
+				//		Remark:                advice.Remark,
1841
+				//		StopTime:              advice.StopTime,
1842
+				//		StopReason:            advice.StopReason,
1843
+				//		StopDoctor:            advice.StopDoctor,
1844
+				//		StopState:             advice.StopState,
1845
+				//		ParentId:              advice.ParentId,
1846
+				//		ExecutionTime:         advice.ExecutionTime,
1847
+				//		ExecutionStaff:        advice.ExecutionStaff,
1848
+				//		ExecutionState:        advice.ExecutionState,
1849
+				//		Checker:               advice.Checker,
1850
+				//		RecordDate:            advice.RecordDate,
1851
+				//		DialysisOrderId:       advice.DialysisOrderId,
1852
+				//		CheckTime:             advice.CheckTime,
1853
+				//		CheckState:            advice.CheckState,
1854
+				//		DrugSpec:              advice.DrugSpec,
1855
+				//		DrugSpecUnit:          advice.DrugSpecUnit,
1856
+				//		Groupno:               advice.Groupno,
1857
+				//		RemindType:            advice.RemindType,
1858
+				//		FrequencyType:         advice.FrequencyType,
1859
+				//		DayCount:              advice.DayCount,
1860
+				//		WeekDay:               advice.WeekDay,
1861
+				//		TemplateId:            advice.TemplateId,
1862
+				//		Modifier:              advice.Modifier,
1863
+				//		DrugId:                advice.DrugId,
1864
+				//		Price:                 advice.Price,
1865
+				//		PrescriptionId:        advice.PrescriptionId,
1866
+				//		MedListCodg:           advice.MedListCodg,
1867
+				//		FeedetlSn:             advice.FeedetlSn,
1868
+				//		Day:                   advice.DayCount,
1869
+				//		ChildDoctorAdvice:     nil,
1870
+				//		Drug:                  models.Drug{},
1871
+				//		Diagnosis:             advice.Diagnosis,
1872
+				//		Way:                   advice.Way,
1873
+				//		HospApprFlag:          advice.HospApprFlag,
1874
+				//		LmtUsedFlag:           advice.LmtUsedFlag,
1875
+				//		HisOrderInfo:          models.HisOrderInfo{},
1876
+				//		IsMedicine:            advice.IsMedicine,
1877
+				//		ExecutionFrequencyId:  advice.ExecutionFrequencyId,
1878
+				//		Child:                 nil,
1879
+				//		IsSettle:              advice.IsSettle,
1880
+				//		IsMobile:              advice.IsMobile,
1881
+				//		IsSelfDrug:            advice.IsSelfDrug,
1882
+				//		DrugWayCount:          advice.DrugWayCount,
1883
+				//	}
1884
+				//	outListExport, _ := service.GetWarehouseOutListExport(advice.DrugId, advice.PatientId, advice.AdviceDate, advice.ID)
1885
+				//
1886
+				//	var out_count int64
1887
+				//	if len(outListExport) > 0 {
1888
+				//		for _, item := range outListExport {
1889
+				//			if item.CountUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
1890
+				//				out_count = item.Count * medical.MinNumber
1891
+				//			}
1892
+				//			if item.CountUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
1893
+				//				out_count = item.Count
1894
+				//			}
1895
+				//			if item.CountUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
1896
+				//				out_count = item.Count * medical.MinNumber
1897
+				//			}
1898
+				//
1899
+				//		}
1900
+				//	}
1901
+				//	//按最小单位出库
1902
+				//	var cha_count = prescribing_number_total - out_count
1903
+				//
1904
+				//	newadviceInfo.PrescribingNumber = float64(cha_count)
1905
+				//	newadviceInfo.PrescribingNumberUnit = medical.MinUnit
1906
+				//	service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
1907
+				//}
1908
+
1815 1909
 			}
1816 1910
 		}
1817 1911
 

+ 1 - 0
models/patient_models.go Datei anzeigen

@@ -1846,6 +1846,7 @@ type NewDialysisPrescription struct {
1846 1846
 	DisplaceLiquiValue         float64 `gorm:"column:displace_liqui_value" json:"displace_liqui_value" form:"displace_liqui_value"`
1847 1847
 	BloodFlowVolume            float64 `gorm:"column:blood_flow_volume" json:"blood_flow_volume" form:"blood_flow_volume"`
1848 1848
 	PrescriptionWater          float64 `gorm:"column:prescription_water" json:"prescription_water" form:"prescription_water"`
1849
+	DisplaceLiquiPart          int64   `gorm:"column:displace_liqui_part" json:"displace_liqui_part" form:"displace_liqui_part"`
1849 1850
 }
1850 1851
 
1851 1852
 func (NewDialysisPrescription) TableName() string {

+ 2 - 2
service/dialysis_service.go Datei anzeigen

@@ -2500,9 +2500,9 @@ func GetAllAdviceList(patient_id int64, advice_date int64, user_org_id int64) (a
2500 2500
 	return advice, err
2501 2501
 }
2502 2502
 
2503
-func GetHistoryWarehouseOutInfo(patient_id int64, user_org_id int64, record_time int64) (outInfo []*models.WarehouseOutInfo, err error) {
2503
+func GetHistoryWarehouseOutInfo(patient_id int64, user_org_id int64, record_time int64, good_id int64) (outInfo []*models.WarehouseOutInfo, err error) {
2504 2504
 
2505
-	err = XTReadDB().Where("patient_id = ? and user_org_id = ? and sys_record_time = ? and status =1", patient_id, user_org_id, record_time).Find(&outInfo).Error
2505
+	err = XTReadDB().Where("patient_id = ? and org_id = ? and sys_record_time = ? and status =1 and good_id = ?", patient_id, user_org_id, record_time, good_id).Find(&outInfo).Error
2506 2506
 
2507 2507
 	return outInfo, err
2508 2508
 }

+ 1 - 1
service/patient_service.go Datei anzeigen

@@ -1535,7 +1535,7 @@ func GetPatientDialysisRecord(orgID, patientID int64, page, limit, start, end, m
1535 1535
 	// Where("do.patient_id=? and do.user_org_id=? and do.stage = 2 and do.status=1", patientID, orgID).Count(&total).Offset(offset).Limit(limit).Order("do.dialysis_date desc").Select(" do.id, do.dialysis_date, do.user_org_id, do.patient_id, do.prescription_id, do.stage, do.remark, do.status, do.created_time, do.updated_time, s.schedule_type, s.partition_id, dz.name as partition_name").Find(&orders).Error
1536 1536
 
1537 1537
 	db := readDb.Table("xt_dialysis_order as do").
1538
-		Preload("DoctorAdvice", "patient_id =? and user_org_id = ? and status =1", patientID, orgID).
1538
+		Preload("DoctorAdvice", "patient_id =? and user_org_id = ? and status =1 and advice_type =2", patientID, orgID).
1539 1539
 		Preload("DialysisPrescription", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
1540 1540
 		Preload("PredialysisEvaluation", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
1541 1541
 		Preload("DialysisPrescription", func(db *gorm.DB) *gorm.DB {

+ 1 - 1
service/user_service.go Datei anzeigen

@@ -218,7 +218,7 @@ func GetAllHisDoctor(orgid int64) (appRole []*models.App_Role, err error) {
218 218
 
219 219
 func GetDrugFlowDetailById(drug_id int64, org_id int64) (flow []*models.DrugFlow, err error) {
220 220
 
221
-	if org_id == 10217 {
221
+	if org_id == 10188 {
222 222
 		err = XTReadDB().Model(&flow).Where("drug_id = ? and status =1 and user_org_id =? and system_time>=1717171200", drug_id, org_id).Order("ctime asc").Find(&flow).Error
223 223
 	} else {
224 224
 		err = XTReadDB().Model(&flow).Where("drug_id = ? and status =1 and user_org_id =?", drug_id, org_id).Order("ctime asc").Find(&flow).Error