Browse Source

2024/6/17

28169 2 months ago
parent
commit
b64296f1dd

BIN
XT_New.exe View File


+ 4 - 4
controllers/base_api_controller.go View File

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

+ 36 - 6
controllers/drug_pharmacy_management_controller.go View File

@@ -1,17 +1,18 @@
1 1
 package controllers
2 2
 
3 3
 import (
4
+	"fmt"
5
+	"math"
6
+	"strconv"
7
+	"strings"
8
+	"time"
9
+
4 10
 	"XT_New/enums"
5 11
 	"XT_New/models"
6 12
 	"XT_New/service"
7 13
 	"XT_New/utils"
8
-	"fmt"
9 14
 	"github.com/astaxie/beego"
10 15
 	"github.com/jinzhu/gorm"
11
-	"math"
12
-	"strconv"
13
-	"strings"
14
-	"time"
15 16
 )
16 17
 
17 18
 type PharmacyApiController struct {
@@ -478,6 +479,7 @@ func (this *PharmacyApiController) SaveSetting() {
478 479
 	}()
479 480
 	is_open, _ := this.GetInt64("is_open")
480 481
 
482
+	is_drug_open, _ := this.GetInt64("is_drug_open")
481 483
 	orgId := this.GetAdminUserInfo().CurrentOrgId
482 484
 	config := models.PharmacyConfig{
483 485
 		UserOrgId: orgId,
@@ -502,6 +504,32 @@ func (this *PharmacyApiController) SaveSetting() {
502 504
 		err = fmt.Errorf("用户开启药房管理出库")
503 505
 	}
504 506
 
507
+	codeConfig, _ := service.GetDrugCodeConfig(orgId)
508
+
509
+	if codeConfig.ID == 1 {
510
+		drugCodeConfig := models.XtDrugCodeConfig{
511
+			ID:        codeConfig.ID,
512
+			IsOpen:    is_drug_open,
513
+			UserOrgId: orgId,
514
+			Status:    1,
515
+			Ctime:     time.Now().Unix(),
516
+			Mtime:     time.Now().Unix(),
517
+		}
518
+		service.SaveDrugCodeConfig(drugCodeConfig)
519
+	}
520
+
521
+	if codeConfig.ID == 0 {
522
+
523
+		drugCodeConfig := models.XtDrugCodeConfig{
524
+			IsOpen:    is_drug_open,
525
+			UserOrgId: orgId,
526
+			Status:    1,
527
+			Ctime:     time.Now().Unix(),
528
+			Mtime:     time.Now().Unix(),
529
+		}
530
+		service.CreateDrugCodeConfig(drugCodeConfig)
531
+	}
532
+
505 533
 	this.ServeSuccessJSON(map[string]interface{}{
506 534
 		"config": config,
507 535
 	})
@@ -513,9 +541,11 @@ func (this *PharmacyApiController) GetPharmacyConfig() {
513 541
 
514 542
 	config, err := service.GetPharmacyConfig(orgId)
515 543
 
544
+	codeConfig, _ := service.GetDrugCodeConfig(orgId)
516 545
 	if err == nil {
517 546
 		this.ServeSuccessJSON(map[string]interface{}{
518
-			"config": config,
547
+			"config":     config,
548
+			"codeConfig": codeConfig,
519 549
 		})
520 550
 	} else {
521 551
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)

+ 147 - 2
controllers/new_stock_api_controller.go View File

@@ -1,12 +1,15 @@
1 1
 package controllers
2 2
 
3 3
 import (
4
+	"fmt"
5
+	"math"
6
+	"strconv"
7
+	"time"
8
+
4 9
 	"XT_New/enums"
5 10
 	"XT_New/service"
6 11
 	"XT_New/utils"
7
-	"fmt"
8 12
 	"github.com/astaxie/beego"
9
-	"time"
10 13
 )
11 14
 
12 15
 type NewStockApiController struct {
@@ -18,6 +21,10 @@ func NewStockApiRegistRouters() {
18 21
 	beego.Router("/api/drug/change", &NewStockApiController{}, "Get:GetDrugChange")
19 22
 	//beego.Router("/api/drug/query", &NewStockApiController{}, "Get:GetDrugQuery")
20 23
 
24
+	beego.Router("/api/drug/gethisdrugcodequery", &NewStockApiController{}, "Get:GetHisDrugCodeQuery")
25
+	beego.Router("/api/drug/createuploaddrugcode", &NewStockApiController{}, "Get:CrateUploadDrugCode")
26
+	beego.Router("/api/drug/getpatientdrugcode", &NewStockApiController{}, "Get:GetPatientDrugCode")
27
+
21 28
 }
22 29
 
23 30
 func (c *NewStockApiController) GetDrugStock() {
@@ -151,3 +158,141 @@ func (c *NewStockApiController) GetDrugQuery() {
151 158
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
152 159
 	}
153 160
 }
161
+
162
+func (this *NewStockApiController) GetHisDrugCodeQuery() {
163
+
164
+	start_time := this.GetString("start_time")
165
+
166
+	end_time := this.GetString("end_time")
167
+
168
+	limit, _ := this.GetInt64("limit")
169
+
170
+	page, _ := this.GetInt64("page")
171
+
172
+	is_sale, _ := this.GetInt64("is_sale")
173
+
174
+	orgId := this.GetAdminUserInfo().CurrentOrgId
175
+
176
+	timeLayout := "2006-01-02"
177
+	loc, _ := time.LoadLocation("Local")
178
+	var startTime int64
179
+	if len(start_time) > 0 {
180
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
181
+
182
+		if err != nil {
183
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
184
+			return
185
+		}
186
+		startTime = theTime.Unix()
187
+	}
188
+	var endTime int64
189
+	if len(end_time) > 0 {
190
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
191
+		if err != nil {
192
+			utils.ErrorLog(err.Error())
193
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
194
+			return
195
+		}
196
+		endTime = theTime.Unix()
197
+	}
198
+
199
+	list, total, _ := service.GetHisDrugCodeQuery(orgId, startTime, endTime, limit, page, is_sale)
200
+
201
+	drug, _ := service.GetAllDrugList(orgId)
202
+
203
+	codeConfig, _ := service.GetDrugCodeConfig(orgId)
204
+
205
+	patients, _ := service.GetAllpatient(orgId)
206
+	this.ServeSuccessJSON(map[string]interface{}{
207
+		"list":       list,
208
+		"total":      total,
209
+		"drug":       drug,
210
+		"patients":   patients,
211
+		"codeConfig": codeConfig,
212
+	})
213
+
214
+	return
215
+}
216
+
217
+func (this *NewStockApiController) CrateUploadDrugCode() {
218
+
219
+	drug_id, _ := this.GetInt64("drug_id")
220
+
221
+	patient_id, _ := this.GetInt64("patient_id")
222
+
223
+	advice_date, _ := this.GetInt64("advice_date")
224
+
225
+	orgId := this.GetAdminUserInfo().CurrentOrgId
226
+
227
+	//查询该药品是否出库
228
+	outinfo, _ := service.GetDrugWarehouseOutInfoByDrugCode(drug_id, patient_id, advice_date, orgId)
229
+
230
+	if len(outinfo) == 0 {
231
+		this.ServeDynamicFailJsonSend("该药品未出库,请先出库")
232
+		return
233
+	} else {
234
+		this.ServeDynamicFailJsonSend("成功!")
235
+		return
236
+	}
237
+
238
+}
239
+
240
+func (this *NewStockApiController) GetPatientDrugCode() {
241
+
242
+	drug_id, _ := this.GetInt64("drug_id")
243
+
244
+	patient_id, _ := this.GetInt64("patient_id")
245
+
246
+	advice_date, _ := this.GetInt64("advice_date")
247
+
248
+	orgId := this.GetAdminUserInfo().CurrentOrgId
249
+
250
+	advicelist, _ := service.FindeHisAdviceDocAdviceOne(orgId, patient_id, drug_id, advice_date)
251
+	if len(advicelist) > 0 {
252
+		var total int64
253
+		var prescribing_number_total int64
254
+		for _, item := range advicelist {
255
+			//查询改药品信息
256
+			medical, _ := service.GetBaseDrugMedical(item.DrugId)
257
+			//如果是药房发药的方式
258
+			if medical.IsPharmacy == 1 {
259
+				houseConfig, _ := service.GetAllStoreHouseConfig(orgId)
260
+				//查询该药品是否有库存
261
+				list, _ := service.GetDrugTotalCountTwenty(item.DrugId, item.UserOrgId, houseConfig.DrugStorehouseOut)
262
+
263
+				//判断单位是否相等
264
+				if medical.MaxUnit == item.PrescribingNumberUnit {
265
+					prescribingNumber_temp := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
266
+					count, _ := strconv.ParseInt(prescribingNumber_temp, 10, 64)
267
+					//转化为最小单位
268
+					total = list.Count*medical.MinNumber + list.StockMinNumber
269
+					prescribing_number_total = count * medical.MinNumber
270
+				}
271
+				if medical.MinUnit == item.PrescribingNumberUnit {
272
+					prescribingNumber_temp := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
273
+					count, _ := strconv.ParseInt(prescribingNumber_temp, 10, 64)
274
+					total = list.Count*medical.MinNumber + list.StockMinNumber
275
+					prescribing_number_total = count
276
+				}
277
+
278
+				if medical.IsUse != 1 {
279
+					//如果出库数量大于库存数量
280
+					if prescribing_number_total > total {
281
+						err := fmt.Errorf(service.FindDrugsName(item.DrugId) + "库存不足")
282
+						if err != nil {
283
+							utils.ErrorLog(err.Error())
284
+							this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
285
+							return
286
+						}
287
+					}
288
+				}
289
+			}
290
+
291
+		}
292
+	}
293
+	creater := this.GetAdminUserInfo().AdminUser.Id
294
+	service.DispensingMedicineTwo(orgId, patient_id, advice_date, drug_id, creater)
295
+
296
+	this.ServeDynamicFailJsonSend("发药成功!")
297
+	return
298
+}

+ 3 - 3
controllers/stock_in_api_controller.go View File

@@ -4443,9 +4443,9 @@ func (this *StockManagerApiController) AddDrugInformation() {
4443 4443
 		drug.MinPrice = min_price
4444 4444
 		dose := goodNameM["dose"].(string)
4445 4445
 
4446
-		is_self_drug := int64(goodNameM["is_self_drug"].(float64))
4447
-
4448
-		drug.IsSelfDrug = is_self_drug
4446
+		//is_self_drug := int64(goodNameM["is_self_drug"].(float64))
4447
+		//
4448
+		//drug.IsSelfDrug = is_self_drug
4449 4449
 
4450 4450
 		if len(dose) < 0 { //名字为空则生成一条导入错误日志
4451 4451
 			err_log := models.ExportErrLog{

+ 13 - 0
models/drug_pharmacy_management_models.go View File

@@ -237,3 +237,16 @@ type Pharmacy struct {
237 237
 func (Pharmacy) TableName() string {
238 238
 	return "xt_pharmacy"
239 239
 }
240
+
241
+type XtDrugCodeConfig struct {
242
+	ID        int64 `gorm:"column:id" json:"id" form:"id"`
243
+	IsOpen    int64 `gorm:"column:is_open" json:"is_open" form:"is_open"`
244
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
245
+	Status    int64 `gorm:"column:status" json:"status" form:"status"`
246
+	Ctime     int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
247
+	Mtime     int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
248
+}
249
+
250
+func (XtDrugCodeConfig) TableName() string {
251
+	return "xt_drug_code_config"
252
+}

+ 1 - 0
models/his_models.go View File

@@ -275,6 +275,7 @@ type HisDoctorAdviceInfo struct {
275 275
 	DrugWayCount          string                 `gorm:"column:drug_way_count" json:"drug_way_count" form:"drug_way_count"`
276 276
 	YbSyncStatus          int64                  `gorm:"column:yb_sync_status" json:"yb_sync_status" form:"yb_sync_status"`
277 277
 	DrugCode              string                 `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
278
+	IsUpload              int64                  `gorm:"column:is_upload" json:"is_upload" form:"is_upload"`
278 279
 }
279 280
 
280 281
 func (HisDoctorAdviceInfo) TableName() string {

+ 25 - 3
service/drug_pharmacy_management_service.go View File

@@ -1,15 +1,16 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"XT_New/models"
5
-	"XT_New/utils"
6 4
 	"errors"
7 5
 	"fmt"
8
-	"github.com/jinzhu/gorm"
9 6
 	"math"
10 7
 	"strconv"
11 8
 	"strings"
12 9
 	"time"
10
+
11
+	"XT_New/models"
12
+	"XT_New/utils"
13
+	"github.com/jinzhu/gorm"
13 14
 )
14 15
 
15 16
 func GetPharmacyDrugList(storehouse_id int64, orgid int64, keywords string) (drug []*models.PharmacyBaseDrug, err error) {
@@ -1654,3 +1655,24 @@ func CreateDrugError(drugError models.XtDrugError) error {
1654 1655
 
1655 1656
 	return err
1656 1657
 }
1658
+
1659
+func GetDrugCodeConfig(user_org_id int64) (models.XtDrugCodeConfig, error) {
1660
+
1661
+	codeConfig := models.XtDrugCodeConfig{}
1662
+	err := XTReadDB().Where("user_org_id = ? and status =1", user_org_id).Find(&codeConfig).Error
1663
+	return codeConfig, err
1664
+}
1665
+
1666
+func SaveDrugCodeConfig(config models.XtDrugCodeConfig) error {
1667
+
1668
+	err := XTWriteDB().Save(&config).Error
1669
+
1670
+	return err
1671
+}
1672
+
1673
+func CreateDrugCodeConfig(config models.XtDrugCodeConfig) error {
1674
+
1675
+	err := XTWriteDB().Create(&config).Error
1676
+
1677
+	return err
1678
+}

+ 103 - 0
service/pharmacy_service.go View File

@@ -983,6 +983,12 @@ func GetHisPatientNoMedical(user_org_id int64, patient_id int64, startime int64,
983 983
 	return advice, err
984 984
 }
985 985
 
986
+func GetHisPatientNoMedicalOne(user_org_id int64, patient_id int64, drug_id int64, advice_date int64) (advice []*models.HisDoctorAdviceInfo, err error) {
987
+
988
+	err = XTReadDB().Where("user_org_id =? and patient_id = ? and drug_id =? and advice_date=? and is_medicine =0 and status=1", user_org_id, patient_id, drug_id, advice_date).Find(&advice).Error
989
+	return advice, err
990
+}
991
+
986 992
 func UpdateIsMedicalHisAdvice(id int64) (err error) {
987 993
 	adviceInfo := models.HisDoctorAdviceInfo{}
988 994
 	err = XTWriteDB().Model(&adviceInfo).Where("id =? and status =1", id).Update(map[string]interface{}{"is_medicine": 1, "dispensing_time": time.Now().Unix()}).Error
@@ -2293,6 +2299,27 @@ func FindeHisAdviceDocAdvice(orgid int64, patient_id int64, stime int64, etime i
2293 2299
 	return advice, err
2294 2300
 }
2295 2301
 
2302
+func FindeHisAdviceDocAdviceOne(orgid int64, patient_id int64, drug_id int64, advice_date int64) (advice []*models.HisDoctorAdviceInfo, err error) {
2303
+
2304
+	db := XTReadDB().Model(&advice).Where("status= 1 and is_medicine = 0")
2305
+
2306
+	if orgid > 0 {
2307
+		db = db.Where("user_org_id = ?", orgid)
2308
+	}
2309
+	if patient_id > 0 {
2310
+		db = db.Where("patient_id = ?", patient_id)
2311
+	}
2312
+	if drug_id > 0 {
2313
+		db = db.Where("drug_id =?", drug_id)
2314
+	}
2315
+	if advice_date > 0 {
2316
+		db = db.Where("advice_date = ?", advice_date)
2317
+	}
2318
+	err = db.Find(&advice).Error
2319
+
2320
+	return advice, err
2321
+}
2322
+
2296 2323
 func GetFlow(drug_id int64, system_time int64, org_id int64, patient_id int64) (flow []*models.DrugFlow, err error) {
2297 2324
 
2298 2325
 	err = XTWriteDB().Where("drug_id = ? and system_time =? and user_org_id = ? and status = 1 and patient_id =?", drug_id, system_time, org_id, patient_id).Find(&flow).Error
@@ -2382,3 +2409,79 @@ func ChangeAdivceDrugCode(id int64, drug_code string, user_org_id int64) (models
2382 2409
 
2383 2410
 	return adviceInfo, err
2384 2411
 }
2412
+
2413
+func DispensingMedicineTwo(orgid, patient_id, advice_date, drug_id, creater int64) (err error) {
2414
+
2415
+	//开事务
2416
+	tx := XTWriteDB().Begin()
2417
+	defer func() {
2418
+		if err != nil {
2419
+			utils.ErrorLog("事务失败,原因为: %v", err)
2420
+			tx.Rollback()
2421
+		} else {
2422
+			tx.Commit()
2423
+		}
2424
+	}()
2425
+
2426
+	//查询当前患者未发药的列表
2427
+	adviceList, err := GetHisPatientNoMedicalOne(orgid, patient_id, drug_id, advice_date)
2428
+	//发药
2429
+	if len(adviceList) > 0 {
2430
+		for _, item := range adviceList {
2431
+
2432
+			pharmacyConfig := IsPharmacyConfig(orgid)
2433
+			if pharmacyConfig == true {
2434
+				//扣减库存
2435
+				err = HisFaDrugsDelivery(orgid, creater, item)
2436
+				if err != nil {
2437
+					err = fmt.Errorf("!:%v", err)
2438
+					return
2439
+				}
2440
+			}
2441
+
2442
+			//修改发药状态
2443
+			err = UpdateIsMedicalHisAdvice(item.ID)
2444
+			if err != nil {
2445
+				err = fmt.Errorf("!:%v", err)
2446
+				return
2447
+			}
2448
+			err = UpdateHisPrescription(item.PrescriptionId)
2449
+			if err != nil {
2450
+				err = fmt.Errorf("!:%v", err)
2451
+				return
2452
+			}
2453
+
2454
+			//查询默认仓库
2455
+			storeHouseConfig, _ := GetAllStoreHouseConfig(orgid)
2456
+			//查询默认仓库剩余多少库存
2457
+			var sum_count int64
2458
+			stockInfo, _ := GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, orgid, item.DrugId)
2459
+			for _, its := range stockInfo {
2460
+				baseDrug, _ := GetBaseDrugMedical(its.DrugId)
2461
+				if its.MaxUnit == baseDrug.MaxUnit {
2462
+					its.StockMaxNumber = its.StockMaxNumber * baseDrug.MinNumber
2463
+				}
2464
+				sum_count += its.StockMaxNumber + its.StockMinNumber
2465
+			}
2466
+			UpdateBaseDrugSumTwo(item.DrugId, sum_count, orgid)
2467
+			//扣减库存
2468
+			UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
2469
+
2470
+			over, _ := FindOverCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut)
2471
+			UpdateActOut(over.ID, over.SumInCount, over.FlushCount, over.SumCancelCount)
2472
+		}
2473
+	}
2474
+
2475
+	//生成明细记录
2476
+	tmp_ph := models.Pharmary{
2477
+		UserOrgId:  orgid,
2478
+		PatientId:  patient_id,
2479
+		Ctime:      time.Now().Unix(),
2480
+		Mtime:      time.Now().Unix(),
2481
+		Status:     1,
2482
+		RecordDate: time.Now().Unix(),
2483
+	}
2484
+	err = tx.Create(&tmp_ph).Error
2485
+
2486
+	return
2487
+}

+ 35 - 0
service/stock_service.go View File

@@ -9771,3 +9771,38 @@ func SaveDrugOpen(open models.XtDrugCodeOpen) error {
9771 9771
 
9772 9772
 	return err
9773 9773
 }
9774
+
9775
+func GetHisDrugCodeQuery(orgId int64, start_time int64, end_time int64, limit int64, page int64, is_sale int64) (list []*models.HisDoctorAdviceInfo, total int64, err error) {
9776
+
9777
+	db := XTReadDB().Model(&models.HisDoctorAdviceInfo{}).Where("status=1")
9778
+
9779
+	if orgId > 0 {
9780
+		db = db.Where("user_org_id=?", orgId)
9781
+	}
9782
+	if start_time > 0 {
9783
+		db = db.Where("advice_date >= ?", start_time)
9784
+	}
9785
+
9786
+	if end_time > 0 {
9787
+		db = db.Where("advice_date<=?", end_time)
9788
+	}
9789
+
9790
+	offset := (page - 1) * limit
9791
+
9792
+	if is_sale == 1 {
9793
+		db = db.Where("is_upload = 1")
9794
+	}
9795
+	if is_sale == 2 {
9796
+		db = db.Where("is_upload = 2")
9797
+	}
9798
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_date desc").Find(&list).Error
9799
+
9800
+	return list, total, err
9801
+}
9802
+
9803
+func GetDrugWarehouseOutInfoByDrugCode(drug_id int64, patient_id int64, advice_date int64, user_org_id int64) (outinfo []*models.XtDrugWarehouseOutInfo, err error) {
9804
+
9805
+	err = XTReadDB().Where("drug_id = ? and patient_id = ? and sys_record_time =? and org_id = ? and status =1", drug_id, patient_id, advice_date, user_org_id).Find(&outinfo).Error
9806
+
9807
+	return outinfo, err
9808
+}

+ 0 - 1
service/warhouse_service.go View File

@@ -9329,7 +9329,6 @@ func HisFaDrugsDelivery(orgID int64, creater int64, advice *models.HisDoctorAdvi
9329 9329
 				}
9330 9330
 			}
9331 9331
 
9332
-			fmt.Println("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhwode", advice.DrugCode)
9333 9332
 			newadviceInfo := &models.HisDoctorAdviceInfo{
9334 9333
 				ID:                    advice.ID,
9335 9334
 				UserOrgId:             advice.UserOrgId,