package com.siwei.rsmonitoring.controller;

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

import com.siwei.rsmonitoring.domain.TDkjbxxTj;
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.TFieldworkTj;
import com.siwei.rsmonitoring.service.ITFieldworkTjService;
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-03-05
 */
@RestController
@RequestMapping("/fieldwork/tj")
public class TFieldworkTjController extends BaseController {
    @Autowired
    private ITFieldworkTjService tFieldworkTjService;

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

    /**
     * 新增地块基本信息审查
     */
//    @RequiresPermissions("rsmonitoring:tj:add")
//    @Log(title = "地块基本信息提交", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TFieldworkTj tFieldworkTj) {
        return toAjax(tFieldworkTjService.addTFieldworkTj(tFieldworkTj));
    }
}
