|
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -25,15 +26,14 @@ import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 能源设施/系统类别Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
* @date 2024-07-11
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/basecfg/facsCategory")
|
|
|
@Api(value = "FacsCategoryController", description = "设施类别管理")
|
|
|
-public class FacsCategoryController extends BaseController
|
|
|
-{
|
|
|
+public class FacsCategoryController extends BaseController {
|
|
|
@Autowired
|
|
|
private IFacsCategoryService facsCategoryService;
|
|
|
|
|
@@ -42,8 +42,7 @@ public class FacsCategoryController extends BaseController
|
|
|
*/
|
|
|
@RequiresPermissions("basecfg:facscategory:list")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(FacsCategory category)
|
|
|
- {
|
|
|
+ public TableDataInfo list(FacsCategory category) {
|
|
|
startPage();
|
|
|
List<FacsCategory> list = facsCategoryService.selectCategoryList(category);
|
|
|
return getDataTable(list);
|
|
@@ -51,6 +50,7 @@ public class FacsCategoryController extends BaseController
|
|
|
|
|
|
/**
|
|
|
* 获取所有能源设施/系统分类
|
|
|
+ *
|
|
|
* @return 能源设施/系统分类列表
|
|
|
*/
|
|
|
@GetMapping("/listall")
|
|
@@ -65,8 +65,7 @@ public class FacsCategoryController extends BaseController
|
|
|
@RequiresPermissions("basecfg:facscategory:export")
|
|
|
@Log(title = "能源设施/系统分类", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, FacsCategory category)
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, FacsCategory category) {
|
|
|
List<FacsCategory> list = facsCategoryService.selectCategoryList(category);
|
|
|
ExcelUtil<FacsCategory> util = new ExcelUtil<FacsCategory>(FacsCategory.class);
|
|
|
util.exportExcel(response, list, "能源设施/系统分类数据");
|
|
@@ -77,19 +76,26 @@ public class FacsCategoryController extends BaseController
|
|
|
*/
|
|
|
@RequiresPermissions("basecfg:facscategory:query")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return success(facsCategoryService.selectCategoryById(id));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取能源设施/系统分类详细信息
|
|
|
+ */
|
|
|
+ @RequiresPermissions("basecfg:facscategory:query")
|
|
|
+ @GetMapping(value = "/getByCode")
|
|
|
+ public AjaxResult getByCode(@RequestParam(name = "code") String code) {
|
|
|
+ return success(facsCategoryService.selectCategoryByCode(code));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 新增能源设施/系统分类
|
|
|
*/
|
|
|
@RequiresPermissions("basecfg:facscategory:add")
|
|
|
@Log(title = "能源设施/系统分类", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody FacsCategory category)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody FacsCategory category) {
|
|
|
return toAjax(facsCategoryService.insertCategory(category));
|
|
|
}
|
|
|
|
|
@@ -99,8 +105,7 @@ public class FacsCategoryController extends BaseController
|
|
|
@RequiresPermissions("basecfg:facscategory:edit")
|
|
|
@Log(title = "能源设施/系统分类", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody FacsCategory category)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody FacsCategory category) {
|
|
|
return toAjax(facsCategoryService.updateCategory(category));
|
|
|
}
|
|
|
|
|
@@ -109,9 +114,8 @@ public class FacsCategoryController extends BaseController
|
|
|
*/
|
|
|
@RequiresPermissions("basecfg:facscategory:remove")
|
|
|
@Log(title = "能源设施/系统分类", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(facsCategoryService.deleteCategoryByIds(ids));
|
|
|
}
|
|
|
}
|