package com.prolog.cs.biz.inbound.controller.report;

import com.prolog.cs.biz.inbound.dto.PageParam;
import com.prolog.cs.biz.inbound.dto.failure.ExceptionLineQueryDTO;
import com.prolog.cs.biz.inbound.dto.rcv.RcvHDTO;
import com.prolog.cs.biz.inbound.dto.rcv.RcvInstockLinesDTO;
import com.prolog.cs.biz.inbound.dto.rcv.RcvLinesDTO;
import com.prolog.cs.biz.inbound.dto.rcv.RcvRejectLinesDTO;
import com.prolog.cs.biz.inbound.dto.rqc.RqcLinesDTO;
import com.prolog.cs.biz.inbound.dto.rqc.RqcReLinesDTO;
import com.prolog.cs.biz.inbound.service.rcv.RcvHeadersService;
import com.prolog.cs.biz.inbound.vo.LineQueryVO;
import com.prolog.cs.biz.inbound.vo.RcvQueryVO;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import com.prolog.framework.log.aop.annotation.UserLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 报表信息
 * 
 * @author Xiong
 *
 */
@Api(tags = "报表查询")
@RestController
@RequestMapping("/report/v1.0")
public class ReportController {

	@Resource
	private RcvHeadersService rcvHeadersService;

	/**
	 * 收货报表头 筛选条件: asn单号,rcv单号,单位助记码,收货开始->结束日期
	 */
	@ApiOperation(value = "收货报表头", response = RcvHDTO.class)
	@GetMapping("/getReportHeader")
	@UserLog()
	public RestMessage<Page<RcvHDTO>> getReportHeader(RcvQueryVO rcvQueryVO, PageParam pageParam) {
		return RestMessage.newInstance(true, "getReportHeader",
				rcvHeadersService.getReportHeader(rcvQueryVO, pageParam));
	}

	/**
	 * 收货报表行 根据rcvHeaderId查询
	 */
	@ApiOperation(value = "收货报表行")
	@GetMapping("/getReportRcvLine")
	@UserLog()
	public RestMessage<Page<RcvLinesDTO>> getReportRcvLine(LineQueryVO lineQueryVO, PageParam pageParam) {
		return RestMessage.newInstance(true, "getReportRcvLine",
				rcvHeadersService.getReportRcvLine(lineQueryVO, pageParam));
	}

	/**
	 * 质检报表行 根据rcvHeaderId查询
	 */
	@ApiOperation(value = "质检报表行")
	@GetMapping("/getReportRqcLine")
	@UserLog()
	public RestMessage<Page<RqcLinesDTO>> getReportRqcLine(LineQueryVO lineQueryVO, PageParam pageParam) {
		return RestMessage.newInstance(true, "getReportRqcLine",
				rcvHeadersService.getReportRqcLine(lineQueryVO, pageParam));
	}

	/**
	 * 复检报表行
	 */
	@ApiOperation(value = "复检报表行")
	@GetMapping("/getReportRqcReLine")
	@UserLog()
	public RestMessage<Page<RqcReLinesDTO>> getReportRqcReLine(LineQueryVO lineQueryVO, PageParam pageParam) {
		return RestMessage.newInstance(true, "getReportRqcReLine",
				rcvHeadersService.getReportRqcReLine(lineQueryVO, pageParam));
	}

	/**
	 * 拒收报表行
	 */
	@ApiOperation(value = "拒收报表行")
	@GetMapping("/getReportRejectLine")
	@UserLog()
	public RestMessage<Page<RcvRejectLinesDTO>> getReportRejectLine(LineQueryVO lineQueryVO, PageParam pageParam) {
		return RestMessage.newInstance(true, "getReportRejectLine",
				rcvHeadersService.getReportRejectLine(lineQueryVO, pageParam));
	}

	/**
	 * 异常报表行
	 */
	@ApiOperation(value = "异常报表行")
	@GetMapping("/getReportExceptionLine")
	@UserLog()
	public RestMessage<Page<ExceptionLineQueryDTO>> getReportExceptionLine(LineQueryVO lineQueryVO,
			PageParam pageParam) {
		return RestMessage.newInstance(true, "getReportExceptionLine",
				rcvHeadersService.getReportExceptionLine(lineQueryVO, pageParam));
	}

	/**
	 * 上架报表行
	 */
	@ApiOperation(value = "上架报表行")
	@GetMapping("/getReportInstockLine")
	@UserLog()
	public RestMessage<Page<RcvInstockLinesDTO>> getReportInstockLine(LineQueryVO lineQueryVO, PageParam pageParam) {
		return RestMessage.newInstance(true, "getReportInstockLine",
				rcvHeadersService.getReportInstockLine(lineQueryVO, pageParam));
	}
	/**
	 * ......
	 */
}
