a8f2b5a7e8da7826982f3319435af918a011ff4b.svn-base 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package cn.com.goldenwater.dcproj.controller.cdep;
  2. import cn.com.goldenwater.dcproj.model.BisInspCdepRgstr;
  3. import cn.com.goldenwater.dcproj.param.BisInspCdepRgstrParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspCdepRgstrService;
  5. import cn.com.goldenwater.core.web.BaseController;
  6. import cn.com.goldenwater.core.web.BaseResponse;
  7. import com.github.pagehelper.PageInfo;
  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.RestController;
  21. import java.util.Date;
  22. /**
  23. * @author zhangcheng xinjiang
  24. * @date 2020-11-19
  25. */
  26. @Api(value = "乙级检测单位管理",tags="乙级检测单位管理")
  27. @RestController
  28. @RequestMapping("/bis/insp/cdep")
  29. public class BisInspCdepRgstrController extends BaseController {
  30. private Logger logger = LoggerFactory.getLogger(getClass());
  31. @Autowired
  32. private BisInspCdepRgstrService bisInspCdepRgstrService;
  33. @ApiOperation(value = "添加或修改乙级检测单位登记表(新疆)")
  34. @RequestMapping(value = "", method = RequestMethod.POST)
  35. public BaseResponse<BisInspCdepRgstr> insert(@ApiParam(name = "bisInspCdepRgstr", value = "BisInspCdepRgstr", required = true) @RequestBody BisInspCdepRgstr bisInspCdepRgstr) {
  36. if (StringUtils.isBlank(bisInspCdepRgstr.getObjId())
  37. && StringUtils.isBlank(bisInspCdepRgstr.getId())
  38. && StringUtils.isBlank(bisInspCdepRgstr.getRgstrId())) {
  39. return buildFailResponse();
  40. }
  41. return buildSuccessResponse(bisInspCdepRgstrService.save(bisInspCdepRgstr));
  42. }
  43. @ApiOperation(value = "根据ID删除xxx")
  44. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  45. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  46. int ret = bisInspCdepRgstrService.delete(id);
  47. return buildSuccessResponse();
  48. }
  49. @ApiOperation(value = "更新乙级检测单位登记表管理信息")
  50. @RequestMapping(value = "/update", method = RequestMethod.POST)
  51. public BaseResponse<BisInspCdepRgstr> update(@ApiParam(name = "bisInspCdepRgstr", value = "BisInspCdepRgstr", required = true) @RequestBody BisInspCdepRgstr bisInspCdepRgstr) {
  52. Assert.notNull(bisInspCdepRgstr.getId(), "主键id为必填参数");
  53. bisInspCdepRgstr.setUptm(new Date());
  54. int ret = bisInspCdepRgstrService.update(bisInspCdepRgstr);
  55. return buildSuccessResponse(bisInspCdepRgstr);
  56. }
  57. @ApiOperation(value = "根据ID获取乙级检测单位登记表(新疆)(单表)")
  58. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  59. public BaseResponse<BisInspCdepRgstr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  60. BisInspCdepRgstr bisInspCdepRgstr = bisInspCdepRgstrService.get(id);
  61. return buildSuccessResponse(bisInspCdepRgstr);
  62. }
  63. @ApiOperation(value = "乙级检测单位登记表(新疆)(列表--分页)")
  64. @RequestMapping(value = "/findPage", method = RequestMethod.POST)
  65. public BaseResponse<PageInfo<BisInspCdepRgstr>> page(@ApiParam(name = "bisInspCdepRgstrParam", value = "bisInspCdepRgstrParam", required = true)
  66. @RequestBody BisInspCdepRgstrParam bisInspCdepRgstrParam) {
  67. //此处记得在BisInspCdepRgstrParam类中增加plnaId字段
  68. PageInfo<BisInspCdepRgstr> bisInspCdepRgstrCollegeList = bisInspCdepRgstrService.findCdepPageInfo(bisInspCdepRgstrParam);
  69. return buildSuccessResponse(bisInspCdepRgstrCollegeList);
  70. }
  71. }