CostProjectMaterialController.java 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.hotent.project.controller;
  2. import com.hotent.base.annotation.ApiGroup;
  3. import com.hotent.base.constants.ApiGroupConsts;
  4. import com.hotent.common.CrudService;
  5. import com.hotent.project.model.CostProjectDocument;
  6. import com.hotent.project.req.CostProjectBasePageReq;
  7. import com.hotent.project.req.CostProjectMemoUpdateReq;
  8. import com.hotent.req.PageReq;
  9. import com.hotent.resp.PageResp;
  10. import io.swagger.annotations.Api;
  11. import org.springframework.web.bind.annotation.GetMapping;
  12. import org.springframework.web.bind.annotation.PostMapping;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RequestParam;
  16. import com.hotent.base.model.CommonResult;
  17. import com.hotent.base.util.StringUtil;
  18. import io.swagger.annotations.ApiOperation;
  19. import io.swagger.annotations.ApiParam;
  20. import org.springframework.web.bind.annotation.RestController;
  21. import com.hotent.base.controller.BaseController;
  22. import com.hotent.project.model.CostProjectMaterial;
  23. import com.hotent.project.manager.CostProjectMaterialManager;
  24. /**
  25. * 报送资料要求 前端控制器
  26. *
  27. * @company 山西清众科技股份有限公司
  28. * @author 超级管理员
  29. * @since 2025-09-26
  30. */
  31. @RestController
  32. @RequestMapping("/api/costProjectMaterial/v1/")
  33. @Api(tags = "报送资料要求")
  34. @ApiGroup(group = {ApiGroupConsts.GROUP_COST})
  35. public class CostProjectMaterialController extends BaseController<CostProjectMaterialManager, CostProjectMaterial> {
  36. // 创建通用服务实例
  37. private final CrudService crudService = new CrudService();
  38. /**
  39. * 根据id获取报送资料要求数据详情
  40. * @param id
  41. * @return
  42. * @throws Exception
  43. * ModelAndView
  44. */
  45. @GetMapping(value="/getDetail")
  46. @ApiOperation(value="根据id获取报送资料要求数据详情",httpMethod = "GET",notes = "根据id获取报送资料要求数据详情")
  47. public CommonResult<CostProjectMaterial> getDetail(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{
  48. return CommonResult.<CostProjectMaterial>ok().value(baseService.getDetail(id));
  49. }
  50. @PostMapping(value="/pageList")
  51. @ApiOperation(value="分页查询pageList",httpMethod = "POST",notes = "分页查询pageList")
  52. public CommonResult<PageResp<CostProjectMaterial>> pageList(@RequestBody CostProjectBasePageReq req) {
  53. return CommonResult.<PageResp<CostProjectMaterial>>ok().value(crudService.pageQuery(req, baseService::pageList));
  54. }
  55. /**
  56. * 取报送资料要求数据新增或者修改
  57. * @return
  58. * @throws Exception
  59. * ModelAndView
  60. */
  61. @PostMapping(value = "/update")
  62. @ApiOperation(value = "取报送资料要求数据新增或者修改", httpMethod = "POST", notes = "取报送资料要求数据新增或者修改")
  63. public CommonResult update(@RequestBody CostProjectMaterial req) throws Exception {
  64. int result = baseService.createOrUpdate(req);
  65. return CommonResult.ok().value(result > 0 ? "更新成功" : "更新失败");
  66. }
  67. }