TaskStatisticsController.java 15 KB

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