|
@@ -0,0 +1,106 @@
|
|
|
|
+package com.ruoyi.web.controller.business;
|
|
|
|
+
|
|
|
|
+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.business.domain.BizDevice;
|
|
|
|
+import com.ruoyi.business.service.IBizDeviceService;
|
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 【请填写功能名称】Controller
|
|
|
|
+ *
|
|
|
|
+ * @author slibra
|
|
|
|
+ * @date 2025-03-11
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/business/device")
|
|
|
|
+public class BizDeviceController extends BaseController
|
|
|
|
+{
|
|
|
|
+ @Autowired
|
|
|
|
+ private IBizDeviceService bizDeviceService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询【请填写功能名称】列表
|
|
|
|
+ */
|
|
|
|
+// @PreAuthorize("@ss.hasPermi('business:device:list')")
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ public TableDataInfo list(BizDevice bizDevice)
|
|
|
|
+ {
|
|
|
|
+ startPage();
|
|
|
|
+ List<BizDevice> list = bizDeviceService.selectBizDeviceList(bizDevice);
|
|
|
|
+ return getDataTable(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出【请填写功能名称】列表
|
|
|
|
+ */
|
|
|
|
+// @PreAuthorize("@ss.hasPermi('business:device:export')")
|
|
|
|
+// @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
|
|
|
+ @PostMapping("/export")
|
|
|
|
+ public void export(HttpServletResponse response, BizDevice bizDevice)
|
|
|
|
+ {
|
|
|
|
+ List<BizDevice> list = bizDeviceService.selectBizDeviceList(bizDevice);
|
|
|
|
+ ExcelUtil<BizDevice> util = new ExcelUtil<BizDevice>(BizDevice.class);
|
|
|
|
+ util.exportExcel(response, list, "【请填写功能名称】数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取【请填写功能名称】详细信息
|
|
|
|
+ */
|
|
|
|
+// @PreAuthorize("@ss.hasPermi('business:device:query')")
|
|
|
|
+ @GetMapping(value = "/{deviceId}")
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
|
|
|
|
+ {
|
|
|
|
+ return success(bizDeviceService.selectBizDeviceByDeviceId(deviceId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增【请填写功能名称】
|
|
|
|
+ */
|
|
|
|
+// @PreAuthorize("@ss.hasPermi('business:device:add')")
|
|
|
|
+// @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
|
|
|
+ @PostMapping
|
|
|
|
+ public AjaxResult add(@RequestBody BizDevice bizDevice)
|
|
|
|
+ {
|
|
|
|
+ bizDevice.setCreateBy(getUsername());
|
|
|
|
+ return toAjax(bizDeviceService.insertBizDevice(bizDevice));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改【请填写功能名称】
|
|
|
|
+ */
|
|
|
|
+// @PreAuthorize("@ss.hasPermi('business:device:edit')")
|
|
|
|
+// @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
|
|
|
+ @PutMapping
|
|
|
|
+ public AjaxResult edit(@RequestBody BizDevice bizDevice)
|
|
|
|
+ {
|
|
|
|
+ bizDevice.setUpdateBy(getUsername());
|
|
|
|
+ return toAjax(bizDeviceService.updateBizDevice(bizDevice));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除【请填写功能名称】
|
|
|
|
+ */
|
|
|
|
+// @PreAuthorize("@ss.hasPermi('business:device:remove')")
|
|
|
|
+// @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
|
|
|
+ @DeleteMapping("/{deviceIds}")
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] deviceIds)
|
|
|
|
+ {
|
|
|
|
+ return toAjax(bizDeviceService.deleteBizDeviceByDeviceIds(deviceIds));
|
|
|
|
+ }
|
|
|
|
+}
|