QuoteCountController.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package com.ydtech.modules.admin.controller.quoteCount;
  2. import com.ydtech.core.page.HttpResult;
  3. import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto;
  4. import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataQueryDto;
  5. import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
  6. import com.ydtech.modules.admin.service.CompanyDataReportService;
  7. import com.ydtech.modules.admin.utils.KztGetDeptUtils;
  8. import com.ydtech.modules.order.entity.BasePageResult;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.apache.commons.lang3.ObjectUtils;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.PostMapping;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import javax.servlet.http.HttpServletRequest;
  18. /**
  19. * @version
  20. * @author: hxl
  21. * @Date: 2024/7/30 14:38
  22. * @Description: 报价次数查询
  23. */
  24. @Api(tags = "报价次数")
  25. @RequestMapping("/quoteCount")
  26. @RestController
  27. public class QuoteCountController {
  28. @Autowired
  29. private CompanyDataReportService companyDataReportService;
  30. /**
  31. * @version
  32. * @author: hxl
  33. * @Date: 2024/7/3 15:35
  34. * @Description: 查询报价次数数据
  35. */
  36. @PostMapping("queryCompanyQutationCountDataPage")
  37. @ApiOperation(value = "查询报价次数数据")
  38. public HttpResult<BasePageResult<CompanyQutationCountDataDto>> queryCompanyQutationCountDataPage(@RequestBody CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto, HttpServletRequest httpServerRequest) {
  39. try{
  40. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  41. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  42. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  43. if("1".equals(kztGetDeptUtilsDto.getType())){
  44. companyQutationCountDataQueryDto.setDeptIds(kztGetDeptUtilsDto.getIds());
  45. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  46. companyQutationCountDataQueryDto.setUserIds(kztGetDeptUtilsDto.getIds());
  47. }
  48. }
  49. BasePageResult<CompanyQutationCountDataDto> result = companyDataReportService.queryCompanyQutationCountDataPage(companyQutationCountDataQueryDto);
  50. return HttpResult.ok("查询数据成功", result);
  51. }catch (Exception e){
  52. return HttpResult.error("查询错误"+e.getMessage());
  53. }
  54. }
  55. }