package com.ydtech.modules.admin.controller.taskStatistics; import com.baomidou.mybatisplus.core.metadata.IPage; import com.ydtech.core.page.HttpResult; import com.ydtech.modules.admin.model.dto.TaskStatisticsDto; import com.ydtech.modules.admin.model.vo.BusinessAgentData; import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto; import com.ydtech.modules.admin.model.vo.TaskStatisticsVo; import com.ydtech.modules.admin.service.TaskStatisticsService; import com.ydtech.modules.admin.utils.KztGetDeptUtils; import io.swagger.annotations.*; 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; /** * @description: 任务统计 * @author: whp * @date: 2024/7/25 **/ @Api(tags = "控制台-任务统计") @RequestMapping("/taskStatistics") @RestController public class TaskStatisticsController { @Autowired private TaskStatisticsService taskStatisticsService; /** * @description: 渠道任务统计查询 * @author: whp * @date: 2024/7/25 **/ @PostMapping("queryPage") @ApiOperation(value = "控制台-渠道任务统计查询") public HttpResult> queryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds()); } } IPage result = taskStatisticsService.queryPage(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 保险公司统计查询 * @author: whp * @date: 2024/7/25 **/ @PostMapping("insuranceCompanyQueryPage") @ApiOperation(value = "控制台-保险公司统计查询") public HttpResult> insuranceCompanyQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds()); } } IPage result = taskStatisticsService.insuranceCompanyQueryPage(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 代理人统计查询 * @author: whp * @date: 2024/7/26 **/ @PostMapping("agentStatisticsQueryPage") @ApiOperation(value = "控制台-代理人统计查询") public HttpResult> agentStatisticsQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds()); } } IPage result = taskStatisticsService.agentStatisticsQueryPage(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 任务统计-代理人导出 * @author: whp * @date: 2024/9/9 **/ @PostMapping("/agentExcel") @ApiOperation(value = "任务统计-代理人导出") public HttpResult channelAgentExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) { return this.taskStatisticsService.agentExcel(taskStatisticsVo); } /** * @description: 财务中心-费用校验 * @author: whp * @date: 2024/7/29 **/ @PostMapping("costCenter") @ApiOperation(value = "控制台-财务中心-费用校验") public HttpResult> costCenter(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds()); } } IPage result = taskStatisticsService.costCenter(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 保险公司统计总报价 * @author: whp * @date: 2024/8/12 **/ @PostMapping("totalQuotation") @ApiOperation(value = "控制台-保险公司统计查询") public HttpResult> totalQuotation(@RequestBody TaskStatisticsVo taskStatisticsVo) { try{ IPage result = taskStatisticsService.totalQuotation(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 任务统计-保险公司-导出 * @author: whp * @date: 2024/9/9 **/ @PostMapping("/insuranceCompanyExcel") @ApiOperation(value = "任务统计-保险公司-导出") public HttpResult insuranceCompanyExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) { return this.taskStatisticsService.insuranceCompanyExcel(taskStatisticsVo); } /** * @description: 控制台-业务数据 * @author: whp * @date: 2024/8/13 **/ @PostMapping("getBusinessData") @ApiOperation(value = "控制台-业务数据") public HttpResult> getBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds()); } } IPage result = taskStatisticsService.getBusinessData(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 控制台-业务数据 - 保险分布 * @author: whp * @date: 2024/8/13 **/ @PostMapping("getDistribution") @ApiOperation(value = "控制台-业务数据-保险分布") public HttpResult> getDistribution(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds()); } } List result = taskStatisticsService.getDistribution(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 任务统计-渠道导出 * @author: whp * @date: 2024/8/13 **/ @PostMapping("/channelExcel") @ApiOperation(value = "任务统计-渠道导出") public HttpResult channelExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) { return this.taskStatisticsService.channelExcel(taskStatisticsVo); } /** * @description: 任控制台-业务数据-代理人 * @author: whp * @date: 2024/09/09 **/ @PostMapping("getBusinessAgentData") @ApiOperation(value = "控制台-业务数据-代理人") public HttpResult> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds()); } } IPage result = taskStatisticsService.getBusinessAgentData(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 任控制台-业务数据-代理人-合计 * @author: whp * @date: 2024/09/09 **/ @PostMapping("getBusinessAgentDataTotal") @ApiOperation(value = "控制台-业务数据-代理人-合计") public HttpResult getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) { try{ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils(); KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString()); if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){ if("1".equals(kztGetDeptUtilsDto.getType())){ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds()); } else if ("2".equals(kztGetDeptUtilsDto.getType())) { taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds()); } } BusinessAgentData result = taskStatisticsService.getBusinessAgentDataTotal(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * @description: 任控制台-业务数据-代理人-详情 * @author: whp * @date: 2024/09/10 **/ @PostMapping("getBusinessAgentDataDetails") @ApiOperation(value = "控制台-业务数据-代理人-详情") public HttpResult> getBusinessAgentDataDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) { try{ IPage result = taskStatisticsService.getBusinessAgentDataDetails(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } /** * * @param taskStatisticsVo * @return 控制台任务统计 渠道代理人详情 */ @PostMapping("channelAgentDetails") @ApiOperation(value = "控制台任务统计 渠道代理人详情") public HttpResult> channelAgentDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) { try{ IPage result = taskStatisticsService.channelAgentDetails(taskStatisticsVo); return HttpResult.ok("查询数据成功", result); }catch (Exception e){ return HttpResult.error("查询错误"+e.getMessage()); } } }