TaskStatisticsController.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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.dto.TaskStatisticsDtoNew;
  6. import com.ydtech.modules.admin.model.vo.BusinessAgentData;
  7. import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
  8. import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
  9. import com.ydtech.modules.admin.service.TaskStatisticsService;
  10. import com.ydtech.modules.admin.utils.KztGetDeptUtils;
  11. import io.swagger.annotations.*;
  12. import org.apache.commons.lang3.ObjectUtils;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RestController;
  18. import javax.servlet.http.HttpServletRequest;
  19. import java.util.HashMap;
  20. import java.util.List;
  21. /**
  22. * @description: 任务统计
  23. * @author: whp
  24. * @date: 2024/7/25
  25. **/
  26. @Api(tags = "控制台-任务统计")
  27. @RequestMapping("/taskStatistics")
  28. @RestController
  29. public class TaskStatisticsController {
  30. @Autowired
  31. private TaskStatisticsService taskStatisticsService;
  32. /**
  33. * @description: 渠道任务统计查询
  34. * @author: whp
  35. * @date: 2024/7/25
  36. **/
  37. @PostMapping("queryPage")
  38. @ApiOperation(value = "控制台-渠道任务统计查询")
  39. public HttpResult<IPage<TaskStatisticsDto>> queryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  40. try{
  41. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  42. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  43. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  44. if("1".equals(kztGetDeptUtilsDto.getType())){
  45. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  46. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  47. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  48. }
  49. }
  50. IPage<TaskStatisticsDto> result = taskStatisticsService.queryPage(taskStatisticsVo);
  51. return HttpResult.ok("查询数据成功", result);
  52. }catch (Exception e){
  53. return HttpResult.error("查询错误"+e.getMessage());
  54. }
  55. }
  56. /**
  57. * @description: 保险公司统计查询
  58. * @author: whp
  59. * @date: 2024/7/25
  60. **/
  61. @PostMapping("insuranceCompanyQueryPage")
  62. @ApiOperation(value = "控制台-保险公司统计查询")
  63. public HttpResult<IPage<TaskStatisticsDto>> insuranceCompanyQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  64. try{
  65. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  66. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  67. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  68. if("1".equals(kztGetDeptUtilsDto.getType())){
  69. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  70. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  71. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  72. }
  73. }
  74. IPage<TaskStatisticsDto> result = taskStatisticsService.insuranceCompanyQueryPage(taskStatisticsVo);
  75. return HttpResult.ok("查询数据成功", result);
  76. }catch (Exception e){
  77. return HttpResult.error("查询错误"+e.getMessage());
  78. }
  79. }
  80. /**
  81. * @description: 代理人统计查询
  82. * @author: whp
  83. * @date: 2024/7/26
  84. **/
  85. @PostMapping("agentStatisticsQueryPage")
  86. @ApiOperation(value = "控制台-代理人统计查询")
  87. public HttpResult<IPage<TaskStatisticsDto>> agentStatisticsQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  88. try{
  89. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  90. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  91. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  92. if("1".equals(kztGetDeptUtilsDto.getType())){
  93. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  94. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  95. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  96. }
  97. }
  98. IPage<TaskStatisticsDto> result = taskStatisticsService.agentStatisticsQueryPage(taskStatisticsVo);
  99. return HttpResult.ok("查询数据成功", result);
  100. }catch (Exception e){
  101. return HttpResult.error("查询错误"+e.getMessage());
  102. }
  103. }
  104. /**
  105. * @description: 任务统计-代理人导出
  106. * @author: whp
  107. * @date: 2024/9/9
  108. **/
  109. @PostMapping("/agentExcel")
  110. @ApiOperation(value = "任务统计-代理人导出")
  111. public HttpResult channelAgentExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  112. return this.taskStatisticsService.agentExcel(taskStatisticsVo);
  113. }
  114. /**
  115. * @description: 财务中心-费用校验
  116. * @author: whp
  117. * @date: 2024/7/29
  118. **/
  119. @PostMapping("costCenter")
  120. @ApiOperation(value = "控制台-财务中心-费用校验")
  121. public HttpResult<IPage<TaskStatisticsDto>> costCenter(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  122. try{
  123. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  124. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  125. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  126. if("1".equals(kztGetDeptUtilsDto.getType())){
  127. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  128. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  129. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  130. }
  131. }
  132. IPage<TaskStatisticsDto> result = taskStatisticsService.costCenter(taskStatisticsVo);
  133. return HttpResult.ok("查询数据成功", result);
  134. }catch (Exception e){
  135. return HttpResult.error("查询错误"+e.getMessage());
  136. }
  137. }
  138. /**
  139. * @description: 财务中心-费用校验-明细
  140. * @author: whp
  141. * @date: 2024/10/10
  142. **/
  143. @PostMapping("costCenterDetails")
  144. @ApiOperation(value = "控制台-财务中心-费用校验详情")
  145. public HttpResult<IPage<TaskStatisticsDto>> costCenterDetails(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  146. try{
  147. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  148. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  149. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  150. if("1".equals(kztGetDeptUtilsDto.getType())){
  151. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  152. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  153. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  154. }
  155. }
  156. IPage<TaskStatisticsDto> result = taskStatisticsService.costCenterDetails(taskStatisticsVo);
  157. return HttpResult.ok("查询数据成功", result);
  158. }catch (Exception e){
  159. return HttpResult.error("查询错误"+e.getMessage());
  160. }
  161. }
  162. /**
  163. * @description: 财务中心-费用校验-明细-查看
  164. * @author: whp
  165. * @date: 2024/10/10
  166. **/
  167. @PostMapping("costCenterDetailsLicense")
  168. @ApiOperation(value = "控制台-财务中心-费用校验详情-查看")
  169. public HttpResult<TaskStatisticsDtoNew> costCenterDetailsLicense(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  170. try{
  171. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  172. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  173. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  174. if("1".equals(kztGetDeptUtilsDto.getType())){
  175. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  176. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  177. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  178. }
  179. }
  180. TaskStatisticsDtoNew result = taskStatisticsService.costCenterDetailsLicense(taskStatisticsVo);
  181. return HttpResult.ok("查询数据成功", result);
  182. }catch (Exception e){
  183. return HttpResult.error("查询错误"+e.getMessage());
  184. }
  185. }
  186. /**
  187. * @description: 任务统计-保险公司-导出
  188. * @author: whp
  189. * @date: 2024/9/9
  190. **/
  191. @PostMapping("/costCenterDetailsExcel")
  192. @ApiOperation(value = "控制台-财务中心-费用校验详情-导出")
  193. public HttpResult costCenterDetailsExcel(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  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. return this.taskStatisticsService.costCenterDetailsExcel(taskStatisticsVo);
  204. }
  205. /**
  206. * @description: 财务中心-费用校验-合计
  207. * @author: whp
  208. * @date: 2024/9/28
  209. **/
  210. @PostMapping("costCenterTotal")
  211. @ApiOperation(value = "财务中心-费用校验-合计")
  212. public HttpResult<HashMap<String,Object>> costCenterTotal(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  213. try{
  214. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  215. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  216. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  217. if("1".equals(kztGetDeptUtilsDto.getType())){
  218. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  219. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  220. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  221. }
  222. }
  223. HashMap<String,Object> result = taskStatisticsService.costCenterTotal(taskStatisticsVo);
  224. return HttpResult.ok("查询数据成功", result);
  225. }catch (Exception e){
  226. return HttpResult.error("查询错误"+e.getMessage());
  227. }
  228. }
  229. /**
  230. * @description: 保险公司统计总报价
  231. * @author: whp
  232. * @date: 2024/8/12
  233. **/
  234. @PostMapping("totalQuotation")
  235. @ApiOperation(value = "控制台-保险公司统计查询")
  236. public HttpResult<IPage<TaskStatisticsDto>> totalQuotation(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  237. try{
  238. IPage<TaskStatisticsDto> result = taskStatisticsService.totalQuotation(taskStatisticsVo);
  239. return HttpResult.ok("查询数据成功", result);
  240. }catch (Exception e){
  241. return HttpResult.error("查询错误"+e.getMessage());
  242. }
  243. }
  244. /**
  245. * @description: 任务统计-保险公司-导出
  246. * @author: whp
  247. * @date: 2024/9/9
  248. **/
  249. @PostMapping("/insuranceCompanyExcel")
  250. @ApiOperation(value = "任务统计-保险公司-导出")
  251. public HttpResult insuranceCompanyExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  252. return this.taskStatisticsService.insuranceCompanyExcel(taskStatisticsVo);
  253. }
  254. /**
  255. * @description: 控制台-业务数据
  256. * @author: whp
  257. * @date: 2024/8/13
  258. **/
  259. @PostMapping("getBusinessData")
  260. @ApiOperation(value = "控制台-业务数据")
  261. public HttpResult<IPage<TaskStatisticsDto>> getBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  262. try{
  263. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  264. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  265. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  266. if("1".equals(kztGetDeptUtilsDto.getType())){
  267. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  268. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  269. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  270. }
  271. }
  272. IPage<TaskStatisticsDto> result = taskStatisticsService.getBusinessData(taskStatisticsVo);
  273. return HttpResult.ok("查询数据成功", result);
  274. }catch (Exception e){
  275. return HttpResult.error("查询错误"+e.getMessage());
  276. }
  277. }
  278. /**
  279. * @description: 控制台-业务数据 - 保险分布
  280. * @author: whp
  281. * @date: 2024/8/13
  282. **/
  283. @PostMapping("getDistribution")
  284. @ApiOperation(value = "控制台-业务数据-保险分布")
  285. public HttpResult<List<TaskStatisticsDto>> getDistribution(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  286. try{
  287. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  288. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  289. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  290. if("1".equals(kztGetDeptUtilsDto.getType())){
  291. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  292. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  293. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  294. }
  295. }
  296. List<TaskStatisticsDto> result = taskStatisticsService.getDistribution(taskStatisticsVo);
  297. return HttpResult.ok("查询数据成功", result);
  298. }catch (Exception e){
  299. return HttpResult.error("查询错误"+e.getMessage());
  300. }
  301. }
  302. /**
  303. * @description: 任务统计-渠道导出
  304. * @author: whp
  305. * @date: 2024/8/13
  306. **/
  307. @PostMapping("/channelExcel")
  308. @ApiOperation(value = "任务统计-渠道导出")
  309. public HttpResult channelExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  310. return this.taskStatisticsService.channelExcel(taskStatisticsVo);
  311. }
  312. /**
  313. * @description: 任控制台-业务数据-代理人
  314. * @author: whp
  315. * @date: 2024/09/09
  316. **/
  317. @PostMapping("getBusinessAgentData")
  318. @ApiOperation(value = "控制台-业务数据-代理人")
  319. public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  320. try{
  321. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  322. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  323. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  324. if("1".equals(kztGetDeptUtilsDto.getType())){
  325. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  326. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  327. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  328. }
  329. }
  330. IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentData(taskStatisticsVo);
  331. return HttpResult.ok("查询数据成功", result);
  332. }catch (Exception e){
  333. return HttpResult.error("查询错误"+e.getMessage());
  334. }
  335. }
  336. /**
  337. * @description: 任控制台-业务数据-代理人-合计
  338. * @author: whp
  339. * @date: 2024/09/09
  340. **/
  341. @PostMapping("getBusinessAgentDataTotal")
  342. @ApiOperation(value = "控制台-业务数据-代理人-合计")
  343. public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  344. try{
  345. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  346. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  347. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  348. if("1".equals(kztGetDeptUtilsDto.getType())){
  349. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  350. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  351. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  352. }
  353. }
  354. BusinessAgentData result = taskStatisticsService.getBusinessAgentDataTotal(taskStatisticsVo);
  355. return HttpResult.ok("查询数据成功", result);
  356. }catch (Exception e){
  357. return HttpResult.error("查询错误"+e.getMessage());
  358. }
  359. }
  360. /**
  361. * @description: 任控制台-业务数据-代理人-详情
  362. * @author: whp
  363. * @date: 2024/09/10
  364. **/
  365. @PostMapping("getBusinessAgentDataDetails")
  366. @ApiOperation(value = "控制台-业务数据-代理人-详情")
  367. public HttpResult<IPage<BusinessAgentData>> getBusinessAgentDataDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  368. try{
  369. IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentDataDetails(taskStatisticsVo);
  370. return HttpResult.ok("查询数据成功", result);
  371. }catch (Exception e){
  372. return HttpResult.error("查询错误"+e.getMessage());
  373. }
  374. }
  375. /**
  376. *
  377. * @param taskStatisticsVo
  378. * @return 控制台任务统计 渠道代理人详情
  379. */
  380. @PostMapping("channelAgentDetails")
  381. @ApiOperation(value = "控制台任务统计 渠道代理人详情")
  382. public HttpResult<IPage<TaskStatisticsDto>> channelAgentDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  383. try{
  384. IPage<TaskStatisticsDto> result = taskStatisticsService.channelAgentDetails(taskStatisticsVo);
  385. return HttpResult.ok("查询数据成功", result);
  386. }catch (Exception e){
  387. return HttpResult.error("查询错误"+e.getMessage());
  388. }
  389. }
  390. }