package com.sooka.system.gas.xinKer_disposition_infor.controller;

import com.sooka.common.annotation.Log;
import com.sooka.common.core.controller.BaseController;
import com.sooka.common.core.domain.AjaxResult;
import com.sooka.common.core.page.TableDataInfo;
import com.sooka.common.enums.BusinessType;
import com.sooka.common.utils.poi.ExcelUtil;
import com.sooka.system.gas.xinKer_disposition_infor.domain.TGuijiXinKerDispositionInfor;
import com.sooka.system.gas.xinKer_disposition_infor.service.ITGuijiXinKerDispositionInforService;
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;

/**
 * 鑫科客户系统-处理信息Controller
 *
 * @author lei
 * @date 2022-08-22
 */
@Controller
@RequestMapping("/system/gas/xinKer_disposition_infor")
public class TGuijXinKerDispositionInforController extends BaseController
{
    private String prefix = "system/gas/xinKer_disposition_infor";

    @Autowired
    private ITGuijiXinKerDispositionInforService service;

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

    /**
     * 查询鑫科客户系统-处理信息列表
     */
    @RequiresPermissions("system:xinKer_disposition_infor:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(TGuijiXinKerDispositionInfor param)
    {
        startPage();
        List<TGuijiXinKerDispositionInfor> list = service.selectList(param);
        return getDataTable(list);
    }

    /**
     * 导出鑫科客户系统-处理信息列表
     */
    @RequiresPermissions("system:xinKer_disposition_infor:export")
    @Log(title = "鑫科客户系统-处理信息", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(TGuijiXinKerDispositionInfor param)
    {
        List<TGuijiXinKerDispositionInfor> list = service.selectList(param);
        ExcelUtil<TGuijiXinKerDispositionInfor> util = new ExcelUtil<TGuijiXinKerDispositionInfor>(TGuijiXinKerDispositionInfor.class);
        return util.exportExcel(list, "鑫科客户系统-处理信息");
    }

    /**
     * 新增鑫科客户系统-处理信息
     */
    @GetMapping("/add")
    public String add()
    {
        return prefix + "/add";
    }

    /**
     * 新增保存鑫科客户系统-处理信息
     */
    @RequiresPermissions("system:xinKer_disposition_infor:add")
    @Log(title = "鑫科客户系统-处理信息", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave(TGuijiXinKerDispositionInfor param)
    {
        return toAjax(service.insert(param));
    }

    /**
     * 修改鑫科客户系统-处理信息
     */
    @GetMapping("/edit/{id}")
    public String edit(@PathVariable("id") String id, ModelMap mmap)
    {
        TGuijiXinKerDispositionInfor param = service.selectById(id);
        mmap.put("param", param);
        return prefix + "/edit";
    }

    /**
     * 修改保存鑫科客户系统-处理信息
     */
    @RequiresPermissions("system:xinKer_disposition_infor:edit")
    @Log(title = "鑫科客户系统-处理信息", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(TGuijiXinKerDispositionInfor param)
    {
        return toAjax(service.update(param));
    }

    /**
     * 删除鑫科客户系统-处理信息
     */
    @RequiresPermissions("system:xinKer_disposition_infor:remove")
    @Log(title = "鑫科客户系统-处理信息", businessType = BusinessType.DELETE)
    @PostMapping( "/remove")
    @ResponseBody
    public AjaxResult remove(String ids)
    {
        return toAjax(service.deleteByIds(ids));
    }

    /**
     * 鑫科客户系统-处理信息详情
     */
    @GetMapping("/detail/{id}")
    public String detail(@PathVariable("id") String id, ModelMap mmap)
    {
        TGuijiXinKerDispositionInfor param = service.selectById(id);
        mmap.put("detail", param);
        return prefix + "/detail";
    }
}
