ScheduleRealInfoController.java 2.44 KB
package com.bsth.controller.realcontrol;

import java.util.Collection;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.bsth.controller.BaseController;
import com.bsth.entity.realcontrol.ScheduleRealInfo;
import com.bsth.service.realcontrol.ScheduleRealInfoService;
import com.bsth.vehicle.common.CommonMapped;

@RestController
@RequestMapping("/realSchedule")
public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long>{

	@Autowired
	ScheduleRealInfoService scheduleRealInfoService;
	
	@RequestMapping(value = "/lines")
	public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines){
		return scheduleRealInfoService.findByLines(lines);
	}
	
	/**
	 * 
	 * @Title: outgoAdjust 
	 * @Description: TODO(待发调整) 
	 * @param @param id 主键
	 * @param @param remarks 备注
	 * @param @param dfsj 待发时间(HH:mm)
	 * @throws
	 */
	@RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST)
	public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,@RequestParam String dfsj){
		return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj);
	}
	
	/**
	 * 
	 * @Title: destroy 
	 * @Description: TODO(销毁,烂班) 
	 * @param @param idsStr  要烂掉的班次ID ,分隔
	 * @param @param spaceAdjust 自动调整后续间隔(1 是 -1 否)
	 * @param @param remarks 备注
	 * @param @param reason 理由
	 * @param @param spaceNum 间隔(分钟)
	 * @throws
	 */
	@RequestMapping(value = "/destroy", method = RequestMethod.POST)
	public Map<String, Object> destroy(@RequestParam String idsStr,@RequestParam int spaceAdjust,@RequestParam String  remarks,@RequestParam String reason,@RequestParam  int spaceNum){
		return scheduleRealInfoService.destroy(idsStr, spaceAdjust, remarks, reason, spaceNum);
	}
	
	/**
	 * 
	 * @Title: carDeviceMapp 
	 * @Description: TODO(获取车辆自编号和设备号对照,从缓存取) 
	 * @throws
	 */
	@RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET)
	public Map<String, String> carDeviceMapp(){
		return CommonMapped.vehicDeviceBiMap.inverse();
	}
}