package org.springblade.modules.app.web;


import com.wn.common.controller.BaseController;
import com.wn.common.datamodel.ResultDTO;
import org.springblade.modules.app.common.dto.TransportStageInfoDTO;
import org.springblade.modules.app.common.vo.ApprovalVO;
import org.springblade.modules.app.manager.TransportStageManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
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 fuxinsheng
 * @since 2021-11-05
 */
@RestController
@RequestMapping("app/transportStageInfo")
@Api(value = "运输单阶段信息管理", tags = "运输单阶段信息管理")

public class TransportStageInfoController extends BaseController {

    @Autowired
    private TransportStageManager transportStageManager;

    //@ApiOperation(value = "提交运输单阶段信息", tags = "运输单阶段信息管理")
    @PostMapping("/stage")
    public ResponseEntity<ResultDTO<String>> transportStage(@RequestBody TransportStageInfoDTO stageInfoDTO) {
        return success(transportStageManager.transportStage(stageInfoDTO));
    }

    //@ApiOperation(value = "审核验收数据", tags = "运输单阶段信息管理")
    @PostMapping("approval")
    public ResponseEntity<ResultDTO<Boolean>> approvalAccept(@RequestBody ApprovalVO approvalVO) {
        return success(transportStageManager.approvalAccept(approvalVO));
    }

    //@ApiOperation(value = "重新提交验收数据", tags = "运输单阶段信息管理")
    @PostMapping("/resubmit")
    public ResponseEntity<ResultDTO<Boolean>> resubmitAccept(@RequestBody TransportStageInfoDTO stageInfoDTO) {
        return success(transportStageManager.resubmitAccept(stageInfoDTO));
    }
}

