72c959f31de663597ae2aae7603fa0b743ff82fc.svn-base 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package cn.com.goldenwater.dcproj.controller;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
  5. import cn.com.goldenwater.dcproj.model.BisInspUnwtRgstr;
  6. import cn.com.goldenwater.dcproj.param.TypeParam;
  7. import cn.com.goldenwater.dcproj.service.BisInspUnwtRgstrService;
  8. import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
  9. import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
  10. import com.github.pagehelper.PageInfo;
  11. import io.swagger.annotations.Api;
  12. import io.swagger.annotations.ApiOperation;
  13. import io.swagger.annotations.ApiParam;
  14. import org.apache.commons.lang.StringUtils;
  15. import org.slf4j.Logger;
  16. import org.slf4j.LoggerFactory;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.web.bind.annotation.*;
  19. /**
  20. * @author lhc
  21. * @date 2021-5-27
  22. */
  23. @Api(value = "xxx管理", tags = "xxx管理")
  24. @RestController
  25. @RequestMapping("/bis/insp/unwt")
  26. public class BisInspUnwtRgstrController extends BaseController {
  27. private Logger logger = LoggerFactory.getLogger(getClass());
  28. @Autowired
  29. private BisInspUnwtRgstrService bisInspUnwtRgstrService;
  30. @Autowired
  31. private OlBisInspOrgService olBisInspOrgService;
  32. @ApiOperation(value = "修改xxx")
  33. @RequestMapping(value = "", method = RequestMethod.POST)
  34. public BaseResponse<BisInspUnwtRgstr> insert(@ApiParam(name = "bisInspUnwtRgstr", value = "BisInspUnwtRgstr", required = true) @RequestBody BisInspUnwtRgstr bisInspUnwtRgstr) {
  35. bisInspUnwtRgstrService.update(bisInspUnwtRgstr);
  36. return buildSuccessResponse(bisInspUnwtRgstr);
  37. }
  38. @ApiOperation(value = "根据ID删除xxx")
  39. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  40. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  41. int ret = bisInspUnwtRgstrService.delete(id);
  42. return buildSuccessResponse();
  43. }
  44. @ApiOperation(value = "根据ID获取xxx(单表)")
  45. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  46. public BaseResponse<BisInspUnwtRgstr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  47. BisInspUnwtRgstr bisInspUnwtRgstr = bisInspUnwtRgstrService.get(id);
  48. return buildSuccessResponse(bisInspUnwtRgstr);
  49. }
  50. @ApiOperation(value = "列表--分页")
  51. @RequestMapping(value = "/findPage", method = RequestMethod.POST)
  52. public BaseResponse<PageInfo> page(@ApiParam(name = "typeParam", value = "", required = true)
  53. @RequestBody TypeParam typeParam) {
  54. typeParam.setpType(BisInspEnum.UNWT.getValue());
  55. typeParam.setPresId(getCurrentPersId());
  56. if (StringUtils.isBlank(typeParam.getAdCode())) {
  57. typeParam.setAdCodes(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
  58. }
  59. PageInfo rgstrPageInfo = bisInspUnwtRgstrService.findObjPageByType(typeParam, null);
  60. return buildSuccessResponse(rgstrPageInfo);
  61. }
  62. }