fc9b35753a7cedf1cd6f992fecafd14a1584286b.svn-base 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package cn.com.goldenwater.dcproj.controller.pblm;
  2. import cn.com.goldenwater.dcproj.model.BisInspPblmDuty;
  3. import cn.com.goldenwater.dcproj.param.BisInspPblmDutyParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspPblmDutyService;
  5. import cn.com.goldenwater.core.web.BaseController;
  6. import cn.com.goldenwater.core.web.BaseResponse;
  7. import cn.com.goldenwater.dcproj.utils.StringUtils;
  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.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-3-13
  26. */
  27. @Api(value = "问题责任单位管理", tags = "问题责任单位管理")
  28. @RestController
  29. @RequestMapping("/bis/insp/pblm/duty")
  30. public class BisInspPblmDutyController extends BaseController {
  31. private Logger logger = LoggerFactory.getLogger(getClass());
  32. @Autowired
  33. private BisInspPblmDutyService bisInspPblmDutyService;
  34. @ApiOperation(value = "添加问题责任单位")
  35. @RequestMapping(value = "/", method = RequestMethod.POST)
  36. public BaseResponse<BisInspPblmDuty> insert(@ApiParam(name = "bisInspPblmDuty", value = "BisInspPblmDuty", required = true) @RequestBody BisInspPblmDuty bisInspPblmDuty) {
  37. if (StringUtils.isBlank(bisInspPblmDuty.getId())) {
  38. bisInspPblmDutyService.insert(bisInspPblmDuty);
  39. } else {
  40. bisInspPblmDutyService.update(bisInspPblmDuty);
  41. }
  42. return buildSuccessResponse(bisInspPblmDuty);
  43. }
  44. @ApiOperation(value = "根据ID删除问题责任单位")
  45. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  46. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  47. int ret = bisInspPblmDutyService.delete(id);
  48. return buildSuccessResponse();
  49. }
  50. @ApiOperation(value = "更新问题责任单位信息")
  51. @RequestMapping(value = "/update", method = RequestMethod.POST)
  52. public BaseResponse<BisInspPblmDuty> update(@ApiParam(name = "bisInspPblmDuty", value = "BisInspPblmDuty", required = true) @RequestBody BisInspPblmDuty bisInspPblmDuty) {
  53. Assert.notNull(bisInspPblmDuty.getId(), "主键id为必填参数");
  54. int ret = bisInspPblmDutyService.update(bisInspPblmDuty);
  55. return buildSuccessResponse(bisInspPblmDuty);
  56. }
  57. @ApiOperation(value = "根据ID获取问题责任单位(单表)")
  58. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  59. public BaseResponse<BisInspPblmDuty> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  60. BisInspPblmDuty bisInspPblmDuty = bisInspPblmDutyService.get(id);
  61. return buildSuccessResponse(bisInspPblmDuty);
  62. }
  63. }