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

import com.prolog.cs.biz.inbound.dto.PageParam;
import com.prolog.cs.biz.inbound.dto.rcv.RcvHDTO;
import com.prolog.cs.biz.inbound.dto.rcv.RcvRejectLinesDTO;
import com.prolog.cs.biz.inbound.dto.task.TaskRejectedDetailDTO;
import com.prolog.cs.biz.inbound.service.rcv.RcvRejectLinesService;
import com.prolog.cs.biz.inbound.vo.RcvQueryVO;
import com.prolog.cs.biz.inbound.vo.task.TaskQueryVO;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description // TODO
 * @Date 2021-03-24
 */

@Api(tags = "拒绝收货行")
@RestController
@RequestMapping("/rcvRejectLines")
public class RcvRejectLinesController {

	@Resource
	private RcvRejectLinesService rcvRejectLinesService;

	/**
	* 
	*/
	@ApiOperation("批量添加")
	@PostMapping("/batchAdd")
	public RestMessage<Object> batchAdd(@RequestBody List<RcvRejectLinesDTO> rcvRejectLinesDTOList) {
		return RestMessage.newInstance(true, "batchAddSuccess", rcvRejectLinesService.batchAdd(rcvRejectLinesDTOList));
	}

	/**
	 * 拒收头表展示
	 */
	@ApiOperation("提取拒收rcv头表")
	@GetMapping("/extractRcvH")
	public RestMessage<Page<RcvHDTO>> extractRcvH(RcvQueryVO rcvQueryVO, PageParam pageParam) {
		return RestMessage.newInstance(true, "extractRcvH",
				rcvRejectLinesService.extractRcvHAndPro(rcvQueryVO, pageParam));
	}

	/**
	 * 提取拒绝的任务
	 */
	@ApiOperation("提取上架池中的任务(条件分页)")
	@GetMapping("/extractTask")
	public RestMessage<Page<TaskRejectedDetailDTO>> extractTask(TaskQueryVO queryVO, PageParam pageParam) {
		return RestMessage.newInstance(true, "extractTask", rcvRejectLinesService.extractTask(queryVO, pageParam));
	}

//	/**
//	 * 提取拒绝的任务
//	 */
//	@ApiOperation("提取质检池中的任务(条件分页)")
//	@GetMapping("/extractTask")
//	public RestMessage<Page<TaskRejectedDetailDTO>> extractTask(TaskQcDQueryVO taskQcDQueryVO, PageParam pageParam) {
//		return RestMessage.newInstance(true, "extractTask", rcvRejectLinesService.extractTask(taskQcDQueryVO,pageParam));
//	}
//	/**
//	* // TODO
//	*/
//	@ApiOperation("批量编辑")
//	@PostMapping("/batchEdit")
//	public RestMessage<Object> batchEdit(@NotEmpty(message = "collection is empty")@RequestBody List<RcvRejectLinesDTO> rcvRejectLinesDTOList) {
//		return RestMessage.newInstance(true, "batchEditSuccess", rcvRejectLinesService.batchEdit(rcvRejectLinesDTOList));
//	}
//
//	/**
//	* // TODO
//	*/
//	@ApiOperation("详情(主键id)")
//	@GetMapping("/findByPkId")
//	public RestMessage<RcvRejectLinesDTO> findByPkId(@NotEmpty(message = "pkId is empty") String pkId){
//		return RestMessage.newInstance(true, "findByPkIdSuccess", rcvRejectLinesService.findByPkId(pkId));
//	}	
//	/**
//	* // TODO
//	*/
//	@ApiOperation("添加")
//	@PostMapping("/add")
//	public RestMessage<Object> add(@Validated(validAdd.class) @RequestBody RcvRejectLinesDTO rcvRejectLinesDTO){
//		return RestMessage.newInstance(true, "addSuccess", rcvRejectLinesService.add(rcvRejectLinesDTO));
//	}
//
//	/**
//	* // TODO
//	*/
//	@ApiOperation("编辑")
//	@PostMapping("/edit")
//	public RestMessage<Object> edit(@Validated(validEdit.class) @RequestBody RcvRejectLinesDTO rcvRejectLinesDTO){
//		return RestMessage.newInstance(true, "editSuccess", rcvRejectLinesService.edit(null,rcvRejectLinesDTO));
//	}
//
//	/**
//	* // TODO
//	*/
//	@ApiOperation("条件分页查询")
//	@GetMapping("/page")
//	public RestMessage<Page<RcvRejectLinesDTO>> list(RcvRejectLinesDTO rcvRejectLinesDTO,PageParam pageParam) throws Exception {
//		return RestMessage.newInstance(true, "pageSuccess", rcvRejectLinesService.findList(rcvRejectLinesDTO,pageParam));
//	}

}
