guoyuji
2024-05-23 ef5a518c3e2c1fe41aa60f56ca31ddafa0cb1561
north-glass-erp/src/main/java/com/example/erp/controller/sd/CustomerController.java
@@ -1,6 +1,7 @@
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.sd.Customer;
@@ -28,35 +29,31 @@
    /*发货订单查询*/
    @ApiOperation("客户查询接口")
    @PostMapping("/getseletCustomer/{pageNum}/{pageSize}")
    public Result getseletShippingOrder(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody Customer customer){
        return Result.seccess(customerService.getseletCustomer(pageNum,pageSize,customer));
    @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){
        if(customerService.insertCustomer(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"客户新增/修改失败");
        }
        return Result.seccess(customerService.insertCustomer(object));
    }
    @ApiOperation("客户删除接口")
    @SaCheckPermission("selectCustomer.delete")
    @PostMapping("/deleteCustomer")
    public Result deleteCustomer( @RequestBody Map<String,Object>  object){
        if(customerService.deleteCustomer(object)){
        return Result.seccess(customerService.deleteCustomer(object));
    }
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"客户删除失败");
        }
    @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));
    }