package com.hotent.project.controller;


import com.hotent.base.query.PageList;
import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.constants.ApiGroupConsts;
import com.hotent.baseInfo.model.CostDocumentTemplate;
import com.hotent.baseInfo.req.CostDocumentTemplatePageReq;
import com.hotent.common.CrudService;
import com.hotent.project.req.CostAnnualPlanPageReq;
import com.hotent.project.resp.CostAnnualPlanDetailResp;
import com.hotent.resp.PageResp;
import io.swagger.annotations.Api;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.hotent.base.model.CommonResult;
import com.hotent.base.util.StringUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RestController;
import com.hotent.base.controller.BaseController;
import com.hotent.project.model.CostAnnualPlan;
import com.hotent.project.manager.CostAnnualPlanManager;

/**
 * 年度监审计划表 前端控制器
 *
 * @company 山西清众科技股份有限公司
 * @author 超级管理员
 * @since 2025-09-20
 */
@RestController
@RequestMapping("/api/costAnnualPlan/v1/")
@Api(tags = "年度监审计划表")
@ApiGroup(group = {ApiGroupConsts.GROUP_COST})
public class CostAnnualPlanController extends BaseController<CostAnnualPlanManager, CostAnnualPlan> {

	// 创建通用服务实例
	private final CrudService crudService = new CrudService();
	@Autowired
	private CostAnnualPlanManager costAnnualPlanManager;

	/**
	 * 根据id获取年度监审计划表数据详情
	 * @param id
	 * @return
	 * @throws Exception 
	 * ModelAndView
	 */
	@GetMapping(value="/getDetail")
	@ApiOperation(value="根据id获取年度监审计划表数据详情",httpMethod = "GET",notes = "根据id获取年度监审计划表数据详情")
	public CommonResult<CostAnnualPlanDetailResp> getDetail(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{
		return CommonResult.<CostAnnualPlanDetailResp>ok().value(baseService.getDetail(id));
	}

	//分页查询
	/*@PostMapping(value="/pageList")
	@ApiOperation(value="分页查询pageList",httpMethod = "POST",notes = "分页查询pageList")
	public PageResp<CostAnnualPlan> pageList(@RequestBody CostAnnualPlanPageReq req){
		return  crudService.pageQuery(req, baseService::pageList);
	}*/
	@PostMapping(value="/pageList")
	@ApiOperation(value="分页查询pageList",httpMethod = "POST",notes = "分页查询pageList")
	public PageList<CostAnnualPlan> pageList(@RequestBody CostAnnualPlanPageReq req) throws Exception {
		return  costAnnualPlanManager.pageList(req);
	}

}
