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

import com.prolog.common.util.ToolKits;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import com.prolog.framework.log.aop.annotation.UserLog;
import com.prolog.product.core.easyexcel.util.ExcelUtils;
import com.prolog.rdc.tms.constant.SeriaNnumberConstant;
import com.prolog.rdc.tms.model.dto.basicData.*;
import com.prolog.rdc.tms.model.vo.basicData.*;
import com.prolog.rdc.tms.model.vo.xlsimport.LineCarrierImportStdVO;
import com.prolog.rdc.tms.model.vo.xlsimport.LineConsigneeImportStdVO;
import com.prolog.rdc.tms.model.vo.xlsimport.LineShipperImportStdVO;
import com.prolog.rdc.tms.model.vo.xlsimport.TranslineImportStdVO;
import com.prolog.rdc.tms.service.SysCodeengineService;
import com.prolog.rdc.tms.service.basicData.TranslineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 *
 *
 * 基础数据-线路管理控制层
 *
 * @className :TmsBaseTranslineController
 * @author :fanzw
 * @creationTime :2022/03/21
 * @description :
 *
 * @modifier :fanzw
 * @modifyTime :2022/03/21
 * @reviseRemarks:
 *
 * @version :1.0.0
 *
 */
@RestController
@Api(tags = "基础数据-线路管理控制层")
@RequestMapping("/line")
public class TranslineController {

	@Autowired
	private TranslineService service;

	@Autowired
	private SysCodeengineService sysCodeengineService;

