Browse Source

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

陈少旭 1 month ago
parent
commit
1dce24b157

BIN
XT_New.exe View File


+ 7 - 0
controllers/dialysis_api_controller.go View File

@@ -5009,6 +5009,13 @@ func (c *DialysisApiController) GetDialysisOrder() {
5009 5009
 		endTime = theTime.Unix()
5010 5010
 	}
5011 5011
 
5012
+	if xttime < 1740931200 {
5013
+
5014
+		startTime = 1740326400
5015
+
5016
+		endTime = 1740844800
5017
+	}
5018
+
5012 5019
 	scheduleDialyCount, _ := service.GetPatientScheduleDialyCount(patientInfo.ID, startTime, endTime, adminUserInfo.CurrentOrgId)
5013 5020
 
5014 5021
 	dialysis_count := len(scheduleDialyCount)

+ 1 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -4147,7 +4147,7 @@ func (this *DialysisAPIController) StartDialysis() {
4147 4147
 	}
4148 4148
 
4149 4149
 	//只针对广慈医院
4150
-	if template.TemplateId == 26 || template.TemplateId == 25 || template.TemplateId == 28 || adminUserInfo.Org.Id == 9987 || adminUserInfo.Org.Id == 9526 || template.TemplateId == 32 || adminUserInfo.Org.Id == 9918 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 4 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10517 || adminUserInfo.Org.Id == 10679 || adminUserInfo.Org.Id == 10742 {
4150
+	if template.TemplateId == 26 || template.TemplateId == 25 || template.TemplateId == 28 || adminUserInfo.Org.Id == 9987 || adminUserInfo.Org.Id == 9526 || template.TemplateId == 32 || adminUserInfo.Org.Id == 9918 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 4 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10517 || adminUserInfo.Org.Id == 10679 || adminUserInfo.Org.Id == 10742 || adminUserInfo.Org.Id == 10757 {
4151 4151
 		// 查询病人是否有透前评估数据
4152 4152
 		befor, errcode := service.GetAssessmentBefor(adminUserInfo.Org.Id, patientID, recordDate.Unix())
4153 4153
 

+ 8 - 1
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -6264,6 +6264,13 @@ func (c *PatientApiController) GetPrintDialysisOrder() {
6264 6264
 		endTime = theTime.Unix()
6265 6265
 	}
6266 6266
 
6267
+	if xttime < 1740931200 {
6268
+
6269
+		startTime = 1740326400
6270
+
6271
+		endTime = 1740844800
6272
+	}
6273
+
6267 6274
 	scheduleDialyCount, _ := service.GetPatientScheduleDialyCount(patientInfo.ID, startTime, endTime, adminUserInfo.Org.Id)
6268 6275
 
6269 6276
 	dialysis_count_one := len(scheduleDialyCount)
@@ -6952,7 +6959,7 @@ func (c *PatientApiController) DelDoctorAdvice() {
6952 6959
 		adminUserInfo := c.GetMobileAdminUserInfo()
6953 6960
 		var advice models.DoctorAdvice
6954 6961
 		if groupno > 0 {
6955
-			advice, _ = service.FindDoctorAdviceByGoroupNo(adminUserInfo.Org.Id, groupno)
6962
+			advice, _ = service.FindDoctorAdviceByGoroupNoOne(adminUserInfo.Org.Id, groupno, patient_id, doc_advice_date)
6956 6963
 			if advice.ID == 0 {
6957 6964
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDoctorAdviceNotExist)
6958 6965
 				return

+ 33 - 11
controllers/new_stock_api_controller.go View File

@@ -171,6 +171,8 @@ func (this *NewStockApiController) GetHisDrugCodeQuery() {
171 171
 	is_settle, _ := this.GetInt64("is_settle")
172 172
 	is_code, _ := this.GetInt64("is_code")
173 173
 
174
+	is_type, _ := this.GetInt64("is_type")
175
+
174 176
 	orgId := this.GetAdminUserInfo().CurrentOrgId
175 177
 	timeLayout := "2006-01-02"
176 178
 	loc, _ := time.LoadLocation("Local")
@@ -194,20 +196,40 @@ func (this *NewStockApiController) GetHisDrugCodeQuery() {
194 196
 		endTime = theTime.Unix()
195 197
 	}
196 198
 
197
-	list, total, _ := service.GetHisDrugCodeQuery(orgId, startTime, endTime, limit, page, is_sale, is_settle, keywords, is_code)
199
+	if is_type == 1 {
200
+		list, total, _ := service.GetHisDrugCodeQuery(orgId, startTime, endTime, limit, page, is_sale, is_settle, keywords, is_code)
198 201
 
199
-	drug, _ := service.GetAllDrugList(orgId)
202
+		drug, _ := service.GetAllDrugList(orgId)
200 203
 
201
-	codeConfig, _ := service.GetDrugCodeConfig(orgId)
204
+		codeConfig, _ := service.GetDrugCodeConfig(orgId)
202 205
 
203
-	patients, _ := service.GetAllpatient(orgId)
204
-	this.ServeSuccessJSON(map[string]interface{}{
205
-		"list":       list,
206
-		"total":      total,
207
-		"drug":       drug,
208
-		"patients":   patients,
209
-		"codeConfig": codeConfig,
210
-	})
206
+		patients, _ := service.GetAllpatient(orgId)
207
+		this.ServeSuccessJSON(map[string]interface{}{
208
+			"list":       list,
209
+			"total":      total,
210
+			"drug":       drug,
211
+			"patients":   patients,
212
+			"codeConfig": codeConfig,
213
+		})
214
+	}
215
+
216
+	if is_type == 2 {
217
+		advice, total, _ := service.GetBloodDrugCode(orgId, startTime, endTime, limit, page, is_sale)
218
+
219
+		drug, _ := service.GetAllDrugList(orgId)
220
+
221
+		codeConfig, _ := service.GetDrugCodeConfig(orgId)
222
+
223
+		patients, _ := service.GetAllpatient(orgId)
224
+		this.ServeSuccessJSON(map[string]interface{}{
225
+			"list":       advice,
226
+			"total":      total,
227
+			"drug":       drug,
228
+			"patients":   patients,
229
+			"codeConfig": codeConfig,
230
+		})
231
+
232
+	}
211 233
 
212 234
 	return
213 235
 }

+ 7 - 1
controllers/print_data_api_controller.go View File

@@ -257,9 +257,15 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
257 257
 				endTime = theTime.Unix()
258 258
 			}
259 259
 
260
+			if item.ScheduleDate < 1740931200 {
261
+
262
+				startTime = 1740326400
263
+
264
+				endTime = 1740844800
265
+			}
266
+
260 267
 			scheduleDialyCount, _ := service.GetPatientScheduleDialyCount(item.PatientID, startTime, endTime, adminUserInfo.CurrentOrgId)
261 268
 
262
-			fmt.Println("scheduleDialyCount------------------", scheduleDialyCount)
263 269
 			dialysis_count := len(scheduleDialyCount)
264 270
 
265 271
 			var dialysis_count_str = "一周" + strconv.Itoa(dialysis_count) + "次"

+ 1 - 0
models/dialysis.go View File

@@ -465,6 +465,7 @@ type DoctorAdvice struct {
465 465
 	IsSettle              int64           `gorm:"column:is_settle" json:"is_settle" form:"is_settle"`
466 466
 	IsPrescription        int64           `gorm:"column:is_prescription" json:"is_prescription" form:"is_prescription"`
467 467
 	DrugCode              string          `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
468
+	IsUpload              int64           `gorm:"column:is_upload" json:"is_upload" form:"is_upload"`
468 469
 }
469 470
 
470 471
 func (DoctorAdvice) TableName() string {

+ 11 - 6
service/new_warehouse_service.go View File

@@ -4606,17 +4606,22 @@ func HisStoryBloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, war
4606 4606
 				warehouse.StockMaxNumber = warehouse.StockMaxNumber - 1
4607 4607
 			}
4608 4608
 
4609
+			if warehouse.MaxUnit != warehouse.MinUnit {
4610
+				warehouse.StockMinNumber = warehouse.StockMinNumber + drup.MinNumber - minNumber
4611
+			}
4612
+			fmt.Println("minNumber------", minNumber)
4613
+			fmt.Println("warehouse.StockMinNumber", warehouse.StockMinNumber)
4614
+			fmt.Println(" warehouse.MaxUnit", warehouse.MaxUnit)
4615
+			fmt.Println(" warehouse.MinUnit", warehouse.MinUnit)
4616
+
4609 4617
 			if warehouse.MaxUnit == warehouse.MinUnit {
4610 4618
 				//改动的地方
4611 4619
 				warehouse.StockMaxNumber = warehouse.StockMaxNumber - minNumber
4612 4620
 			}
4613 4621
 
4614
-			if warehouse.MaxUnit != warehouse.MinUnit {
4615
-				warehouse.StockMinNumber = warehouse.StockMinNumber + drup.MinNumber - minNumber
4616
-			}
4617
-			if minNumber == 2 && warehouse.MaxUnit == warehouse.MinUnit && warehouse.StockMinNumber == 0 {
4618
-				warehouse.StockMaxNumber = warehouse.StockMaxNumber - 1
4619
-			}
4622
+			//if minNumber == 2 && warehouse.MaxUnit == warehouse.MinUnit && warehouse.StockMinNumber == 0 {
4623
+			//	warehouse.StockMaxNumber = warehouse.StockMaxNumber - 1
4624
+			//}
4620 4625
 		} else {
4621 4626
 
4622 4627
 			if minNumber > 0 {

+ 5 - 0
service/patient_service.go View File

@@ -1757,6 +1757,11 @@ func FindDoctorAdviceByGoroupNo(orgID int64, groupno int64) (advice models.Docto
1757 1757
 	return
1758 1758
 }
1759 1759
 
1760
+func FindDoctorAdviceByGoroupNoOne(orgID int64, groupno int64, patient_id int64, advice_date int64) (advice models.DoctorAdvice, err error) {
1761
+	err = readDb.Model(&models.DoctorAdvice{}).Where("user_org_id=?  AND groupno = ? AND status = 1 and patient_id = ? and advice_date =?", orgID, groupno, patient_id, advice_date).First(&advice).Error
1762
+	return
1763
+}
1764
+
1760 1765
 func FindOldDoctorAdvice(orgID int64, advice_id int64) (advice models.DoctorAdvice, err error) {
1761 1766
 	err = readDb.Model(&models.DoctorAdvice{}).Where("id = ? AND user_org_id=? AND status = 1", advice_id, orgID).First(&advice).Error
1762 1767
 	return

+ 25 - 0
service/stock_service.go View File

@@ -11066,6 +11066,31 @@ func GetHisDrugCodeQuery(orgId int64, start_time int64, end_time int64, limit in
11066 11066
 	return list, total, err
11067 11067
 }
11068 11068
 
11069
+func GetBloodDrugCode(orgId int64, start_time int64, end_time int64, limit int64, page int64, is_sale int64) (advice []*models.DoctorAdvice, total int64, err error) {
11070
+
11071
+	db := XTReadDB().Model(&advice).Where("status=1 and advice_type !=1")
11072
+
11073
+	if orgId > 0 {
11074
+		db = db.Where("user_org_id = ?", orgId)
11075
+	}
11076
+
11077
+	if start_time > 0 {
11078
+		db = db.Where("advice_date>=?", start_time)
11079
+	}
11080
+
11081
+	if end_time > 0 {
11082
+		db = db.Where("advice_date<=?", end_time)
11083
+	}
11084
+
11085
+	if is_sale > 0 {
11086
+		db = db.Where("is_upload = ?", is_sale)
11087
+	}
11088
+	offset := (page - 1) * limit
11089
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("advice_date desc").Find(&advice).Error
11090
+
11091
+	return advice, total, err
11092
+}
11093
+
11069 11094
 func GetDoctorAdviceInfoList(page int64, limit int64, orgId int64, start_time int64, end_time int64, is_sale int64) ([]models.HisDoctorAdviceInfo, int64, error) {
11070 11095
 	var list []models.HisDoctorAdviceInfo
11071 11096
 	var total int64