package com.hotent.project.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.constants.ApiGroupConsts;
import com.hotent.project.model.CostProjectDeliberate;
import com.hotent.project.req.CostProjectBasePageReq;
import io.swagger.annotations.Api;
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.CostProjectConclusion;
import com.hotent.project.manager.CostProjectConclusionManager;

/**
 * 监审项目结论表 前端控制器
 *
 * @company 山西清众科技股份有限公司
 * @author 超级管理员
 * @since 2025-09-27
 */
@RestController
@RequestMapping("/api/costProjectConclusion/v1/")
@Api(tags = "监审项目结论表")
@ApiGroup(group = {ApiGroupConsts.GROUP_COST})
public class CostProjectConclusionController extends BaseController<CostProjectConclusionManager, CostProjectConclusion> {

	/**
	 * 根据id获取监审项目结论表数据详情
	 * @param projectId 项目id
	 * @return
	 * @throws Exception
	 * ModelAndView
	 */
	@GetMapping(value="/getDetail")
	@ApiOperation(value="根据项目id获取监审项目结论表数据详情",httpMethod = "GET",notes = "根据项目id获取监审项目结论表数据详情")
	public CommonResult<CostProjectConclusion> getDetail(@ApiParam(name="projectId",value="项目id", required = true)@RequestParam(required=true) String projectId) throws Exception{
		return CommonResult.<CostProjectConclusion>ok().value(baseService.getDetail(projectId));
	}

	@GetMapping(value="/getByTaskId")
	@ApiOperation(value="根据项目id获取监审项目结论表数据详情",httpMethod = "GET",notes = "根据项目id获取监审项目结论表数据详情")
	public CommonResult<CostProjectConclusion> getByTaskId(@ApiParam(name="taskId",value="taskId", required = true)@RequestParam(required=true) String taskId) throws Exception{
		CostProjectConclusion conclusion = baseService.getOne(
				new LambdaQueryWrapper<CostProjectConclusion>()
						.eq(CostProjectConclusion::getTaskId, taskId)
		);
		return CommonResult.<CostProjectConclusion>ok().value(conclusion);
	}


}
