Browse Source

11月9日库存管理

XMLWAN 2 years ago
parent
commit
c6e8d31c0f

+ 9 - 0
controllers/dialysis_api_controller.go View File

@@ -4311,12 +4311,18 @@ func (this *DialysisApiController) GetDialysisAdviceTemplateList() {
4311 4311
 
4312 4312
 	//获取医嘱模版
4313 4313
 	templateList, _ := service.GetAllHisAdviceTemplateList(orgId)
4314
+
4315
+	_, config := service.FindXTHisRecordByOrgId(orgId)
4316
+
4317
+	drugList, _ := service.GetAllBaseDrugList(orgId)
4314 4318
 	if err == nil {
4315 4319
 		this.ServeSuccessJSON(map[string]interface{}{
4316 4320
 			"list":         list,
4317 4321
 			"total":        total,
4318 4322
 			"adviceList":   adviceList,
4319 4323
 			"templateList": templateList,
4324
+			"config":       config,
4325
+			"drugList":     drugList,
4320 4326
 		})
4321 4327
 		return
4322 4328
 
@@ -4482,12 +4488,15 @@ func (this *DialysisApiController) GetDialysisAdviceSchedulist() {
4482 4488
 	adviceList, _ := service.GetAllLongAdviceList(orgId)
4483 4489
 	//获取医嘱模版
4484 4490
 	templateList, _ := service.GetAllHisAdviceTemplateList(orgId)
4491
+
4492
+	_, config := service.FindXTHisRecordByOrgId(orgId)
4485 4493
 	if err == nil {
4486 4494
 		this.ServeSuccessJSON(map[string]interface{}{
4487 4495
 			"list":         list,
4488 4496
 			"drug":         drug,
4489 4497
 			"adviceList":   adviceList,
4490 4498
 			"templateList": templateList,
4499
+			"config":       config,
4491 4500
 		})
4492 4501
 		return
4493 4502
 

+ 0 - 3
controllers/gobal_config_api_controller.go View File

@@ -70,9 +70,6 @@ func GobalConfigRegistRouters() {
70 70
 	beego.Router("/api/hisstockpriceconfig/get", &GobalConfigApiController{}, "get:GetHisStockPriceConfig")
71 71
 	beego.Router("/api/hisstockpriceconfig/isopen", &GobalConfigApiController{}, "post:PostHisStockPriceConfig")
72 72
 
73
-	beego.Router("/api/xtconfig/get", &GobalConfigApiController{}, "get:GetXTHisConfig")
74
-	beego.Router("/api/xtconfig/isopen", &GobalConfigApiController{}, "post:PostXTHisConfig")
75
-
76 73
 	beego.Router("/api/xtconfigproject/isopen", &GobalConfigApiController{}, "post:PostXTHisProjectConfig")
77 74
 
78 75
 	beego.Router("/api/isopen/init", &GobalConfigApiController{}, "get:GetAllIsOpenConfig")

+ 16 - 0
controllers/self_drug_api_congtroller.go View File

@@ -112,6 +112,8 @@ func SelfDrugRouters() {
112 112
 	beego.Router("/api/stock/getpurchasenewdrugquery", &SelfDrugApiController{}, "Get:GetPurchaseNewDrugQuery")
113 113
 	beego.Router("/api/stock/getgoodovercount", &SelfDrugApiController{}, "Get:GetGoodOverCount")
114 114
 	beego.Router("/api/stock/getdrugovercount", &SelfDrugApiController{}, "Get:GetDrugOverCount")
115
+
116
+	beego.Router("/api/stock/getdruginfolist", &SelfDrugApiController{}, "Get:GetDrugInventoryWarehouseInfoList")
115 117
 }
116 118
 
117 119
 func (this *SelfDrugApiController) GetCurrentPatient() {
@@ -3992,3 +3994,17 @@ func (this *SelfDrugApiController) GetDrugOverCount() {
3992 3994
 	this.ServeSuccessJSON(returnData)
3993 3995
 	return
3994 3996
 }
3997
+
3998
+func (this *SelfDrugApiController) GetDrugInventoryWarehouseInfoList() {
3999
+
4000
+	storehouse_id, _ := this.GetInt64("storehouse_id")
4001
+	orgId := this.GetAdminUserInfo().CurrentOrgId
4002
+	list, _ := service.GetDrugInventoryWarehouseInfoList(orgId, storehouse_id)
4003
+	manufacturerList, _ := service.GetAllManufacturerList(orgId)
4004
+	dealerList, _ := service.GetAllDealerList(orgId)
4005
+	this.ServeSuccessJSON(map[string]interface{}{
4006
+		"list":             list,
4007
+		"manufacturerList": manufacturerList,
4008
+		"dealerList":       dealerList,
4009
+	})
4010
+}

+ 16 - 1
controllers/stock_in_api_controller.go View File

@@ -147,6 +147,8 @@ func StockManagerApiRegistRouters() {
147 147
 	beego.Router("/api/stock/checkstockwarehouseinfo", &StockManagerApiController{}, "Get:CheckStockWarehouseInfo")
148 148
 	beego.Router("/api/stock/checkreturnstockwarehouseinfo", &StockManagerApiController{}, "Get:CheckReturnStockWarehouseInfo")
149 149
 	beego.Router("/api/stock/getprintlist", &StockManagerApiController{}, "Get:GetPrintList")
150
+
151
+	beego.Router("/api/stock/getwarehouseinfolist", &StockManagerApiController{}, "Get:GetInvetoryWarehouseInfoList")
150 152
 }
151 153
 
152 154
 func (c *StockManagerApiController) CreateWarehouse() {
@@ -400,7 +402,6 @@ func (c *StockManagerApiController) GetWarehouseList() {
400 402
 			}
401 403
 		}
402 404
 	}
403
-
404 405
 	warehouseList, total, err := service.FindAllWarehousingList(adminUserInfo.CurrentOrgId, page, limit, startTime, endTime, types, keywords, ids, storehouse_id, check_type)
405 406
 	houselist, _ := service.GetAllStoreHouseList(adminUserInfo.CurrentOrgId)
406 407
 	if err == nil {
@@ -7682,3 +7683,17 @@ func (this *StockManagerApiController) GetPrintList() {
7682 7683
 		"houseList": houseList,
7683 7684
 	})
7684 7685
 }
7686
+
7687
+func (this *StockManagerApiController) GetInvetoryWarehouseInfoList() {
7688
+
7689
+	storehouse_id, _ := this.GetInt64("storehouse_id")
7690
+	orgId := this.GetAdminUserInfo().CurrentOrgId
7691
+	list, _ := service.GetInvetoryWarehouseInfoList(orgId, storehouse_id)
7692
+	manufacturerList, _ := service.GetAllManufacturerList(orgId)
7693
+	dealerList, _ := service.GetAllDealerList(orgId)
7694
+	this.ServeSuccessJSON(map[string]interface{}{
7695
+		"list":             list,
7696
+		"manufacturerList": manufacturerList,
7697
+		"dealerList":       dealerList,
7698
+	})
7699
+}

+ 4 - 4
service/new_warehouse_service.go View File

@@ -246,7 +246,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
246 246
 				PatientId:               patient_id,
247 247
 				SystemTime:              record_time,
248 248
 				ConsumableType:          7,
249
-				IsSys:                   0,
249
+				IsSys:                   1,
250 250
 				WarehousingOrder:        "",
251 251
 				WarehouseOutId:          lastOut.WarehouseOutId,
252 252
 				WarehouseOutOrderNumber: lastOut.WarehouseOutOrderNumber,
@@ -499,7 +499,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
499 499
 				PatientId:               patient_id,
500 500
 				SystemTime:              record_time,
501 501
 				ConsumableType:          7,
502
-				IsSys:                   0,
502
+				IsSys:                   1,
503 503
 				WarehousingOrder:        "",
504 504
 				WarehouseOutId:          lastOut.WarehouseOutId,
505 505
 				WarehouseOutOrderNumber: lastOut.WarehouseOutOrderNumber,
@@ -910,7 +910,7 @@ func BloodDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *
910 910
 				PatientId:               advice.PatientId,
911 911
 				SystemTime:              advice.AdviceDate,
912 912
 				ConsumableType:          7,
913
-				IsSys:                   0,
913
+				IsSys:                   1,
914 914
 				WarehousingOrder:        "",
915 915
 				WarehouseOutId:          0,
916 916
 				WarehouseOutOrderNumber: "",
@@ -1205,7 +1205,7 @@ func BloodDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *
1205 1205
 				PatientId:               advice.PatientId,
1206 1206
 				SystemTime:              advice.AdviceDate,
1207 1207
 				ConsumableType:          7,
1208
-				IsSys:                   0,
1208
+				IsSys:                   1,
1209 1209
 				WarehousingOrder:        "",
1210 1210
 				WarehouseOutId:          0,
1211 1211
 				WarehouseOutOrderNumber: "",

+ 6 - 0
service/self_drug_service.go View File

@@ -2675,3 +2675,9 @@ func ModifyDrugFlowById(id int64, over_count int64) error {
2675 2675
 	err := XTWriteDB().Model(&models.DrugFlow{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"over_count": over_count}).Error
2676 2676
 	return err
2677 2677
 }
2678
+
2679
+func GetDrugInventoryWarehouseInfoList(org_id int64, storehouse_id int64) (info []*models.XtDrugWarehouseInfo, err error) {
2680
+
2681
+	err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id = ? and is_check = 1 and org_id = ?", storehouse_id, org_id).Preload("XtBaseDrug", "status= 1").Find(&info).Error
2682
+	return info, err
2683
+}

+ 6 - 0
service/stock_service.go View File

@@ -8069,3 +8069,9 @@ func ReduceGoodSumOutCount(storehouse_id int64, good_id int64, user_org_id int64
8069 8069
 	ut.Commit()
8070 8070
 	return err
8071 8071
 }
8072
+
8073
+func GetInvetoryWarehouseInfoList(orgid int64, storehouse_id int64) (info []*models.WarehousingInfo, err error) {
8074
+
8075
+	err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id=? and is_check= 1 and org_id = ?", storehouse_id, orgid).Preload("GoodInfo", "status = 1").Find(&info).Error
8076
+	return info, err
8077
+}