FrontController.java 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. package com.slibra.web.controller.business;
  2. import com.alibaba.fastjson2.JSON;
  3. import com.slibra.business.domain.CAgent;
  4. import com.slibra.business.domain.City;
  5. import com.slibra.business.domain.TCallRecord;
  6. import com.slibra.business.domain.TPumpingStationNeighbourhoodNumber;
  7. import com.slibra.business.mapper.*;
  8. import com.slibra.business.req.AiChatReq;
  9. import com.slibra.business.req.AiChatRes;
  10. import com.slibra.business.res.CallRecordCount;
  11. import com.slibra.business.res.CallUserCountInfo;
  12. import com.slibra.business.res.HomeCountResp;
  13. import com.slibra.business.res.PumpAndNumber;
  14. import com.slibra.business.service.IFrontService;
  15. import com.slibra.business.service.ITCallRecordService;
  16. import com.slibra.business.service.ITNeighborhoodService;
  17. import com.slibra.common.core.controller.BaseController;
  18. import com.slibra.common.core.domain.AjaxResult;
  19. import com.slibra.common.core.domain.R;
  20. import com.slibra.common.core.page.TableDataInfo;
  21. import com.slibra.common.utils.SecurityUtils;
  22. import lombok.extern.slf4j.Slf4j;
  23. import org.springframework.beans.factory.annotation.Autowired;
  24. import org.springframework.web.bind.annotation.*;
  25. import java.util.HashMap;
  26. import java.util.List;
  27. /**
  28. * 前端用户相关接口
  29. */
  30. @RestController
  31. @RequestMapping("/front")
  32. @Slf4j
  33. public class FrontController extends BaseController {
  34. @Autowired
  35. private IFrontService frontService;
  36. @Autowired
  37. private CityMapper cityMapper;
  38. @Autowired
  39. private TCallRecordMapper tCallRecordMapper;
  40. @Autowired
  41. private ITCallRecordService itCallRecordService;
  42. @Autowired
  43. private CAgentMapper cAgentMapper;
  44. @Autowired
  45. private ITCallRecordService tCallRecordService;
  46. /**
  47. * 获取全国省市区接口
  48. * @param city
  49. * @return
  50. */
  51. @GetMapping("/getCities")
  52. public R<List<City>> getCities(City city){
  53. log.info("进入了 获取全国省市区接口 接口,请求参数为{}", JSON.toJSONString(city));
  54. return R.ok(this.cityMapper.selectCityList(city));
  55. }
  56. /**
  57. * 分页获取通话记录
  58. * @param callRecordReq
  59. * @return
  60. */
  61. @GetMapping("/getCallRecordPageList")
  62. public TableDataInfo getCallRecordPageList(TCallRecord callRecordReq)
  63. {
  64. log.info("进入了 分页获取通话记录 接口");
  65. startPage();
  66. return getDataTable(tCallRecordService.selectTCallRecordList(callRecordReq));
  67. }
  68. /**
  69. * 通话统计接口
  70. * @return
  71. */
  72. @GetMapping("/callRecordCountInfo")
  73. public R<CallRecordCount> callRecordCountInfo(){
  74. log.info("进入了 通话统计接口 接口");
  75. return R.ok(this.itCallRecordService.callRecordCountInfo());
  76. }
  77. /**
  78. * 获取某个用户的坐席的outId信息
  79. * 2024年11月25日17:56:32 配置坐席和用户的逻辑调整,不再放到用户里
  80. * @return
  81. */
  82. @GetMapping("/getSeatsByUserId")
  83. public R<HashMap<String, Object>> getSeatsByUserId(Long userId){
  84. log.info("进入了 获取某个用户的坐席的outId信息 接口");
  85. return R.ok(this.cAgentMapper.getSeatsByUserId(userId));
  86. }
  87. /**
  88. * 人工客服统计 接口
  89. * @return
  90. */
  91. @GetMapping("/userCallCount")
  92. public R<List<CallUserCountInfo>> userCallCount(){
  93. log.info("进入了 人工客服统计 接口");
  94. return R.ok(this.itCallRecordService.userCallCount());
  95. }
  96. /**
  97. * 机器人客服统计 接口
  98. * @return
  99. */
  100. @GetMapping("/robotCallCount")
  101. public R<List<CallUserCountInfo>> robotCallCount(){
  102. log.info("进入了 机器人客服统计 接口");
  103. return R.ok(this.itCallRecordService.robotCallCount());
  104. }
  105. //-----------------------------2025年01月16日17:00:52 下面是新增的大屏和统计列表相关接口-----------------------------
  106. /**
  107. * 通过起止时间获取通话记录-统计的分页
  108. * @param callRecordReq
  109. * @return
  110. */
  111. @GetMapping("/callRecordCountPageList")
  112. public TableDataInfo callRecordCountPageList(TCallRecord callRecordReq)
  113. {
  114. log.info("进入了 通过起止时间获取通话记录-统计的分页 接口");
  115. startPage();
  116. return getDataTable(tCallRecordService.callRecordCountPageList(callRecordReq));
  117. }
  118. /**
  119. * 首页大屏统计接口
  120. * @return
  121. */
  122. @GetMapping("/homeScreenCount")
  123. public R<HomeCountResp> homeScreenCount()
  124. {
  125. log.info("进入了 首页大屏统计接口 接口");
  126. return R.ok(tCallRecordService.homeScreenCount());
  127. }
  128. // /**
  129. // * 获取大屏的实时数据 + 统计数据
  130. // * @return
  131. // */
  132. // @GetMapping(value = "/realTimeData")
  133. // public AjaxResult realTimeData()
  134. // {
  135. // log.info("进入了 获取大屏的实时数据 + 统计数据 接口");
  136. // return AjaxResult.success(frontService.countInfo());
  137. // }
  138. //
  139. //
  140. // /**
  141. // * 分页获取大模型的问答记录
  142. // * @param tXinyiChatRecord
  143. // * @return
  144. // */
  145. // @GetMapping("/bigModel/qa/pageList")
  146. // public TableDataInfo qaPageList(TXinyiChatRecord tXinyiChatRecord)
  147. // {
  148. // log.info("进入了 分页获取大模型的问答记录 接口");
  149. // //获取登录用户信息
  150. // Long userId = SecurityUtils.getUserId();
  151. // tXinyiChatRecord.setUserId(String.valueOf(userId));
  152. // startPage();
  153. // return getDataTable(xinyiChatRecordMapper.selectTXinyiChatRecordFirstList(tXinyiChatRecord));
  154. // }
  155. }