LineConfigController.java 3.65 KB
package com.bsth.controller.realcontrol;

import com.bsth.controller.BaseController;
import com.bsth.entity.realcontrol.LineConfig;
import com.bsth.service.realcontrol.LineConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/lineConfig")
public class LineConfigController extends BaseController<LineConfig, Integer>{

	@Autowired
	LineConfigService lineConfigService;

	/**
	 * 检查是否有线路配置信息
	 * @param codeArray
	 * @return
	 */
	@RequestMapping("/check")
	public Map<String, Object> check(@RequestParam String[] codeArray){
		return lineConfigService.check(codeArray);
	}

	/**
	 * 初始化线路配置
	 * @param lineCode
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("/init/{lineCode}")
	public Integer init(@PathVariable("lineCode") String lineCode) throws Exception{
		return lineConfigService.init(lineCode);
	}

	/**
	 * 修改班次刷新时间
	 * @param time
	 * @param lineCode
	 * @return
	 */
	@RequestMapping(value = "/editTime", method = RequestMethod.POST)
	public Map<String, Object> editStartOptTime(@RequestParam String time,@RequestParam String lineCode){
		return lineConfigService.editStartOptTime(time, lineCode);
	}

	/**
	 * 修改出场时间类型
	 * @param lineCode
	 * @param type
	 * @return
	 */
	@RequestMapping(value = "/editOutTimeType", method = RequestMethod.POST)
	public Map<String, Object> editOutTimeType(@RequestParam String lineCode, @RequestParam int type,@RequestParam String parkCode,@RequestParam String stationCode){
		return lineConfigService.editOutTimeType(lineCode, type, parkCode, stationCode);
	}

	/**
	 * 启用原线路回场
	 * @param lineCode
	 * @param enable
	 * @return
	 */
	@RequestMapping(value = "/enableInParkForSource", method = RequestMethod.POST)
	public Map<String, Object> enableInParkForSource(@RequestParam String lineCode, @RequestParam int enable){
		return lineConfigService.enableInParkForSource(lineCode, enable);
	}

	/**
	 * 根据线路编码获取配置信息
	 * @param lineCode
	 * @return
	 */
	@RequestMapping(value = "/getByLineCode")
	public LineConfig getByLineCode(@RequestParam String lineCode){
		return lineConfigService.getByLineCode(lineCode);
	}

	@RequestMapping(value = "/findByIdx")
	public Map<String, Object> findByIdx(@RequestParam String idx){
		return lineConfigService.findByIdx(idx);
	}

	/**
	 * 到站缓冲区设置
	 * @param lineCode
	 * @param field
	 * @param value
	 * @return
	 */
	@RequestMapping(value = "/bufferTimeDiff", method = RequestMethod.POST)
	public Map<String, Object> bufferTimeDiff(@RequestParam String lineCode, @RequestParam String field,@RequestParam String value){
		return lineConfigService.bufferTimeDiff(lineCode, field, value);
	}

	/**
	 * 应急停靠设置
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/yjtkSet", method = RequestMethod.POST)
	public Map<String, Object> yjtkSet(@RequestParam Map<String, String> map){
		//System.out.println(map);
		return lineConfigService.yjtkSet(map);
	}

	/**
	 * 修改场既是站的  停车场 和 站点
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/parkAndStationSet", method = RequestMethod.POST)
	public Map<String, Object> parkAndStationSet(@RequestParam Map<String, String> map){
		return lineConfigService.parkAndStationSet(map);
	}

	@RequestMapping(value = "/setAutoExec", method = RequestMethod.POST)
	public Map<String, Object> setAutoExec(@RequestParam Map<String, String> map){
		return lineConfigService.setAutoExec(map);
	}
}