package com.clx.performance.controller.pc;

import com.clx.performance.param.pc.GoodsOrderMapParam;
import com.clx.performance.service.GoodsOrderMapService;
import com.clx.performance.vo.pc.GoodsOrderSendAddressSelect;
import com.clx.performance.vo.pc.TruckCoordinateVO;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName GoodsOrderController
 * @Description
 * @Author kavin
 * @Date 2023/9/17 17:16
 * @Version 1.0
 */

@Slf4j
@RestController
@RequestMapping("/pc/goodsOrderMap")
@Validated
@Tag(name = "PC-货单地图")
public class GoodsOrderMapController {



    @Autowired
    GoodsOrderMapService goodsOrderMapService;

    @Operation(summary = "获取货源地下拉列表", description = "<br>By:刘海泉")
    @PostMapping("/getSendAddressSelect")
    @UnitCovert(param = false)
    public Result<List<GoodsOrderSendAddressSelect>> getSendAddressSelect(@RequestBody @Validated GoodsOrderMapParam param) {
        return Result.ok(goodsOrderMapService.getSendAddressSelect(param));
    }

    @Operation(summary = "获取平台车辆信息", description = "<br>By:刘海泉")
    @GetMapping("/getPlatformTruckCoordinate")
    public Result<List<TruckCoordinateVO>> getPlatformTruckCoordinate() {
        return Result.ok(goodsOrderMapService.getPlatformTruckCoordinate());
    }


    @Operation(summary = "获取货单车辆", description = "<br>By:刘海泉")
    @GetMapping("/getOrderChildTruckByOrderNo")
    public Result<List<String>> getOrderChildTruckByOrderNo(String orderNo) {
        return Result.ok(goodsOrderMapService.getOrderChildTruckByOrderNo(orderNo));
    }




}
