TaskStatisticsController.java 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. package com.ydtech.modules.admin.controller.taskStatistics;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import com.github.pagehelper.PageInfo;
  4. import com.ydtech.core.page.HttpResult;
  5. import com.ydtech.modules.admin.model.dto.TaskStatisticsDto;
  6. import com.ydtech.modules.admin.model.dto.TaskStatisticsDtoNew;
  7. import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryDto;
  8. import com.ydtech.modules.admin.model.vo.BusinessAgentData;
  9. import com.ydtech.modules.admin.model.vo.BusinessOrderData;
  10. import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
  11. import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
  12. import com.ydtech.modules.admin.service.TaskStatisticsService;
  13. import com.ydtech.modules.admin.utils.KztGetDeptUtils;
  14. import io.swagger.annotations.*;
  15. import org.apache.commons.lang3.ObjectUtils;
  16. import org.apache.commons.lang3.StringUtils;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.web.bind.annotation.PostMapping;
  19. import org.springframework.web.bind.annotation.RequestBody;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.web.bind.annotation.RestController;
  22. import javax.servlet.http.HttpServletRequest;
  23. import java.util.HashMap;
  24. import java.util.List;
  25. /**
  26. * @description: 任务统计
  27. * @author: whp
  28. * @date: 2024/7/25
  29. **/
  30. @Api(tags = "控制台-任务统计")
  31. @RequestMapping("/taskStatistics")
  32. @RestController
  33. public class TaskStatisticsController {
  34. @Autowired
  35. private TaskStatisticsService taskStatisticsService;
  36. /**
  37. * @description: 渠道任务统计查询
  38. * @author: whp
  39. * @date: 2024/7/25
  40. **/
  41. @PostMapping("queryPage")
  42. @ApiOperation(value = "控制台-渠道任务统计查询")
  43. public HttpResult<IPage<TaskStatisticsDto>> queryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  44. try{
  45. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  46. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  47. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  48. if("1".equals(kztGetDeptUtilsDto.getType())){
  49. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  50. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  51. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  52. }
  53. }
  54. IPage<TaskStatisticsDto> result = taskStatisticsService.queryPage(taskStatisticsVo);
  55. return HttpResult.ok("查询数据成功", result);
  56. }catch (Exception e){
  57. return HttpResult.error("查询错误"+e.getMessage());
  58. }
  59. }
  60. /**
  61. * @param taskStatisticsVo
  62. * @param httpServerRequest
  63. * @return 任务统计明细导出
  64. */
  65. @PostMapping("/ordersDetailsExcel")
  66. @ApiOperation(value = "控制台-任务统计导出")
  67. public HttpResult ordersDetailsExcel(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  68. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  69. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  70. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  71. if("1".equals(kztGetDeptUtilsDto.getType())){
  72. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  73. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  74. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  75. }
  76. }
  77. return this.taskStatisticsService.ordersDetailsExcel(taskStatisticsVo);
  78. }
  79. /**
  80. * @description: 电销任务统计查询
  81. * @author: whp
  82. * @date: 2024/10/11
  83. **/
  84. @PostMapping("queryPageElectric")
  85. @ApiOperation(value = "控制台-电销任务统计查询")
  86. public HttpResult<IPage<TaskStatisticsDto>> queryPageElectric(@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.queryPageElectric(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/10/29
  107. **/
  108. @PostMapping("/electricExcel")
  109. @ApiOperation(value = "任务统计-电销导出")
  110. public HttpResult electricExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  111. return this.taskStatisticsService.electricExcel(taskStatisticsVo);
  112. }
  113. /**
  114. * @description: 保险公司统计查询
  115. * @author: whp
  116. * @date: 2024/7/25
  117. **/
  118. @PostMapping("insuranceCompanyQueryPage")
  119. @ApiOperation(value = "控制台-保险公司统计查询")
  120. public HttpResult<IPage<TaskStatisticsDto>> insuranceCompanyQueryPage(@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.insuranceCompanyQueryPage(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/7/26
  141. **/
  142. @PostMapping("agentStatisticsQueryPage")
  143. @ApiOperation(value = "控制台-代理人统计查询")
  144. public HttpResult<IPage<TaskStatisticsDto>> agentStatisticsQueryPage(@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. IPage<TaskStatisticsDto> result = taskStatisticsService.agentStatisticsQueryPage(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/9/9
  165. **/
  166. @PostMapping("/agentExcel")
  167. @ApiOperation(value = "任务统计-代理人导出")
  168. public HttpResult channelAgentExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  169. return this.taskStatisticsService.agentExcel(taskStatisticsVo);
  170. }
  171. /**
  172. * @description: 财务中心-费用校验
  173. * @author: whp
  174. * @date: 2024/7/29
  175. **/
  176. @PostMapping("costCenter")
  177. @ApiOperation(value = "控制台-财务中心-费用校验")
  178. public HttpResult<IPage<TaskStatisticsDto>> costCenter(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  179. try{
  180. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  181. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  182. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  183. if("1".equals(kztGetDeptUtilsDto.getType())){
  184. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  185. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  186. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  187. }
  188. }
  189. IPage<TaskStatisticsDto> result = taskStatisticsService.costCenter(taskStatisticsVo);
  190. return HttpResult.ok("查询数据成功", result);
  191. }catch (Exception e){
  192. return HttpResult.error("查询错误"+e.getMessage());
  193. }
  194. }
  195. /**
  196. * @description: 财务中心-费用校验 -人员查询
  197. * @author: whp
  198. **/
  199. @PostMapping("costReviewer")
  200. @ApiOperation(value = "控制台-财务中心-费用校验")
  201. public HttpResult<IPage<TaskStatisticsDto>> costReviewer(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  202. try{
  203. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  204. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  205. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  206. if("1".equals(kztGetDeptUtilsDto.getType())){
  207. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  208. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  209. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  210. }
  211. }
  212. IPage<TaskStatisticsDto> result = taskStatisticsService.costReviewer(taskStatisticsVo);
  213. return HttpResult.ok("查询数据成功", result);
  214. }catch (Exception e){
  215. return HttpResult.error("查询错误"+e.getMessage());
  216. }
  217. }
  218. /**
  219. * @description: 财务中心-费用校验-明细
  220. * @author: whp
  221. * @date: 2024/10/10
  222. **/
  223. @PostMapping("costCenterDetails")
  224. @ApiOperation(value = "控制台-财务中心-费用校验详情")
  225. public HttpResult<IPage<TaskStatisticsDto>> costCenterDetails(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  226. try{
  227. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  228. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  229. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  230. if("1".equals(kztGetDeptUtilsDto.getType())){
  231. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  232. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  233. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  234. }
  235. }
  236. IPage<TaskStatisticsDto> result = taskStatisticsService.costCenterDetails(taskStatisticsVo);
  237. return HttpResult.ok("查询数据成功", result);
  238. }catch (Exception e){
  239. return HttpResult.error("查询错误"+e.getMessage());
  240. }
  241. }
  242. /**
  243. * @description: 财务中心-费用校验-明细-查看
  244. * @author: whp
  245. * @date: 2024/10/10
  246. **/
  247. @PostMapping("costCenterDetailsLicense")
  248. @ApiOperation(value = "控制台-财务中心-费用校验详情-查看")
  249. public HttpResult<TaskStatisticsDtoNew> costCenterDetailsLicense(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  250. try{
  251. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  252. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  253. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  254. if("1".equals(kztGetDeptUtilsDto.getType())){
  255. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  256. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  257. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  258. }
  259. }
  260. TaskStatisticsDtoNew result = taskStatisticsService.costCenterDetailsLicense(taskStatisticsVo);
  261. return HttpResult.ok("查询数据成功", result);
  262. }catch (Exception e){
  263. return HttpResult.error("查询错误"+e.getMessage());
  264. }
  265. }
  266. /**
  267. * @description: 任务统计-保险公司-导出
  268. * @author: whp
  269. * @date: 2024/9/9
  270. **/
  271. @PostMapping("/costCenterDetailsExcel")
  272. @ApiOperation(value = "控制台-财务中心-费用校验详情-导出")
  273. public HttpResult costCenterDetailsExcel(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  274. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  275. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  276. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  277. if("1".equals(kztGetDeptUtilsDto.getType())){
  278. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  279. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  280. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  281. }
  282. }
  283. return this.taskStatisticsService.costCenterDetailsExcel(taskStatisticsVo);
  284. }
  285. /**
  286. * @description: 财务中心-费用校验-合计
  287. * @author: whp
  288. * @date: 2024/9/28
  289. **/
  290. @PostMapping("costCenterTotal")
  291. @ApiOperation(value = "财务中心-费用校验-合计")
  292. public HttpResult<HashMap<String,Object>> costCenterTotal(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  293. try{
  294. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  295. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  296. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  297. if("1".equals(kztGetDeptUtilsDto.getType())){
  298. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  299. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  300. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  301. }
  302. }
  303. HashMap<String,Object> result = taskStatisticsService.costCenterTotal(taskStatisticsVo);
  304. return HttpResult.ok("查询数据成功", result);
  305. }catch (Exception e){
  306. return HttpResult.error("查询错误"+e.getMessage());
  307. }
  308. }
  309. /**
  310. * @description: 保险公司统计总报价
  311. * @author: whp
  312. * @date: 2024/8/12
  313. **/
  314. @PostMapping("totalQuotation")
  315. @ApiOperation(value = "控制台-保险公司统计查询")
  316. public HttpResult<IPage<TaskStatisticsDto>> totalQuotation(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  317. try{
  318. IPage<TaskStatisticsDto> result = taskStatisticsService.totalQuotation(taskStatisticsVo);
  319. return HttpResult.ok("查询数据成功", result);
  320. }catch (Exception e){
  321. return HttpResult.error("查询错误"+e.getMessage());
  322. }
  323. }
  324. /**
  325. * @description: 任务统计-保险公司-导出
  326. * @author: whp
  327. * @date: 2024/9/9
  328. **/
  329. @PostMapping("/insuranceCompanyExcel")
  330. @ApiOperation(value = "任务统计-保险公司-导出")
  331. public HttpResult insuranceCompanyExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  332. return this.taskStatisticsService.insuranceCompanyExcel(taskStatisticsVo);
  333. }
  334. /**
  335. * @description: 控制台-业务数据
  336. * @author: whp
  337. * @date: 2024/8/13
  338. **/
  339. @PostMapping("getBusinessData")
  340. @ApiOperation(value = "控制台-业务数据")
  341. public HttpResult<IPage<TaskStatisticsDto>> getBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  342. try{
  343. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  344. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  345. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  346. if("1".equals(kztGetDeptUtilsDto.getType())){
  347. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  348. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  349. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  350. }
  351. }
  352. IPage<TaskStatisticsDto> result = taskStatisticsService.getBusinessData(taskStatisticsVo);
  353. return HttpResult.ok("查询数据成功", result);
  354. }catch (Exception e){
  355. return HttpResult.error("查询错误"+e.getMessage());
  356. }
  357. }
  358. /**
  359. * @description: 控制台 - 业务数据 -保险公司导出
  360. * @author: whp
  361. * @date: 2024/12/13
  362. **/
  363. @PostMapping("/getBusinessDataExcel")
  364. @ApiOperation(value = "任务统计-保险公司导出")
  365. public HttpResult getBusinessDataExcel(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  366. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  367. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  368. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  369. if("1".equals(kztGetDeptUtilsDto.getType())){
  370. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  371. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  372. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  373. }
  374. }
  375. return this.taskStatisticsService.getBusinessDataExcel(taskStatisticsVo);
  376. }
  377. /**
  378. * @description: 控制台-业务数据-统计
  379. * @author: whp
  380. * @date: 2024/10/12
  381. **/
  382. @PostMapping("getCountBusinessData")
  383. @ApiOperation(value = "控制台-业务数据")
  384. public HttpResult<TaskStatisticsDto> getCountBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  385. try{
  386. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  387. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  388. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  389. if("1".equals(kztGetDeptUtilsDto.getType())){
  390. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  391. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  392. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  393. }
  394. }
  395. TaskStatisticsDto result = taskStatisticsService.getCountBusinessData(taskStatisticsVo);
  396. return HttpResult.ok("查询数据成功", result);
  397. }catch (Exception e){
  398. return HttpResult.error("查询错误"+e.getMessage());
  399. }
  400. }
  401. /**
  402. * @description: 控制台-业务数据 - 保险分布
  403. * @author: whp
  404. * @date: 2024/8/13
  405. **/
  406. @PostMapping("getDistribution")
  407. @ApiOperation(value = "控制台-业务数据-保险分布")
  408. public HttpResult<List<TaskStatisticsDto>> getDistribution(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  409. try{
  410. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  411. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  412. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  413. if("1".equals(kztGetDeptUtilsDto.getType())){
  414. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  415. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  416. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  417. }
  418. }
  419. List<TaskStatisticsDto> result = taskStatisticsService.getDistribution(taskStatisticsVo);
  420. return HttpResult.ok("查询数据成功", result);
  421. }catch (Exception e){
  422. return HttpResult.error("查询错误"+e.getMessage());
  423. }
  424. }
  425. /**
  426. * @description: 任务统计-渠道导出
  427. * @author: whp
  428. * @date: 2024/8/13
  429. **/
  430. @PostMapping("/channelExcel")
  431. @ApiOperation(value = "任务统计-渠道导出")
  432. public HttpResult channelExcel(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  433. return this.taskStatisticsService.channelExcel(taskStatisticsVo);
  434. }
  435. /**
  436. * @description: 任控制台-业务数据-代理人
  437. * @author: whp
  438. * @date: 2024/09/09
  439. **/
  440. @PostMapping("getBusinessAgentData")
  441. @ApiOperation(value = "控制台-业务数据-代理人")
  442. public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  443. try{
  444. IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentData(taskStatisticsVo);
  445. return HttpResult.ok("查询数据成功", result);
  446. }catch (Exception e){
  447. return HttpResult.error("查询错误"+e.getMessage());
  448. }
  449. }
  450. /**
  451. * @description: 控制台 - 业务数据 -代理人导出
  452. * @author: whp
  453. * @date: 2024/12/13
  454. **/
  455. @PostMapping("/getBusinessAgentExcel")
  456. @ApiOperation(value = "任务统计-代理人导出")
  457. public HttpResult getBusinessAgentExcel(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  458. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  459. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  460. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  461. if("1".equals(kztGetDeptUtilsDto.getType())){
  462. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  463. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  464. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  465. }
  466. }
  467. return this.taskStatisticsService.getBusinessAgentExcel(taskStatisticsVo);
  468. }
  469. /**
  470. * @description: 控制台 - 业务数据 -渠道导出
  471. * @author: whp
  472. * @date: 2024/12/13
  473. **/
  474. @PostMapping("/getChannelExcel")
  475. @ApiOperation(value = "任务统计-渠道导出")
  476. public HttpResult getChannelExcel(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
  477. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  478. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  479. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  480. if("1".equals(kztGetDeptUtilsDto.getType())){
  481. taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  482. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  483. taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
  484. }
  485. }
  486. return this.taskStatisticsService.getChannelExcel(taskStatisticsVo);
  487. }
  488. /**
  489. * @description: 任控制台-业务数据-渠道
  490. * @author: whp
  491. * @date: 2024/12/05
  492. **/
  493. @PostMapping("getBusinessElectricData")
  494. @ApiOperation(value = "任控制台-业务数据-渠道")
  495. public HttpResult<IPage<BusinessAgentData>> getBusinessElectricData(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  496. try{
  497. IPage<BusinessAgentData> result = taskStatisticsService.getBusinessElectricData(taskStatisticsVo);
  498. return HttpResult.ok("查询数据成功", result);
  499. }catch (Exception e){
  500. return HttpResult.error("查询错误"+e.getMessage());
  501. }
  502. }
  503. /**
  504. * @description: 任控制台-业务数据-代理人-合计
  505. * @author: whp
  506. * @date: 2024/09/09
  507. **/
  508. @PostMapping("getBusinessAgentDataTotal")
  509. @ApiOperation(value = "控制台-业务数据-代理人-合计")
  510. public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  511. try{
  512. BusinessAgentData result = taskStatisticsService.getBusinessAgentDataTotal(taskStatisticsVo);
  513. return HttpResult.ok("查询数据成功", result);
  514. }catch (Exception e){
  515. return HttpResult.error("查询错误"+e.getMessage());
  516. }
  517. }
  518. /**
  519. * @description: 任控制台-业务数据-代理人-合计
  520. * @author: whp
  521. *
  522. **/
  523. @PostMapping("getBusinessElectricDataTotal")
  524. @ApiOperation(value = "控制台-业务数据-渠道-合计")
  525. public HttpResult<BusinessAgentData> getBusinesElectricDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  526. try{
  527. BusinessAgentData result = taskStatisticsService.getBusinessElectricDataTotal(taskStatisticsVo);
  528. return HttpResult.ok("查询数据成功", result);
  529. }catch (Exception e){
  530. return HttpResult.error("查询错误"+e.getMessage());
  531. }
  532. }
  533. /**
  534. * @description: 任控制台-业务数据-代理人-详情
  535. * @author: whp
  536. * @date: 2024/09/10
  537. **/
  538. @PostMapping("getBusinessAgentDataDetails")
  539. @ApiOperation(value = "控制台-业务数据-代理人-详情")
  540. public HttpResult<IPage<BusinessAgentData>> getBusinessAgentDataDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  541. try{
  542. IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentDataDetails(taskStatisticsVo);
  543. return HttpResult.ok("查询数据成功", result);
  544. }catch (Exception e){
  545. return HttpResult.error("查询错误"+e.getMessage());
  546. }
  547. }
  548. /**
  549. *
  550. * @param taskStatisticsVo
  551. * @return 控制台任务统计 渠道代理人详情
  552. */
  553. @PostMapping("channelAgentDetails")
  554. @ApiOperation(value = "控制台任务统计 渠道代理人详情")
  555. public HttpResult<IPage<TaskStatisticsDto>> channelAgentDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  556. try{
  557. IPage<TaskStatisticsDto> result = taskStatisticsService.channelAgentDetails(taskStatisticsVo);
  558. return HttpResult.ok("查询数据成功", result);
  559. }catch (Exception e){
  560. return HttpResult.error("查询错误"+e.getMessage());
  561. }
  562. }
  563. /**
  564. * @description: 任控制台-业务数据-渠道-详情
  565. * @author: hh
  566. * @date: 2024/11/19
  567. **/
  568. @PostMapping("getBusinessOrderDataDetails")
  569. @ApiOperation(value = "控制台-业务数据-电销-订单详情-详情")
  570. public HttpResult<PageInfo<BusinessOrderData>> getBusinessOrderDataDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  571. try {
  572. PageInfo<BusinessOrderData> businessOrderDataDetails = taskStatisticsService.getBusinessOrderDataDetails(taskStatisticsVo);
  573. return HttpResult.ok("查询数据成功", businessOrderDataDetails);
  574. } catch (Exception e) {
  575. return HttpResult.error("查询错误"+e.getMessage());
  576. }
  577. }
  578. /**
  579. * @description: 控制台-业务数据-渠道-订单详情-合计
  580. * @author: hh
  581. * @date: 2024/11/19
  582. **/
  583. @PostMapping("getBusinessOrderDataTotal")
  584. @ApiOperation(value = "控制台-业务数据-电销-订单详情-合计")
  585. public HttpResult<BusinessOrderData> getBusinessOrderDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo) {
  586. try {
  587. BusinessOrderData result = taskStatisticsService.getBusinessOrderDataTotal(taskStatisticsVo);
  588. return HttpResult.ok("查询数据成功", result);
  589. } catch (Exception e) {
  590. return HttpResult.error("查询错误"+e.getMessage());
  591. }
  592. }
  593. }