88c6c87d30f8d448149aacae9058639d3a7e2f4e.svn-base 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package cn.com.goldenwater.dcproj.controller.plansd;
  2. import cn.com.goldenwater.dcproj.model.BisInspPlandpRl;
  3. import cn.com.goldenwater.dcproj.param.BisInspPlandpRlParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspPlandpRlService;
  5. import cn.com.goldenwater.core.web.BaseController;
  6. import cn.com.goldenwater.core.web.BaseResponse;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.slf4j.Logger;
  12. import org.slf4j.LoggerFactory;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.PathVariable;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RequestMethod;
  18. import org.springframework.web.bind.annotation.RestController;
  19. import java.util.List;
  20. /**
  21. * @author hjp
  22. * @date 2022-8-9
  23. */
  24. @Api(value = "年度计划参建单位信息管理",tags="年度计划参建单位信息管理")
  25. @RestController
  26. @RequestMapping("/bis/insp/plan/dprl")
  27. public class BisInspPlandpRlController extends BaseController {
  28. private Logger logger = LoggerFactory.getLogger(getClass());
  29. @Autowired
  30. private BisInspPlandpRlService bisInspPlandpRlService;
  31. @ApiOperation(value = "添加年度计划参建单位信息")
  32. @RequestMapping(value = "", method = RequestMethod.POST)
  33. public BaseResponse<BisInspPlandpRl> insert(@ApiParam(name = "bisInspPlandpRl", value = "BisInspPlandpRl", required = true) @RequestBody BisInspPlandpRl bisInspPlandpRl) {
  34. bisInspPlandpRl.setPersId(getCurrentPersId());
  35. if (StringUtils.isBlank(bisInspPlandpRl.getId())){
  36. bisInspPlandpRlService.insert(bisInspPlandpRl);
  37. }else {
  38. bisInspPlandpRlService.update(bisInspPlandpRl);
  39. }
  40. return buildSuccessResponse(bisInspPlandpRl);
  41. }
  42. @ApiOperation(value = "根据ID删除年度计划参建单位信息")
  43. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  44. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  45. int ret = bisInspPlandpRlService.delete(id);
  46. return buildSuccessResponse();
  47. }
  48. @ApiOperation(value = "根据ID获取年度计划参建单位信息(单表)")
  49. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  50. public BaseResponse<BisInspPlandpRl> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. BisInspPlandpRl bisInspPlandpRl = bisInspPlandpRlService.get(id);
  52. return buildSuccessResponse(bisInspPlandpRl);
  53. }
  54. @ApiOperation(value = "获取年度计划参建单位信息数据")
  55. @RequestMapping(value = "/findList", method = RequestMethod.POST)
  56. public BaseResponse<List<BisInspPlandpRl>> findList(@RequestBody BisInspPlandpRlParam param) {
  57. return buildSuccessResponse(bisInspPlandpRlService.findList(param));
  58. }
  59. }