|
@@ -1416,21 +1416,42 @@ func (this *SupplyOrderApiController) GetAllGoodOderList() {
|
1416
|
1416
|
func (this *SupplyOrderApiController) GetGoodOrderDetail() {
|
1417
|
1417
|
|
1418
|
1418
|
id, _ := this.GetInt64("id")
|
|
1419
|
+ ids := this.GetString("ids")
|
1419
|
1420
|
orgId := this.GetAdminUserInfo().CurrentOrgId
|
1420
|
|
- out, err := service.GetGoodOrderDetail(id, orgId)
|
1421
|
|
- list, _ := service.GetSupplyWarehouseOutById(id, orgId)
|
1422
|
|
- drugList, _ := service.GetSupplyDrugList(orgId)
|
1423
|
|
- goodList, _ := service.GetSupplyGoodList(orgId)
|
1424
|
|
- if err == nil {
|
1425
|
|
- this.ServeSuccessJSON(map[string]interface{}{
|
1426
|
|
- "out": out,
|
1427
|
|
- "list": list,
|
1428
|
|
- "goodList": goodList,
|
1429
|
|
- "drugList": drugList,
|
1430
|
|
- })
|
1431
|
|
- } else {
|
1432
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1421
|
+ if len(ids) == 0 {
|
|
1422
|
+ out, err := service.GetGoodOrderDetail(id, orgId)
|
|
1423
|
+ list, _ := service.GetSupplyWarehouseOutById(id, orgId)
|
|
1424
|
+ drugList, _ := service.GetSupplyDrugList(orgId)
|
|
1425
|
+ goodList, _ := service.GetSupplyGoodList(orgId)
|
|
1426
|
+ if err == nil {
|
|
1427
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1428
|
+ "out": out,
|
|
1429
|
+ "list": list,
|
|
1430
|
+ "goodList": goodList,
|
|
1431
|
+ "drugList": drugList,
|
|
1432
|
+ })
|
|
1433
|
+ } else {
|
|
1434
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1435
|
+ }
|
|
1436
|
+ }
|
|
1437
|
+ if len(ids) > 0 {
|
|
1438
|
+ idArray := strings.Split(ids, ",")
|
|
1439
|
+ out, err := service.GetGoodOrderDetail(id, orgId)
|
|
1440
|
+ list, _ := service.GetSupplyWarehouseOutByIdOne(id, orgId, idArray)
|
|
1441
|
+ drugList, _ := service.GetSupplyDrugList(orgId)
|
|
1442
|
+ goodList, _ := service.GetSupplyGoodList(orgId)
|
|
1443
|
+ if err == nil {
|
|
1444
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1445
|
+ "out": out,
|
|
1446
|
+ "list": list,
|
|
1447
|
+ "goodList": goodList,
|
|
1448
|
+ "drugList": drugList,
|
|
1449
|
+ })
|
|
1450
|
+ } else {
|
|
1451
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1452
|
+ }
|
1433
|
1453
|
}
|
|
1454
|
+
|
1434
|
1455
|
}
|
1435
|
1456
|
|
1436
|
1457
|
func (this *SupplyOrderApiController) UpdateGoodOrder() {
|
|
@@ -2676,6 +2697,8 @@ func (this *SupplyOrderApiController) ModefyGoodOrder() {
|
2676
|
2697
|
//获取购货单的数据
|
2677
|
2698
|
goodOrder, _ := service.GetAllGoodOrderById(id, orgId)
|
2678
|
2699
|
drugList, _ := service.GetSupplyDrugList(orgId)
|
|
2700
|
+ //获取已有关联的退货单
|
|
2701
|
+ cancelList, _ := service.GetSupplyCancelWarehouse(id, orgId)
|
2679
|
2702
|
//查询是否存在退货单
|
2680
|
2703
|
_, errcode := service.GetSupplyCancelOrderById(id, orgId)
|
2681
|
2704
|
//无退库单
|
|
@@ -2710,6 +2733,7 @@ func (this *SupplyOrderApiController) ModefyGoodOrder() {
|
2710
|
2733
|
service.UpdateGoodSupplyFlow(id, orgId)
|
2711
|
2734
|
if err == nil {
|
2712
|
2735
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
2736
|
+ "cancelList": cancelList,
|
2713
|
2737
|
"purcaseOrder": purcaseOrder,
|
2714
|
2738
|
"goodOrder": goodOrder,
|
2715
|
2739
|
"drugList": drugList,
|
|
@@ -2721,6 +2745,7 @@ func (this *SupplyOrderApiController) ModefyGoodOrder() {
|
2721
|
2745
|
}
|
2722
|
2746
|
} else if errcode == nil {
|
2723
|
2747
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
2748
|
+ "cancelList": cancelList,
|
2724
|
2749
|
"purcaseOrder": purcaseOrder,
|
2725
|
2750
|
"goodOrder": goodOrder,
|
2726
|
2751
|
"drugList": drugList,
|