759f378839fd413fef5938ffe7ed6a19267ceea2.svn-base 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package cn.com.goldenwater.dcproj.controller.zhejiang;
  2. import cn.com.goldenwater.dcproj.dto.BisInspRgstrDto;
  3. import cn.com.goldenwater.dcproj.model.BisZhejiangJgRgstr;
  4. import cn.com.goldenwater.dcproj.param.BisZhejiangJgRgstrParam;
  5. import cn.com.goldenwater.dcproj.service.BisZhejiangJgRgstrService;
  6. import cn.com.goldenwater.core.web.BaseController;
  7. import cn.com.goldenwater.core.web.BaseResponse;
  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.apache.commons.lang3.StringUtils;
  13. import com.github.pagehelper.PageInfo;
  14. import org.slf4j.Logger;
  15. import org.slf4j.LoggerFactory;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.web.bind.annotation.*;
  18. import java.util.List;
  19. import cn.com.goldenwater.dcproj.param.TypeParam;
  20. /**
  21. * @author lune
  22. * @date 2020-5-12
  23. */
  24. @Api(value = "BIS 2020浙江强监管登记表3管理",tags="BIS 2020浙江强监管登记表3管理")
  25. @RestController
  26. @RequestMapping("/bis/zhejiang/jg/rgstr")
  27. public class BisZhejiangJgRgstrController extends BaseController {
  28. private Logger logger = LoggerFactory.getLogger(getClass());
  29. @Autowired
  30. private BisZhejiangJgRgstrService bisZhejiangJgRgstrService;
  31. @ApiOperation(value = "添加/修改2020浙江强监管登记表3")
  32. @RequestMapping(value = "", method = RequestMethod.POST)
  33. public BaseResponse<BisZhejiangJgRgstr> insert(@ApiParam(name = "bisZhejiangJgRgstr", value = "BisZhejiangJgRgstr", required = true) @RequestBody BisZhejiangJgRgstr bisZhejiangJgRgstr) {
  34. if(StringUtils.isBlank(bisZhejiangJgRgstr.getId())) {
  35. String uuid = UuidUtil.uuid(); // 生成uuid
  36. bisZhejiangJgRgstr.setId(uuid);
  37. bisZhejiangJgRgstrService.insert(bisZhejiangJgRgstr);
  38. }else{
  39. bisZhejiangJgRgstrService.update(bisZhejiangJgRgstr);
  40. }
  41. return buildSuccessResponse(bisZhejiangJgRgstr);
  42. }
  43. @ApiOperation(value = "根据ID删除2020浙江强监管登记表3")
  44. @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
  45. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  46. int ret = bisZhejiangJgRgstrService.delete(id);
  47. return buildSuccessResponse();
  48. }
  49. @ApiOperation(value = "根据ID获取2020浙江强监管登记表3(单表)")
  50. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  51. public BaseResponse<BisZhejiangJgRgstr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  52. BisZhejiangJgRgstr bisZhejiangJgRgstr = bisZhejiangJgRgstrService.get(id);
  53. return buildSuccessResponse(bisZhejiangJgRgstr);
  54. }
  55. @ApiOperation(value = "获取2020浙江强监管登记表3(列表所有)")
  56. @RequestMapping(value = "/list", method = RequestMethod.POST)
  57. public BaseResponse<List<BisZhejiangJgRgstr>> list(@ApiParam(name = "bisZhejiangJgRgstrParam", value = "bisZhejiangJgRgstrParam", required = true) @RequestBody BisZhejiangJgRgstrParam bisZhejiangJgRgstrParam) {
  58. List<BisZhejiangJgRgstr> bisZhejiangJgRgstrList = bisZhejiangJgRgstrService.findList(bisZhejiangJgRgstrParam);
  59. return buildSuccessResponse(bisZhejiangJgRgstrList);
  60. }
  61. @ApiOperation(value = "获取2020浙江强监管登记表3(列表--分页)")
  62. @RequestMapping(value = "/page", method = RequestMethod.POST)
  63. public BaseResponse<PageInfo<BisZhejiangJgRgstr>> page(@ApiParam(name = "bisZhejiangJgRgstrParam", value = "bisZhejiangJgRgstrParam", required = true) @RequestBody BisZhejiangJgRgstrParam bisZhejiangJgRgstrParam) {
  64. PageInfo<BisZhejiangJgRgstr> bisZhejiangJgRgstrList = bisZhejiangJgRgstrService.findPageInfo(bisZhejiangJgRgstrParam);
  65. return buildSuccessResponse(bisZhejiangJgRgstrList);
  66. }
  67. @ApiOperation(value = "浙江强监管登记表-pc端(列表--分页)")
  68. @PostMapping("/rgstrs-pc")
  69. public BaseResponse<PageInfo<BisInspRgstrDto>> getZhejiangJgRegstrInfoToPc(@ApiParam(name = "typeParam", value = "typeParam", required = true)@RequestBody TypeParam typeParam){
  70. typeParam.setOrgId(getCurrentOrgId());
  71. return buildSuccessResponse(bisZhejiangJgRgstrService.getZhejiangJgRegstrInfo(typeParam));
  72. }
  73. @ApiOperation(value = "浙江强监管登记表-app端(列表--分页)")
  74. @GetMapping("/rgstrs-app")
  75. public BaseResponse<PageInfo<BisInspRgstrDto>> getZhejiangJgRegstrInfoToApp(@ApiParam(name = "typeParam", value = "typeParam", required = true) TypeParam typeParam){
  76. return buildSuccessResponse(bisZhejiangJgRgstrService.getZhejiangJgRegstrInfo(typeParam));
  77. }
  78. }