|
@@ -1386,21 +1386,42 @@ func (this *SupplyOrderApiController) GetAllGoodOderList() {
|
1386
|
1386
|
func (this *SupplyOrderApiController) GetGoodOrderDetail() {
|
1387
|
1387
|
|
1388
|
1388
|
id, _ := this.GetInt64("id")
|
|
1389
|
+ ids := this.GetString("ids")
|
1389
|
1390
|
orgId := this.GetAdminUserInfo().CurrentOrgId
|
1390
|
|
- out, err := service.GetGoodOrderDetail(id, orgId)
|
1391
|
|
- list, _ := service.GetSupplyWarehouseOutById(id, orgId)
|
1392
|
|
- drugList, _ := service.GetSupplyDrugList(orgId)
|
1393
|
|
- goodList, _ := service.GetSupplyGoodList(orgId)
|
1394
|
|
- if err == nil {
|
1395
|
|
- this.ServeSuccessJSON(map[string]interface{}{
|
1396
|
|
- "out": out,
|
1397
|
|
- "list": list,
|
1398
|
|
- "goodList": goodList,
|
1399
|
|
- "drugList": drugList,
|
1400
|
|
- })
|
1401
|
|
- } else {
|
1402
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1391
|
+ if len(ids) == 0 {
|
|
1392
|
+ out, err := service.GetGoodOrderDetail(id, orgId)
|
|
1393
|
+ list, _ := service.GetSupplyWarehouseOutById(id, orgId)
|
|
1394
|
+ drugList, _ := service.GetSupplyDrugList(orgId)
|
|
1395
|
+ goodList, _ := service.GetSupplyGoodList(orgId)
|
|
1396
|
+ if err == nil {
|
|
1397
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1398
|
+ "out": out,
|
|
1399
|
+ "list": list,
|
|
1400
|
+ "goodList": goodList,
|
|
1401
|
+ "drugList": drugList,
|
|
1402
|
+ })
|
|
1403
|
+ } else {
|
|
1404
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1405
|
+ }
|
|
1406
|
+ }
|
|
1407
|
+ if len(ids) > 0 {
|
|
1408
|
+ idArray := strings.Split(ids, ",")
|
|
1409
|
+ out, err := service.GetGoodOrderDetail(id, orgId)
|
|
1410
|
+ list, _ := service.GetSupplyWarehouseOutByIdOne(id, orgId, idArray)
|
|
1411
|
+ drugList, _ := service.GetSupplyDrugList(orgId)
|
|
1412
|
+ goodList, _ := service.GetSupplyGoodList(orgId)
|
|
1413
|
+ if err == nil {
|
|
1414
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1415
|
+ "out": out,
|
|
1416
|
+ "list": list,
|
|
1417
|
+ "goodList": goodList,
|
|
1418
|
+ "drugList": drugList,
|
|
1419
|
+ })
|
|
1420
|
+ } else {
|
|
1421
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1422
|
+ }
|
1403
|
1423
|
}
|
|
1424
|
+
|
1404
|
1425
|
}
|
1405
|
1426
|
|
1406
|
1427
|
func (this *SupplyOrderApiController) UpdateGoodOrder() {
|
|
@@ -2646,6 +2667,8 @@ func (this *SupplyOrderApiController) ModefyGoodOrder() {
|
2646
|
2667
|
//获取购货单的数据
|
2647
|
2668
|
goodOrder, _ := service.GetAllGoodOrderById(id, orgId)
|
2648
|
2669
|
drugList, _ := service.GetSupplyDrugList(orgId)
|
|
2670
|
+ //获取已有关联的退货单
|
|
2671
|
+ cancelList, _ := service.GetSupplyCancelWarehouse(id, orgId)
|
2649
|
2672
|
//查询是否存在退货单
|
2650
|
2673
|
_, errcode := service.GetSupplyCancelOrderById(id, orgId)
|
2651
|
2674
|
//无退库单
|
|
@@ -2680,6 +2703,7 @@ func (this *SupplyOrderApiController) ModefyGoodOrder() {
|
2680
|
2703
|
service.UpdateGoodSupplyFlow(id, orgId)
|
2681
|
2704
|
if err == nil {
|
2682
|
2705
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
2706
|
+ "cancelList": cancelList,
|
2683
|
2707
|
"purcaseOrder": purcaseOrder,
|
2684
|
2708
|
"goodOrder": goodOrder,
|
2685
|
2709
|
"drugList": drugList,
|
|
@@ -2691,6 +2715,7 @@ func (this *SupplyOrderApiController) ModefyGoodOrder() {
|
2691
|
2715
|
}
|
2692
|
2716
|
} else if errcode == nil {
|
2693
|
2717
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
2718
|
+ "cancelList": cancelList,
|
2694
|
2719
|
"purcaseOrder": purcaseOrder,
|
2695
|
2720
|
"goodOrder": goodOrder,
|
2696
|
2721
|
"drugList": drugList,
|