AgreeReportConroller.java 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package com.ydtech.modules.admin.controller;
  2. import cn.hutool.http.server.HttpServerRequest;
  3. import com.ydtech.core.page.HttpResult;
  4. import com.ydtech.modules.admin.model.dto.AgreeReportQueryDto;
  5. import com.ydtech.modules.admin.model.report.user.agree.AgreeReportDto;
  6. import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
  7. import com.ydtech.modules.admin.service.AgreeReportService;
  8. import com.ydtech.modules.admin.utils.KztGetDeptUtils;
  9. import com.ydtech.modules.order.entity.BasePageResult;
  10. import io.swagger.annotations.Api;
  11. import io.swagger.annotations.ApiOperation;
  12. import org.apache.commons.lang3.ObjectUtils;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RestController;
  18. import javax.servlet.http.HttpServletRequest;
  19. import java.util.List;
  20. /**
  21. * @version
  22. * @author: hxl
  23. * @Date: 2024/6/28 8:36
  24. * @Description: 控制台战略合作单位统计
  25. */
  26. @Api(tags = "控制台战略合作单位统计")
  27. @RequestMapping("/agreeReport")
  28. @RestController
  29. public class AgreeReportConroller {
  30. @Autowired
  31. private AgreeReportService agreeReportService;
  32. /**
  33. * @version
  34. * @author: hxl
  35. * @Date: 2024/6/28 8:36
  36. * @Description: 控制台战略合作单位统计
  37. */
  38. @PostMapping("queryPage")
  39. @ApiOperation(value = "控制台战略合作单位统计")
  40. public HttpResult<BasePageResult<AgreeReportDto>> queryPage(@RequestBody AgreeReportQueryDto agreeReportQueryDto, HttpServletRequest httpServerRequest) {
  41. try{
  42. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  43. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  44. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  45. if("1".equals(kztGetDeptUtilsDto.getType())){
  46. agreeReportQueryDto.setDeptIds(kztGetDeptUtilsDto.getIds());
  47. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  48. agreeReportQueryDto.setUserIds(kztGetDeptUtilsDto.getIds());
  49. }
  50. }
  51. BasePageResult<AgreeReportDto> result = agreeReportService.queryPage(agreeReportQueryDto);
  52. return HttpResult.ok("查询数据成功", result);
  53. }catch (Exception e){
  54. return HttpResult.error("查询错误"+e.getMessage());
  55. }
  56. }
  57. /**
  58. * @version
  59. * @author: whp
  60. * @Date: 2024/7/23
  61. * @Description: 查询保险公司列表
  62. */
  63. @PostMapping("getInsuranceCompany")
  64. @ApiOperation(value = "获取保险公司列表")
  65. public HttpResult<List<AgreeReportDto>> getInsuranceCompany() {
  66. try {
  67. List<AgreeReportDto> result = agreeReportService.getInsuranceCompany();
  68. return HttpResult.ok("查询数据成功", result);
  69. } catch (Exception e) {
  70. return HttpResult.error("查询错误" + e.getMessage());
  71. }
  72. }
  73. }