|
@@ -3858,10 +3858,25 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
|
3858
|
3858
|
|
3859
|
3859
|
//期间减少
|
3860
|
3860
|
banceOutList, _ := service.GetInitOutBanceList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
|
|
3861
|
+
|
3861
|
3862
|
for _, it := range banceOutList {
|
3862
|
3863
|
item.WarehouseOutInfoTenty = append(item.WarehouseOutInfoTenty, it)
|
3863
|
3864
|
}
|
3864
|
3865
|
|
|
3866
|
+ //期间盘盈
|
|
3867
|
+ infoFlow, _ := service.GetInitInfoFlow(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
|
|
3868
|
+
|
|
3869
|
+ for _, it := range infoFlow {
|
|
3870
|
+ item.WareStartInStockFlow = append(item.WareStartInStockFlow, it)
|
|
3871
|
+ }
|
|
3872
|
+
|
|
3873
|
+ //期间盘亏
|
|
3874
|
+ outInfoFlow, _ := service.GetInitOutInfoFlow(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
|
|
3875
|
+
|
|
3876
|
+ for _, it := range outInfoFlow {
|
|
3877
|
+ item.WareStartOutStockFlow = append(item.WareStartOutStockFlow, it)
|
|
3878
|
+ }
|
|
3879
|
+
|
3865
|
3880
|
}
|
3866
|
3881
|
|
3867
|
3882
|
if err != nil {
|
|
@@ -3940,41 +3955,6 @@ func (this *SelfDrugApiController) GetPurchaseNewDrugQuery() {
|
3940
|
3955
|
endFlow, _ := service.GetDrugEndFlow(item.ID, orgId, endTime)
|
3941
|
3956
|
|
3942
|
3957
|
item.DrugEndFlow = endFlow
|
3943
|
|
- //获取期初结余入库数量
|
3944
|
|
- //startDrugInfo, _ := service.GetDrugWarehouseInfoStart(item.ID, orgId, startTime)
|
3945
|
|
- //for _, it := range startDrugInfo {
|
3946
|
|
- // item.DrugWarehouseInfoStart = append(item.DrugWarehouseInfoStart, it)
|
3947
|
|
- //}
|
3948
|
|
- //
|
3949
|
|
- ////获取期初结余出库数量
|
3950
|
|
- //flowOutList, _ := service.GetDrugFlowOut(item.ID, orgId, startTime)
|
3951
|
|
- //for _, it := range flowOutList {
|
3952
|
|
- // item.DrugWarehouseOutInfoStart = append(item.DrugWarehouseOutInfoStart, it)
|
3953
|
|
- //}
|
3954
|
|
- //
|
3955
|
|
- ////获取期初结余退库数量
|
3956
|
|
- //cancelInfo, _ := service.GetStartDrugFlowCancelInfo(item.ID, orgId, startTime)
|
3957
|
|
- //for _, it := range cancelInfo {
|
3958
|
|
- // item.WareStartStockCancelInfo = append(item.WareStartStockCancelInfo, it)
|
3959
|
|
- //}
|
3960
|
|
- //
|
3961
|
|
- ////获取期末结余入库数量
|
3962
|
|
- //drugwarehouseinfoend, _ := service.DrugWarehouseInfoEnd(item.ID, orgId, endTime)
|
3963
|
|
- //for _, it := range drugwarehouseinfoend {
|
3964
|
|
- // item.DrugWarehouseInfoEnd = append(item.DrugWarehouseInfoEnd, it)
|
3965
|
|
- //}
|
3966
|
|
-
|
3967
|
|
- ////获取期末出库结余
|
3968
|
|
- //endDrugInfo, _ := service.DrugWarehouseOutInfoEnd(item.ID, orgId, endTime)
|
3969
|
|
- //for _, it := range endDrugInfo {
|
3970
|
|
- // item.DrugWarehouseOutInfoEnd = append(item.DrugWarehouseOutInfoEnd, it)
|
3971
|
|
- //}
|
3972
|
|
- //
|
3973
|
|
- ////获取期末退库数量
|
3974
|
|
- //flowCancelInfo, _ := service.GetEndDrugFlowCancelInfo(item.ID, orgId, endTime)
|
3975
|
|
- //for _, it := range flowCancelInfo {
|
3976
|
|
- // item.WareEndStockCancelInfo = append(item.WareEndStockCancelInfo, it)
|
3977
|
|
- //}
|
3978
|
3958
|
|
3979
|
3959
|
//期中增加
|
3980
|
3960
|
drugWarehouse, _ := service.GetDrugWarehouseStartEnd(item.ID, orgId, startTime, endTime)
|
|
@@ -3995,27 +3975,6 @@ func (this *SelfDrugApiController) GetPurchaseNewDrugQuery() {
|
3995
|
3975
|
item.WareStartEndStockCancelInfo = append(item.WareStartEndStockCancelInfo, it)
|
3996
|
3976
|
}
|
3997
|
3977
|
|
3998
|
|
- ////获取期初盘盈
|
3999
|
|
- //startProfit, _ := service.GetDrugFlowStartProfit(item.ID, orgId, startTime)
|
4000
|
|
- //for _, it := range startProfit {
|
4001
|
|
- // item.WareStartStockInventoryProfit = append(item.WareStartStockInventoryProfit, it)
|
4002
|
|
- //}
|
4003
|
|
- ////获取期初盘亏
|
4004
|
|
- //startLosses, _ := service.GetDrugFlowStartLosses(item.ID, orgId, startTime)
|
4005
|
|
- //for _, it := range startLosses {
|
4006
|
|
- // item.WareStartStockInventoryLosses = append(item.WareStartStockInventoryLosses, it)
|
4007
|
|
- //}
|
4008
|
|
- ////获取期末盘盈
|
4009
|
|
- //endProfit, _ := service.GetDrugFlowEndProfit(item.ID, orgId, endTime)
|
4010
|
|
- //for _, it := range endProfit {
|
4011
|
|
- // item.WareEndStockInventoryProfit = append(item.WareEndStockInventoryProfit, it)
|
4012
|
|
- //}
|
4013
|
|
- ////获取期末盘亏
|
4014
|
|
- //losses, _ := service.GetDrugFlowEndLosses(item.ID, orgId, endTime)
|
4015
|
|
- //for _, it := range losses {
|
4016
|
|
- // item.WareEndStockInventoryLosses = append(item.WareEndStockInventoryLosses, it)
|
4017
|
|
- //}
|
4018
|
|
-
|
4019
|
3978
|
//获取期中盘盈
|
4020
|
3979
|
profit, _ := service.GetDrugFlowStartEndProfit(item.ID, orgId, startTime, endTime)
|
4021
|
3980
|
for _, it := range profit {
|
|
@@ -4027,6 +3986,37 @@ func (this *SelfDrugApiController) GetPurchaseNewDrugQuery() {
|
4027
|
3986
|
for _, it := range endLosses {
|
4028
|
3987
|
item.WareStartEndStockInventoryLosses = append(item.WareStartEndStockInventoryLosses, it)
|
4029
|
3988
|
}
|
|
3989
|
+
|
|
3990
|
+ //获取入库
|
|
3991
|
+ infoFLow, _ := service.GetNewDrugFlowInWarehouseInfo(item.ID, orgId, startTime)
|
|
3992
|
+
|
|
3993
|
+ for _, it := range infoFLow {
|
|
3994
|
+ item.NewDrugFlowInWarehouseInfo = append(item.NewDrugFlowInWarehouseInfo, it)
|
|
3995
|
+ }
|
|
3996
|
+ //获取盘盈
|
|
3997
|
+ infoProfitFlow, _ := service.GetNewDrugFlowPofitWarehouseInfo(item.ID, orgId, startTime)
|
|
3998
|
+
|
|
3999
|
+ for _, it := range infoProfitFlow {
|
|
4000
|
+ item.NewDrugFlowPofitWarehouseInfo = append(item.NewDrugFlowPofitWarehouseInfo, it)
|
|
4001
|
+ }
|
|
4002
|
+ //获取出库
|
|
4003
|
+ infoOutFlow, _ := service.GetNewDrugFlowOutWarehouseInfo(item.ID, orgId, startTime)
|
|
4004
|
+ for _, it := range infoOutFlow {
|
|
4005
|
+ item.NewDrugFlowOutWarehouseInfo = append(item.NewDrugFlowOutWarehouseInfo, it)
|
|
4006
|
+ }
|
|
4007
|
+
|
|
4008
|
+ //获取退库
|
|
4009
|
+ infoCacelFlow, _ := service.GetNewDrugFlowCacelWarehouseInfo(item.ID, orgId, startTime)
|
|
4010
|
+ for _, it := range infoCacelFlow {
|
|
4011
|
+ item.NewDrugFlowNoCancelWarehouseInfo = append(item.NewDrugFlowNoCancelWarehouseInfo, it)
|
|
4012
|
+ }
|
|
4013
|
+
|
|
4014
|
+ //获取盘亏
|
|
4015
|
+ infoNoPofitFlow, _ := service.GetNewDrugFlowNoPofitWarehouseInfo(item.ID, orgId, startTime)
|
|
4016
|
+ for _, it := range infoNoPofitFlow {
|
|
4017
|
+ item.NewDrugFlowNoPofitWarehouseInfo = append(item.NewDrugFlowNoPofitWarehouseInfo, it)
|
|
4018
|
+ }
|
|
4019
|
+
|
4030
|
4020
|
}
|
4031
|
4021
|
if err != nil {
|
4032
|
4022
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取患者信息失败")
|