package com.prolog.rdc.tms.controller.basicData;

import java.util.List;

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;

import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.log.aop.annotation.UserLog;
import com.prolog.rdc.tms.model.dto.basicData.LocationByIdDTO;
import com.prolog.rdc.tms.model.vo.basicData.LocationByIdVO;
import com.prolog.rdc.tms.service.basicData.MaindataCommonService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 
 *
 * 基础资料公共服务控制层
 *
 * @className :MaindataCommonController
 * @author :fanzw
 * @creationTime :2023/01/12
 * @description :
 *
 * @modifier :fanzw
 * @modifyTime :2023/01/12
 * @reviseRemarks:
 *
 * @version :1.0.0
 *
 */
@RestController
@Api(tags = "基础资料公共服务控制层")
@RequestMapping("/common")
public class MaindataCommonController {

	@Autowired
	private MaindataCommonService maindataCommonService;

	@UserLog("运单定位信息查询")
	@ApiOperation(value = "运单定位信息查询", notes = "运单定位信息查询")
	@PostMapping("/shipbill/location")
	public RestMessage<List<LocationByIdDTO>> locationByIdExecute(@RequestBody List<LocationByIdVO> locationByIdVOs) {
		try {
			List<LocationByIdDTO> locationByIdDTOs = maindataCommonService.locationByIdData(locationByIdVOs);
			return RestMessage.newInstance(true, "查询成功", locationByIdDTOs);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

}
