|
@@ -103,6 +103,9 @@ func SupplyOrderApiRegistRouters() {
|
103
|
103
|
beego.Router("/api/supply/deletereturnorderbyid", &SupplyOrderApiController{}, "Get:DeleteReturnOrderById")
|
104
|
104
|
//反审核退货单
|
105
|
105
|
beego.Router("/api/supply/modefyreturnorder", &SupplyOrderApiController{}, "Get:ModefyReturnOrder")
|
|
106
|
+
|
|
107
|
+ //获取采购数据
|
|
108
|
+ beego.Router("/api/supply/getgoodorderdetaillist", &SupplyOrderApiController{}, "Get:GetGoodOrderDetailList")
|
106
|
109
|
}
|
107
|
110
|
|
108
|
111
|
//判断前端参数是否为空
|
|
@@ -3083,7 +3086,7 @@ func (this *SupplyOrderApiController) ModefyGoodOrder() {
|
3083
|
3086
|
for _, it := range goodOrder {
|
3084
|
3087
|
|
3085
|
3088
|
if it.IsSource == 1 {
|
3086
|
|
- out, _ := service.GetDrugWarehosueInfoByWarehousingId(it.ProjectId, it.WarehousingId, orgId)
|
|
3089
|
+ out, _ := service.GetDrugWarehosueInfoByWarehousingId(it.ProjectId, id, orgId)
|
3087
|
3090
|
|
3088
|
3091
|
if out.ID > 0 {
|
3089
|
3092
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -3097,7 +3100,8 @@ func (this *SupplyOrderApiController) ModefyGoodOrder() {
|
3097
|
3100
|
}
|
3098
|
3101
|
}
|
3099
|
3102
|
if it.IsSource == 2 {
|
3100
|
|
- out, _ := service.GetGoodWarehouseInfoByWarehousingId(it.ProjectId, it.WarehousingId, orgId)
|
|
3103
|
+ fmt.Println("hh23323233232232332232323232332", it.WarehouseOutId)
|
|
3104
|
+ out, _ := service.GetGoodWarehouseInfoByWarehousingId(it.ProjectId, id, orgId)
|
3101
|
3105
|
if out.ID > 0 {
|
3102
|
3106
|
this.ServeSuccessJSON(map[string]interface{}{
|
3103
|
3107
|
"cancelList": "",
|
|
@@ -3657,3 +3661,74 @@ func (this *SupplyOrderApiController) ModefyReturnOrder() {
|
3657
|
3661
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
3658
|
3662
|
}
|
3659
|
3663
|
}
|
|
3664
|
+
|
|
3665
|
+func (this *SupplyOrderApiController) GetGoodOrderDetailList() {
|
|
3666
|
+ id, _ := this.GetInt64("id")
|
|
3667
|
+ ids := this.GetString("ids")
|
|
3668
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
3669
|
+
|
|
3670
|
+ if len(ids) == 0 {
|
|
3671
|
+ out, err := service.GetGoodOrderDetail(id, orgId)
|
|
3672
|
+ list, _ := service.GetSupplyWarehouseOutById(id, orgId)
|
|
3673
|
+ for _, item := range list {
|
|
3674
|
+
|
|
3675
|
+ if item.IsSource == 1 {
|
|
3676
|
+ waresingList, _ := service.GetAllDrugWaresingList(item.ProjectId, orgId)
|
|
3677
|
+ medical, _ := service.GetBaseDrugMedical(item.ProjectId)
|
|
3678
|
+ item.DrugWarehouseInfo = waresingList
|
|
3679
|
+ item.SpBaseDrug = medical
|
|
3680
|
+ }
|
|
3681
|
+ if item.IsSource == 2 {
|
|
3682
|
+ waresingList, _ := service.GetAllGoodWaresingList(item.ProjectId, orgId)
|
|
3683
|
+
|
|
3684
|
+ item.GoodWarehouseInfo = waresingList
|
|
3685
|
+ }
|
|
3686
|
+ }
|
|
3687
|
+ drugList, _ := service.GetSupplyDrugList(orgId)
|
|
3688
|
+ goodList, _ := service.GetSupplyGoodList(orgId)
|
|
3689
|
+ supplyList, _ := service.GetSupplierList(orgId)
|
|
3690
|
+ if err == nil {
|
|
3691
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
3692
|
+ "out": out,
|
|
3693
|
+ "list": list,
|
|
3694
|
+ "goodList": goodList,
|
|
3695
|
+ "drugList": drugList,
|
|
3696
|
+ "supplyList": supplyList,
|
|
3697
|
+ })
|
|
3698
|
+ } else {
|
|
3699
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
3700
|
+ }
|
|
3701
|
+ }
|
|
3702
|
+ if len(ids) > 0 {
|
|
3703
|
+ idArray := strings.Split(ids, ",")
|
|
3704
|
+ out, err := service.GetGoodOrderDetail(id, orgId)
|
|
3705
|
+ list, _ := service.GetSupplyWarehouseOutByIdOne(id, orgId, idArray)
|
|
3706
|
+ for _, item := range list {
|
|
3707
|
+ if item.IsSource == 1 {
|
|
3708
|
+ waresingList, _ := service.GetAllDrugWaresingList(item.ProjectId, orgId)
|
|
3709
|
+ medical, _ := service.GetBaseDrugMedical(item.ProjectId)
|
|
3710
|
+ item.DrugWarehouseInfo = waresingList
|
|
3711
|
+ item.SpBaseDrug = medical
|
|
3712
|
+ }
|
|
3713
|
+ if item.IsSource == 2 {
|
|
3714
|
+ waresingList, _ := service.GetAllGoodWaresingList(item.ProjectId, orgId)
|
|
3715
|
+
|
|
3716
|
+ item.GoodWarehouseInfo = waresingList
|
|
3717
|
+ }
|
|
3718
|
+ }
|
|
3719
|
+ drugList, _ := service.GetSupplyDrugList(orgId)
|
|
3720
|
+ goodList, _ := service.GetSupplyGoodList(orgId)
|
|
3721
|
+ supplyList, _ := service.GetSupplierList(orgId)
|
|
3722
|
+ if err == nil {
|
|
3723
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
3724
|
+ "out": out,
|
|
3725
|
+ "list": list,
|
|
3726
|
+ "goodList": goodList,
|
|
3727
|
+ "drugList": drugList,
|
|
3728
|
+ "supplyList": supplyList,
|
|
3729
|
+ })
|
|
3730
|
+ } else {
|
|
3731
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
3732
|
+ }
|
|
3733
|
+ }
|
|
3734
|
+}
|