2b17b30a5bad6052533e85fcc70f4c5e5310183b.svn-base 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.model.AttGnrlBase;
  5. import cn.com.goldenwater.dcproj.service.AttGnrlBaseService;
  6. import cn.com.goldenwater.dcproj.vo.JxEcharTotal;
  7. import cn.com.goldenwater.dcproj.vo.JxMapVo;
  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.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. import java.util.List;
  15. import java.util.Map;
  16. /**
  17. * @author
  18. * @date 2021-12-6
  19. */
  20. @Api(value = "通用督查检查管理", tags = "通用督查检查管理")
  21. @RestController
  22. @RequestMapping("/att/gnrl/base")
  23. public class AttGnrlBaseController extends BaseController {
  24. @Autowired
  25. private AttGnrlBaseService attGnrlBaseService;
  26. @ApiOperation(value = "新增/修改通用督查检查")
  27. @RequestMapping(value = "", method = RequestMethod.POST)
  28. public BaseResponse<AttGnrlBase> insert(@ApiParam(name = "attGnrlBase", value = "AttGnrlBase", required = true)
  29. @RequestBody AttGnrlBase attGnrlBase) {
  30. int ret = 0;
  31. if (StringUtils.isBlank(attGnrlBase.getId())) {
  32. ret = attGnrlBaseService.insert(attGnrlBase);
  33. } else {
  34. ret = attGnrlBaseService.update(attGnrlBase);
  35. }
  36. return buildSuccessResponse(attGnrlBase);
  37. }
  38. @ApiOperation(value = "根据ID删除通用督查检查")
  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 = attGnrlBaseService.delete(id);
  42. return buildSuccessResponse();
  43. }
  44. @ApiOperation(value = "根据ID获取通用督查检查(单表)")
  45. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  46. public BaseResponse<AttGnrlBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  47. AttGnrlBase attGnrlBase = attGnrlBaseService.get(id);
  48. return buildSuccessResponse(attGnrlBase);
  49. }
  50. @ApiOperation(value = "按问题分类,问题数量统计echars")
  51. @PostMapping("/echarsTotal")
  52. public BaseResponse<List<JxEcharTotal>> echarsTotal(@RequestBody Map<String,String> map){
  53. List<JxEcharTotal> ptype = attGnrlBaseService.getzichaEcharsTotal(map.get("ptype"));
  54. return buildSuccessResponse(ptype);
  55. }
  56. @ApiOperation(value = "按问题分类,问题数量统计echars")
  57. @PostMapping("/echarsDesc")
  58. public BaseResponse<List<JxMapVo>> echarsDesc(@RequestBody Map<String,String> map){
  59. List<JxMapVo> jxMapVos = attGnrlBaseService.getzichaEcharsDesc(map.get("adCode"), map.get("ptype"));
  60. return buildSuccessResponse(jxMapVos);
  61. }
  62. }