Browse Source

11月8日库存管理

XMLWAN 2 years ago
parent
commit
4365eb8f50

+ 4 - 0
controllers/manager_center_api_controller.go View File

@@ -1497,6 +1497,7 @@ func (c *ManagerCenterApiController) CreateGoodInfo() {
1497 1497
 	default_count_unit := c.GetString("default_count_unit")
1498 1498
 	is_user, _ := c.GetInt64("is_user")
1499 1499
 	number := c.GetString("number")
1500
+	is_warehouse, _ := c.GetInt64("is_warehouse")
1500 1501
 	adminUserInfo := c.GetAdminUserInfo()
1501 1502
 
1502 1503
 	totals := service.FindGoodInfoByNameTwo(specification_name, adminUserInfo.CurrentOrgId, good_id, good_name)
@@ -1559,6 +1560,7 @@ func (c *ManagerCenterApiController) CreateGoodInfo() {
1559 1560
 		ProvincesCode:               provinces_code,
1560 1561
 		IsUser:                      is_user,
1561 1562
 		Number:                      number,
1563
+		IsWarehouse:                 is_warehouse,
1562 1564
 	}
1563 1565
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1564 1566
 	if err == nil {
@@ -1626,6 +1628,7 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1626 1628
 	register_number := c.GetString("register_number")
1627 1629
 	is_user, _ := c.GetInt64("is_user")
1628 1630
 	number := c.GetString("number")
1631
+	is_warehouse, _ := c.GetInt64("is_warehouse")
1629 1632
 	adminUserInfo := c.GetAdminUserInfo()
1630 1633
 
1631 1634
 	goodInfo := models.GoodInfo{
@@ -1680,6 +1683,7 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1680 1683
 		RegisterNumber:              register_number,
1681 1684
 		IsUser:                      is_user,
1682 1685
 		Number:                      number,
1686
+		IsWarehouse:                 is_warehouse,
1683 1687
 	}
1684 1688
 
1685 1689
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)

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

@@ -4752,6 +4752,7 @@ func (c *DialysisAPIController) CreateOtherStockOutInfo() {
4752 4752
 			})
4753 4753
 			return
4754 4754
 		}
4755
+
4755 4756
 	}
4756 4757
 
4757 4758
 	//出库逻辑

+ 1 - 0
models/good_models.go View File

@@ -85,6 +85,7 @@ type GoodInfo struct {
85 85
 	GoodSotckInfo               []*GoodSotckInfo     `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"good_stock_in"`
86 86
 	IsUser                      int64                `gorm:"column:is_user" json:"is_user" form:"is_user"`
87 87
 	Number                      string               `gorm:"column:number" json:"number" form:"number"`
88
+	IsWarehouse                 int64                `gorm:"column:is_warehouse" json:"is_warehouse" form:"is_warehouse"`
88 89
 }
89 90
 
90 91
 func (GoodInfo) TableName() string {

+ 1 - 1
service/mobile_dialysis_service.go View File

@@ -3433,7 +3433,7 @@ func GetHisProjectConfig(orgid int64) (models.XtHisProjectConfig, error) {
3433 3433
 
3434 3434
 func GetHisPrescriptionProject(org_id int64, patient_id int64, record_date int64) (project []*models.HisPrescriptionProject, err error) {
3435 3435
 	err = readDb.Model(&models.HisPrescriptionProject{}).Preload("GoodInfo", func(db *gorm.DB) *gorm.DB {
3436
-		return db.Preload("GoodsType", "status = 1").Where("status = 1 and is_user = 2")
3436
+		return db.Preload("GoodsType", "status = 1").Where("status = 1 and is_warehouse = 1")
3437 3437
 	}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND type = 3", org_id, record_date, patient_id).Find(&project).Error
3438 3438
 
3439 3439
 	return

+ 2 - 2
service/stock_service.go View File

@@ -196,7 +196,6 @@ func FindAllGoodInfoTotal(orgId int64) (total int64) {
196 196
 }
197 197
 
198 198
 func AddSigleGoodInfo(goodInfo *models.GoodInfo) (error, *models.GoodInfo) {
199
-	fmt.Println("goodino232323232323232323", goodInfo.IsUse)
200 199
 	err := writeDb.Create(&goodInfo).Error
201 200
 	return err, goodInfo
202 201
 
@@ -251,6 +250,7 @@ func ModifyGoodInfo(goodInfo *models.GoodInfo) (error, *models.GoodInfo) {
251 250
 		"provinces_code":                 goodInfo.ProvincesCode,
252 251
 		"is_user":                        goodInfo.IsUser,
253 252
 		"number":                         goodInfo.Number,
253
+		"is_warehouse":                   goodInfo.IsWarehouse,
254 254
 	}).Error
255 255
 
256 256
 	writeDb.Model(&models.WarehousingInfo{}).Where("good_id = ? AND org_id = ?", goodInfo.ID, goodInfo.OrgId).Updates(map[string]interface{}{"good_type_id": goodInfo.GoodTypeId})
@@ -364,7 +364,7 @@ func FindAllGoodTypeOne(org_id int64) (goodType []*models.GoodsType, err error)
364 364
 }
365 365
 
366 366
 func FindAllGoodInfo(org_id int64) (goodInfo []*models.GoodInfo, err error) {
367
-	err = XTReadDB().Model(&models.GoodInfo{}).Where("org_id = ? AND status = 1 and is_user = 2", org_id).Find(&goodInfo).Error
367
+	err = XTReadDB().Model(&models.GoodInfo{}).Where("org_id = ? AND status = 1 and is_warehouse = 1", org_id).Find(&goodInfo).Error
368 368
 	return goodInfo, err
369 369
 }
370 370