77ff5affcbd88c253a5331bde1616dbaa6f4f60e.svn-base 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package cn.com.goldenwater.dcproj.controller.fjpjlgl;
  2. import cn.com.goldenwater.dcproj.model.AttFjpjlglBase;
  3. import cn.com.goldenwater.dcproj.model.AttSafetyBase;
  4. import cn.com.goldenwater.dcproj.param.AttFjpjlglBaseParam;
  5. import cn.com.goldenwater.dcproj.service.AttFjpjlglBaseService;
  6. import cn.com.goldenwater.core.web.BaseController;
  7. import cn.com.goldenwater.core.web.BaseResponse;
  8. import cn.com.goldenwater.id.util.UuidUtil;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import io.swagger.annotations.ApiParam;
  12. import org.apache.commons.lang3.StringUtils;
  13. import org.slf4j.Logger;
  14. import org.slf4j.LoggerFactory;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.util.Assert;
  17. import org.springframework.web.bind.annotation.PathVariable;
  18. import org.springframework.web.bind.annotation.RequestBody;
  19. import org.springframework.web.bind.annotation.RequestMapping;
  20. import org.springframework.web.bind.annotation.RequestMethod;
  21. import org.springframework.web.bind.annotation.RequestParam;
  22. import org.springframework.web.bind.annotation.RestController;
  23. import java.util.List;
  24. /**
  25. * @author lhc
  26. * @date 2023-11-7
  27. */
  28. @Api(value = "项目法人基本信息表管理",tags="项目法人基本信息表管理")
  29. @RestController
  30. @RequestMapping("/att/fjpjlgl/base")
  31. public class AttFjpjlglBaseController extends BaseController {
  32. private Logger logger = LoggerFactory.getLogger(getClass());
  33. @Autowired
  34. private AttFjpjlglBaseService attFjpjlglBaseService;
  35. @ApiOperation(value = "添加项目法人基本信息表")
  36. @RequestMapping(value = "", method = RequestMethod.POST)
  37. public BaseResponse<AttFjpjlglBase> insert(@ApiParam(name = "attFjpjlglBase", value = "AttFjpjlglBase", required = true) @RequestBody AttFjpjlglBase attFjpjlglBase) {
  38. if(StringUtils.isBlank(attFjpjlglBase.getId())) {
  39. attFjpjlglBaseService.insert(attFjpjlglBase);
  40. }
  41. else{
  42. attFjpjlglBaseService.update(attFjpjlglBase);
  43. }
  44. return buildSuccessResponse(attFjpjlglBase);
  45. }
  46. @ApiOperation(value = "根据ID删除项目法人基本信息表")
  47. @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
  48. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  49. int ret = attFjpjlglBaseService.delete(id);
  50. return buildSuccessResponse();
  51. }
  52. @ApiOperation(value = "更新项目法人基本信息表信息")
  53. @RequestMapping(value = "/update", method = RequestMethod.POST)
  54. public BaseResponse<AttFjpjlglBase> update(@ApiParam(name = "attFjpjlglBase", value = "AttFjpjlglBase", required = true) @RequestBody AttFjpjlglBase attFjpjlglBase) {
  55. Assert.notNull(attFjpjlglBase.getId(), "主键id为必填参数");
  56. int ret = attFjpjlglBaseService.update(attFjpjlglBase);
  57. return buildSuccessResponse(attFjpjlglBase);
  58. }
  59. @ApiOperation(value = "根据ID获取项目法人基本信息表(单表)")
  60. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  61. public BaseResponse<AttFjpjlglBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  62. AttFjpjlglBase attFjpjlglBase = attFjpjlglBaseService.get(id);
  63. return buildSuccessResponse(attFjpjlglBase);
  64. }
  65. @ApiOperation(value = "根据 objId 获取基本信息(单表)")
  66. @RequestMapping(value = "/getObjId/{objId}", method = {RequestMethod.GET, RequestMethod.POST})
  67. public BaseResponse<AttFjpjlglBase> getObjId(@ApiParam(name = "objId", value = "objId", required = true)
  68. @PathVariable String objId) {
  69. return buildSuccessResponse(attFjpjlglBaseService.getObjId(objId));
  70. }
  71. }