package com.ruoyi.web.controller.system.property;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.TdPropertyManager;
import com.ruoyi.system.service.ITdPropertyManagerService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * packageName com.ruoyi.web.controller.system.property
 *
 * @author wangxy
 * @version JDK 8
 * @className TdPropertyChangeListController
 * @date 2024/6/24
 * @description 资产变更
 */
@Controller
@RequestMapping("/system/change/list")
public class TdPropertyChangeListController extends BaseController {

    private String prefix = "system/property/propertychange/list";

    @Autowired
    private ITdPropertyManagerService tdPropertyManagerService;

    @RequiresPermissions("system:change:view")
    @GetMapping()
    public String property()
    {
        return prefix + "/property";
    }

    /**
     * 查询资产登记列表
     */
    @RequiresPermissions("system:change:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(TdPropertyManager tdPropertyManager)
    {
        startPage();
        List<TdPropertyManager> list = tdPropertyManagerService.selectTdPropertyManagerList(tdPropertyManager);
        return getDataTable(list);
    }



    /**
     * 添加资产条目
     */
    @RequiresPermissions("system:change:detail")
    @GetMapping("/detail/{useId}")
    public String detail(@PathVariable("useId") String useId, ModelMap mmap)
    {
        mmap.put("useId",useId);
        return "system/property/propertychange/changeproperty";
    }
}
