|
@@ -468,7 +468,8 @@ func FindLastDrugWarehousingInfoByID(drug_id int64) (info models.XtDrugWarehouse
|
468
|
468
|
return info, err
|
469
|
469
|
}
|
470
|
470
|
|
471
|
|
-// 出库时先进先出,找出最先入库的批次
|
|
471
|
+//
|
|
472
|
+//// 出库时先进先出,找出最先入库的批次
|
472
|
473
|
//func (drug_id int64) (info models.WarehousingInfo, err error) {
|
473
|
474
|
// err = readDb.Model(&models.WarehousingInfo{}).Where("drup_id = ? AND status = 1 AND (stock_max_number > 0 or stock_min_number > 0) ", drug_id).Order("ctime").First(&info).Error
|
474
|
475
|
// return info, err
|
|
@@ -578,9 +579,6 @@ type Drug struct {
|
578
|
579
|
MaxUnit string `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
|
579
|
580
|
MinUnit string `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
|
580
|
581
|
LastPrice float64 `gorm:"column:last_price" json:"last_price" form:"last_price"`
|
581
|
|
- HospApprFlag int64 `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
|
582
|
|
- LmtUsedFlag int64 `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
|
583
|
|
- Total float64 `gorm:"column:total" json:"total" form:"total"`
|
584
|
582
|
}
|
585
|
583
|
|
586
|
584
|
func (Drug) TableName() string {
|
|
@@ -2186,13 +2184,10 @@ func (VMWarehousingInfo) TableName() string {
|
2186
|
2184
|
}
|
2187
|
2185
|
|
2188
|
2186
|
type GoodInfo struct {
|
2189
|
|
- ID int64 `gorm:"column:id" json:"id"`
|
2190
|
|
- SpecificationName string `gorm:"column:specification_name" json:"specification_name"`
|
2191
|
|
- Status int64 `gorm:"column:status" json:"status"`
|
2192
|
|
- OrgId int64 `gorm:"column:org_id" json:"org_id"`
|
2193
|
|
- GoodName string `gorm:"column:good_name" json:"good_name" form:"good_name"`
|
2194
|
|
- GoodUnit int64 `gorm:"column:good_unit" json:"good_unit" form:"good_unit"`
|
2195
|
|
- RetailPrice float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
|
|
2187
|
+ ID int64 `gorm:"column:id" json:"id"`
|
|
2188
|
+ SpecificationName string `gorm:"column:specification_name" json:"specification_name"`
|
|
2189
|
+ Status int64 `gorm:"column:status" json:"status"`
|
|
2190
|
+ OrgId int64 `gorm:"column:org_id" json:"org_id"`
|
2196
|
2191
|
}
|
2197
|
2192
|
|
2198
|
2193
|
func (GoodInfo) TableName() string {
|
|
@@ -2333,13 +2328,14 @@ func GetCoutWareseOutInfo(startime int64, endtime int64, orgid int64) (houseOutI
|
2333
|
2328
|
}
|
2334
|
2329
|
|
2335
|
2330
|
func GetGoodInfomationList(orgid int64, keyword string) (goodInfo []*models.GoodInfo, err error) {
|
|
2331
|
+ key := "%" + keyword + "%"
|
2336
|
2332
|
if len(keyword) == 0 {
|
2337
|
2333
|
err = XTReadDB().Where("org_id = ? and status = 1", orgid).Find(&goodInfo).Error
|
|
2334
|
+
|
2338
|
2335
|
} else {
|
2339
|
|
- key := "%" + keyword + "%"
|
2340
|
|
- err = XTReadDB().Where("org_id = ? and status = 1 and good_name Like ?", orgid, key).Find(&goodInfo).Error
|
2341
|
|
- }
|
|
2336
|
+ err = XTReadDB().Where("org_id = ? and status = 1 AND good_name like ?", orgid, key).Find(&goodInfo).Error
|
2342
|
2337
|
|
|
2338
|
+ }
|
2343
|
2339
|
return goodInfo, err
|
2344
|
2340
|
}
|
2345
|
2341
|
|