|
|
@@ -12,6 +12,8 @@ import com.railway.common.core.domain.AjaxResult;
|
|
|
import com.railway.common.core.page.TableDataInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import java.util.List;
|
|
|
+import javax.validation.Valid;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -22,9 +24,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import javax.validation.Valid;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
/**
|
|
|
* @author fenghao
|
|
|
*/
|
|
|
@@ -34,79 +33,80 @@ import java.util.List;
|
|
|
@RequestMapping(value = "business/catenary/bus/jlgz")
|
|
|
public class BusJlgzController extends BaseController {
|
|
|
|
|
|
- private final IBusJlgzService budJlgzService;
|
|
|
+ private final IBusJlgzService budJlgzService;
|
|
|
|
|
|
- public BusJlgzController(IBusJlgzService budJlgzService) {
|
|
|
- this.budJlgzService = budJlgzService;
|
|
|
- }
|
|
|
+ public BusJlgzController(IBusJlgzService budJlgzService) {
|
|
|
+ this.budJlgzService = budJlgzService;
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "新增")
|
|
|
- @PostMapping("/add")
|
|
|
- public AjaxResult add(@Validated @RequestBody BusJlgz busJlgz) {
|
|
|
- return toAjax(budJlgzService.create(busJlgz));
|
|
|
- }
|
|
|
+ @ApiOperation(value = "新增")
|
|
|
+ @PostMapping("/add")
|
|
|
+ public AjaxResult add(@Validated @RequestBody BusJlgz busJlgz) {
|
|
|
+ return toAjax(budJlgzService.create(busJlgz));
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "删除")
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult delete(@PathVariable(value = "ids") Long[] ids) {
|
|
|
- return toAjax(budJlgzService.delete(ids));
|
|
|
- }
|
|
|
+ @ApiOperation(value = "删除")
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult delete(@PathVariable(value = "ids") Long[] ids) {
|
|
|
+ return toAjax(budJlgzService.delete(ids));
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "更新")
|
|
|
- @PutMapping("/update")
|
|
|
- public AjaxResult update(@RequestBody @Valid BusJlgz busJlgz) {
|
|
|
- return toAjax(budJlgzService.update(busJlgz));
|
|
|
- }
|
|
|
+ @ApiOperation(value = "更新")
|
|
|
+ @PutMapping("/update")
|
|
|
+ public AjaxResult update(@RequestBody @Valid BusJlgz busJlgz) {
|
|
|
+ return toAjax(budJlgzService.update(busJlgz));
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "单个")
|
|
|
- @GetMapping(value = {"/", "/{id}"})
|
|
|
- public AjaxResult getInfo(@PathVariable(value = "id") Long id) {
|
|
|
- BusJlgz info = budJlgzService.getInfo(id, null);
|
|
|
- AjaxResult ajax = AjaxResult.success();
|
|
|
- ajax.put("info",info);
|
|
|
- return ajax;
|
|
|
- }
|
|
|
+ @ApiOperation(value = "单个")
|
|
|
+ @GetMapping(value = {"/", "/{id}"})
|
|
|
+ public AjaxResult getInfo(@PathVariable(value = "id") Long id) {
|
|
|
+ BusJlgz info = budJlgzService.getInfo(id, null);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("info", info);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "单个")
|
|
|
- @GetMapping(value = {"/", "/{id}/{lineId}"})
|
|
|
- public AjaxResult getInfoByLine(@PathVariable(value = "id") Long id, @PathVariable(value = "lineId") Long lineId) {
|
|
|
- BusJlgz info = budJlgzService.getInfo(id, lineId);
|
|
|
- AjaxResult ajax = AjaxResult.success();
|
|
|
- ajax.put("info",info);
|
|
|
- return ajax;
|
|
|
- }
|
|
|
+ @ApiOperation(value = "单个")
|
|
|
+ @GetMapping(value = {"/", "/{id}/{lineId}"})
|
|
|
+ public AjaxResult getInfoByLine(@PathVariable(value = "id") Long id,
|
|
|
+ @PathVariable(value = "lineId") Long lineId) {
|
|
|
+ BusJlgz info = budJlgzService.getInfo(id, lineId);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("info", info);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "列表")
|
|
|
- @GetMapping(value = "list")
|
|
|
- public TableDataInfo getList(BusJlgz busJlgz) {
|
|
|
- startPage();
|
|
|
- List<BusJlgz> list = budJlgzService.getList(busJlgz);
|
|
|
- return getDataTable(list);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "列表")
|
|
|
+ @GetMapping(value = "list")
|
|
|
+ public TableDataInfo getList(BusJlgz busJlgz) {
|
|
|
+ startPage();
|
|
|
+ List<BusJlgz> list = budJlgzService.getList(busJlgz);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "通过支柱信息获取历史故障统计", notes = "通过支柱信息获取历史故障统计", response = AjaxResult.class)
|
|
|
- @GetMapping("/getListByZz")
|
|
|
- public AjaxResult getListByZz(BusSmartQueryVo busSmartQueryVo) {
|
|
|
- List<BusJlgzListByZzVo> list = budJlgzService.getListByZz(busSmartQueryVo);
|
|
|
- AjaxResult ajax = AjaxResult.success();
|
|
|
- ajax.put("info",list);
|
|
|
- return ajax;
|
|
|
- }
|
|
|
+ @ApiOperation(value = "通过支柱信息获取历史故障统计", notes = "通过支柱信息获取历史故障统计", response = AjaxResult.class)
|
|
|
+ @GetMapping("/getListByZz")
|
|
|
+ public AjaxResult getListByZz(BusSmartQueryVo busSmartQueryVo) {
|
|
|
+ List<BusJlgzListByZzVo> list = budJlgzService.getListByZz(busSmartQueryVo);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("info", list);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "获取记录故障线别")
|
|
|
- @GetMapping("/getJlgzLine")
|
|
|
- public TableDataInfo getJlgzLine() {
|
|
|
- startPage();
|
|
|
- List<JlgzLineVo> list = budJlgzService.getJlgzLine();
|
|
|
- return getDataTable(list);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "获取记录故障线别")
|
|
|
+ @GetMapping("/getJlgzLine")
|
|
|
+ public TableDataInfo getJlgzLine() {
|
|
|
+ startPage();
|
|
|
+ List<JlgzLineVo> list = budJlgzService.getJlgzLine();
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "获取记录故障所别")
|
|
|
- @GetMapping("/getJlgzSubstation")
|
|
|
- public TableDataInfo getJlgzSubstation(BaseSubstation baseSubstation) {
|
|
|
- startPage();
|
|
|
- List<JlgzSubstationVo> list = budJlgzService.getJlgzSubstation(baseSubstation.getLineId());
|
|
|
- return getDataTable(list);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "获取记录故障所别")
|
|
|
+ @GetMapping("/getJlgzSubstation")
|
|
|
+ public TableDataInfo getJlgzSubstation(BaseSubstation baseSubstation) {
|
|
|
+ startPage();
|
|
|
+ List<JlgzSubstationVo> list = budJlgzService.getJlgzSubstation(baseSubstation.getLineId());
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
|
|
|
}
|