a571a9c0090d86a6cd4b8d0fed366097c1ccf469.svn-base 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package cn.com.goldenwater.dcproj.controller.villqh;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.BisInspVillqhRgstrRelVill;
  5. import cn.com.goldenwater.dcproj.param.CountryParam;
  6. import cn.com.goldenwater.dcproj.service.BisInspVillqhRgstrRelVillService;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.slf4j.Logger;
  12. import org.slf4j.LoggerFactory;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.*;
  15. import java.util.List;
  16. /**
  17. * @author lhc
  18. * @date 2021-2-1
  19. */
  20. @Api(value = "农饮(青海)-登记表与行政村关系管理", tags = "农饮(青海)-登记表与行政村关系管理")
  21. @RestController
  22. @RequestMapping("/bis/insp/villqh/rel")
  23. public class BisInspVillqhRgstrRelVillController extends BaseController {
  24. private Logger logger = LoggerFactory.getLogger(getClass());
  25. @Autowired
  26. private BisInspVillqhRgstrRelVillService bisInspVillqhRgstrRelVillService;
  27. @ApiOperation(value = "修改农饮(青海)-登记表与行政村关系")
  28. @RequestMapping(value = "", method = RequestMethod.POST)
  29. public BaseResponse<BisInspVillqhRgstrRelVill> insert(@ApiParam(name = "bisInspVillqhRgstrRelVill", value = "BisInspVillqhRgstrRelVill", required = true)
  30. @RequestBody BisInspVillqhRgstrRelVill bisInspVillqhRgstrRelVill) {
  31. int ret = 0;
  32. if (StringUtils.isBlank(bisInspVillqhRgstrRelVill.getId())) {
  33. ret = bisInspVillqhRgstrRelVillService.insert(bisInspVillqhRgstrRelVill);
  34. } else {
  35. ret = bisInspVillqhRgstrRelVillService.update(bisInspVillqhRgstrRelVill);
  36. }
  37. return buildSuccessResponse(bisInspVillqhRgstrRelVill);
  38. }
  39. @ApiOperation(value = "根据ID删除农饮(青海)-登记表与行政村关系")
  40. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  41. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  42. int ret = bisInspVillqhRgstrRelVillService.delete(id);
  43. return buildSuccessResponse();
  44. }
  45. @ApiOperation(value = "根据ID获取农饮(青海)-登记表与行政村关系(单表)")
  46. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  47. public BaseResponse<BisInspVillqhRgstrRelVill> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  48. BisInspVillqhRgstrRelVill bisInspVillqhRgstrRelVill = bisInspVillqhRgstrRelVillService.get(id);
  49. return buildSuccessResponse(bisInspVillqhRgstrRelVill);
  50. }
  51. @ApiOperation(value = "批量添加行政村")
  52. @RequestMapping(value = "/addbatch", method = RequestMethod.POST)
  53. public BaseResponse addbatch(@ApiParam(name = "countryParam", value = "countryParam", required = true)
  54. @RequestBody List<CountryParam> countryParamList) {
  55. return buildSuccessResponse(bisInspVillqhRgstrRelVillService.addbatch(countryParamList, getCurrentPersId()));
  56. }
  57. }