Browse Source

11月8日库存管理

XMLWAN 2 years ago
parent
commit
b48dae0715

+ 2 - 2
conf/app.conf View File

@@ -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

+ 2 - 0
controllers/patient_api_controller.go View File

@@ -1419,11 +1419,13 @@ func (c *PatientApiController) CreateGroupAdvice() {
1419 1419
 
1420 1420
 	list, err := service.CreateMGroupAdvice(adminUserInfo.CurrentOrgId, advices, groupNo)
1421 1421
 	key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patient, 10) + ":" + strconv.FormatInt(AdviceDate, 10) + ":doctor_advices"
1422
+	//fmt.Println("key23323323232323223233223232323",key)
1422 1423
 	redis := service.RedisClient()
1423 1424
 	defer redis.Close()
1424 1425
 	redis.Set(key, "", time.Second)
1425 1426
 	keyOne := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(AdviceDate, 10) + ":advice_list_all"
1426 1427
 	redis.Set(keyOne, "", time.Second)
1428
+	//fmt.Println("keyOne23322322323232323233232332",keyOne)
1427 1429
 	if err != nil {
1428 1430
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateDoctorAdviceFail)
1429 1431
 		return

+ 50 - 5
controllers/supply_order_api_contorller.go View File

@@ -1312,6 +1312,15 @@ func (this *SupplyOrderApiController) AddGoodOrder() {
1312 1312
 
1313 1313
 				price_float, _ := strconv.ParseFloat(supply_price, 64)
1314 1314
 
1315
+				if items["min_price"] == nil || reflect.TypeOf(items["min_price"]).String() != "string" {
1316
+					utils.ErrorLog("min_price")
1317
+					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1318
+					return
1319
+				}
1320
+				min_price := items["min_price"].(string)
1321
+
1322
+				min_price_float, _ := strconv.ParseFloat(min_price, 64)
1323
+
1315 1324
 				if items["supply_total_price"] == nil || reflect.TypeOf(items["supply_total_price"]).String() != "string" {
1316 1325
 					utils.ErrorLog("supply_total_price")
1317 1326
 					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -1453,6 +1462,7 @@ func (this *SupplyOrderApiController) AddGoodOrder() {
1453 1462
 					ManufacturerId:          manufacturer_id,
1454 1463
 					GoodNumber:              warehouseOut.GoodNumber,
1455 1464
 					SupplyManufacturer:      supply_manufacturer,
1465
+					MinPrice:                min_price_float,
1456 1466
 				}
1457 1467
 				warehousingOut = append(warehousingOut, &order)
1458 1468
 			}
@@ -1464,7 +1474,21 @@ func (this *SupplyOrderApiController) AddGoodOrder() {
1464 1474
 		if item.WarehouseInfoId == 0 {
1465 1475
 			item.Type = 2
1466 1476
 		}
1467
-		err = service.CreateSupplyWarehousOutOrder(item)
1477
+		//查询该商品是否来源于采购订单,如果存在则关联, 如果不存在则取消关联
1478
+		_, errcode := service.GetGoodIsSource(warehousing_id, item.ProjectId, orgId)
1479
+		if errcode == gorm.ErrRecordNotFound {
1480
+			item.WarehousingId = 0
1481
+			item.WarehouseInfoId = 0
1482
+			item.OrderNumber = ""
1483
+			item.Type = 2
1484
+			err = service.CreateSupplyWarehousOutOrder(item)
1485
+			//更新采购单
1486
+			service.ModfySupplyWarehouseOut(warehousing_id, orgId)
1487
+		}
1488
+		if errcode == nil {
1489
+			err = service.CreateSupplyWarehousOutOrder(item)
1490
+		}
1491
+
1468 1492
 	}
1469 1493
 
1470 1494
 	list, parseDateErr := service.GetSupplyWarehouseOutById(warehouseOut.ID, orgId)
@@ -1659,6 +1683,15 @@ func (this *SupplyOrderApiController) UpdateGoodOrder() {
1659 1683
 
1660 1684
 				supply_total_price_float, _ := strconv.ParseFloat(supply_total_price, 64)
1661 1685
 
1686
+				if items["min_price"] == nil || reflect.TypeOf(items["min_price"]).String() != "string" {
1687
+					utils.ErrorLog("min_price")
1688
+					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1689
+					return
1690
+				}
1691
+				min_price := items["min_price"].(string)
1692
+
1693
+				min_price_float, _ := strconv.ParseFloat(min_price, 64)
1694
+
1662 1695
 				if items["project_id"] == nil || reflect.TypeOf(items["project_id"]).String() != "float64" {
1663 1696
 					utils.ErrorLog("project_id")
1664 1697
 					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -1807,6 +1840,7 @@ func (this *SupplyOrderApiController) UpdateGoodOrder() {
1807 1840
 						SupplyManufacturer:      supply_manufacturer,
1808 1841
 						WarehouseInfoId:         warehouse_info_id,
1809 1842
 						WarehousingId:           warehousing_id,
1843
+						MinPrice:                min_price_float,
1810 1844
 					}
1811 1845
 					updateWarehout = append(updateWarehout, &order)
1812 1846
 				}
@@ -1840,6 +1874,7 @@ func (this *SupplyOrderApiController) UpdateGoodOrder() {
1840 1874
 						ManufacturerId:          manufacturer_id,
1841 1875
 						GoodNumber:              good_number,
1842 1876
 						SupplyManufacturer:      supply_manufacturer,
1877
+						MinPrice:                min_price_float,
1843 1878
 					}
1844 1879
 					warehousingOut = append(warehousingOut, &order)
1845 1880
 				}
@@ -1856,6 +1891,7 @@ func (this *SupplyOrderApiController) UpdateGoodOrder() {
1856 1891
 		DocumentDate:     startTime,
1857 1892
 		ReturnRemake:     return_remake,
1858 1893
 	}
1894
+
1859 1895
 	//更改购货单据
1860 1896
 	service.UpdateGoodWarehouseOut(warehose_out_id, out)
1861 1897
 
@@ -1867,8 +1903,17 @@ func (this *SupplyOrderApiController) UpdateGoodOrder() {
1867 1903
 		err = service.CreateSupplyWarehousOutOrder(item)
1868 1904
 	}
1869 1905
 	for _, item := range updateWarehout {
1870
-
1871
-		service.UpdateGoodWarehouseOutOrder(item)
1906
+		//查询该商品是否来源于采购订单,如果存在则关联, 如果不存在则取消关联
1907
+		_, errcode := service.GetGoodIsSource(item.WarehousingId, item.ProjectId, orgId)
1908
+		if errcode == gorm.ErrRecordNotFound {
1909
+			item.WarehousingId = 0
1910
+			item.WarehouseInfoId = 0
1911
+			item.Type = 2
1912
+			item.OrderNumber = ""
1913
+			service.UpdateGoodWarehouseOutOrder(item)
1914
+			//更新采购单
1915
+			service.ModfySupplyWarehouseOut(item.WarehousingId, orgId)
1916
+		}
1872 1917
 	}
1873 1918
 	if err == nil {
1874 1919
 		this.ServeSuccessJSON(map[string]interface{}{
@@ -2076,7 +2121,7 @@ func (this *SupplyOrderApiController) GetGoodOrderCountList() {
2076 2121
 						BatchNumber:               item.SupplyBatchNumber,
2077 2122
 						MaxUnit:                   item.SupplyUnit,
2078 2123
 						MinUnit:                   item.SupplyUnit,
2079
-						RetailPrice:               medical.MinPrice,
2124
+						RetailPrice:               item.MinPrice,
2080 2125
 						SupplyWarehouseId:         id,
2081 2126
 						SupplyWarehouseDetailInfo: item.ID,
2082 2127
 					}
@@ -2176,7 +2221,7 @@ func (this *SupplyOrderApiController) GetGoodOrderCountList() {
2176 2221
 						StockCount:                item.Count,
2177 2222
 						Dealer:                    good.Dealer,
2178 2223
 						LicenseNumber:             item.SupplyLicenseNumber,
2179
-						PackingPrice:              good.PackingPrice,
2224
+						PackingPrice:              item.MinPrice,
2180 2225
 						SupplyWarehouseId:         id,
2181 2226
 						SupplyWarehouseDetailInfo: item.ID,
2182 2227
 					}

+ 3 - 0
models/supply.models.go View File

@@ -37,6 +37,7 @@ type SpBaseDrug struct {
37 37
 	LastPrice         float64                `gorm:"column:last_price" json:"last_price" form:"last_price"`
38 38
 	DrugWarehouseInfo []*SpDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_warehouse_info"`
39 39
 	DrugStatus        string                 `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
40
+	MinPrice          float64                `gorm:"column:min_price" json:"min_price" form:"min_price"`
40 41
 }
41 42
 
42 43
 func (SpBaseDrug) TableName() string {
@@ -56,6 +57,7 @@ type SpGoodInformation struct {
56 57
 	GoodStatus        string             `gorm:"column:good_status" json:"good_status" form:"good_status"`
57 58
 	GoodWarehouseInfo []*SpWarehouseInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"good_warehouse_info"`
58 59
 	Number            string             `gorm:"column:number" json:"number" form:"number"`
60
+	RetailPrice       float64            `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
59 61
 }
60 62
 
61 63
 func (SpGoodInformation) TableName() string {
@@ -221,6 +223,7 @@ type SpSupplierWarehousingOutOrder struct {
221 223
 	ManufacturerId          int64   `gorm:"column:manufacturer_id" json:"manufacturer_id" form:"manufacturer_id"`
222 224
 	SupplyLicenseNumber     string  `gorm:"column:supply_license_number" json:"supply_license_number" form:"supply_license_number"`
223 225
 	GoodNumber              string  `gorm:"column:good_number" json:"good_number" form:"good_number"`
226
+	MinPrice                float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
224 227
 }
225 228
 
226 229
 func (SpSupplierWarehousingOutOrder) TableName() string {

+ 43 - 40
service/stock_service.go View File

@@ -871,21 +871,22 @@ func GetWarehoureOrderOutByGoodId(good_id []int64, startime int64, endtime int64
871 871
 }
872 872
 
873 873
 type VMDrugWarehouse struct {
874
-	ID               int64                `gorm:"column:id" json:"id" form:"id"`
875
-	WarehousingOrder string               `gorm:"column:warehousing_order" json:"warehousing_order" form:"warehousing_order"`
876
-	OperationTime    int64                `gorm:"column:operation_time" json:"operation_time" form:"operation_time"`
877
-	OrgId            int64                `gorm:"column:org_id" json:"org_id" form:"org_id"`
878
-	Creater          int64                `gorm:"column:creater" json:"creater" form:"creater"`
879
-	Ctime            int64                `gorm:"column:ctime" json:"ctime" form:"ctime"`
880
-	Modifier         int64                `gorm:"column:modifier" json:"modifier" form:"modifier"`
881
-	Mtime            int64                `gorm:"column:mtime" json:"mtime" form:"mtime"`
882
-	Status           int64                `gorm:"column:status" json:"status" form:"status"`
883
-	WarehousingTime  int64                `gorm:"column:warehousing_time" json:"warehousing_time" form:"warehousing_time"`
884
-	Dealer           int64                `gorm:"column:dealer" json:"dealer" form:"dealer"`
885
-	Manufacturer     int64                `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
886
-	Type             int64                `gorm:"column:type" json:"type" form:"type"`
887
-	Manufacturers    *models.Manufacturer `gorm:"ForeignKey:Manufacturer;AssociationForeignKey:ID" json:"manufacturers"`
888
-	Dealers          *models.Dealer       `gorm:"ForeignKey:Dealer;AssociationForeignKey:ID" json:"dealers"`
874
+	ID                int64                `gorm:"column:id" json:"id" form:"id"`
875
+	WarehousingOrder  string               `gorm:"column:warehousing_order" json:"warehousing_order" form:"warehousing_order"`
876
+	OperationTime     int64                `gorm:"column:operation_time" json:"operation_time" form:"operation_time"`
877
+	OrgId             int64                `gorm:"column:org_id" json:"org_id" form:"org_id"`
878
+	Creater           int64                `gorm:"column:creater" json:"creater" form:"creater"`
879
+	Ctime             int64                `gorm:"column:ctime" json:"ctime" form:"ctime"`
880
+	Modifier          int64                `gorm:"column:modifier" json:"modifier" form:"modifier"`
881
+	Mtime             int64                `gorm:"column:mtime" json:"mtime" form:"mtime"`
882
+	Status            int64                `gorm:"column:status" json:"status" form:"status"`
883
+	WarehousingTime   int64                `gorm:"column:warehousing_time" json:"warehousing_time" form:"warehousing_time"`
884
+	Dealer            int64                `gorm:"column:dealer" json:"dealer" form:"dealer"`
885
+	Manufacturer      int64                `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
886
+	Type              int64                `gorm:"column:type" json:"type" form:"type"`
887
+	Manufacturers     *models.Manufacturer `gorm:"ForeignKey:Manufacturer;AssociationForeignKey:ID" json:"manufacturers"`
888
+	Dealers           *models.Dealer       `gorm:"ForeignKey:Dealer;AssociationForeignKey:ID" json:"dealers"`
889
+	SupplyWarehouseId int64                `gorm:"column:supply_warehouse_id" json:"supply_warehouse_id" form:"supply_warehouse_id"`
889 890
 }
890 891
 
891 892
 func (VMDrugWarehouse) TableName() string {
@@ -893,31 +894,33 @@ func (VMDrugWarehouse) TableName() string {
893 894
 }
894 895
 
895 896
 type VMDrugWarehouseInfo struct {
896
-	ID               int64   `gorm:"column:id" json:"id" form:"id"`
897
-	WarehousingId    int64   `gorm:"column:warehousing_id" json:"warehousing_id" form:"warehousing_id"`
898
-	DrugId           int64   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
899
-	Number           string  `gorm:"column:number" json:"number" form:"number"`
900
-	ProductDate      int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
901
-	ExpiryDate       int64   `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
902
-	WarehousingCount int64   `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
903
-	Price            float64 `gorm:"column:price" json:"price" form:"price"`
904
-	TotalPrice       float64 `gorm:"column:total_price" json:"total_price" form:"total_price"`
905
-	Dealer           int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
906
-	Manufacturer     int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
907
-	Remark           string  `gorm:"column:remark" json:"remark" form:"remark"`
908
-	Ctime            int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
909
-	Mtime            int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
910
-	Status           int64   `gorm:"column:status" json:"status" form:"status"`
911
-	OrgId            int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
912
-	IsReturn         int64   `gorm:"column:is_return" json:"is_return" form:"is_return"`
913
-	WarehousingOrder string  `gorm:"column:warehousing_order" json:"warehousing_order" form:"warehousing_order"`
914
-	Type             int64   `gorm:"column:type" json:"type" form:"type"`
915
-	RetailPrice      float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
916
-	RetailTotalPrice float64 `gorm:"column:retail_total_price" json:"retail_total_price" form:"retail_total_price"`
917
-	BatchNumber      string  `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
918
-	MaxUnit          string  `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
919
-	MinUnit          string  `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
920
-	Drug             *Drug   `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug"`
897
+	ID                        int64   `gorm:"column:id" json:"id" form:"id"`
898
+	WarehousingId             int64   `gorm:"column:warehousing_id" json:"warehousing_id" form:"warehousing_id"`
899
+	DrugId                    int64   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
900
+	Number                    string  `gorm:"column:number" json:"number" form:"number"`
901
+	ProductDate               int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
902
+	ExpiryDate                int64   `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
903
+	WarehousingCount          int64   `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
904
+	Price                     float64 `gorm:"column:price" json:"price" form:"price"`
905
+	TotalPrice                float64 `gorm:"column:total_price" json:"total_price" form:"total_price"`
906
+	Dealer                    int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
907
+	Manufacturer              int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
908
+	Remark                    string  `gorm:"column:remark" json:"remark" form:"remark"`
909
+	Ctime                     int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
910
+	Mtime                     int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
911
+	Status                    int64   `gorm:"column:status" json:"status" form:"status"`
912
+	OrgId                     int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
913
+	IsReturn                  int64   `gorm:"column:is_return" json:"is_return" form:"is_return"`
914
+	WarehousingOrder          string  `gorm:"column:warehousing_order" json:"warehousing_order" form:"warehousing_order"`
915
+	Type                      int64   `gorm:"column:type" json:"type" form:"type"`
916
+	RetailPrice               float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
917
+	RetailTotalPrice          float64 `gorm:"column:retail_total_price" json:"retail_total_price" form:"retail_total_price"`
918
+	BatchNumber               string  `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
919
+	MaxUnit                   string  `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
920
+	MinUnit                   string  `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
921
+	Drug                      *Drug   `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug"`
922
+	SupplyWarehouseId         int64   `gorm:"column:supply_warehouse_id" json:"supply_warehouse_id" form:"supply_warehouse_id"`
923
+	SupplyWarehouseDetailInfo int64   `gorm:"column:supply_warehouse_detail_info" json:"supply_warehouse_detail_info" form:"supply_warehouse_detail_info"`
921 924
 }
922 925
 
923 926
 func (VMDrugWarehouseInfo) TableName() string {

+ 23 - 3
service/supply_service.go View File

@@ -491,13 +491,13 @@ func GetGoodOrderDetail(id int64, orgid int64) (models.SpSupplierWarehouseOut, e
491 491
 
492 492
 func UpdateGoodWarehouseOut(id int64, out models.SpSupplierWarehouseOut) error {
493 493
 
494
-	err := XTWriteDB().Model(&out).Where("id=? and status = 1", id).Updates(map[string]interface{}{"arrearage": out.Arrearage, "payment": out.Payment, "rate_of_concession": out.RateOfConcession, "discount_amount": out.DiscountAmount, "document_date": out.DocumentDate, "return_remake": out.ReturnRemake}).Error
494
+	err := XTWriteDB().Model(&out).Where("id=? and status = 1", id).Updates(map[string]interface{}{"arrearage": out.Arrearage, "payment": out.Payment, "rate_of_concession": out.RateOfConcession, "discount_amount": out.DiscountAmount, "document_date": out.DocumentDate, "return_remake": out.ReturnRemake, "supplier_id": out.SupplierId}).Error
495 495
 	return err
496 496
 }
497 497
 
498 498
 func UpdateGoodWarehouseOutOrder(order *models.SpSupplierWarehousingOutOrder) error {
499 499
 
500
-	err := XTWriteDB().Model(&order).Where("id = ? and status = 1", order.ID).Updates(map[string]interface{}{"project_id": order.ProjectId, "is_source": order.IsSource, "count": order.Count, "price": order.Count, "remark": order.Remark, "supply_batch_number": order.SupplyBatchNumber, "supply_product_date": order.SupplyProductDate, "supply_expiry_date": order.SupplyExpiryDate, "supply_type": order.SupplyType, "supply_specification_name": order.SupplySpecificationName, "supply_total": order.SupplySpecificationName, "supply_manufacturer": order.SupplyManufacturer, "name": order.Name, "supply_unit": order.SupplyUnit, "manufacturer_id": order.ManufacturerId, "supply_license_number": order.SupplyLicenseNumber, "warehousing_id": order.WarehousingId, "warehouse_info_id": order.WarehouseInfoId}).Error
500
+	err := XTWriteDB().Model(&order).Where("id = ? and status = 1", order.ID).Updates(map[string]interface{}{"project_id": order.ProjectId, "is_source": order.IsSource, "count": order.Count, "price": order.Count, "remark": order.Remark, "supply_batch_number": order.SupplyBatchNumber, "supply_product_date": order.SupplyProductDate, "supply_expiry_date": order.SupplyExpiryDate, "supply_type": order.SupplyType, "supply_specification_name": order.SupplySpecificationName, "supply_total": order.SupplyTotal, "supply_manufacturer": order.SupplyManufacturer, "name": order.Name, "supply_unit": order.SupplyUnit, "manufacturer_id": order.ManufacturerId, "supply_license_number": order.SupplyLicenseNumber, "warehousing_id": order.WarehousingId, "warehouse_info_id": order.WarehouseInfoId, "min_price": order.MinPrice}).Error
501 501
 	return err
502 502
 }
503 503
 
@@ -734,7 +734,7 @@ func UpdateGoodSupplyWarehousingInfo(id int64, orgid int64) error {
734 734
 
735 735
 func UpdateGoodSupplyFlow(id int64, orgid int64) error {
736 736
 
737
-	err := XTWriteDB().Model(&models.WarehousingInfo{}).Where("supply_warehouse_id = ? and user_org_id = ? and status = 1", id, orgid).Updates(map[string]interface{}{"status": 0}).Error
737
+	err := XTWriteDB().Model(&models.WarehousingInfo{}).Where("supply_warehouse_id = ? and org_id = ? and status = 1", id, orgid).Updates(map[string]interface{}{"status": 0}).Error
738 738
 	return err
739 739
 }
740 740
 
@@ -960,3 +960,23 @@ func DeleteDrugWarehouseOutNight(goodid int64, supply_warehouse_id int64) error
960 960
 
961 961
 	return err
962 962
 }
963
+
964
+func GetGoodIsSource(warehousing_id int64, project_id int64, orgid int64) (*models.SupplierWarehousingInfoOrder, error) {
965
+	info := models.SupplierWarehousingInfoOrder{}
966
+	var err error
967
+	err = XTReadDB().Model(&info).Where("warehousing_id = ? and project_id = ? and user_org_id = ? and status = 1", warehousing_id, project_id, orgid).Find(&info).Error
968
+	if err == gorm.ErrRecordNotFound {
969
+		return nil, err
970
+	}
971
+	if err != nil {
972
+		return nil, err
973
+	}
974
+	return &info, nil
975
+}
976
+
977
+func ModfySupplyWarehouseOut(warehousing_id int64, orgid int64) error {
978
+
979
+	out := models.SpSupplierWarehouseOut{}
980
+	err := XTWriteDB().Model(&out).Where("warehousing_id = ? and user_org_id =? and status = 1", warehousing_id, orgid).Updates(map[string]interface{}{"warehousing_id": 0, "number": ""}).Error
981
+	return err
982
+}