소스 검색

耗材参数

XMLWAN 3 년 전
부모
커밋
0494bd38e0

+ 2 - 2
conf/app.conf 파일 보기

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2
-httpport = 9531
3
-runmode = prod
2
+httpport = 9529
3
+runmode = dev
4 4
 
5 5
 #
6 6
 copyrequestbody = true

+ 59 - 60
controllers/base_api_controller.go 파일 보기

@@ -2,7 +2,6 @@ package controllers
2 2
 
3 3
 import (
4 4
 	"XT_New/enums"
5
-	"XT_New/models"
6 5
 	"XT_New/service"
7 6
 	"fmt"
8 7
 	"strconv"
@@ -70,36 +69,36 @@ type BaseAuthAPIController struct {
70 69
 func (this *BaseAuthAPIController) Prepare() {
71 70
 	this.BaseAPIController.Prepare()
72 71
 	if this.GetAdminUserInfo() == nil {
73
-		var userAdmin models.AdminUser
74
-		userAdmin.Id = 1448
75
-		userAdmin.Mobile = "13318599895"
76
-
77
-		userAdmin.Id = 597
78
-		userAdmin.Mobile = "19874122664"
79
-		userAdmin.IsSuperAdmin = false
80
-		userAdmin.Status = 1
81
-		userAdmin.CreateTime = 1530786071
82
-		userAdmin.ModifyTime = 1530786071
83
-		var subscibe models.ServeSubscibe
84
-		subscibe.ID = 1
85
-		subscibe.OrgId = 9675
86
-		subscibe.PeriodStart = 1538035409
87
-		subscibe.PeriodEnd = 1569571409
88
-		subscibe.State = 1
89
-		subscibe.Status = 1
90
-		subscibe.CreatedTime = 1538035409
91
-		subscibe.UpdatedTime = 1538035409
92
-		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93
-		subscibes[4] = &subscibe
94
-		var adminUserInfo service.AdminUserInfo
95
-		adminUserInfo.CurrentOrgId = 9675
96
-		adminUserInfo.CurrentAppId = 4
97
-		adminUserInfo.AdminUser = &userAdmin
98
-		adminUserInfo.Subscibes = subscibes
99
-		this.SetSession("admin_user_info", &adminUserInfo)
100
-
101
-		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
102
-		//this.StopRun()
72
+		//var userAdmin models.AdminUser
73
+		//userAdmin.Id = 1448
74
+		//userAdmin.Mobile = "13318599895"
75
+		//
76
+		//userAdmin.Id = 597
77
+		//userAdmin.Mobile = "19874122664"
78
+		//userAdmin.IsSuperAdmin = false
79
+		//userAdmin.Status = 1
80
+		//userAdmin.CreateTime = 1530786071
81
+		//userAdmin.ModifyTime = 1530786071
82
+		//var subscibe models.ServeSubscibe
83
+		//subscibe.ID = 1
84
+		//subscibe.OrgId = 9675
85
+		//subscibe.PeriodStart = 1538035409
86
+		//subscibe.PeriodEnd = 1569571409
87
+		//subscibe.State = 1
88
+		//subscibe.Status = 1
89
+		//subscibe.CreatedTime = 1538035409
90
+		//subscibe.UpdatedTime = 1538035409
91
+		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
92
+		//subscibes[4] = &subscibe
93
+		//var adminUserInfo service.AdminUserInfo
94
+		//adminUserInfo.CurrentOrgId = 9675
95
+		//adminUserInfo.CurrentAppId = 4
96
+		//adminUserInfo.AdminUser = &userAdmin
97
+		//adminUserInfo.Subscibes = subscibes
98
+		//this.SetSession("admin_user_info", &adminUserInfo)
99
+
100
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
101
+		this.StopRun()
103 102
 
104 103
 	}
105 104
 
@@ -316,35 +315,35 @@ type BaseServeAPIController struct {
316 315
 func (this *BaseServeAPIController) Prepare() {
317 316
 	this.BaseAPIController.Prepare()
318 317
 	if this.GetAdminUserInfo() == nil {
319
-		var userAdmin models.AdminUser
320
-		userAdmin.Id = 1448
321
-		userAdmin.Mobile = "13318599895"
322
-
323
-		userAdmin.Id = 597
324
-		userAdmin.Mobile = "19874122664"
325
-		userAdmin.IsSuperAdmin = false
326
-		userAdmin.Status = 1
327
-		userAdmin.CreateTime = 1530786071
328
-		userAdmin.ModifyTime = 1530786071
329
-		var subscibe models.ServeSubscibe
330
-		subscibe.ID = 1
331
-		subscibe.OrgId = 9675
332
-		subscibe.PeriodStart = 1538035409
333
-		subscibe.PeriodEnd = 1569571409
334
-		subscibe.State = 1
335
-		subscibe.Status = 1
336
-		subscibe.CreatedTime = 1538035409
337
-		subscibe.UpdatedTime = 1538035409
338
-		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339
-		subscibes[4] = &subscibe
340
-		var adminUserInfo service.AdminUserInfo
341
-		adminUserInfo.CurrentOrgId = 9675
342
-		adminUserInfo.CurrentAppId = 4
343
-		adminUserInfo.AdminUser = &userAdmin
344
-		adminUserInfo.Subscibes = subscibes
345
-		this.SetSession("admin_user_info", &adminUserInfo)
346
-		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
347
-		//this.StopRun()
318
+		//var userAdmin models.AdminUser
319
+		//userAdmin.Id = 1448
320
+		//userAdmin.Mobile = "13318599895"
321
+		//
322
+		//userAdmin.Id = 597
323
+		//userAdmin.Mobile = "19874122664"
324
+		//userAdmin.IsSuperAdmin = false
325
+		//userAdmin.Status = 1
326
+		//userAdmin.CreateTime = 1530786071
327
+		//userAdmin.ModifyTime = 1530786071
328
+		//var subscibe models.ServeSubscibe
329
+		//subscibe.ID = 1
330
+		//subscibe.OrgId = 9675
331
+		//subscibe.PeriodStart = 1538035409
332
+		//subscibe.PeriodEnd = 1569571409
333
+		//subscibe.State = 1
334
+		//subscibe.Status = 1
335
+		//subscibe.CreatedTime = 1538035409
336
+		//subscibe.UpdatedTime = 1538035409
337
+		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
338
+		//subscibes[4] = &subscibe
339
+		//var adminUserInfo service.AdminUserInfo
340
+		//adminUserInfo.CurrentOrgId = 9675
341
+		//adminUserInfo.CurrentAppId = 4
342
+		//adminUserInfo.AdminUser = &userAdmin
343
+		//adminUserInfo.Subscibes = subscibes
344
+		//this.SetSession("admin_user_info", &adminUserInfo)
345
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
346
+		this.StopRun()
348 347
 	}
349 348
 
350 349
 	//if adminUserInfo.AppRole != nil {

+ 1 - 0
controllers/self_drug_api_congtroller.go 파일 보기

@@ -1453,6 +1453,7 @@ func (this *SelfDrugApiController) GetDrugDamageList() {
1453 1453
 
1454 1454
 	limit, _ := this.GetInt64("limit")
1455 1455
 	page, _ := this.GetInt64("page")
1456
+
1456 1457
 	list, total, err := service.GetDrugDamageList(startTime, endTime, orgId, keyword, limit, page)
1457 1458
 
1458 1459
 	damagelist, _ := service.GetDrugDamageByOrgId(orgId)

+ 11 - 0
controllers/stock_in_api_controller.go 파일 보기

@@ -128,6 +128,7 @@ func StockManagerApiRegistRouters() {
128 128
 	beego.Router("/api/stock/getgoodwarehouselist", &StockManagerApiController{}, "Get:GetGoodWarehouseList")
129 129
 	beego.Router("/api/stock/proofinventory", &StockManagerApiController{}, "Get:ProofInventory")
130 130
 	beego.Router("/api/stock/getwarehousetotal", &StockManagerApiController{}, "Get:GetWarehouseTotal")
131
+	beego.Router("/api/stock/getgoodinventorywarehouselist", &StockManagerApiController{}, "Get:GetGoodInventoryWarehouseList")
131 132
 
132 133
 }
133 134
 
@@ -6146,3 +6147,13 @@ func (this *StockManagerApiController) GetWarehouseTotal() {
6146 6147
 		"list": list,
6147 6148
 	})
6148 6149
 }
6150
+
6151
+func (this *StockManagerApiController) GetGoodInventoryWarehouseList() {
6152
+
6153
+	id, _ := this.GetInt64("id")
6154
+	list, _ := service.GetGoodInventoryWarehouseList(id)
6155
+	orgId := this.GetAdminUserInfo().CurrentOrgId
6156
+	this.ServeSuccessJSON(map[string]interface{}{
6157
+		"list": list,
6158
+	})
6159
+}

+ 43 - 0
models/self_drug_models.go 파일 보기

@@ -767,6 +767,49 @@ func (XtDrugDamage) TableName() string {
767 767
 	return "xt_drug_damage"
768 768
 }
769 769
 
770
+type VmXtDrugInventory struct {
771
+	ID                 int64      `gorm:"column:id" json:"id" form:"id"`
772
+	DrugName           string     `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
773
+	SpecificationName  string     `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
774
+	WarehousingUnit    string     `gorm:"column:warehousing_unit" json:"warehousing_unit" form:"warehousing_unit"`
775
+	Count              int64      `gorm:"column:count" json:"count" form:"count"`
776
+	LastPrice          float64    `gorm:"column:last_price" json:"last_price" form:"last_price"`
777
+	RetailPrice        float64    `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
778
+	NewPrice           float64    `gorm:"column:new_price" json:"new_price" form:"new_price"`
779
+	Manufacturer       string     `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
780
+	Dealer             string     `gorm:"column:dealer" json:"dealer" form:"dealer"`
781
+	Remark             string     `gorm:"column:remark" json:"remark" form:"remark"`
782
+	DrugId             int64      `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
783
+	UserOrgId          int64      `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
784
+	Ctime              int64      `gorm:"column:ctime" json:"ctime" form:"ctime"`
785
+	Mtime              int64      `gorm:"column:mtime" json:"mtime" form:"mtime"`
786
+	Status             int64      `gorm:"column:status" json:"status" form:"status"`
787
+	WarehousingOrder   string     `gorm:"column:warehousing_order" json:"warehousing_order" form:"warehousing_order"`
788
+	LicenseNumber      string     `gorm:"column:license_number" json:"license_number" form:"license_number"`
789
+	StartTime          int64      `gorm:"column:start_time" json:"start_time" form:"start_time"`
790
+	Creater            int64      `gorm:"column:creater" json:"creater" form:"creater"`
791
+	Checker            int64      `gorm:"column:checker" json:"checker" form:"checker"`
792
+	CheckerStatus      int64      `gorm:"column:checker_status" json:"checker_status" form:"checker_status"`
793
+	CheckerTime        int64      `gorm:"column:checker_time" json:"checker_time" form:"checker_time"`
794
+	ExpiryDate         int64      `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
795
+	ProductDate        int64      `gorm:"column:product_date" json:"product_date" form:"product_date"`
796
+	Number             string     `gorm:"column:number" json:"number" form:"number"`
797
+	BatchNumber        string     `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
798
+	Total              string     `gorm:"column:total" json:"total" form:"total"`
799
+	DrugOriginPlace    string     `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
800
+	WarehouseInfoId    int64      `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
801
+	ProofCount         int64      `gorm:"column:proof_count" json:"proof_count" form:"proof_count"`
802
+	StockMaxNumber     int64      `gorm:"column:stock_max_number" json:"stock_max_number" form:"stock_max_number"`
803
+	StockMinNumber     int64      `gorm:"column:stock_min_number" json:"stock_min_number" form:"stock_min_number"`
804
+	MinCount           int64      `gorm:"column:min_count" json:"min_count" form:"min_count"`
805
+	MinUnit            string     `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
806
+	LastStockMaxNumber int64      `gorm:"column:last_stock_max_number" json:"last_stock_max_number" form:"last_stock_max_number"`
807
+	LastStockMinNumber int64      `gorm:"column:last_stock_min_number" json:"last_stock_min_number" form:"last_stock_min_number"`
808
+	InventoryType      int64      `gorm:"column:inventory_type" json:"inventory_type" form:"inventory_type"`
809
+	Type               int64      `gorm:"column:type" json:"type" form:"type"`
810
+	XtBaseDrug         XtBaseDrug `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" `
811
+}
812
+
770 813
 type XtDrugInventory struct {
771 814
 	ID                 int64   `gorm:"column:id" json:"id" form:"id"`
772 815
 	DrugName           string  `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`

+ 6 - 3
service/self_drug_service.go 파일 보기

@@ -883,8 +883,11 @@ func GetDrugDamageList(startime int64, endtime int64, orgId int64, keyword strin
883 883
 	table := XTReadDB().Table("xt_base_drug as t").Where("t.status = 1")
884 884
 	tab := UserReadDB().Table("sgj_user_admin_role as r").Where("r.status = 1")
885 885
 	fmt.Println(table, tab)
886
+	//if len(keyword) > 0 {
887
+	//	db = db.Where("x.warehousing_order = ? or r.user_name like ?", keyword, likeKey)
888
+	//}
886 889
 	if len(keyword) > 0 {
887
-		db = db.Where("x.warehousing_order = ? or r.user_name like ?", keyword, likeKey)
890
+		db = db.Where("x.drug_name like ?", likeKey)
888 891
 	}
889 892
 	if orgId > 0 {
890 893
 		db = db.Where("x.user_org_id = ?", orgId)
@@ -1121,7 +1124,7 @@ func CreateDrugWarehouseOutInfo(info models.DrugWarehouseOutInfo) error {
1121 1124
 	return err
1122 1125
 }
1123 1126
 
1124
-func GetDamageByDrugId(drugid int64, warhousingorder string, drugtype int64) (drug []*models.XtDrugInventory, err error) {
1127
+func GetDamageByDrugId(drugid int64, warhousingorder string, drugtype int64) (drug []*models.VmXtDrugInventory, err error) {
1125 1128
 
1126 1129
 	db := XTReadDB().Table("xt_drug_inventory").Where("status = 1 and inventory_type = 11 ")
1127 1130
 
@@ -1135,6 +1138,6 @@ func GetDamageByDrugId(drugid int64, warhousingorder string, drugtype int64) (dr
1135 1138
 		db = db.Where("type = ?", drugtype)
1136 1139
 	}
1137 1140
 
1138
-	err = db.Find(&drug).Error
1141
+	err = db.Preload("XtBaseDrug", "status = 1").Find(&drug).Error
1139 1142
 	return drug, err
1140 1143
 }

+ 6 - 0
service/stock_service.go 파일 보기

@@ -4771,3 +4771,9 @@ func ModifyDrugWarehouseInfo(info *models.DrugWarehouseInfo, id int64) error {
4771 4771
 	err := XTWriteDB().Model(&info).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"stock_max_number": info.StockMaxNumber, "stock_min_number": info.StockMinNumber}).Error
4772 4772
 	return err
4773 4773
 }
4774
+
4775
+func GetGoodInventoryWarehouseList(id int64) (info []*models.WarehousingInfo, err error) {
4776
+
4777
+	err = XTReadDB().Model(&info).Where("good_id = ? and status = 1", id).Preload("GoodInfo", "status = 1").Find(&info).Error
4778
+	return info, err
4779
+}