济菏高速数据中心代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

122 lines
3.7 KiB

package com.zc.business.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.zc.business.domain.DcStakeMark;
import com.zc.business.service.IDcStakeMarkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
/**
* 桩号Controller
*
* @author zhaoxianglong
*/
@Api(tags={"桩号"})
@RestController
@RequestMapping("/business/stakeMark")
public class DcStakeMarkController extends BaseController {
@Resource
private IDcStakeMarkService dcStakeMarkService;
//*********************************桩号增删改查******************************************
/**
* 分页查询桩号列表
*
* @param dcStakeMark 请求参数
* @return 分页查询结果
*/
@ApiOperation("分页查询桩号列表")
@PreAuthorize("@ss.hasPermi('iot:stakeMark:list')")
@GetMapping("list")
public TableDataInfo listStakeMark(DcStakeMark dcStakeMark) {
return getDataTable(dcStakeMarkService.pageStakeMark(dcStakeMark));
}
/**
* 无分页查询桩号列表
*
* @param dcStakeMark 请求参数
* @return 查询结果
*/
@ApiOperation("无分页查询桩号列表")
@PreAuthorize("@ss.hasPermi('iot:stakeMark:query')")
@GetMapping("query")
public AjaxResult queryStakeMark(DcStakeMark dcStakeMark) {
return AjaxResult.success(dcStakeMarkService.listStakeMark(dcStakeMark));
}
/**
* 根据id查询桩号信息
*
* @param id id
* @return 查询结果
*/
@ApiOperation("根据id查询桩号信息")
@PreAuthorize("@ss.hasPermi('iot:stakeMark:query')")
@GetMapping("{id}")
public AjaxResult getStakeMark(@PathVariable String id) {
return AjaxResult.success(dcStakeMarkService.getStakeMark(id));
}
/**
* 新增
*
* @param dcStakeMark 新增参数
* @return 新增操作结果
*/
@ApiOperation("新增")
@PreAuthorize("@ss.hasPermi('iot:stakeMark:add')")
@Log(title = "新增桩号", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult addStakeMark(@Valid @RequestBody DcStakeMark dcStakeMark) {
return toAjax(dcStakeMarkService.addStakeMark(dcStakeMark));
}
/**
* 修改
*
* @param dcStakeMark 修改参数
* @return 修改操作结果
*/
@ApiOperation("修改")
@PreAuthorize("@ss.hasPermi('iot:stakeMark:edit')")
@Log(title = "修改桩号", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult editStakeMark(@Valid @RequestBody DcStakeMark dcStakeMark) {
return toAjax(dcStakeMarkService.editStakeMark(dcStakeMark));
}
/**
* 删除
*
* @param ids id集
* @return 删除操作结果
*/
@ApiOperation("删除")
@PreAuthorize("@ss.hasPermi('iot:stakeMark:remove')")
@Log(title = "删除", businessType = BusinessType.DELETE)
@DeleteMapping("{ids}")
public AjaxResult removeStakeMark(@PathVariable List<String> ids) {
return toAjax(dcStakeMarkService.removeStakeMark(ids));
}
@ApiOperation("根据json文件路径导入桩号")
@PostMapping("importStakeMarkByJsonFilePath")
public AjaxResult importJsonStakeMark(String filePath) throws IOException {
return dcStakeMarkService.importJsonStakeMark(filePath);
}
}