소스 검색

11月9日库存管理

XMLWAN 1 년 전
부모
커밋
453b4b8ee0

+ 1 - 1
controllers/gobal_config_api_controller.go 파일 보기

@@ -2231,7 +2231,7 @@ func (c *GobalConfigApiController) GetSingleOrderDetail() {
2231 2231
 	orgId := c.GetAdminUserInfo().CurrentOrgId
2232 2232
 
2233 2233
 	list, err := service.GetSingleOrderDetail(id, orgId)
2234
-	drugoutlist, _ := service.GetDrugWarehouseOutDetailSeventy(id, orgId)
2234
+	drugoutlist, _ := service.GetDrugWarehouseOutDetailNighty(id, orgId)
2235 2235
 	dealerList, err := service.GetAllDealerList(orgId)
2236 2236
 	manufacturerList, err := service.GetAllManufacturerList(orgId)
2237 2237
 	drugFlowList, _ := service.GetDrugStockFlowDetail(start_time, orgId)

+ 49 - 0
models/drug_stock.go 파일 보기

@@ -647,3 +647,52 @@ type DrugFlowNight struct {
647 647
 func (DrugFlowNight) TableName() string {
648 648
 	return "xt_drug_flow"
649 649
 }
650
+
651
+type DrugWarehouseOutInfoNight struct {
652
+	ID                      int64            `gorm:"column:id" json:"id" form:"id"`
653
+	WarehouseOutId          int64            `gorm:"column:warehouse_out_id" json:"warehouse_out_id" form:"warehouse_out_id"`
654
+	DrugId                  int64            `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
655
+	WarehousingOutTarget    int64            `gorm:"column:warehousing_out_target" json:"warehousing_out_target" form:"warehousing_out_target"`
656
+	Count                   int64            `gorm:"column:count" json:"count" form:"count"`
657
+	CountUnit               string           `gorm:"column:count_unit" json:"count_unit" form:"count_unit"`
658
+	Price                   float64          `gorm:"column:price" json:"price" form:"price"`
659
+	TotalPrice              float64          `gorm:"column:total_price" json:"total_price" form:"total_price"`
660
+	ProductDate             int64            `gorm:"column:product_date" json:"product_date" form:"product_date"`
661
+	ExpiryDate              int64            `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
662
+	Mtime                   int64            `gorm:"column:mtime" json:"mtime" form:"mtime"`
663
+	Ctime                   int64            `gorm:"column:ctime" json:"ctime" form:"ctime"`
664
+	Status                  int64            `gorm:"column:status" json:"status" form:"status"`
665
+	OrgId                   int64            `gorm:"column:org_id" json:"org_id" form:"org_id"`
666
+	Remark                  string           `gorm:"column:remark" json:"remark" form:"remark"`
667
+	IsCancel                int64            `gorm:"column:is_cancel" json:"is_cancel" form:"is_cancel"`
668
+	WarehouseOutOrderNumber string           `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number" form:"warehouse_out_order_number"`
669
+	Type                    int64            `gorm:"column:type" json:"type" form:"type"`
670
+	Dealer                  int64            `gorm:"column:dealer" json:"dealer" form:"dealer"`
671
+	Manufacturer            int64            `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
672
+	IsSys                   int64            `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
673
+	SysRecordTime           int64            `gorm:"column:sys_record_time" json:"sys_record_time" form:"sys_record_time"`
674
+	RetailPrice             float64          `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
675
+	RetailTotalPrice        float64          `gorm:"column:retail_total_price" json:"retail_total_price" form:"retail_total_price"`
676
+	Number                  string           `gorm:"column:number" json:"number" form:"number"`
677
+	BatchNumber             string           `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
678
+	PatientId               int64            `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
679
+	WarehouseInfoId         int64            `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
680
+	AdviceId                int64            `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
681
+	SupplyCancelOutId       int64            `gorm:"column:supply_cancel_out_id" json:"supply_cancel_out_id" form:"supply_cancel_out_id"`
682
+	SupplyWarehouseId       int64            `gorm:"column:supply_warehouse_id" json:"supply_warehouse_id" form:"supply_warehouse_id"`
683
+	IsSource                int64            `gorm:"column:is_source" json:"is_source" form:"is_source"`
684
+	StorehouseId            int64            `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
685
+	SecondWarehouseInfoId   int64            `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
686
+	AdminUserId             int64            `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
687
+	LastPrice               float64          `gorm:"column:last_price" json:"last_price" form:"last_price"`
688
+	StockCount              string           `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
689
+	PharmacyId              int64            `gorm:"column:pharmacy_id" json:"pharmacy_id" form:"pharmacy_id"`
690
+	IsCheck                 int64            `gorm:"column:is_check" json:"is_check" form:"is_check"`
691
+	Drug                    BaseDrugLibSeven `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId"json:"drug" `
692
+	OverCount               int64            `gorm:"column:over_count" json:"over_count" form:"over_count"`
693
+	OrderId                 int64            `gorm:"column:order_id" json:"order_id" form:"order_id"`
694
+}
695
+
696
+func (DrugWarehouseOutInfoNight) TableName() string {
697
+	return "xt_drug_warehouse_out_info"
698
+}

+ 7 - 1
service/gobal_config_service.go 파일 보기

@@ -902,6 +902,12 @@ func GetDrugWarehouseOutDetailSeventy(id int64, org_id int64) (info []*models.Dr
902 902
 	return info, err
903 903
 }
904 904
 
905
+func GetDrugWarehouseOutDetailNighty(id int64, org_id int64) (info []*models.DrugWarehouseOutInfoNight, err error) {
906
+
907
+	err = XTReadDB().Where("warehouse_out_id in(?) and org_id = ? and status =1", id, org_id).Preload("Drug", "org_id = ? and status = 1", org_id).Find(&info).Error
908
+	return info, err
909
+}
910
+
905 911
 func GetDrugStockFlowDetail(record_time int64, orgid int64) (drugflow []*models.XtDrugAutomaticReduceDetail, err error) {
906 912
 
907 913
 	err = XTReadDB().Where("record_time = ? and org_id = ? and status = 1", record_time, orgid).Preload("XtBaseDrug", "status = 1").Find(&drugflow).Error
@@ -953,7 +959,7 @@ func GetDrugFlowListGroupById(id int64, orgid int64) (drugFlow []*models.DrugFlo
953 959
 
954 960
 func GetDrugFlowListGroupByIdOne(id int64, orgid int64) (drugFlow []*models.DrugFlow, err error) {
955 961
 
956
-	err = XTReadDB().Where("warehouse_out_id in(?) and user_org_id = ? and status = 1", id, orgid).Group("batch_number").Find(&drugFlow).Error
962
+	err = XTReadDB().Where("warehouse_out_id in(?) and user_org_id = ? and status = 1", id, orgid).Group("warehousing_detail_id").Find(&drugFlow).Error
957 963
 	return drugFlow, err
958 964
 }
959 965
 

+ 1 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go 파일 보기

@@ -215,6 +215,7 @@ type PrescriptionVM struct {
215 215
 	OxygenUptake               int64   `gorm:"column:oxygen_uptake" json:"oxygen_uptake" form:"oxygen_uptake"`
216 216
 	OxygenFlow                 string  `gorm:"column:oxygen_flow" json:"oxygen_flow" form:"oxygen_flow"`
217 217
 	OxygenTime                 string  `gorm:"column:oxygen_time" json:"oxygen_time" form:"oxygen_time"`
218
+	DialysisRemark             string  `gorm:"column:dialysis_remark" json:"dialysis_remark" form:"dialysis_remark"`
218 219
 }
219 220
 
220 221
 func (PrescriptionVM) TableName() string {