package com.ydtech.modules.admin.controller.quoteCount; import com.ydtech.core.page.HttpResult; import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto; import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataQueryDto; import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto; import com.ydtech.modules.admin.service.CompanyDataReportService; import com.ydtech.modules.admin.utils.KztGetDeptUtils; import com.ydtech.modules.order.entity.BasePageResult; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; /** * @version * @author: hxl * @Date: 2024/7/30 14:38 * @Description: 报价次数查询 */ @Api(tags = "报价次数") @RequestMapping("/quoteCount") @RestController public class QuoteCountController { @Autowired private CompanyDataReportService companyDataReportService; /** * @version * @author: hxl * @Date: 2024/7/3 15:35 * @Description: 查询报价次数数据 */ @PostMapping("queryCompanyQutationCountDataPage") @ApiOperation(value = "查询报价次数数据") public HttpResult> queryCompanyQutationCountDataPage(@RequestBody CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ companyQutationCountDataQueryDto.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { companyQutationCountDataQueryDto.setUserIds(kztGetDeptUtilsDto.getIds()); } } BasePageResult result = companyDataReportService.queryCompanyQutationCountDataPage(companyQutationCountDataQueryDto); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } }