f6b66429b27a708bf33660512f30bb99b6e395dc.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package cn.com.goldenwater.dcproj.controller.plansd;
  2. import cn.com.goldenwater.dcproj.model.BisInspPlanDtlPtyp;
  3. import cn.com.goldenwater.dcproj.service.BisInspPlanDtlPtypService;
  4. import cn.com.goldenwater.core.web.BaseController;
  5. import cn.com.goldenwater.core.web.BaseResponse;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.slf4j.Logger;
  10. import org.slf4j.LoggerFactory;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.util.Assert;
  13. import org.springframework.web.bind.annotation.PathVariable;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RequestMethod;
  17. import org.springframework.web.bind.annotation.RequestParam;
  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/dtlptyp")
  27. public class BisInspPlanDtlPtypController extends BaseController {
  28. private Logger logger = LoggerFactory.getLogger(getClass());
  29. @Autowired
  30. private BisInspPlanDtlPtypService bisInspPlanDtlPtypService;
  31. @ApiOperation(value = "添加检查年度计划分解表-关联督查类型")
  32. @RequestMapping(value = "/add", method = RequestMethod.POST)
  33. public BaseResponse<BisInspPlanDtlPtyp> insert(@ApiParam(name = "bisInspPlanDtlPtyp", value = "BisInspPlanDtlPtyp", required = true) @RequestBody BisInspPlanDtlPtyp bisInspPlanDtlPtyp) {
  34. int ret = bisInspPlanDtlPtypService.insert(bisInspPlanDtlPtyp);
  35. return buildSuccessResponse(bisInspPlanDtlPtyp);
  36. }
  37. @ApiOperation(value = "根据ID删除检查年度计划分解表-关联督查类型")
  38. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  39. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  40. int ret = bisInspPlanDtlPtypService.delete(id);
  41. return buildSuccessResponse();
  42. }
  43. @ApiOperation(value = "更新检查年度计划分解表-关联督查类型信息")
  44. @RequestMapping(value = "/update", method = RequestMethod.POST)
  45. public BaseResponse<BisInspPlanDtlPtyp> update(@ApiParam(name = "bisInspPlanDtlPtyp", value = "BisInspPlanDtlPtyp", required = true) @RequestBody BisInspPlanDtlPtyp bisInspPlanDtlPtyp) {
  46. Assert.notNull(bisInspPlanDtlPtyp.getId(), "主键id为必填参数");
  47. int ret = bisInspPlanDtlPtypService.update(bisInspPlanDtlPtyp);
  48. return buildSuccessResponse(bisInspPlanDtlPtyp);
  49. }
  50. @ApiOperation(value = "根据ID获取检查年度计划分解表-关联督查类型(单表)")
  51. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  52. public BaseResponse<BisInspPlanDtlPtyp> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  53. BisInspPlanDtlPtyp bisInspPlanDtlPtyp = bisInspPlanDtlPtypService.get(id);
  54. return buildSuccessResponse(bisInspPlanDtlPtyp);
  55. }
  56. }