package com.fjhx.victoriatourist.controller.logistics;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.kd100.util.KD100Result;
import com.fjhx.victoriatourist.entity.logistics.dto.LogisticsInfosDto;
import com.fjhx.victoriatourist.entity.logistics.dto.LogisticsInfosSelectDto;
import com.fjhx.victoriatourist.entity.logistics.vo.LogisticsInfosVo;
import com.fjhx.victoriatourist.service.logistics.LogisticsInfosService;
import com.ruoyi.common.core.domain.BaseSelectDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 物流信息 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-17
 */
@RestController
@RequestMapping("/logisticsInfos")
public class LogisticsInfosController {

    @Autowired
    private LogisticsInfosService logisticsInfosService;

    /**
     * 物流信息分页
     */
    @PostMapping("/page")
    public Page<LogisticsInfosVo> page(@RequestBody LogisticsInfosSelectDto dto) {
        return logisticsInfosService.getPage(dto);
    }

    /**
     * 物流信息明细
     */
    @PostMapping("/detail")
    public LogisticsInfosVo detail(@RequestBody BaseSelectDto dto) {
        return logisticsInfosService.detail(dto.getId());
    }

    /**
     * 物流信息新增
     */
    @PostMapping("/add")
    public void add(@RequestBody LogisticsInfosDto logisticsInfosDto) {
        logisticsInfosService.add(logisticsInfosDto);
    }

    /**
     * 物流信息编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody LogisticsInfosDto logisticsInfosDto) {
        logisticsInfosService.edit(logisticsInfosDto);
    }

    /**
     * 物流信息删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        logisticsInfosService.delete(dto.getId());
    }

    /**
     * 快递信息
     */
    @PostMapping("/getLogistics")
    public KD100Result getLogistics(@RequestBody BaseSelectDto dto) {
        return logisticsInfosService.getLogistics(dto.getId());
    }

    /**
     * 更新物流状态
     */
    @PostMapping("/dataInfoEdit")
    public void dataInfoEdit(@RequestBody BaseSelectDto dto) {
        logisticsInfosService.dataInfoEdit(dto.getId());
    }

    /**
     * 到货通知
     */
    @PostMapping("/arrival/notice")
    public void arrivalNotice(@RequestBody LogisticsInfosVo entity) {
        logisticsInfosService.arrivalNotice(entity);
    }

}
