代码拉取完成,页面将自动刷新
package com.ruoyi.system.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.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.ProbeDesign;
import com.ruoyi.system.domain.ProbeVariableParameter;
import com.ruoyi.system.domain.dto.*;
import com.ruoyi.system.service.IProbeDesignService;
import com.ruoyi.system.service.IProbeVariableParameterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 探针信息Controller
*
* @author ruoyi
* @date 2025-04-23
*/
@RestController
@RequestMapping("/system/probeInfo")
@Api("探针信息")
public class ProbeInfoController extends BaseController
{
@Autowired
private IProbeDesignService probeInfoService;
@Autowired
private IProbeVariableParameterService probeVariableParameterService;
/**
* 修改探针信息
*/
// @PreAuthorize("@ss.hasProbeInfoPermi(#probeDesign.getProbeInfoId(), 'system:probe:design')")
@Log(title = "探针信息", businessType = BusinessType.OTHER)
@PutMapping("/zip-url")
@ApiOperation("信息更新")
public AjaxResult updateZipUrl(@RequestBody ProbeDesignReqDto probeDesign)
{
return toAjax(probeInfoService.updateProbeDesignFileUrl(probeDesign));
}
/**
* 根据template字段获取模板探针对应的probeVarialeParameter表中的id
*/
@GetMapping("/listByTemplate")
public AjaxResult listByTemplateId(@RequestParam Long template)
{
// 我要去probe_design表中查到template字段等于1的probeDesign的数据,拿到其id,
List<Long> list = probeInfoService.selectProbeDesignByTemplate(template);
// 然后再去probe_variable_parameter表中查询对应的probeVariableParameter数据
List<ProbeVariableParameter> probeVariableParameters = probeVariableParameterService.selectProbeVariableParameterListByInfoIds(list);
return success(probeVariableParameters);
}
/**
* 根据项探针id(原项目ID)查询探针签核日志信息列表
*/
@PreAuthorize("@ss.hasAnyProbeInfoPermi(#probeInfoId, 'system:probe:design,system:probe:verify,system:probe:approve')")
@GetMapping("/listByProjectId/{probeInfoId}")
public TableDataInfo listByProbeInfoId(@PathVariable Long probeInfoId)
{
startPage();
List<ProbeSignatureLogRespDto> list = probeInfoService.selectSignatureLogByProbeInfoId(probeInfoId);
return getDataTable(list);
}
/**
* 查询探针信息列表
*/
@PreAuthorize("@ss.hasPermi('system:probeInfo:list')")
@GetMapping("/list")
public TableDataInfo list(ProbeDesign probeDesign)
{
startPage();
List<ProbeDesignRespDto> list = probeInfoService.selectProbeDesignList(probeDesign);
return getDataTable(list);
}
/**
* 版本管理页面,查询版本已经发布信息列表
*/
@PreAuthorize("@ss.hasPermi('system:probeChangeRequest:list')")
@GetMapping("/releasedProbeDesignList")
public TableDataInfo releasedProbeDesignList(ReleasedProbeDesignReqDto probeDesign) {
startPage();
List<ReleasedProbeDesignRespDto> list = probeInfoService.selectReleasedProbeDesignList(probeDesign);
return getDataTable(list);
}
/**
* 导出探针已发布信息列表
*/
@PreAuthorize("@ss.hasPermi('system:probeInfo:export')")
@Log(title = "探针已发布信息", businessType = BusinessType.EXPORT)
@PostMapping("/exportRelease")
public void exportRelease(HttpServletResponse response, ReleasedProbeDesignReqDto probeDesign)
{
List<ReleasedProbeDesignRespDto> list = probeInfoService.selectReleasedProbeDesignList(probeDesign);
ExcelUtil<ReleasedProbeDesignRespDto> util = new ExcelUtil<>(ReleasedProbeDesignRespDto.class);
util.exportExcel(response, list, "探针版本管理信息");
}
/**
* 导出探针信息列表
*/
@PreAuthorize("@ss.hasPermi('system:probeInfo:export')")
@Log(title = "探针信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProbeDesign probeDesign)
{
List<ProbeDesignRespDto> list = probeInfoService.selectProbeDesignList(probeDesign);
ExcelUtil<ProbeDesignRespDto> util = new ExcelUtil<>(ProbeDesignRespDto.class);
util.exportExcel(response, list, "探针设计信息数据");
}
/**
* 获取探针版本信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:probeInfo:query')")
@GetMapping(value = "/{probeDesignId}")
@ApiOperation("探针信息查询")
public AjaxResult getInfo(@PathVariable("probeDesignId") Long probeDesignId)
{
return success(probeInfoService.selectProbeDesignById(probeDesignId));
}
/**
* 新增探针信息(设计探针)
*/
@PreAuthorize("@ss.hasProbeInfoPermi(#probeDesign.getProbeInfoId(), 'system:probe:design')")
@Log(title = "探针信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProbeDesignReqDto probeDesign)
{
return toAjax(probeInfoService.insertProbeDesign(probeDesign));
}
/**
* 修改探针信息
*/
@PreAuthorize("@ss.hasProbeInfoPermi(#probeDesign.getProbeInfoId(), 'system:probe:design')")
@Log(title = "探针信息", businessType = BusinessType.UPDATE)
@PutMapping
@ApiOperation("信息更新")
public AjaxResult edit(@RequestBody ProbeDesignReqDto probeDesign)
{
return toAjax(probeInfoService.updateProbeDesign(probeDesign, false));
}
/**
* 删除探针信息
* 只有设计标签页可以删除探针信息,删除探针需要有设计权限
*/
@PreAuthorize("@ss.hasProbeInfoPermiOfProbeDesignIds(#probeDesignIds, 'system:probe:design')")
@Log(title = "探针信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{probeDesignIds}")
public AjaxResult remove(@PathVariable Long[] probeDesignIds)
{
return toAjax(probeInfoService.deleteProbeDesignByIds(probeDesignIds));
}
/**
* 探针详情设计标签页,根据探针id查询设计相关的探针版本列表
* 包含已发布的探针(当前页面可进行版本更改)
*/
@PreAuthorize("@ss.hasAnyProbeInfoPermi(#probeInfoId, 'system:probe:design,system:probe:verify,system:probe:approve')")
@GetMapping("/designList/{probeInfoId}")
public TableDataInfo designList(@PathVariable Long probeInfoId)
{
List<DesignProbeDesignRespDto> list = probeInfoService.selectDesignProbeList(probeInfoId);
return paginateDataTableFromFullSet(list);
}
/**
* 查询可进行存在校对记录or等待校对的探针列表(校对标签页)
*/
@PreAuthorize("@ss.hasAnyProbeInfoPermi(#probeInfoId, 'system:probe:design,system:probe:verify,system:probe:approve')")
@GetMapping("/verifyList/{probeInfoId}")
public TableDataInfo verifyList(@PathVariable Long probeInfoId)
{
List<VerifyProbeDesignRespDto> list = probeInfoService.selectVerifyProbeList(probeInfoId);
return paginateDataTableFromFullSet(list);
}
/**
* 查询可进行存在审定录or等待审定的探针列表(审定标签页)
*/
@PreAuthorize("@ss.hasAnyProbeInfoPermi(#probeInfoId, 'system:probe:design,system:probe:verify,system:probe:approve')")
@GetMapping("/approveList/{probeInfoId}")
public TableDataInfo approveList(@PathVariable Long probeInfoId)
{
List<ApproveProbeDesignRespDto> list = probeInfoService.selectApproveProbeList(probeInfoId);
return paginateDataTableFromFullSet(list);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。