guoyuji
2024-09-27 4c75789ffd7e559a690adec24c8dd688ca634e09
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
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.dto.sd.CustomerDTO;
import com.example.erp.dto.sd.DeliveryDetailDTO;
import com.example.erp.dto.sd.DeliveryDetailProductDTO;
import com.example.erp.entity.sd.Customer;
import com.example.erp.entity.sd.Delivery;
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.CustomerService;
import com.example.erp.service.sd.DeliveryService;
import com.example.erp.tools.DownExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
 
@RestController
@Api(value="客户controller",tags={"客户操作接口"})
@RequestMapping("/customer")
public class CustomerController {
    @Autowired
    CustomerService customerService;
 
 
    /*发货订单查询*/
    @ApiOperation("客户查询接口")
    @SaCheckPermission("selectCustomer.search")
    @PostMapping("/getSelectCustomer/{pageNum}/{pageSize}")
    public Result getSelectShippingOrder(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody Customer customer){
        return Result.seccess(customerService.getSelectCustomer(pageNum,pageSize,customer));
    }
 
    @ApiOperation("客户新增修改接口")
    @SaCheckPermission("createCustomer.add")
    @PostMapping("/insertCustomer")
    public Result insertCustomer( @RequestBody Map<String,Object>  object){
        return Result.seccess(customerService.insertCustomer(object));
    }
 
    @ApiOperation("客户删除接口")
    @SaCheckPermission("selectCustomer.delete")
    @PostMapping("/deleteCustomer")
    public Result deleteCustomer( @RequestBody Map<String,Object>  object){
        return Result.seccess(customerService.deleteCustomer(object));
    }
 
    @ApiOperation("客户订单查询接口")
    @SaCheckPermission("selectCustomerOrder.search")
    @PostMapping("/getSelectCustomerOderDate/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectCustomerOderDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody OrderDetail orderDetail){
        return Result.seccess(customerService.getSelectCustomerOderDate(pageNum,pageSize,selectDate,orderDetail));
    }
 
    @ApiOperation("客户订单报表")
    @PostMapping("/exportSelectCustomerOderDate/{selectDate}")
    public void exportSelectCustomerOderDate(HttpServletResponse response, @PathVariable List<String> selectDate, @RequestBody OrderDetail orderDetail) throws IOException, IllegalAccessException, InstantiationException {
        DownExcel.download(response, CustomerDTO.class, customerService.exportSelectCustomerOderDate(selectDate,orderDetail),"orderReport");
    }
 
    @ApiOperation("客户发货报表")
    @PostMapping("/exportSelectCustomerDeliveryDate/{selectDate}")
    public void exportSelectCustomerDeliveryDate(HttpServletResponse response, @PathVariable List<String> selectDate, @RequestBody OrderDetail orderDetail) throws IOException, IllegalAccessException, InstantiationException {
        DownExcel.download(response, CustomerDTO.class, customerService.exportSelectCustomerDeliveryDate(selectDate,orderDetail),"deliveryReport");
    }
 
 
 
 
 
 
 
 
}