廖井涛
2024-05-11 3fbc1ac0517b33088e4ff0b9b7822c390c689a9a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package com.example.erp.controller.sd;
 
 
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.mm.FinishedGoodsInventory;
import com.example.erp.entity.sd.Delivery;
import com.example.erp.entity.sd.DeliveryDetail;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.sd.DeliveryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
import java.util.Map;
 
@RestController
@Api(value="发货controller",tags={"发货操作接口"})
@RequestMapping("/Delivery")
public class DeliveryController {
    @Autowired
    DeliveryService deliveryService;
 
 
    /*发货订单查询*/
    @ApiOperation("发货订单查询接口")
    @SaCheckPermission("selectDelivery.search")
    @PostMapping("/getSelectShippingOrder/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectShippingOrder(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody Delivery delivery){
        return Result.seccess(deliveryService.getSelectShippingOrder(pageNum,pageSize,selectDate,delivery));
    }
 
    /*发货报表查询*/
    @ApiOperation("发货报表查询接口")
    @SaCheckPermission("deliveryReport.search")
    @PostMapping("/getSelectDeliveryDetailReport/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectDeliveryDetailReport(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody DeliveryDetail deliveryDetail){
        return Result.seccess(deliveryService.getSelectDeliveryDetailReport(pageNum,pageSize,selectDate,deliveryDetail));
    }
 
    /*发货订单明细查询*/
    @ApiOperation("发货编辑订单明细查询接口")
    @SaCheckPermission("createDelivery.search")
    @PostMapping("/getSelectShippingOrderDetail/{pageNum}/{pageSize}")
    public Result getSelectShippingOrderDetail(@PathVariable Integer pageNum, @PathVariable Integer pageSize,  @RequestBody OrderDetail orderDetail){
        return Result.seccess(deliveryService.getSelectShippingOrderDetail(pageNum,pageSize,orderDetail));
    }
 
    /*库存可发货订单查询*/
    @ApiOperation("库存可发货订单查询接口接口")
    @SaCheckPermission("selectOrderList.search")
    @PostMapping("/getSelectOrderInventory/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectOrderInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody Order order){
        return Result.seccess(deliveryService.getSelectOrderInventory(pageNum,pageSize,selectDate,order));
    }
 
    /*发货订单明细查询*/
    @ApiOperation("发货新增订单明细查询接口")
    @SaCheckPermission("createDelivery.search")
    @PostMapping("/getSelectShippingOrderDetails/{pageNum}/{pageSize}")
    public Result getSelectShippingOrderDetails(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){
        return Result.seccess(deliveryService.getSelectShippingOrderDetails(pageNum,pageSize,orderDetail));
    }
    @ApiOperation("发货新增接口")
    @SaCheckPermission("createDelivery.add")
    @PostMapping("/insertDelivery")
    public Result insertDelivery( @RequestBody Map<String,Object> object){
        if(deliveryService.insertDelivery(object)){
            return Result.seccess();
 
        }else {
            throw new ServiceException(Constants.Code_500,"发货失败");
 
        }
    }
    @ApiOperation("发货审核修改接口")
    @SaCheckPermission("createDelivery.review")
    @PostMapping("/updateDeliveryToExamine")
    public Result updateDeliveryToExamine( @RequestBody Map<String,Object> object){
        if(deliveryService.updateDeliveryToExamine(object)){
            return Result.seccess();
 
        }else {
            throw new ServiceException(Constants.Code_500,"审核失败");
 
        }
    }
 
    @ApiOperation("发货删除接口")
    @SaCheckPermission("selectDelivery.delete")
    @PostMapping("/deleteDelivery")
    public Result deleteDelivery( @RequestBody Map<String,Object> object){
        if(deliveryService.deleteDelivery(object)){
            return Result.seccess();
 
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败");
 
        }
    }
 
    @ApiOperation("发货订单查询接口")
    @SaCheckPermission("selectDelivery.search")
    @PostMapping("/getSelectDeliveryPrinting")
    public Result getSelectDeliveryPrinting( @RequestBody DeliveryDetail deliveryDetail){
        return Result.seccess(deliveryService.getSelectDeliveryPrinting(deliveryDetail));
    }
 
 
 
 
 
 
}