package com.ydtech.modules.admin.controller; import cn.hutool.http.server.HttpServerRequest; import com.ydtech.core.page.HttpResult; import com.ydtech.modules.admin.model.dto.AgreeReportQueryDto; import com.ydtech.modules.admin.model.report.user.agree.AgreeReportDto; import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto; import com.ydtech.modules.admin.service.AgreeReportService; 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; import java.util.List; /** * @version * @author: hxl * @Date: 2024/6/28 8:36 * @Description: 控制台战略合作单位统计 */ @Api(tags = "控制台战略合作单位统计") @RequestMapping("/agreeReport") @RestController public class AgreeReportConroller { @Autowired private AgreeReportService agreeReportService; /** * @version * @author: hxl * @Date: 2024/6/28 8:36 * @Description: 控制台战略合作单位统计 */ @PostMapping("queryPage") @ApiOperation(value = "控制台战略合作单位统计") public HttpResult> queryPage(@RequestBody AgreeReportQueryDto agreeReportQueryDto, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ agreeReportQueryDto.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { agreeReportQueryDto.setUserIds(kztGetDeptUtilsDto.getIds()); } } BasePageResult result = agreeReportService.queryPage(agreeReportQueryDto); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @version * @author: whp * @Date: 2024/7/23 * @Description: 查询保险公司列表 */ @PostMapping("getInsuranceCompany") @ApiOperation(value = "获取保险公司列表") public HttpResult> getInsuranceCompany() { try { List result = agreeReportService.getInsuranceCompany(); return HttpResult.ok("查询数据成功", result); } catch (Exception e) { return HttpResult.error("查询错误" + e.getMessage()); } } }