| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- 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<IPage<TaskStatisticsDto>> 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<TaskStatisticsDto> 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<IPage<TaskStatisticsDto>> 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<TaskStatisticsDto> 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<IPage<TaskStatisticsDto>> 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<TaskStatisticsDto> 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<IPage<TaskStatisticsDto>> 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<TaskStatisticsDto> 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<IPage<TaskStatisticsDto>> totalQuotation(@RequestBody TaskStatisticsVo taskStatisticsVo) {
- try{
- IPage<TaskStatisticsDto> 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<IPage<TaskStatisticsDto>> 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<TaskStatisticsDto> 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<List<TaskStatisticsDto>> 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<TaskStatisticsDto> 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<IPage<BusinessAgentData>> 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<BusinessAgentData> 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<BusinessAgentData> 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<IPage<BusinessAgentData>> getBusinessAgentDataDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
- try{
- IPage<BusinessAgentData> 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<IPage<TaskStatisticsDto>> channelAgentDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
- try{
- IPage<TaskStatisticsDto> result = taskStatisticsService.channelAgentDetails(taskStatisticsVo);
- return HttpResult.ok("查询数据成功", result);
- }catch (Exception e){
- return HttpResult.error("查询错误"+e.getMessage());
- }
- }
- }
|