package com.hotent.project.controller; import com.hotent.base.annotation.ApiGroup; import com.hotent.base.constants.ApiGroupConsts; import com.hotent.common.CrudService; import com.hotent.project.model.CostProjectDocument; import com.hotent.project.req.CostProjectBasePageReq; import com.hotent.project.req.CostProjectMemoUpdateReq; import com.hotent.req.PageReq; import com.hotent.resp.PageResp; 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.CostProjectMaterial; import com.hotent.project.manager.CostProjectMaterialManager; /** * 报送资料要求 前端控制器 * * @company 山西清众科技股份有限公司 * @author 超级管理员 * @since 2025-09-26 */ @RestController @RequestMapping("/api/costProjectMaterial/v1/") @Api(tags = "报送资料要求") @ApiGroup(group = {ApiGroupConsts.GROUP_COST}) public class CostProjectMaterialController extends BaseController { // 创建通用服务实例 private final CrudService crudService = new CrudService(); /** * 根据id获取报送资料要求数据详情 * @param id * @return * @throws Exception * ModelAndView */ @GetMapping(value="/getDetail") @ApiOperation(value="根据id获取报送资料要求数据详情",httpMethod = "GET",notes = "根据id获取报送资料要求数据详情") public CommonResult getDetail(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{ return CommonResult.ok().value(baseService.getDetail(id)); } @PostMapping(value="/pageList") @ApiOperation(value="分页查询pageList",httpMethod = "POST",notes = "分页查询pageList") public CommonResult> pageList(@RequestBody CostProjectBasePageReq req) { return CommonResult.>ok().value(crudService.pageQuery(req, baseService::pageList)); } /** * 取报送资料要求数据新增或者修改 * @return * @throws Exception * ModelAndView */ @PostMapping(value = "/update") @ApiOperation(value = "取报送资料要求数据新增或者修改", httpMethod = "POST", notes = "取报送资料要求数据新增或者修改") public CommonResult update(@RequestBody CostProjectMaterial req) throws Exception { int result = baseService.createOrUpdate(req); return CommonResult.ok().value(result > 0 ? "更新成功" : "更新失败"); } }