package com.siwei.rsmonitoring.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

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.siwei.common.log.annotation.Log;
import com.siwei.common.log.enums.BusinessType;
import com.siwei.common.security.annotation.RequiresPermissions;
import com.siwei.rsmonitoring.domain.TDkjbxxSc;
import com.siwei.rsmonitoring.service.ITDkjbxxScService;
import com.siwei.common.core.web.controller.BaseController;
import com.siwei.common.core.web.domain.AjaxResult;
import com.siwei.common.core.utils.poi.ExcelUtil;
import com.siwei.common.core.web.page.TableDataInfo;

/**
 * 地块基本信息审查Controller
 *
 * @author siwei
 * @date 2025-02-12
 */
@RestController
@RequestMapping("/dkjbxx/sc")
public class TDkjbxxScController extends BaseController {
    @Autowired
    private ITDkjbxxScService tDkjbxxScService;
//
//    /**
//     * 查询地块基本信息审查列表
//     */
//    @RequiresPermissions("rsmonitoring:sc:list")
//    @GetMapping("/list")
//    public TableDataInfo list(TDkjbxxSc tDkjbxxSc)
//    {
//        startPage();
//        List<TDkjbxxSc> list = tDkjbxxScService.selectTDkjbxxScList(tDkjbxxSc);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出地块基本信息审查列表
//     */
//    @RequiresPermissions("rsmonitoring:sc:export")
//    @Log(title = "地块基本信息审查", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, TDkjbxxSc tDkjbxxSc)
//    {
//        List<TDkjbxxSc> list = tDkjbxxScService.selectTDkjbxxScList(tDkjbxxSc);
//        ExcelUtil<TDkjbxxSc> util = new ExcelUtil<TDkjbxxSc>(TDkjbxxSc.class);
//        util.exportExcel(response, list, "地块基本信息审查数据");
//    }
//

    /**
     * 获取地块基本信息审查详细信息
     */
//    @RequiresPermissions("rsmonitoring:sc:query")
    @GetMapping(value = "/info")
    public AjaxResult getInfo(String dkid, String auditflowStep, String auditflowId) {
        return success(tDkjbxxScService.selectTDkjbxxScInfo(dkid, auditflowStep, auditflowId));
    }

    /**
     * 新增地块基本信息审查
     */
//    @RequiresPermissions("rsmonitoring:sc:add")
//    @Log(title = "地块基本信息审查", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TDkjbxxSc tDkjbxxSc) {
        return toAjax(tDkjbxxScService.addTDkjbxxSc(tDkjbxxSc));
    }


//
//    /**
//     * 修改地块基本信息审查
//     */
//    @RequiresPermissions("rsmonitoring:sc:edit")
//    @Log(title = "地块基本信息审查", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody TDkjbxxSc tDkjbxxSc)
//    {
//        return toAjax(tDkjbxxScService.updateTDkjbxxSc(tDkjbxxSc));
//    }
//
//    /**
//     * 删除地块基本信息审查
//     */
//    @RequiresPermissions("rsmonitoring:sc:remove")
//    @Log(title = "地块基本信息审查", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable String[] ids)
//    {
//        return toAjax(tDkjbxxScService.deleteTDkjbxxScByIds(ids));
//    }
}
