TaskStatisticsController.java 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. package com.ydtech.modules.admin.controller.taskStatistics;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import com.ydtech.core.page.HttpResult;
  4. import com.ydtech.modules.admin.model.dto.TaskStatisticsDto;
  5. import com.ydtech.modules.admin.model.vo.BusinessAgentData;
  6. import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
  7. import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
  8. import com.ydtech.modules.admin.service.TaskStatisticsService;
  9. import com.ydtech.modules.admin.utils.KztGetDeptUtils;
  10. import io.swagger.annotations.*;
  11. import org.apache.commons.lang3.ObjectUtils;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.PostMapping;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import javax.servlet.http.HttpServletRequest;
  18. import java.util.List;
  19. /**
  20. * @description: 任务统计
  21. * @author: whp
  22. * @date: 2024/7/25
  23. **/
  24. @Api(tags = "控制台-任务统计")
  25. @RequestMapping("/taskStatistics")
  26. @RestController
  27. public class TaskStatisticsController {
  28. @Autowired
  29. private TaskStatisticsService taskStatisticsService;
  30. /**
  31. * @description: 渠道任务统计查询
  32. * @author: whp
  33. * @date: 2024/7/25
  34. **/
  35. @PostMapping("queryPage")
  36. @ApiOperation(value = "控制台-渠道任务统计查询")
  37. public HttpResult<IPage<TaskStatisticsDto>> queryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  38. try{
  39. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  40. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  41. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  42. if("1".equals(kztGetDeptUtilsDto.getType())){
  43. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  44. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  45. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  46. }
  47. }
  48. IPage<TaskStatisticsDto> result = taskStatisticsService.queryPage(taskStatisticsVo);
  49. return HttpResult.ok("查询数据成功", result);
  50. }catch (Exception e){
  51. return HttpResult.error("查询错误"+e.getMessage());
  52. }
  53. }
  54. /**
  55. * @description: 保险公司统计查询
  56. * @author: whp
  57. * @date: 2024/7/25
  58. **/
  59. @PostMapping("insuranceCompanyQueryPage")
  60. @ApiOperation(value = "控制台-保险公司统计查询")
  61. public HttpResult<IPage<TaskStatisticsDto>> insuranceCompanyQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  62. try{
  63. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  64. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  65. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  66. if("1".equals(kztGetDeptUtilsDto.getType())){
  67. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  68. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  69. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  70. }
  71. }
  72. IPage<TaskStatisticsDto> result = taskStatisticsService.insuranceCompanyQueryPage(taskStatisticsVo);
  73. return HttpResult.ok("查询数据成功", result);
  74. }catch (Exception e){
  75. return HttpResult.error("查询错误"+e.getMessage());
  76. }
  77. }
  78. /**
  79. * @description: 代理人统计查询
  80. * @author: whp
  81. * @date: 2024/7/26
  82. **/
  83. @PostMapping("agentStatisticsQueryPage")
  84. @ApiOperation(value = "控制台-代理人统计查询")
  85. public HttpResult<IPage<TaskStatisticsDto>> agentStatisticsQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  86. try{
  87. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  88. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  89. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  90. if("1".equals(kztGetDeptUtilsDto.getType())){
  91. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  92. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  93. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  94. }
  95. }
  96. IPage<TaskStatisticsDto> result = taskStatisticsService.agentStatisticsQueryPage(taskStatisticsVo);
  97. return HttpResult.ok("查询数据成功", result);
  98. }catch (Exception e){
  99. return HttpResult.error("查询错误"+e.getMessage());
  100. }
  101. }
  102. /**
  103. * @description: 任务统计-代理人导出
  104. * @author: whp
  105. * @date: 2024/9/9
  106. **/
  107. @PostMapping("/agentExcel")
  108. @ApiOperation(value = "任务统计-代理人导出")
  109. public HttpResult channelAgentExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  110. return this.taskStatisticsService.agentExcel(taskStatisticsVo);
  111. }
  112. /**
  113. * @description: 财务中心-费用校验
  114. * @author: whp
  115. * @date: 2024/7/29
  116. **/
  117. @PostMapping("costCenter")
  118. @ApiOperation(value = "控制台-财务中心-费用校验")
  119. public HttpResult<IPage<TaskStatisticsDto>> costCenter(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  120. try{
  121. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  122. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  123. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  124. if("1".equals(kztGetDeptUtilsDto.getType())){
  125. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  126. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  127. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  128. }
  129. }
  130. IPage<TaskStatisticsDto> result = taskStatisticsService.costCenter(taskStatisticsVo);
  131. return HttpResult.ok("查询数据成功", result);
  132. }catch (Exception e){
  133. return HttpResult.error("查询错误"+e.getMessage());
  134. }
  135. }
  136. /**
  137. * @description: 保险公司统计总报价
  138. * @author: whp
  139. * @date: 2024/8/12
  140. **/
  141. @PostMapping("totalQuotation")
  142. @ApiOperation(value = "控制台-保险公司统计查询")
  143. public HttpResult<IPage<TaskStatisticsDto>> totalQuotation(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  144. try{
  145. IPage<TaskStatisticsDto> result = taskStatisticsService.totalQuotation(taskStatisticsVo);
  146. return HttpResult.ok("查询数据成功", result);
  147. }catch (Exception e){
  148. return HttpResult.error("查询错误"+e.getMessage());
  149. }
  150. }
  151. /**
  152. * @description: 任务统计-保险公司-导出
  153. * @author: whp
  154. * @date: 2024/9/9
  155. **/
  156. @PostMapping("/insuranceCompanyExcel")
  157. @ApiOperation(value = "任务统计-保险公司-导出")
  158. public HttpResult insuranceCompanyExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  159. return this.taskStatisticsService.insuranceCompanyExcel(taskStatisticsVo);
  160. }
  161. /**
  162. * @description: 控制台-业务数据
  163. * @author: whp
  164. * @date: 2024/8/13
  165. **/
  166. @PostMapping("getBusinessData")
  167. @ApiOperation(value = "控制台-业务数据")
  168. public HttpResult<IPage<TaskStatisticsDto>> getBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  169. try{
  170. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  171. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  172. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  173. if("1".equals(kztGetDeptUtilsDto.getType())){
  174. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  175. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  176. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  177. }
  178. }
  179. IPage<TaskStatisticsDto> result = taskStatisticsService.getBusinessData(taskStatisticsVo);
  180. return HttpResult.ok("查询数据成功", result);
  181. }catch (Exception e){
  182. return HttpResult.error("查询错误"+e.getMessage());
  183. }
  184. }
  185. /**
  186. * @description: 控制台-业务数据 - 保险分布
  187. * @author: whp
  188. * @date: 2024/8/13
  189. **/
  190. @PostMapping("getDistribution")
  191. @ApiOperation(value = "控制台-业务数据-保险分布")
  192. public HttpResult<List<TaskStatisticsDto>> getDistribution(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  193. try{
  194. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  195. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  196. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  197. if("1".equals(kztGetDeptUtilsDto.getType())){
  198. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  199. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  200. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  201. }
  202. }
  203. List<TaskStatisticsDto> result = taskStatisticsService.getDistribution(taskStatisticsVo);
  204. return HttpResult.ok("查询数据成功", result);
  205. }catch (Exception e){
  206. return HttpResult.error("查询错误"+e.getMessage());
  207. }
  208. }
  209. /**
  210. * @description: 任务统计-渠道导出
  211. * @author: whp
  212. * @date: 2024/8/13
  213. **/
  214. @PostMapping("/channelExcel")
  215. @ApiOperation(value = "任务统计-渠道导出")
  216. public HttpResult channelExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  217. return this.taskStatisticsService.channelExcel(taskStatisticsVo);
  218. }
  219. /**
  220. * @description: 任控制台-业务数据-代理人
  221. * @author: whp
  222. * @date: 2024/09/09
  223. **/
  224. @PostMapping("getBusinessAgentData")
  225. @ApiOperation(value = "控制台-业务数据-代理人")
  226. public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  227. try{
  228. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  229. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  230. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  231. if("1".equals(kztGetDeptUtilsDto.getType())){
  232. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  233. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  234. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  235. }
  236. }
  237. IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentData(taskStatisticsVo);
  238. return HttpResult.ok("查询数据成功", result);
  239. }catch (Exception e){
  240. return HttpResult.error("查询错误"+e.getMessage());
  241. }
  242. }
  243. /**
  244. * @description: 任控制台-业务数据-代理人-合计
  245. * @author: whp
  246. * @date: 2024/09/09
  247. **/
  248. @PostMapping("getBusinessAgentDataTotal")
  249. @ApiOperation(value = "控制台-业务数据-代理人-合计")
  250. public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  251. try{
  252. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  253. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  254. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  255. if("1".equals(kztGetDeptUtilsDto.getType())){
  256. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  257. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  258. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  259. }
  260. }
  261. BusinessAgentData result = taskStatisticsService.getBusinessAgentDataTotal(taskStatisticsVo);
  262. return HttpResult.ok("查询数据成功", result);
  263. }catch (Exception e){
  264. return HttpResult.error("查询错误"+e.getMessage());
  265. }
  266. }
  267. /**
  268. * @description: 任控制台-业务数据-代理人-详情
  269. * @author: whp
  270. * @date: 2024/09/10
  271. **/
  272. @PostMapping("getBusinessAgentDataDetails")
  273. @ApiOperation(value = "控制台-业务数据-代理人-详情")
  274. public HttpResult<IPage<BusinessAgentData>> getBusinessAgentDataDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  275. try{
  276. IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentDataDetails(taskStatisticsVo);
  277. return HttpResult.ok("查询数据成功", result);
  278. }catch (Exception e){
  279. return HttpResult.error("查询错误"+e.getMessage());
  280. }
  281. }
  282. /**
  283. *
  284. * @param taskStatisticsVo
  285. * @return 控制台任务统计 渠道代理人详情
  286. */
  287. @PostMapping("channelAgentDetails")
  288. @ApiOperation(value = "控制台任务统计 渠道代理人详情")
  289. public HttpResult<IPage<TaskStatisticsDto>> channelAgentDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  290. try{
  291. IPage<TaskStatisticsDto> result = taskStatisticsService.channelAgentDetails(taskStatisticsVo);
  292. return HttpResult.ok("查询数据成功", result);
  293. }catch (Exception e){
  294. return HttpResult.error("查询错误"+e.getMessage());
  295. }
  296. }
  297. }