package com.stylefeng.guns.modular.api;
|
|
|
import com.stylefeng.guns.modular.system.service.ILineSiteService;
|
import com.stylefeng.guns.modular.system.util.ResultUtil;
|
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
|
import com.stylefeng.guns.modular.system.warpper.LineSiteWarpper;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
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.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* 线路排班控制器
|
*/
|
@Api
|
@RestController
|
@RequestMapping("/api/lineSite")
|
public class LineSiteController {
|
|
@Autowired
|
private ILineSiteService lineSiteService;
|
|
|
|
|
@ResponseBody
|
@RequestMapping(value = "/queryDriver", method = RequestMethod.POST)
|
@ApiOperation(value = "根据线路id获取线路排班数据", tags = {"调度端-添加订单"}, notes = "")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "线路id", name = "lineId", required = true, dataType = "int"),
|
@ApiImplicitParam(value = "查询天(2020-09-03)", name = "day", required = true, dataType = "string"),
|
@ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
|
})
|
public ResultUtil<List<LineSiteWarpper>> queryDriver(Integer lineId, String day){
|
try {
|
List<Map<String, Object>> list = lineSiteService.queryDriver(lineId, day);
|
return ResultUtil.success(LineSiteWarpper.getLineSiteWarppers(list));
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
|
|
|
|
@ResponseBody
|
@RequestMapping(value = "/querySeat", method = RequestMethod.POST)
|
@ApiOperation(value = "根据司机的排班id获取剩余座位数据", tags = {"调度端-添加订单"}, notes = "")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "司机排班id", name = "id", required = true, dataType = "int"),
|
@ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
|
})
|
public ResultUtil<BaseWarpper> querySeat(Integer id){
|
try {
|
Map<String, Object> map = lineSiteService.querySeat(id);
|
return ResultUtil.success(BaseWarpper.getBaseWarpper(map));
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
|
}
|