|
@@ -8,12 +8,8 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
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.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -38,9 +34,8 @@ public class FaultController extends BaseController {
|
|
|
/**
|
|
|
* 查询故障列表
|
|
|
*/
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:fault:list')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('sim:fault:list')")
|
|
|
@GetMapping("/list")
|
|
|
- @ApiOperation("查询故障列表")
|
|
|
public TableDataInfo list(Fault fault) {
|
|
|
startPage();
|
|
|
List<Fault> list = faultService.selectFaultList(fault);
|
|
@@ -50,9 +45,9 @@ public class FaultController extends BaseController {
|
|
|
/**
|
|
|
* 导出故障列表
|
|
|
*/
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:fault:export')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('sim:fault:export')")
|
|
|
@Log(title = "故障", businessType = BusinessType.EXPORT)
|
|
|
- // @PostMapping("/export")
|
|
|
+ @PostMapping("/export")
|
|
|
public void export(HttpServletResponse response, Fault fault) {
|
|
|
List<Fault> list = faultService.selectFaultList(fault);
|
|
|
ExcelUtil<Fault> util = new ExcelUtil<Fault>(Fault.class);
|
|
@@ -62,7 +57,7 @@ public class FaultController extends BaseController {
|
|
|
/**
|
|
|
* 获取故障详细信息
|
|
|
*/
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:fault:query')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('sim:fault:query')")
|
|
|
@GetMapping(value = "/{faultId}")
|
|
|
public AjaxResult getInfo(@PathVariable("faultId") String faultId) {
|
|
|
return success(faultService.selectFaultByFaultId(faultId));
|
|
@@ -71,7 +66,7 @@ public class FaultController extends BaseController {
|
|
|
/**
|
|
|
* 新增故障
|
|
|
*/
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:fault:add')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('sim:fault:add')")
|
|
|
@Log(title = "故障", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody Fault fault) {
|
|
@@ -81,9 +76,9 @@ public class FaultController extends BaseController {
|
|
|
/**
|
|
|
* 修改故障
|
|
|
*/
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:fault:edit')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('sim:fault:edit')")
|
|
|
@Log(title = "故障", businessType = BusinessType.UPDATE)
|
|
|
- // @PutMapping
|
|
|
+ @PutMapping
|
|
|
public AjaxResult edit(@RequestBody Fault fault) {
|
|
|
return toAjax(faultService.updateFault(fault));
|
|
|
}
|
|
@@ -91,9 +86,9 @@ public class FaultController extends BaseController {
|
|
|
/**
|
|
|
* 删除故障
|
|
|
*/
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:fault:remove')")
|
|
|
+ @PreAuthorize("@ss.hasPermi('sim:fault:remove')")
|
|
|
@Log(title = "故障", businessType = BusinessType.DELETE)
|
|
|
- // @DeleteMapping("/{faultIds}")
|
|
|
+ @DeleteMapping("/{faultIds}")
|
|
|
public AjaxResult remove(@PathVariable String[] faultIds) {
|
|
|
return toAjax(faultService.deleteFaultByFaultIds(faultIds));
|
|
|
}
|
|
@@ -108,7 +103,7 @@ public class FaultController extends BaseController {
|
|
|
@GetMapping("/listAllTreeViaSimType/{simType}")
|
|
|
@ApiOperation("通过模拟器类型,查询故障列表")
|
|
|
public TableDataInfo listAllTreeViaSimType(@PathVariable(value = "simType") String simType) {
|
|
|
- Fault fault =new Fault();
|
|
|
+ Fault fault = new Fault();
|
|
|
fault.setSimType(simType);
|
|
|
List<FaultTree> list = faultService.selectFaultListAllTree(fault);
|
|
|
return getDataTable(list);
|