package com.example.erp.controller.sd;
|
|
|
import com.example.erp.common.Constants;
|
import com.example.erp.common.Result;
|
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 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("/customer")
|
public class CustomerController {
|
@Autowired
|
CustomerService customerService;
|
|
|
/*发货订单查询*/
|
@ApiOperation("客户查询接口")
|
@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("客户新增修改接口")
|
@PostMapping("/insertCustomer")
|
public Result insertCustomer( @RequestBody Map<String,Object> object){
|
if(customerService.insertCustomer(object)){
|
|
return Result.seccess();
|
|
}else {
|
throw new ServiceException(Constants.Code_500,"客户新增/修改失败");
|
|
}
|
}
|
|
@ApiOperation("客户删除接口")
|
@PostMapping("/deleteCustomer")
|
public Result deleteCustomer( @RequestBody Map<String,Object> object){
|
if(customerService.deleteCustomer(object)){
|
|
return Result.seccess();
|
|
}else {
|
throw new ServiceException(Constants.Code_500,"客户删除失败");
|
|
}
|
}
|
|
|
|
|
|
|
|
|
}
|