28169 1 mês atrás
pai
commit
26b53f7cd4

+ 6 - 6
controllers/base_api_controller.go Ver arquivo

@@ -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 = 10206 //机构id
86
+		subscibe.OrgId = 10164 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,8 +93,8 @@ 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 = 10206 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 10697 //4
96
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97
+		adminUserInfo.CurrentAppId = 12627 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
100 100
 		this.SetSession("admin_user_info", &adminUserInfo)
@@ -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 = 10206 //机构id小英9675或4
332
+		subscibe.OrgId = 10164 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,8 +339,8 @@ 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 = 10206 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 16787 //4
342
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343
+		adminUserInfo.CurrentAppId = 12627 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes
346 346
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 1 - 1
controllers/dialysis_api_controller.go Ver arquivo

@@ -2579,7 +2579,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2579 2579
 			if dry_weight > 0 {
2580 2580
 				dewater_amount = weight_before - dry_weight - additional_weight
2581 2581
 
2582
-				if adminUserInfo.CurrentOrgId != 10551 && adminUserInfo.CurrentOrgId != 10579 && adminUserInfo.CurrentOrgId != 10580 && adminUserInfo.CurrentOrgId != 10585 && adminUserInfo.CurrentOrgId != 10344 && adminUserInfo.CurrentOrgId != 10622 && adminUserInfo.CurrentOrgId != 10702 {
2582
+				if adminUserInfo.CurrentOrgId != 10551 && adminUserInfo.CurrentOrgId != 10579 && adminUserInfo.CurrentOrgId != 10580 && adminUserInfo.CurrentOrgId != 10585 && adminUserInfo.CurrentOrgId != 10344 && adminUserInfo.CurrentOrgId != 10622 && adminUserInfo.CurrentOrgId != 10702 && adminUserInfo.CurrentOrgId != 10635 {
2583 2583
 					dewater_amount = dewater_amount * 1000
2584 2584
 				}
2585 2585
 

+ 1 - 1
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go Ver arquivo

@@ -724,7 +724,7 @@ func (this *StaffScheduleApiController) DeleteSchedule() {
724 724
 		service.CreateScheduleLog(xtScheduleLog)
725 725
 
726 726
 		//针对凤凰医院
727
-		if org_id == 10579 || org_id == 10344 || org_id == 10206 {
727
+		if org_id == 10579 || org_id == 10344 || org_id == 10206 || org_id == 10679 {
728 728
 			advice, _ := service.GetDoctorAdviceListTwenty(schedule.PatientId, schedule.ScheduleDate, org_id)
729 729
 			if len(advice) > 0 {
730 730
 				service.UpdateAdviceObj(schedule.PatientId, schedule.ScheduleDate, org_id)

+ 4 - 1
controllers/new_stock_api_controller.go Ver arquivo

@@ -293,6 +293,9 @@ func (this *NewStockApiController) GetPatientDrugCode() {
293 293
 	creater := this.GetAdminUserInfo().AdminUser.Id
294 294
 	service.DispensingMedicineTwo(orgId, patient_id, advice_date, drug_id, creater)
295 295
 
296
-	this.ServeDynamicFailJsonSend("发药成功!")
296
+	this.ServeSuccessJSON(map[string]interface{}{
297
+		"msg": "发药成功!",
298
+	})
297 299
 	return
300
+
298 301
 }

+ 21 - 0
controllers/pharmacy_controller.go Ver arquivo

@@ -139,10 +139,13 @@ func (this *PharmacyController) TodayNumber() {
139 139
 	itotal, _ = service.GetTodayAdviceCount(stime, etime, orgid, 0)
140 140
 
141 141
 	drug, _ := service.GetAllBaseDrugList(orgid)
142
+
143
+	config, _ := service.GetDrugCodeConfig(orgid)
142 144
 	this.ServeSuccessJSON(map[string]interface{}{
143 145
 		"wtotal": wtotal,
144 146
 		"itotal": itotal,
145 147
 		"drug":   drug,
148
+		"config": config,
146 149
 	})
147 150
 	return
148 151
 
@@ -351,6 +354,8 @@ func (this *PharmacyController) GetPharmacyContent() {
351 354
 	prescriptionListByToDay, _ := service.GetPrescriptionListByToDay(orgid, patient_id, stime)
352 355
 
353 356
 	diagnose, _ := service.FindAllDiagnose(orgid)
357
+
358
+	config, _ := service.GetDrugCodeConfig(orgid)
354 359
 	if err != nil {
355 360
 		utils.ErrorLog(err.Error())
356 361
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -367,6 +372,7 @@ func (this *PharmacyController) GetPharmacyContent() {
367 372
 	return_value["doctors"] = allDoctor
368 373
 	return_value["prescription"] = prescriptionListByToDay
369 374
 	return_value["diagnose"] = diagnose
375
+	return_value["config"] = config
370 376
 	//if is_medicine == 1{发药时间先不展示
371 377
 	//	return_value["time"] = time
372 378
 	//}
@@ -402,12 +408,26 @@ func (this *PharmacyController) DispensingMedicine() {
402 408
 		etime = stime + 86399
403 409
 	}
404 410
 	tmp_bool := service.IsPharmacyConfig(orgid)
411
+	codeConfig, _ := service.GetDrugCodeConfig(orgid)
405 412
 	if tmp_bool == true {
406 413
 		advicelist, _ := service.FindeHisAdviceDocAdvice(orgid, patient_id, stime, etime)
407 414
 		if len(advicelist) > 0 {
415
+
408 416
 			var total int64
409 417
 			var prescribing_number_total int64
410 418
 			for _, item := range advicelist {
419
+
420
+				if codeConfig.IsOpen == 1 {
421
+					if item.DrugCode == "" || len(item.DrugCode) == 0 {
422
+						err := fmt.Errorf(service.FindDrugsName(item.DrugId) + "药品追溯码不能为空")
423
+						if err != nil {
424
+							utils.ErrorLog(err.Error())
425
+							this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
426
+							return
427
+						}
428
+					}
429
+				}
430
+
411 431
 				//查询改药品信息
412 432
 				medical, _ := service.GetBaseDrugMedical(item.DrugId)
413 433
 				//如果是药房发药的方式
@@ -797,6 +817,7 @@ func (this *PharmacyController) MedicineDeparture() {
797 817
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数不足")
798 818
 		return
799 819
 	}
820
+
800 821
 	err = service.MedicineDeparture(ids, creater, orgid)
801 822
 	if err != nil {
802 823
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())

+ 3 - 6
controllers/schedule_api_controller.go Ver arquivo

@@ -558,9 +558,7 @@ func (c *ScheduleApiController) BatchPostSmartSch() {
558 558
 
559 559
 				} else { //新的排班信息
560 560
 
561
-					fmt.Println("111111111")
562 561
 					if items["schedule_date"] == nil || reflect.TypeOf(items["schedule_date"]).String() != "string" {
563
-						fmt.Println("33333333")
564 562
 
565 563
 						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
566 564
 						return
@@ -603,8 +601,7 @@ func (c *ScheduleApiController) BatchPostSmartSch() {
603 601
 					schedule.ScheduleType = scheduleType
604 602
 
605 603
 					if items["bed_id"] == nil || reflect.TypeOf(items["bed_id"]).String() != "float64" {
606
-						fmt.Println("~~~~~~22222")
607
-						utils.ErrorLog("bed_id")
604
+
608 605
 						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
609 606
 						return
610 607
 					}
@@ -757,7 +754,7 @@ func (c *ScheduleApiController) BatchPostSmartSch() {
757 754
 
758 755
 					schedule.Status = 0
759 756
 					//针对凤凰医院
760
-					if adminInfo.CurrentOrgId == 10579 || adminInfo.CurrentOrgId == 10344 || adminInfo.CurrentOrgId == 10206 {
757
+					if adminInfo.CurrentOrgId == 10579 || adminInfo.CurrentOrgId == 10344 || adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10679 {
761 758
 						advice, _ := service.GetDoctorAdviceListTwenty(schedule.PatientId, schedule.ScheduleDate, adminInfo.CurrentOrgId)
762 759
 						if len(advice) > 0 {
763 760
 							service.UpdateAdviceObj(schedule.PatientId, schedule.ScheduleDate, adminInfo.CurrentOrgId)
@@ -2211,7 +2208,7 @@ func (c *ScheduleApiController) DeleteSchedule() {
2211 2208
 	service.CreateScheduleLog(scheduleLog)
2212 2209
 
2213 2210
 	//针对凤凰医院
2214
-	if adminINfo.CurrentOrgId == 10579 || adminINfo.CurrentOrgId == 10344 || adminINfo.CurrentOrgId == 10206 {
2211
+	if adminINfo.CurrentOrgId == 10579 || adminINfo.CurrentOrgId == 10344 || adminINfo.CurrentOrgId == 10206 || adminINfo.CurrentOrgId == 10679 {
2215 2212
 		advice, _ := service.GetDoctorAdviceListTwenty(schedule.PatientId, schedule.ScheduleDate, adminINfo.CurrentOrgId)
2216 2213
 		if len(advice) > 0 {
2217 2214
 			service.UpdateAdviceObj(schedule.PatientId, schedule.ScheduleDate, adminINfo.CurrentOrgId)

+ 7 - 0
service/pharmacy_service.go Ver arquivo

@@ -1273,6 +1273,13 @@ func MedicineDeparture(ids string, creater, orgid int64) (err error) {
1273 1273
 				}
1274 1274
 				tmp_bool := IsPharmacyConfig(orgid)
1275 1275
 				if tmp_bool {
1276
+					codeConfig, _ := GetDrugCodeConfig(orgid)
1277
+					if codeConfig.IsOpen == 1 {
1278
+						if v.DrugCode == "" || len(v.DrugCode) == 0 {
1279
+							err = fmt.Errorf(FindDrugsName(v.DrugId) + "药品追溯码不能为空!")
1280
+							return
1281
+						}
1282
+					}
1276 1283
 					if PettyCash(v.DrugId) {
1277 1284
 						continue
1278 1285
 					}

+ 2 - 2
service/self_drug_service.go Ver arquivo

@@ -2859,7 +2859,7 @@ func GetGoodNewPurchaseStockQuery(good_type int64, keyword string, page int64, l
2859 2859
 func GetGoodNewPurchaseStockQueryOne(good_type int64, keyword string, page int64, limit int64, orgid int64, ids []int64, goodIds []int64) (goodinfo []*models.GoodInfoTwenty, total int64, err error) {
2860 2860
 
2861 2861
 	db := XTReadDB().Model(&goodinfo).Where("status = 1")
2862
-	if orgid == 10697 {
2862
+	if orgid == 10697 || orgid == 10644 {
2863 2863
 		db = db.Where("find_in_set('停用',good_status) = 0")
2864 2864
 	}
2865 2865
 	offset := (page - 1) * limit
@@ -2916,7 +2916,7 @@ func GetDrugNewPurchaseStockQuery(good_type int64, keyword string, page int64, l
2916 2916
 	if good_type > 0 {
2917 2917
 		db = db.Where("drug_type = ?", good_type)
2918 2918
 	}
2919
-	if orgid == 10697 {
2919
+	if orgid == 10697 || orgid == 10644 {
2920 2920
 		db = db.Where("find_in_set('停用',drug_status) = 0")
2921 2921
 	}
2922 2922
 

+ 1 - 1
service/stock_service.go Ver arquivo

@@ -9793,7 +9793,7 @@ func GetHisDrugCodeQuery(orgId int64, start_time int64, end_time int64, limit in
9793 9793
 		db = db.Where("is_upload = 1")
9794 9794
 	}
9795 9795
 	if is_sale == 2 {
9796
-		db = db.Where("is_upload = 2")
9796
+		db = db.Where("is_upload = 2 or is_upload =0")
9797 9797
 	}
9798 9798
 	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_date desc").Find(&list).Error
9799 9799