12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- package com.ruoyi.web.controller.assets;
- 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.assets.CommunityAssets;
- import com.ruoyi.system.service.ICommunityAssetsService;
- 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 boman
- * @date 2025-02-14
- */
- @RestController
- @RequestMapping("/wuYe/assets")
- public class CommunityAssetsController extends BaseController {
- @Autowired
- private ICommunityAssetsService communityAssetsService;
- /**
- * 查询社区资产列表
- */
- @PreAuthorize("@ss.hasPermi('system:assets:list')")
- @GetMapping("/list")
- public TableDataInfo list(CommunityAssets communityAssets) {
- startPage();
- List<CommunityAssets> list = communityAssetsService.selectCommunityAssetsList(communityAssets);
- return getDataTable(list);
- }
- /**
- * 导出社区资产列表
- */
- @PreAuthorize("@ss.hasPermi('system:assets:export')")
- @Log(title = "社区资产", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, CommunityAssets communityAssets) {
- List<CommunityAssets> list = communityAssetsService.selectCommunityAssetsList(communityAssets);
- ExcelUtil<CommunityAssets> util = new ExcelUtil<CommunityAssets>(CommunityAssets.class);
- util.exportExcel(response, list, "社区资产数据");
- }
- /**
- * 获取社区资产详细信息
- */
- @PreAuthorize("@ss.hasPermi('system:assets:query')")
- @GetMapping(value = "/{assetId}")
- public AjaxResult getInfo(@PathVariable("assetId") Long assetId) {
- return success(communityAssetsService.selectCommunityAssetsByAssetId(assetId));
- }
- /**
- * 新增社区资产
- */
- @PreAuthorize("@ss.hasPermi('system:assets:add')")
- @Log(title = "社区资产", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody CommunityAssets communityAssets) {
- return toAjax(communityAssetsService.insertCommunityAssets(communityAssets));
- }
- /**
- * 修改社区资产
- */
- @PreAuthorize("@ss.hasPermi('system:assets:edit')")
- @Log(title = "社区资产", businessType = BusinessType.UPDATE)
- @PostMapping("/put")
- public AjaxResult edit(@RequestBody CommunityAssets communityAssets) {
- return toAjax(communityAssetsService.updateCommunityAssets(communityAssets));
- }
- /**
- * 删除社区资产
- */
- @PreAuthorize("@ss.hasPermi('system:assets:remove')")
- @Log(title = "社区资产", businessType = BusinessType.DELETE)
- @GetMapping("/delete/{assetIds}")
- public AjaxResult remove(@PathVariable Long[] assetIds) {
- return toAjax(communityAssetsService.deleteCommunityAssetsByAssetIds(assetIds));
- }
- }
|