105 lines
3.4 KiB
Java
105 lines
3.4 KiB
Java
package com.ruoyi.ngtools.controller;
|
|
|
|
import java.util.List;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import com.ruoyi.common.annotation.Log;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
import com.ruoyi.ngtools.domain.NgNgpar;
|
|
import com.ruoyi.ngtools.service.INgNgparService;
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 天然气物性参数Controller
|
|
*
|
|
* @author ruoyi
|
|
* @date 2025-02-09
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/ngtools/ngpar")
|
|
public class NgNgparController extends BaseController
|
|
{
|
|
@Autowired
|
|
private INgNgparService ngNgparService;
|
|
|
|
/**
|
|
* 查询天然气物性参数列表
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('ngtools:ngpar:list')")
|
|
@GetMapping("/list")
|
|
public TableDataInfo list(NgNgpar ngNgpar)
|
|
{
|
|
startPage();
|
|
List<NgNgpar> list = ngNgparService.selectNgNgparList(ngNgpar);
|
|
return getDataTable(list);
|
|
}
|
|
|
|
/**
|
|
* 导出天然气物性参数列表
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('ngtools:ngpar:export')")
|
|
@Log(title = "天然气物性参数", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(HttpServletResponse response, NgNgpar ngNgpar)
|
|
{
|
|
List<NgNgpar> list = ngNgparService.selectNgNgparList(ngNgpar);
|
|
ExcelUtil<NgNgpar> util = new ExcelUtil<NgNgpar>(NgNgpar.class);
|
|
util.exportExcel(response, list, "天然气物性参数数据");
|
|
}
|
|
|
|
/**
|
|
* 获取天然气物性参数详细信息
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('ngtools:ngpar:query')")
|
|
@GetMapping(value = "/{id}")
|
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
|
{
|
|
return success(ngNgparService.selectNgNgparById(id));
|
|
}
|
|
|
|
/**
|
|
* 新增天然气物性参数
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('ngtools:ngpar:add')")
|
|
@Log(title = "天然气物性参数", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
public AjaxResult add(@RequestBody NgNgpar ngNgpar)
|
|
{
|
|
return toAjax(ngNgparService.insertNgNgpar(ngNgpar));
|
|
}
|
|
|
|
/**
|
|
* 修改天然气物性参数
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('ngtools:ngpar:edit')")
|
|
@Log(title = "天然气物性参数", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
public AjaxResult edit(@RequestBody NgNgpar ngNgpar)
|
|
{
|
|
return toAjax(ngNgparService.updateNgNgpar(ngNgpar));
|
|
}
|
|
|
|
/**
|
|
* 删除天然气物性参数
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('ngtools:ngpar:remove')")
|
|
@Log(title = "天然气物性参数", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{ids}")
|
|
public AjaxResult remove(@PathVariable String[] ids)
|
|
{
|
|
return toAjax(ngNgparService.deleteNgNgparByIds(ids));
|
|
}
|
|
}
|