package com.prolog.rdc.tms.app.controller.business;

import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.log.aop.annotation.UserLog;
import com.prolog.rdc.tms.app.model.dto.business.AdjustmentQueryDTO;
import com.prolog.rdc.tms.app.model.vo.business.AdjustShipbillQueryVO;
import com.prolog.rdc.tms.app.service.business.AdjustmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 业务APP-运单调整控制层
 *
 * @author lhb
 * @since 2022-04-11 09:04:35
 */
@RestController
@Api(tags = "业务APP--运单调整控制层")
@RequestMapping("/adjust")
public class AdjustmentController {

	@Autowired
	private AdjustmentService adjustmentService;

	@UserLog("调整运单模式查询")
	@ApiOperation(value = "调整运单模式查询", notes = "调整运单模式查询")
	@PostMapping("/shipbill")
	public RestMessage<List<AdjustmentQueryDTO>> queryAdjustShipbillExecute(AdjustShipbillQueryVO adjustShipbillQueryVO) {
		try {
			List<AdjustmentQueryDTO> adjustmentQueryDTOS = adjustmentService.queryAdjustShipbill(adjustShipbillQueryVO);
			return RestMessage.newInstance(true, "查询成功", adjustmentQueryDTOS);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

}
