72 lines
2.7 KiB
Java
72 lines
2.7 KiB
Java
|
|
package com.ruoyi.mill.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.mill.domain.EqpEquipmentPart;
|
||
|
|
import com.ruoyi.mill.service.IEqpEquipmentPartService;
|
||
|
|
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;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 双机架设备巡检部位
|
||
|
|
*/
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/mill/eqp/part")
|
||
|
|
public class EqpEquipmentPartController extends BaseController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private IEqpEquipmentPartService eqpEquipmentPartService;
|
||
|
|
|
||
|
|
@PreAuthorize("@ss.hasPermi('mill:eqp:part:list')")
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo list(EqpEquipmentPart part) {
|
||
|
|
startPage();
|
||
|
|
List<EqpEquipmentPart> list = eqpEquipmentPartService.selectEqpPartList(part);
|
||
|
|
return getDataTable(list);
|
||
|
|
}
|
||
|
|
|
||
|
|
@PreAuthorize("@ss.hasPermi('mill:eqp:part:export')")
|
||
|
|
@Log(title = "设备巡检部位", businessType = BusinessType.EXPORT)
|
||
|
|
@PostMapping("/export")
|
||
|
|
public void export(HttpServletResponse response, EqpEquipmentPart part) {
|
||
|
|
List<EqpEquipmentPart> list = eqpEquipmentPartService.selectEqpPartList(part);
|
||
|
|
ExcelUtil<EqpEquipmentPart> util = new ExcelUtil<>(EqpEquipmentPart.class);
|
||
|
|
util.exportExcel(response, list, "设备巡检部位数据");
|
||
|
|
}
|
||
|
|
|
||
|
|
@PreAuthorize("@ss.hasPermi('mill:eqp:part:query')")
|
||
|
|
@GetMapping("/{partId}")
|
||
|
|
public AjaxResult getInfo(@PathVariable Long partId) {
|
||
|
|
return success(eqpEquipmentPartService.selectEqpPartByPartId(partId));
|
||
|
|
}
|
||
|
|
|
||
|
|
@PreAuthorize("@ss.hasPermi('mill:eqp:part:add')")
|
||
|
|
@Log(title = "设备巡检部位", businessType = BusinessType.INSERT)
|
||
|
|
@PostMapping
|
||
|
|
public AjaxResult add(@RequestBody EqpEquipmentPart part) {
|
||
|
|
return toAjax(eqpEquipmentPartService.insertEqpPart(part));
|
||
|
|
}
|
||
|
|
|
||
|
|
@PreAuthorize("@ss.hasPermi('mill:eqp:part:edit')")
|
||
|
|
@Log(title = "设备巡检部位", businessType = BusinessType.UPDATE)
|
||
|
|
@PutMapping
|
||
|
|
public AjaxResult edit(@RequestBody EqpEquipmentPart part) {
|
||
|
|
return toAjax(eqpEquipmentPartService.updateEqpPart(part));
|
||
|
|
}
|
||
|
|
|
||
|
|
@PreAuthorize("@ss.hasPermi('mill:eqp:part:remove')")
|
||
|
|
@Log(title = "设备巡检部位", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{partIds}")
|
||
|
|
public AjaxResult remove(@PathVariable Long[] partIds) {
|
||
|
|
return toAjax(eqpEquipmentPartService.deleteEqpPartByPartIds(partIds));
|
||
|
|
}
|
||
|
|
}
|