Browse Source

耗材参数

XMLWAN 3 years ago
parent
commit
dc9077bebb

+ 2 - 2
controllers/drug_stock_api_contorller.go View File

@@ -383,8 +383,8 @@ func (c *StockDrugApiController) GetDrugWarehouseInfoList() {
383 383
 		return
384 384
 	}
385 385
 
386
-	warehousingInfo, err := service.FindDrugWarehousingInfoById(id, admin.CurrentOrgId)
387
-	fmt.Println("warehousinginfo000000000000000", warehousingInfo)
386
+	warehousingInfo, err := service.FindDrugWarehousingInfoByIdThree(id, admin.CurrentOrgId)
387
+
388 388
 	if err == nil {
389 389
 		c.ServeSuccessJSON(map[string]interface{}{
390 390
 			"info":             warehousingInfo,

+ 9 - 1
controllers/self_drug_api_congtroller.go View File

@@ -1846,6 +1846,14 @@ func (this *SelfDrugApiController) SaveDrugInventory() {
1846 1846
 				return
1847 1847
 			}
1848 1848
 			warehouse_info_id := int64(items["warehouse_info_id"].(float64))
1849
+
1850
+			if items["total"] == nil || reflect.TypeOf(items["total"]).String() != "string" {
1851
+				utils.ErrorLog("total")
1852
+				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1853
+				return
1854
+			}
1855
+
1856
+			total := items["total"].(string)
1849 1857
 			inventory := models.XtDrugInventory{
1850 1858
 
1851 1859
 				DrugName:          drug_name,
@@ -1874,6 +1882,7 @@ func (this *SelfDrugApiController) SaveDrugInventory() {
1874 1882
 				ProductDate:       product_date,
1875 1883
 				Number:            numbers,
1876 1884
 				//BatchNumber:       batch_number,
1885
+				Total:           total,
1877 1886
 				WarehouseInfoId: warehouse_info_id,
1878 1887
 			}
1879 1888
 			err = service.CreateDrugInventory(inventory)
@@ -1893,7 +1902,6 @@ func (this *SelfDrugApiController) GetDrugInventoryList() {
1893 1902
 	fmt.Println(err)
1894 1903
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1895 1904
 	keyword := this.GetString("keyword")
1896
-	fmt.Println("keywoer2r2r32rwrwr", keyword)
1897 1905
 	start_time := this.GetString("start_time")
1898 1906
 	end_time := this.GetString("end_time")
1899 1907
 	var startTime int64

+ 5 - 0
service/stock_service.go View File

@@ -891,6 +891,11 @@ func FindDrugWarehousingInfoById(id int64, org_id int64) (list []*VMDrugWarehous
891 891
 	return list, err
892 892
 }
893 893
 
894
+func FindDrugWarehousingInfoByIdThree(id int64, org_id int64) (list []*VMDrugWarehouseInfo, err error) {
895
+	err = readDb.Model(&VMDrugWarehouseInfo{}).Preload("Drug", "status = 1 AND org_id = ?", org_id).Where("warehousing_id = ? AND status = 1", id).Find(&list).Error
896
+	return list, err
897
+}
898
+
894 899
 func FindDrugWarehousingInfoByIdOne(id []string, org_id int64) (list []*models.StDrugWarehouseInfo, err error) {
895 900
 
896 901
 	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1")