a5c45e7159d37b55b359b8576159c2153af157b1.svn-base 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package cn.com.goldenwater.dcproj.controller.anze;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.AttProjectInsuranceParticip;
  5. import cn.com.goldenwater.dcproj.param.AttProjectInsuranceParticipParam;
  6. import cn.com.goldenwater.dcproj.service.AttProjectInsuranceParticipService;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import lombok.extern.slf4j.Slf4j;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.util.Assert;
  13. import org.springframework.web.bind.annotation.*;
  14. /**
  15. * @author lql
  16. * @date 2026-4-21
  17. */
  18. @Slf4j
  19. @Api(value = "水利工程参建单位信息管理", tags = "水利工程参建单位信息管理")
  20. @RestController
  21. @RequestMapping("/att/project/insurance/particip")
  22. public class AttProjectInsuranceParticipController extends BaseController {
  23. @Autowired
  24. private AttProjectInsuranceParticipService attProjectInsuranceParticipService;
  25. @ApiOperation(value = "添加水利工程参建单位信息")
  26. @RequestMapping(value = "/add", method = RequestMethod.POST)
  27. public BaseResponse<AttProjectInsuranceParticip> insert(
  28. @ApiParam(name = "attProjectInsuranceParticip", value = "AttProjectInsuranceParticip", required = true)
  29. @RequestBody AttProjectInsuranceParticip attProjectInsuranceParticip) {
  30. int ret = attProjectInsuranceParticipService.insert(attProjectInsuranceParticip);
  31. return buildSuccessResponse(attProjectInsuranceParticip);
  32. }
  33. @ApiOperation(value = "根据ID删除水利工程参建单位信息")
  34. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  35. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  36. int ret = attProjectInsuranceParticipService.delete(id);
  37. return buildSuccessResponse();
  38. }
  39. @ApiOperation(value = "更新水利工程参建单位信息信息")
  40. @RequestMapping(value = "/update", method = RequestMethod.POST)
  41. public BaseResponse<AttProjectInsuranceParticip> update(@ApiParam(name = "attProjectInsuranceParticip", value = "AttProjectInsuranceParticip", required = true)
  42. @RequestBody AttProjectInsuranceParticip attProjectInsuranceParticip) {
  43. Assert.notNull(attProjectInsuranceParticip.getId(), "主键id为必填参数");
  44. int ret = attProjectInsuranceParticipService.update(attProjectInsuranceParticip);
  45. return buildSuccessResponse(attProjectInsuranceParticip);
  46. }
  47. @ApiOperation(value = "根据ID获取水利工程参建单位信息(单表)")
  48. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  49. public BaseResponse<AttProjectInsuranceParticip> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  50. AttProjectInsuranceParticip attProjectInsuranceParticip = attProjectInsuranceParticipService.get(id);
  51. return buildSuccessResponse(attProjectInsuranceParticip);
  52. }
  53. @ApiOperation(value = "根据ID获取水利工程参建单位信息(单表)")
  54. @RequestMapping(value = "/getByProjectId/{id}", method = RequestMethod.GET)
  55. public BaseResponse<AttProjectInsuranceParticip> getByProjectId(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  56. AttProjectInsuranceParticipParam param = new AttProjectInsuranceParticipParam();
  57. param.setProjectId(id);
  58. AttProjectInsuranceParticip attProjectInsuranceParticip = attProjectInsuranceParticipService.getBy(param);
  59. return buildSuccessResponse(attProjectInsuranceParticip);
  60. }
  61. }