	@UserLog("线路资料查询")
	@ApiOperation(value = "线路资料查询", notes = "线路资料查询")
	@PostMapping("/query")
	public RestMessage<Page<TmsBaseTranslineDTO>> query(@RequestBody TmsBaseTranslineByQueryVo vo) {
		try {
			Page<TmsBaseTranslineDTO> list = service.query(vo);
			return RestMessage.newInstance(true, "操作成功！", list);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("移动目标线路资料查询")
	@ApiOperation(value = "移动目标线路资料查询", notes = "移动目标线路资料查询")
	@PostMapping("/move_target_line_query")
	public RestMessage<Page<TmsBaseTranslineDTO>> moveTargetLineQuery(@RequestBody LineMoveQueryVO lineMoveQueryVO) {
		try {
			Page<TmsBaseTranslineDTO> list = service.moveTargetLineQuery(lineMoveQueryVO);
			return RestMessage.newInstance(true, "操作成功！", list);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路资料查看")
	@ApiOperation(value = "线路资料管理查看", notes = "线路资料管理查看")
	@PostMapping("/view")
	public RestMessage<TmsBaseTranslineViewDTO> view(@RequestBody TmsBaseTranslineVO vo) {
		try {
			TmsBaseTranslineViewDTO dto = service.view(vo);
			return RestMessage.newInstance(true, "操作成功！", dto);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路资料查看")
	@ApiOperation(value = "线路资料管理查看", notes = "线路资料管理查看")
	@PostMapping("/view_by_name")
	public RestMessage<TmsBaseTranslineViewDTO> viewLineByName(@RequestBody TmsBaseTranslineVO vo) {
		try {
			TmsBaseTranslineViewDTO dto = service.viewByName(vo);
			return RestMessage.newInstance(true, "操作成功！", dto);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路资料管理修改")
	@ApiOperation(value = "线路资料管理修改", notes = "线路资料管理修改")
	@PostMapping("/update")
	public RestMessage<String> update(@RequestBody TmsBaseTranslineVO vo) {
		try {
			service.update(vo);
			return RestMessage.newInstance(true, "修改成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路资料管理新增")
	@ApiOperation(value = "线路资料管理新增", notes = "线路资料管理新增")
	@PostMapping("/save")
	public RestMessage<String> save(@RequestBody TmsBaseTranslineBySaveVO vo) {
		try {
			service.save(vo);
			return RestMessage.newInstance(true, "新增成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路资料管理删除")
	@ApiOperation(value = "线路资料管理删除", notes = "线路资料管理删除")
	@PostMapping("/remove")
	public RestMessage<String> remove(@RequestBody List<TmsBaseTranslineByIdsVO> list) {
		try {
			service.remove(list);
			return RestMessage.newInstance(true, "操作成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路资料管理物理删除")
	@ApiOperation(value = "线路资料管理物理删除", notes = "线路资料管理物理删除")
	@PostMapping("/neverDelete")
	public RestMessage<String> neverDelete(@RequestBody List<TmsBaseTranslineByIdsVO> list) {
		try {
			service.neverDelete(list);
			return RestMessage.newInstance(true, "操作成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-承运方保存")
	@ApiOperation(value = "线路-承运方保存", notes = "线路-承运方保存")
	@PostMapping("/tmsCarrierSave")
	public RestMessage<String> tmsCarrierSave(@RequestBody List<TmsCarrierVO> list) {
		try {
			service.tmsCarrierSave(list);
			return RestMessage.newInstance(true, "保存成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-收货方删除")
	@ApiOperation(value = "线路-收货方删除", notes = "线路-收货方删除")
	@PostMapping("/tmsArriverRemove")
	public RestMessage<String> tmsArriverRemove(@RequestBody List<TmsArriverRemoveVO> list) {
		try {
			service.tmsArriverRemove(list);
			return RestMessage.newInstance(true, "删除成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-收货方新增")
	@ApiOperation(value = "线路-收货方新增", notes = "线路-收货方新增")
	@PostMapping("/tmsArriverSave")
	public RestMessage<String> tmsArriverSave(@RequestBody List<TmsArriverVO> list) {
		try {
			service.tmsArriverSave(list);
			return RestMessage.newInstance(true, "新增成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-发货方删除")
	@ApiOperation(value = "线路-发货方删除", notes = "线路-发货方删除")
	@PostMapping("/tmsShipperRemove")
	public RestMessage<String> tmsShipperRemove(@RequestBody List<TmsShipperRemoveVO> list) {
		try {
			service.tmsShipperRemove(list);
			return RestMessage.newInstance(true, "删除成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-发货方新增")
	@ApiOperation(value = "线路-发货方新增", notes = "线路-发货方新增")
	@PostMapping("/tmsShipperSave")
	public RestMessage<String> tmsShipperSave(@RequestBody List<TmsShipperVO> list) {
		try {
			service.tmsShipperSave(list);
			return RestMessage.newInstance(true, "新增成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-查看途径点")
	@ApiOperation(value = "查看途径点", notes = "查看途径点")
	@PostMapping("/way_site")
	public RestMessage<List<TmsLineWaySiteDTO>> queryWaySiteData(@RequestBody TmsBaseTranslineByIdsVO lineVO) {
		try {
			List<TmsLineWaySiteDTO> dtos = service.queryWaySite(lineVO);
			return RestMessage.newInstance(true, "操作成功！", dtos);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("新-线路-查看地图")
	@ApiOperation(value = "新-线路-查看地图", notes = "新-线路-查看地图")
	@PostMapping("/new_selectMap")
	public RestMessage<List<TmsLineMapDTO>> newSelectMap(@RequestBody List<TmsBaseTranslineByIdsVO> list) {
		try {
			List<TmsLineMapDTO> dtos = service.newSelectMap(list);
			return RestMessage.newInstance(true, "操作成功！", dtos);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("新线路-站点信息")
	@ApiOperation(value = "新线路-站点信息", notes = "新线路-站点信息")
	@PostMapping("/line_sites")
	public RestMessage<List<TmsLineMapDTO>> lineSites(@RequestBody List<Long> lineIds) {
		try {
			List<TmsLineMapDTO> dtos = service.lineSites(lineIds);
			return RestMessage.newInstance(true, "操作成功！", dtos);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-站点移动")
	@ApiOperation(value = "线路-站点移动", notes = "线路-站点移动")
	@PostMapping("/move")
	public RestMessage<String> lineMove(@RequestBody TmsLineMoveVO lineMoveVO) {
		try {
			service.lineMove(lineMoveVO);
			return RestMessage.newInstance(true, "操作成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-查看地图")
	@ApiOperation(value = "线路-地图", notes = "线路-地图")
	@PostMapping("/selectMap")
	public RestMessage<List<TmsBaseTranslineMapDTO>> selectMap(@RequestBody List<TmsBaseTranslineByIdsVO> list) {
		try {
			List<TmsBaseTranslineMapDTO> dtos = service.selectMap(list);
			return RestMessage.newInstance(true, "操作成功！", dtos);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-查看地图详情")
	@ApiOperation(value = "线路-查看地图详情", notes = "线路-查看地图详情")
	@PostMapping("/selectMapDetails")
	public RestMessage<List<TmsBaseTranslineMapDetailsDTO>> selectMapDetails(@RequestBody TmsBaseTranslineMapDetailsVO vo) {
		try {
			List<TmsBaseTranslineMapDetailsDTO> list = service.selectMapDetails(vo);
			return RestMessage.newInstance(true, "操作成功！", list);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-修改地图")
	@ApiOperation(value = "线路-修改地图", notes = "线路-修改地图")
	@PostMapping("/saveMap")
	public RestMessage<String> saveMap(@RequestBody List<TmsBaseTranslineMapVO> list) {
		try {
			service.saveMap(list);
			return RestMessage.newInstance(true, "操作成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("新-线路-修改地图保存")
	@ApiOperation(value = "新-线路-修改地图保存", notes = "新-线路-修改地图保存")
	@PostMapping("/new-saveMap")
	public RestMessage<String> newSaveMap(@RequestBody List<TmsLineMapSaveVO> lineMapSaveVOS) {
		try {
			service.newSaveMap(lineMapSaveVOS);
			return RestMessage.newInstance(true, "操作成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-修改地图")
	@ApiOperation(value = "线路-修改地图", notes = "线路-修改地图")
	@PostMapping("/selectLineByMap")
	public RestMessage<List<LineByMapDTO>> selectLineByMap(@RequestBody List<String> list) {
		try {
			List<LineByMapDTO> dtos = service.selectLineByMap(list);
			return RestMessage.newInstance(true, "操作成功！", dtos);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-计算里程")
	@ApiOperation(value = "线路-计算里程", notes = "线路-计算里程")
	@PostMapping("/calculate")
	public RestMessage<Object> calculate(@RequestBody List<TmsBaseTranslineByCalculateVO> list) {
		try {
			Object calculate = service.calculate(list);
			return RestMessage.newInstance(true, "计算成功！", calculate);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-承运方查询")
	@ApiOperation(value = "线路-承运方查询", notes = "线路-承运方查询")
	@PostMapping("/tmsCarrierPage")
	public RestMessage<Page<TmsCarrierDTO>> tmsCarrierPage(@RequestBody TmsCarrierVO vo) {
		try {
			Page<TmsCarrierDTO> page = service.tmsCarrierPage(vo);
			return RestMessage.newInstance(true, "查询成功！", page);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-收货方查询")
	@ApiOperation(value = "线路-收货方查询", notes = "线路-收货方查询")
	@PostMapping("/tmsArriverPage")
	public RestMessage<Page<TmsArriverDTO>> tmsArriverPage(@RequestBody TmsArriverVO vo) {
		try {
			Page<TmsArriverDTO> page = service.tmsArriverPage(vo);
			return RestMessage.newInstance(true, "查询成功！", page);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-收,发货方关联表查询")
	@ApiOperation(value = "线路-收,发货方关联表查询", notes = "线路-收货方关联表查询")
	@PostMapping("/line_consignee")
	public RestMessage<List<LineShipperConsigneeDTO>> queryLineShipperConsignee(@RequestBody List<Long> lineIds) {
		try {
			List<LineShipperConsigneeDTO> list = service.queryLineShipperConsignee(lineIds);
			return RestMessage.newInstance(true, "查询成功！", list);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-发货方分页查询")
	@ApiOperation(value = "线路-发货方分页查询", notes = "线路-发货方分页查询")
	@PostMapping("/shipper-page")
	public RestMessage<Page<TmsShipperDTO>> tmsLineShipperPage(@RequestBody TmsLineShipperVO vo) {
		try {
			Page<TmsShipperDTO> page = service.tmsLineShipperPage(vo);
			return RestMessage.newInstance(true, "查询成功！", page);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-发货方查询")
	@ApiOperation(value = "线路-发货方查询", notes = "线路-发货方查询")
	@PostMapping("/shipper")
	public RestMessage<List<TmsShipperDTO>> tmsLineShipperQuery(@RequestBody TmsLineShipperQueryVO lineShipperQueryVO) {
		try {
			List<TmsShipperDTO> dtos = service.tmsLineShipperQuery(lineShipperQueryVO);
			return RestMessage.newInstance(true, "查询成功！", dtos);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-行政区域查询")
	@ApiOperation(value = "线路-行政区域查询", notes = "线路-行政区域查询")
	@PostMapping("/getAdministrativeAreas")
	public RestMessage<List<String>> getAdministrativeAreas(@RequestBody TmsArriverVO vo) {
		try {
			List<String> list = service.getAdministrativeAreas(vo);
			return RestMessage.newInstance(true, "查询成功！", list);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-可用日期查询")
	@ApiOperation(value = "线路-可用日期查询", notes = "线路-可用日期查询")
	@PostMapping("/dateQuery")
	public RestMessage<TmsBaseTranslineByDateDTO> dateQuery(@RequestBody TmsBaseTranslineByIdsVO vo) {
		try {
			TmsBaseTranslineByDateDTO dto = service.dateQuery(vo);
			return RestMessage.newInstance(true, "查询成功！", dto);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-可用日期保存")
	@ApiOperation(value = "线路-可用日期保存", notes = "线路-可用日期保存")
	@PostMapping("/dateSave")
	public RestMessage<String> dateSave(@RequestBody TmsBaseTranslineByDateVO vo) {
		try {
			service.dateSave(vo);
			return RestMessage.newInstance(true, "保存成功！", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路批量导入")
	@ApiOperation(value = "线路批量导入", notes = "线路批量导入")
	@PostMapping("/batch_import")
	public RestMessage<String> batchImportExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {
		// 导入批次
		String importBatchNumber = sysCodeengineService.getCodeNumberByCode(SeriaNnumberConstant.IMPORT_BATCHNO, "L");
		ToolKits.isParamNull(importBatchNumber, "导入批次获取失败");
		service.batchImportData(file,importBatchNumber);
		return RestMessage.newInstance(true, "导入成功", null);
	}

	@UserLog("线路导入撤销")
	@ApiOperation(value = "线路导入撤销", notes = "线路导入撤销")
	@PostMapping("/rollback/{batchno}")
	public RestMessage<String> rollbackExcel(@PathVariable("batchno") String batchno) throws Exception {
		try {
			service.rollbackData(batchno);
			return RestMessage.newInstance(true, "操作成功", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-收货方批量导入")
	@ApiOperation(value = "线路-收货方批量导入", notes = "线路-收货方批量导入")
	@PostMapping("/batch_import_consignee")
	public RestMessage<String> batchImportConsigneeExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {
		// 导入批次
		String importBatchNumber = sysCodeengineService.getCodeNumberByCode(SeriaNnumberConstant.IMPORT_BATCHNO, "L");
		ToolKits.isParamNull(importBatchNumber, "导入批次获取失败");
		service.batchImportConsigneeData(file,importBatchNumber);
		return RestMessage.newInstance(true, "导入成功", null);
	}

	@UserLog("线路-收货方导入撤销")
	@ApiOperation(value = "线路-收货方导入撤销", notes = "线路-收货方导入撤销")
	@PostMapping("/rollback_consignee/{batchno}")
	public RestMessage<String> rollbackConsigneeExcel(@PathVariable("batchno") String batchno) throws Exception {
		try {
			service.rollbackConsigneeData(batchno);
			return RestMessage.newInstance(true, "操作成功", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-发货方批量导入")
	@ApiOperation(value = "线路-发货方批量导入", notes = "线路-发货方批量导入")
	@PostMapping("/batch_import_shipper")
	public RestMessage<String> batchImportShipperExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {
		// 导入批次
		String importBatchNumber = sysCodeengineService.getCodeNumberByCode(SeriaNnumberConstant.IMPORT_BATCHNO, "L");
		ToolKits.isParamNull(importBatchNumber, "导入批次获取失败");
		service.batchImportShipperData(file,importBatchNumber);
		return RestMessage.newInstance(true, "导入成功", null);
	}

	@UserLog("线路-发货方导入撤销")
	@ApiOperation(value = "线路-发货方导入撤销", notes = "线路-发货方导入撤销")
	@PostMapping("/rollback_shipper/{batchno}")
	public RestMessage<String> rollbackShipperExcel(@PathVariable("batchno") String batchno) throws Exception {
		try {
			service.rollbackShipperData(batchno);
			return RestMessage.newInstance(true, "操作成功", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路-承运方批量导入")
	@ApiOperation(value = "线路-承运方批量导入", notes = "线路-承运方批量导入")
	@PostMapping("/batch_import_carrier")
	public RestMessage<String> batchImportCarrierExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {
		// 导入批次
		String importBatchNumber = sysCodeengineService.getCodeNumberByCode(SeriaNnumberConstant.IMPORT_BATCHNO, "L");
		ToolKits.isParamNull(importBatchNumber, "导入批次获取失败");
		service.batchImportCarrierData(file,importBatchNumber);
		return RestMessage.newInstance(true, "导入成功", null);
	}

	@UserLog("线路-承运方导入撤销")
	@ApiOperation(value = "线路-承运方导入撤销", notes = "线路-承运方导入撤销")
	@PostMapping("/rollback_carrier/{batchno}")
	public RestMessage<String> rollbackCarrierExcel(@PathVariable("batchno") String batchno) throws Exception {
		try {
			service.rollbackCarrierData(batchno);
			return RestMessage.newInstance(true, "操作成功", null);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路模板")
	@ApiOperation(value = "线路模板", notes = "线路模板")
	@PostMapping("/download_template_line")
	public RestMessage<Object> downloadTemplateLineExecute(HttpServletResponse response) throws IOException {
		ExcelUtils.export(response, TranslineImportStdVO.class, "线路模板", null, null, null, true);
		return null;
	}

	@UserLog("线路承运方模板")
	@ApiOperation(value = "线路承运方模板", notes = "线路承运方模板")
	@PostMapping("/download_template_line_carrier")
	public RestMessage<Object> downloadTemplateLineCarrierExecute(HttpServletResponse response) throws IOException {
		ExcelUtils.export(response, LineCarrierImportStdVO.class, "线路承运方模板", null, null, null, true);
		return null;
	}

	@UserLog("线路收货方模板")
	@ApiOperation(value = "线路收货方模板", notes = "线路收货方模板")
	@PostMapping("/download_template_line_consignee")
	public RestMessage<Object> downloadTemplateLineConsigneeExecute(HttpServletResponse response) throws IOException {
		ExcelUtils.export(response, LineConsigneeImportStdVO.class, "线路收货方模板", null, null, null, true);
		return null;
	}

	@UserLog("线路发货方模板")
	@ApiOperation(value = "线路发货方模板", notes = "线路发货方模板")
	@PostMapping("/download_template_line_shipper")
	public RestMessage<Object> downloadTemplateLineShipperExecute(HttpServletResponse response) throws IOException {
		ExcelUtils.export(response, LineShipperImportStdVO.class, "线路发货方模板", null, null, null, true);
		return null;
	}

	@UserLog("线路-承运方查看")
	@ApiOperation(value = "线路-承运方查看", notes = "线路-承运方查看")
	@PostMapping("/tmsCarrierView")
	public RestMessage<List<TmsCarrierDTO>> tmsCarrierView(@RequestBody TmsCarrierViewVO tmsCarrierViewVO) {
		try {
			List<TmsCarrierDTO> tmsCarrierDTOS = service.tmsCarrierView(tmsCarrierViewVO);
			return RestMessage.newInstance(true, "查询成功！", tmsCarrierDTOS);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("根据客户查询线路")
	@ApiOperation(value = "根据客户查询线路", notes = "根据客户查询线路")
	@PostMapping("/byCustomer")
	public RestMessage<LineByCustomerQueryDTO> getLineByCustomerExecute(@RequestBody LineByCustomerQueryVO lineByCustomerQueryVO) {
		try {
			LineByCustomerQueryDTO lineByCustomerQueryDTO = service.getLineByCustomerData(lineByCustomerQueryVO);
			return RestMessage.newInstance(true, "查询成功", lineByCustomerQueryDTO);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路弹窗")
	@ApiOperation(value = "线路弹窗", notes = "线路弹窗")
	@PostMapping("/pop")
	public RestMessage<Page<TmsBaseTranslinePopDTO>> getLineByPopExecute(@RequestBody TmsBaseTranslinePopVO tmsBaseTranslinePopVO) {
		try {
			Page<TmsBaseTranslinePopDTO> page = service.getLineByPopData(tmsBaseTranslinePopVO);
			return RestMessage.newInstance(true, "查询成功", page);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}

	@UserLog("线路资料弹框")
	@ApiOperation(value = "线路资料弹框", notes = "线路资料弹框")
	@PostMapping("/popup")
	public RestMessage<List<ShipbillMatchLineQueryDTO>> queryLineForPopup(@RequestBody TmsBaseTranslineByQueryVo vo) {
		try {
			List<ShipbillMatchLineQueryDTO> list = service.queryLineForPopup(vo);
			return RestMessage.newInstance(true, "操作成功！", list);
		} catch (Exception e) {
			e.printStackTrace();
			return RestMessage.newInstance(false, e.getMessage(), null);
		}
	}
}
