| package com.mzl.flower.web.transport; | 
|   | 
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
| import com.mzl.flower.base.BaseController; | 
| import com.mzl.flower.base.R; | 
| import com.mzl.flower.base.ReturnDataDTO; | 
| import com.mzl.flower.dto.request.transport.*; | 
| import com.mzl.flower.dto.response.transport.TransportDTO; | 
| import com.mzl.flower.dto.response.transport.TransportFeeDTO; | 
| import com.mzl.flower.dto.response.transport.TransportFeeListDTO; | 
| import com.mzl.flower.service.transport.TransportService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiImplicitParam; | 
| import io.swagger.annotations.ApiImplicitParams; | 
| import io.swagger.annotations.ApiOperation; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.http.ResponseEntity; | 
| import org.springframework.validation.annotation.Validated; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| import java.util.List; | 
|   | 
| @RestController | 
| @RequestMapping("/api/transport") | 
| @Api(value = "物流管理", tags = "物流管理") | 
| @Validated | 
| @Slf4j | 
| public class TransportController extends BaseController { | 
|   | 
|     @Autowired | 
|     private TransportService transportService; | 
|   | 
|     @PostMapping("/list/new") | 
|     @ApiOperation(value = "新增物流") | 
|     public ResponseEntity<ReturnDataDTO> addTransport(@RequestBody TransportCreateDTO dto) { | 
|         return returnData(R.SUCCESS.getCode(), transportService.addTransport(dto)); | 
|     } | 
|   | 
|     @PostMapping("/list/edit") | 
|     @ApiOperation(value = "编辑物流") | 
|     public ResponseEntity<ReturnDataDTO> updateTransport(@RequestBody TransportUpdateDTO dto) { | 
|         return returnData(R.SUCCESS.getCode(), transportService.updateTransport(dto)); | 
|     } | 
|   | 
|     @GetMapping("/list/view") | 
|     @ApiOperation(value = "查询物流详情") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(name = "id", value = "物流id", required = true, dataType = "Long", paramType = "query") | 
|     }) | 
|     public ResponseEntity<ReturnDataDTO<TransportDTO>> getTransport(Long id){ | 
|         return returnData(R.SUCCESS.getCode(), transportService.getTransport(id)); | 
|     } | 
|      | 
|     @GetMapping("/list") | 
|     @ApiOperation(value = "获取物流列表") | 
|     public ResponseEntity<ReturnDataDTO<Page<TransportDTO>>> selectTransportList(Page page, TransportQueryDTO dto){ | 
|         return returnData(R.SUCCESS.getCode(), transportService.selectTransportList(page, dto)); | 
|     } | 
|   | 
|     @GetMapping("/list/delete") | 
|     @ApiOperation(value = "删除物流") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(name = "id", value = "物流id", required = true, dataType = "String", paramType = "query") | 
|     }) | 
|     public ResponseEntity<ReturnDataDTO<?>> deleteTransport(Long id){ | 
|         transportService.deleteTransport(id); | 
|         return returnData(R.SUCCESS.getCode(), null); | 
|     } | 
|   | 
|     @GetMapping("/fee/list") | 
|     @ApiOperation(value = "获取物流计费方式列表") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(name = "id", value = "物流id", required = true, dataType = "String", paramType = "query") | 
|     }) | 
|     public ResponseEntity<ReturnDataDTO<List<TransportFeeListDTO>>> getTransportFees(Long id){ | 
|         return returnData(R.SUCCESS.getCode(), transportService.getTransportFees(id)); | 
|     } | 
|   | 
|     @PostMapping("/fee/list/new") | 
|     @ApiOperation(value = "新增物流计费方式") | 
|     public ResponseEntity<ReturnDataDTO> addFee(@RequestBody TransportFeeCreateDTO dto) { | 
|         return returnData(R.SUCCESS.getCode(), transportService.addFee(dto)); | 
|     } | 
|   | 
|     @PostMapping("/fee/list/edit") | 
|     @ApiOperation(value = "编辑物流计费方式") | 
|     public ResponseEntity<ReturnDataDTO> updateFee(@RequestBody TransportFeeUpdateDTO dto) { | 
|         return returnData(R.SUCCESS.getCode(), transportService.updateFee(dto)); | 
|     } | 
|   | 
|     @GetMapping("/fee/list/view") | 
|     @ApiOperation(value = "查询物流计费方式详情") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(name = "id", value = "物流计费方式id", required = true, dataType = "Long", paramType = "query") | 
|     }) | 
|     public ResponseEntity<ReturnDataDTO<TransportFeeDTO>> getFee(Long id){ | 
|         return returnData(R.SUCCESS.getCode(), transportService.getFee(id)); | 
|     } | 
|   | 
|     @GetMapping("/fee/list/delete") | 
|     @ApiOperation(value = "删除物流计费方式") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(name = "id", value = "物流计费方式id", required = true, dataType = "String", paramType = "query") | 
|     }) | 
|     public ResponseEntity<ReturnDataDTO<?>> deleteFee(Long id){ | 
|         transportService.deleteFee(id); | 
|         return returnData(R.SUCCESS.getCode(), null); | 
|     } | 
| } |