|
@@ -2722,9 +2722,9 @@ func (this *SelfDrugApiController) GetStorehouseList() {
|
2722
|
2722
|
orgId := this.GetAdminUserInfo().CurrentOrgId
|
2723
|
2723
|
|
2724
|
2724
|
list, err := service.GetAllStoreHouseList(orgId)
|
2725
|
|
- manufacturerList, _ := service.GetAllManufacturerList(orgId)
|
2726
|
|
- goodType, _ := service.GetAllGoodType(orgId)
|
2727
|
|
- patientList, _ := service.GetAllpatient(orgId)
|
|
2725
|
+ manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
|
|
2726
|
+ goodType, _ := service.GetAllNewGoodType(orgId)
|
|
2727
|
+ patientList, _ := service.GetAllpatientThirty(orgId)
|
2728
|
2728
|
if err != nil {
|
2729
|
2729
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取仓库失败")
|
2730
|
2730
|
return
|
|
@@ -2761,16 +2761,16 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
|
2761
|
2761
|
}
|
2762
|
2762
|
|
2763
|
2763
|
var ids []int64
|
2764
|
|
- var goodIds []int64
|
|
2764
|
+ //var goodIds []int64
|
2765
|
2765
|
manufacturerList, _ := service.GetManufacturerListByKeyword(orgId, keyword)
|
2766
|
2766
|
for _, it := range manufacturerList {
|
2767
|
2767
|
ids = append(ids, it.ID)
|
2768
|
2768
|
}
|
2769
|
2769
|
|
2770
|
|
- infoList, _ := service.GetGoodWarehouseInfoByOrgId(orgId, storehouse_id)
|
2771
|
|
- for _, it := range infoList {
|
2772
|
|
- goodIds = append(goodIds, it.GoodId)
|
2773
|
|
- }
|
|
2770
|
+ //infoList, _ := service.GetGoodWarehouseInfoByOrgId(orgId, storehouse_id)
|
|
2771
|
+ //for _, it := range infoList {
|
|
2772
|
+ // goodIds = append(goodIds, it.GoodId)
|
|
2773
|
+ //}
|
2774
|
2774
|
|
2775
|
2775
|
stockList, total, err := service.GetGoodStockList(orgId, storehouse_id, good_type, keyword, page, limit, ids)
|
2776
|
2776
|
|
|
@@ -3262,7 +3262,7 @@ func (this *SelfDrugApiController) GetPurchaseDrugQuery() {
|
3262
|
3262
|
for _, it := range infoList {
|
3263
|
3263
|
infoIds = append(infoIds, it.DrugId)
|
3264
|
3264
|
}
|
3265
|
|
- manufacturerList, _ := service.GetAllManufacturerList(orgId)
|
|
3265
|
+ manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
|
3266
|
3266
|
list, total, err := service.GetDrugPurchaseStockQuery(good_type, keyword, page, limit, orgId, startTime, endTime, ids, infoIds)
|
3267
|
3267
|
|
3268
|
3268
|
for _, item := range list {
|
|
@@ -3428,7 +3428,6 @@ func (this *SelfDrugApiController) GetDrugNewQuery() {
|
3428
|
3428
|
for _, it := range infoList {
|
3429
|
3429
|
goodIds = append(goodIds, it.DrugId)
|
3430
|
3430
|
}
|
3431
|
|
- //list, total, err := service.GetDrugNewQuery(orgId, storehouse_id, good_type, keyword, page, limit, ids, goodIds, startTime, endTime)
|
3432
|
3431
|
|
3433
|
3432
|
countList, total, err := service.GetDrugStockCountList(orgId, storehouse_id, good_type, keyword, page, limit, ids, goodIds, startTime, endTime)
|
3434
|
3433
|
|
|
@@ -3441,8 +3440,7 @@ func (this *SelfDrugApiController) GetDrugNewQuery() {
|
3441
|
3440
|
drugTypeList, _ := service.GetParentDataConfig(drugTypeParent.ID, orgId)
|
3442
|
3441
|
|
3443
|
3442
|
this.ServeSuccessJSON(map[string]interface{}{
|
3444
|
|
- "total": total,
|
3445
|
|
- //"list": list,
|
|
3443
|
+ "total": total,
|
3446
|
3444
|
"drugTypeList": drugTypeList,
|
3447
|
3445
|
"countList": countList,
|
3448
|
3446
|
})
|
|
@@ -3665,7 +3663,7 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
|
3665
|
3663
|
for _, it := range manufacturers {
|
3666
|
3664
|
ids = append(ids, it.ID)
|
3667
|
3665
|
}
|
3668
|
|
- manufacturerList, _ := service.GetAllManufacturerList(orgId)
|
|
3666
|
+ manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
|
3669
|
3667
|
list, total, err := service.GetGoodNewPurchaseStockQuery(good_type, keyword, page, limit, orgId, ids, goodIds)
|
3670
|
3668
|
|
3671
|
3669
|
for _, item := range list {
|
|
@@ -3680,18 +3678,6 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
|
3680
|
3678
|
|
3681
|
3679
|
item.GoodEndFlowInfo = flow
|
3682
|
3680
|
|
3683
|
|
- //获取期初结余数量
|
3684
|
|
- //infoList, _ := service.GetStartGoodWarehouseInfoList(item.ID, orgId, startTime)
|
3685
|
|
- //for _, it := range infoList {
|
3686
|
|
- // item.WarehousingInfoStart = append(item.WarehousingInfoStart, it)
|
3687
|
|
- //}
|
3688
|
|
- //
|
3689
|
|
- ////获取期末结余数量
|
3690
|
|
- //warehouseInfoList, _ := service.GetEndGoodWarehouseInfoList(item.ID, orgId, endTime)
|
3691
|
|
- //for _, it := range warehouseInfoList {
|
3692
|
|
- // item.WarehousingInfoEnd = append(item.WarehousingInfoEnd, it)
|
3693
|
|
- //}
|
3694
|
|
-
|
3695
|
3681
|
//获取期间增加
|
3696
|
3682
|
goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime)
|
3697
|
3683
|
for _, it := range goodWarehouseInfoList {
|
|
@@ -3720,63 +3706,6 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
|
3720
|
3706
|
item.WarehouseOutInfoEnd = append(item.WarehouseOutInfoEnd, it)
|
3721
|
3707
|
}
|
3722
|
3708
|
|
3723
|
|
- ////获取期初结余
|
3724
|
|
- //info, _ := service.FindeStartFlowInfo(item.ID, orgId, startTime)
|
3725
|
|
- //for _, it := range info {
|
3726
|
|
- // item.StartFlowInfo = append(item.StartFlowInfo, it)
|
3727
|
|
- //}
|
3728
|
|
- ////获取期初结余
|
3729
|
|
- //flowOutInfo, _ := service.FindeStartFlowOutInfo(item.ID, orgId, startTime)
|
3730
|
|
- //for _, it := range flowOutInfo {
|
3731
|
|
- // item.StartOutFlowInfo = append(item.StartOutFlowInfo, it)
|
3732
|
|
- //}
|
3733
|
|
- //
|
3734
|
|
- ////获取期初退库
|
3735
|
|
- //cancelInfo, _ := service.FindeStartCancelInfo(item.ID, orgId, startTime)
|
3736
|
|
- //for _, it := range cancelInfo {
|
3737
|
|
- // item.StartCancelFlowInfo = append(item.StartCancelFlowInfo, it)
|
3738
|
|
- //}
|
3739
|
|
-
|
3740
|
|
- ////获取期末结余
|
3741
|
|
- //flowInfo, _ := service.FindEndStartFlowInfo(item.ID, orgId, endTime)
|
3742
|
|
- //for _, it := range flowInfo {
|
3743
|
|
- // item.EndFlowInfo = append(item.EndFlowInfo, it)
|
3744
|
|
- //}
|
3745
|
|
- //
|
3746
|
|
- ////获取期末出库
|
3747
|
|
- //lowOutInfo, _ := service.FindeEndFLowOutInfo(item.ID, orgId, endTime)
|
3748
|
|
- //for _, it := range lowOutInfo {
|
3749
|
|
- // item.EndFlowOutInfo = append(item.EndFlowOutInfo, it)
|
3750
|
|
- //}
|
3751
|
|
- //
|
3752
|
|
- ////获取期末退库
|
3753
|
|
- //endCancelInfo, _ := service.FindEndCancelInfo(item.ID, orgId, endTime)
|
3754
|
|
- //for _, it := range endCancelInfo {
|
3755
|
|
- // item.EndCancelFLowInfo = append(item.EndCancelFLowInfo, it)
|
3756
|
|
- //}
|
3757
|
|
-
|
3758
|
|
- ////期初盘赢
|
3759
|
|
- //inventory, _ := service.FindeStartStockInventoryProfit(item.ID, orgId, startTime)
|
3760
|
|
- //for _, it := range inventory {
|
3761
|
|
- // item.WareStartStockInventoryProfit = append(item.WareStartStockInventoryProfit, it)
|
3762
|
|
- //}
|
3763
|
|
- ////期初盘亏
|
3764
|
|
- //stockInventory, _ := service.FindStartStockInventoryLosses(item.ID, orgId, startTime)
|
3765
|
|
- //for _, it := range stockInventory {
|
3766
|
|
- // item.WareStartStockInventoryLosses = append(item.WareStartStockInventoryLosses, it)
|
3767
|
|
- //}
|
3768
|
|
-
|
3769
|
|
- ////期末盘盈
|
3770
|
|
- //inventoryProfit, _ := service.FindeStartStockInventoryProfit(item.ID, orgId, endTime)
|
3771
|
|
- //for _, it := range inventoryProfit {
|
3772
|
|
- // item.WareEndStockInventoryProfit = append(item.WareEndStockInventoryProfit, it)
|
3773
|
|
- //}
|
3774
|
|
- ////期末盘亏
|
3775
|
|
- //inventoryLosses, _ := service.FindStartStockInventoryLosses(item.ID, orgId, endTime)
|
3776
|
|
- //for _, it := range inventoryLosses {
|
3777
|
|
- // item.WareEndStockInventoryLosses = append(item.WareEndStockInventoryLosses, it)
|
3778
|
|
- //}
|
3779
|
|
-
|
3780
|
3709
|
//期中盘盈
|
3781
|
3710
|
profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime)
|
3782
|
3711
|
for _, it := range profit {
|