832a9845e7ce4cd29f511e28ccbd5b2c58cf85ae.svn-base 3.4 KB

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