ScheduleController.java 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. package com.zhongzheng.controller.schedule;
  2. import com.zhongzheng.common.core.controller.BaseController;
  3. import com.zhongzheng.common.core.domain.AjaxResult;
  4. import com.zhongzheng.framework.web.service.AsyncService;
  5. import com.zhongzheng.framework.web.service.WxLoginService;
  6. import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
  7. import com.zhongzheng.modules.grade.service.IClassGradeUserService;
  8. import com.zhongzheng.modules.order.service.IOrderHandleService;
  9. import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
  10. import com.zhongzheng.modules.schedule.service.IScheduleService;
  11. import com.zhongzheng.modules.user.bo.UserQueryBo;
  12. import com.zhongzheng.modules.user.bo.UserWxFollowQueryBo;
  13. import com.zhongzheng.modules.wx.bo.WxLoginBody;
  14. import io.swagger.annotations.Api;
  15. import io.swagger.annotations.ApiOperation;
  16. import lombok.RequiredArgsConstructor;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.web.bind.annotation.GetMapping;
  19. import org.springframework.web.bind.annotation.RequestMapping;
  20. import org.springframework.web.bind.annotation.RestController;
  21. import java.text.ParseException;
  22. import java.util.Arrays;
  23. import java.util.List;
  24. import java.util.Map;
  25. /**
  26. * 定时任务
  27. *
  28. * @author ruoyi
  29. * @date 2021-11-10
  30. */
  31. @Api(value = "定时任务", tags = {"定时任务管理"})
  32. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  33. @RestController
  34. @RequestMapping("/app/common")
  35. public class ScheduleController extends BaseController {
  36. private final IScheduleService iScheduleService;
  37. private final IPolyvLiveService iPolyvLiveService;
  38. private final AsyncService asyncService;
  39. private final WxLoginService wxLoginService;
  40. private final IOrderHandleService iOrderHandleService;
  41. private final IClassGradeUserService iClassGradeUserService;
  42. /**
  43. * 商品购买发送消息
  44. * @return
  45. */
  46. @ApiOperation("商品购买发送消息")
  47. @GetMapping("/updateGoodsSend")
  48. public AjaxResult updateGoodsSend(UserQueryBo bo) {
  49. iScheduleService.updateGoodsSend(bo);
  50. return AjaxResult.success();
  51. }
  52. /**
  53. * 考试提醒
  54. * @return
  55. */
  56. @ApiOperation("考试预约提醒")
  57. @GetMapping("/updateExamSend")
  58. public AjaxResult updateExamSend(UserQueryBo bo) {
  59. iScheduleService.updateExamSend(bo);
  60. return AjaxResult.success();
  61. }
  62. /**
  63. * 考试提醒
  64. * @return
  65. */
  66. @ApiOperation("每天10点请求的考试提醒")
  67. @GetMapping("/timeSend")
  68. public AjaxResult timeSend(UserQueryBo bo) {
  69. iScheduleService.timeSend(bo);
  70. return AjaxResult.success();
  71. }
  72. /**
  73. * 订单超时关闭
  74. * @return
  75. */
  76. @ApiOperation("订单超时关闭")
  77. @GetMapping("/outTimeOrder")
  78. public AjaxResult outTimeOrder() {
  79. iScheduleService.closeTimeOutOrder();
  80. return AjaxResult.success();
  81. }
  82. @ApiOperation("二建服务和班级到期提醒")
  83. @GetMapping("/sendServiceEnd")
  84. public AjaxResult sendServiceEnd() {
  85. iScheduleService.sendServiceEnd();
  86. iScheduleService.sendClassTenAndFifteenEnd();
  87. return AjaxResult.success();
  88. }
  89. /**
  90. * 考试提醒
  91. * @return
  92. */
  93. @ApiOperation("考试预约提醒")
  94. @GetMapping("/issue")
  95. public AjaxResult updateIssue(UserQueryBo bo) throws ParseException {
  96. iScheduleService.updateIssue(bo);
  97. return AjaxResult.success();
  98. }
  99. /**
  100. * 计划更新每晚0点更新
  101. * @return
  102. */
  103. @ApiOperation("计划更新每晚0点更新")
  104. @GetMapping("/UpPlan")
  105. public AjaxResult UpPlan(UserQueryBo bo){
  106. iScheduleService.UpPlan(bo);
  107. return AjaxResult.success();
  108. }
  109. /**
  110. * 计划更新每晚0点更新
  111. * @return
  112. */
  113. @ApiOperation("更新过期时间")
  114. @GetMapping("/UpExam")
  115. public AjaxResult UpExam(UserQueryBo bo){
  116. iScheduleService.UpExam(bo);
  117. return AjaxResult.success();
  118. }
  119. /**
  120. * 商品下架状态更新
  121. * @return
  122. */
  123. @ApiOperation("更新商品下架状态")
  124. @GetMapping("/UpGoods")
  125. public AjaxResult UpGoods(UserQueryBo bo){
  126. iScheduleService.UpGoods(bo);
  127. return AjaxResult.success();
  128. }
  129. /**
  130. * 商品下架状态更新
  131. * @return
  132. */
  133. @ApiOperation("更新考次次数")
  134. @GetMapping("/UpExamNum")
  135. public AjaxResult UpExamNum(UserQueryBo bo){
  136. iScheduleService.UpExamNum(bo);
  137. return AjaxResult.success();
  138. }
  139. /**
  140. * 报考数据绑定前培
  141. * @return
  142. */
  143. @ApiOperation("报考数据绑定前培")
  144. @GetMapping("/bindBefore")
  145. public AjaxResult bindBefore(UserQueryBo bo){
  146. iScheduleService.bindBefore(bo);
  147. return AjaxResult.success();
  148. }
  149. /**
  150. * 官方信息推送
  151. * @return
  152. */
  153. @ApiOperation("定时官方信息推送")
  154. @GetMapping("/officialInfoPush")
  155. public AjaxResult officialInfoPush(UserQueryBo bo){
  156. iScheduleService.officialInfoPush(bo);
  157. return AjaxResult.success();
  158. }
  159. /**
  160. * 官方学时推送
  161. * @return
  162. */
  163. @ApiOperation("定时官方学时推送")
  164. @GetMapping("/officialPeriodPush")
  165. public AjaxResult officialPeriodPush(UserQueryBo bo){
  166. iScheduleService.officialPeriodPush(bo);
  167. return AjaxResult.success();
  168. }
  169. @ApiOperation("直播结束更新学时")
  170. @GetMapping("/overLive")
  171. public AjaxResult overLive(UserQueryBo bo){
  172. iScheduleService.overLive(bo);
  173. return AjaxResult.success();
  174. }
  175. @ApiOperation("保利威直播结束更新回放")
  176. @GetMapping("/liveToReplay")
  177. public AjaxResult liveToReplay(UserQueryBo bo) throws Exception {
  178. iScheduleService.liveToReplay(bo);
  179. return AjaxResult.success();
  180. }
  181. @ApiOperation("同步保利威场次vid")
  182. @GetMapping("/syncToReplay")
  183. public AjaxResult syncToReplay(UserQueryBo bo) throws Exception {
  184. iScheduleService.syncToReplay(bo);
  185. return AjaxResult.success();
  186. }
  187. /**
  188. * 模考预约提醒
  189. * @return
  190. */
  191. @ApiOperation("模考预约提醒")
  192. @GetMapping("/sendMockSubscribe")
  193. public AjaxResult sendMockSubscribe(UserQueryBo bo) {
  194. iScheduleService.sendMockSubscribe(bo);
  195. return AjaxResult.success();
  196. }
  197. /**
  198. * 模考开始提醒
  199. * @return
  200. */
  201. @ApiOperation("模考开始前60分钟提醒")
  202. @GetMapping("/mockTimeSend")
  203. public AjaxResult mockTimeSend(UserQueryBo bo) {
  204. iScheduleService.mockTimeSend(bo);
  205. return AjaxResult.success();
  206. }
  207. /**
  208. * 模考直播提醒
  209. * @return
  210. */
  211. @ApiOperation("模考直播开始前60分钟提醒")
  212. @GetMapping("/mockLiveSend")
  213. public AjaxResult mockLiveSend(UserQueryBo bo) {
  214. iScheduleService.mockLiveSend(bo);
  215. return AjaxResult.success();
  216. }
  217. @ApiOperation("获取关注列表")
  218. @GetMapping("/syncFollowList")
  219. public AjaxResult syncFollowList(){
  220. WxLoginBody loginBody = new WxLoginBody();
  221. wxLoginService.getWxGzhUserList(loginBody.getNextOpenid());
  222. return AjaxResult.success();
  223. }
  224. @ApiOperation("同步union")
  225. @GetMapping("/syncUnion")
  226. public AjaxResult syncUnion(){
  227. UserWxFollowQueryBo bo = new UserWxFollowQueryBo();
  228. asyncService.executeAsync(bo,0);
  229. return AjaxResult.success();
  230. }
  231. @ApiOperation("学生购买2天未学习提醒")
  232. @GetMapping("/buyNotReadToStudentTwo")
  233. public AjaxResult buyNotReadToStudentTwo(UserQueryBo bo){
  234. iScheduleService.buyNotReadToStudentTwo(bo);
  235. return AjaxResult.success();
  236. }
  237. @ApiOperation("学生购买5天未学习提醒")
  238. @GetMapping("/buyNotReadToStudentFive")
  239. public AjaxResult buyNotReadToStudentFive(UserQueryBo bo){
  240. iScheduleService.buyNotReadToStudentFive(bo);
  241. return AjaxResult.success();
  242. }
  243. @ApiOperation("学生购买15天未学习提醒")
  244. @GetMapping("/buyNotReadToStudentFifteen")
  245. public AjaxResult buyNotReadToStudentFifteen(UserQueryBo bo){
  246. iScheduleService.buyNotReadToStudentFifteen(bo);
  247. return AjaxResult.success();
  248. }
  249. @ApiOperation("学生购买30天未学习提醒")
  250. @GetMapping("/buyNotReadToStudentThirty")
  251. public AjaxResult buyNotReadToStudentThirty(UserQueryBo bo){
  252. iScheduleService.buyNotReadToStudentThirty(bo);
  253. return AjaxResult.success();
  254. }
  255. @ApiOperation("学生购买55天未学习提醒")
  256. @GetMapping("/buyNotReadToStudentFiftyFive")
  257. public AjaxResult buyNotReadToStudentFiftyFive(UserQueryBo bo){
  258. iScheduleService.buyNotReadToStudentFiftyFive(bo);
  259. return AjaxResult.success();
  260. }
  261. @ApiOperation("学生购买7天未学习教务提醒")
  262. @GetMapping("/buyNotReadToTeacher")
  263. public AjaxResult buyNotReadToTeacher(UserQueryBo bo){
  264. iScheduleService.buyNotReadToTeacher(bo);
  265. return AjaxResult.success();
  266. }
  267. @ApiOperation("学生购买15天未学习教务提醒")
  268. @GetMapping("/buyNotReadToTeacherFifteen")
  269. public AjaxResult buyNotReadToTeacherFifteen(UserQueryBo bo){
  270. iScheduleService.buyNotReadToTeacherFifteen(bo);
  271. return AjaxResult.success();
  272. }
  273. @ApiOperation("学生购买30天未学习教务提醒")
  274. @GetMapping("/buyNotReadToTeacherThirty")
  275. public AjaxResult buyNotReadToTeacherThirty(UserQueryBo bo){
  276. iScheduleService.buyNotReadToTeacherThirty(bo);
  277. return AjaxResult.success();
  278. }
  279. @ApiOperation("学生购买55天未学习教务提醒")
  280. @GetMapping("/buyNotReadToTeacherFiftyFive")
  281. public AjaxResult buyNotReadToTeacherFiftyFive(UserQueryBo bo){
  282. iScheduleService.buyNotReadToTeacherFiftyFive(bo);
  283. return AjaxResult.success();
  284. }
  285. @ApiOperation("学生长时间3天未学习提醒")
  286. @GetMapping("/longNotReadToStudentThree")
  287. public AjaxResult longNotReadToStudentThree(UserQueryBo bo){
  288. iScheduleService.longNotReadToStudentThree(bo);
  289. return AjaxResult.success();
  290. }
  291. @ApiOperation("学生长时间5天未学习提醒")
  292. @GetMapping("/longNotReadToStudentFive")
  293. public AjaxResult longNotReadToStudentFive(UserQueryBo bo){
  294. iScheduleService.longNotReadToStudentFive(bo);
  295. return AjaxResult.success();
  296. }
  297. @ApiOperation("学生长时间7天未学习教务提醒")
  298. @GetMapping("/longNotReadToTeacher")
  299. public AjaxResult longNotReadToTeacher(UserQueryBo bo){
  300. iScheduleService.longNotReadToTeacher(bo);
  301. return AjaxResult.success();
  302. }
  303. @ApiOperation("同步智慧考场")
  304. @GetMapping("/syncExamSite")
  305. public AjaxResult syncExamSite(UserQueryBo bo){
  306. iScheduleService.wisdomExamSite(bo);
  307. return AjaxResult.success();
  308. }
  309. @ApiOperation("批量同步考试计划用户")
  310. @GetMapping("/syncApplyUserInfo")
  311. public AjaxResult<Map<String,Object>> wisdomSyncApplyUserInfo(ExamApplyQueryBo bo){
  312. return AjaxResult.success(iScheduleService.wisdomSyncApplyUserInfo(bo));
  313. }
  314. @ApiOperation("同步考生考试状态信息")
  315. @GetMapping("/wisdomSyncExamStatus")
  316. public AjaxResult wisdomSyncExamStatus(ExamApplyQueryBo bo){
  317. iScheduleService.wisdomSyncExamStatus(bo);
  318. return AjaxResult.success();
  319. }
  320. @ApiOperation("同步考试视频信息")
  321. @GetMapping("/wisdomSyncExamVideo")
  322. public AjaxResult wisdomSyncExamVideo(ExamApplyQueryBo bo){
  323. iScheduleService.wisdomSyncExamVideo(bo);
  324. return AjaxResult.success();
  325. }
  326. @ApiOperation("手动刷新token")
  327. @GetMapping("/refreshToken")
  328. public AjaxResult refreshToken(UserQueryBo bo){
  329. iScheduleService.refreshToken(bo);
  330. return AjaxResult.success();
  331. }
  332. @ApiOperation("每日一练未打卡提醒")
  333. @GetMapping("/toDayExamNotRecordWarn")
  334. public AjaxResult toDayExamNotRecordWarn(){
  335. iScheduleService.toDayExamNotRecordWarn();
  336. return AjaxResult.success();
  337. }
  338. @ApiOperation("课程试卷未做完3天提醒")
  339. @GetMapping("/noFinishExamToStudentThree")
  340. public AjaxResult noFinishExamToStudentThree(UserQueryBo bo){
  341. iScheduleService.noFinishExamToStudentThree(bo);
  342. return AjaxResult.success();
  343. }
  344. @ApiOperation("课程试卷未做完5天提醒")
  345. @GetMapping("/noFinishExamToStudentFive")
  346. public AjaxResult noFinishExamToStudentFive(UserQueryBo bo){
  347. iScheduleService.noFinishExamToStudentFive(bo);
  348. return AjaxResult.success();
  349. }
  350. @ApiOperation("课程试卷未做完7天提醒")
  351. @GetMapping("/noFinishExamToStudentSeven")
  352. public AjaxResult noFinishExamToStudentSeven(UserQueryBo bo){
  353. iScheduleService.noFinishExamToStudentSeven(bo);
  354. return AjaxResult.success();
  355. }
  356. @ApiOperation("同步机构商品")
  357. @GetMapping("/synchronization/goods")
  358. public AjaxResult synchronizationGoods(){
  359. //湛江云学堂 972001468256950403
  360. //茂名市建设培训学校 680980002459417532
  361. //肇庆市建筑业协会 480813706424615769
  362. // List<String> tenantIds = Arrays.asList("972001468256950403", "680980002459417532", "480813706424615769");
  363. // List<String> tenantIds = Arrays.asList("87440920140968","694515817698614");
  364. // tenantIds.forEach(tenantId -> {
  365. // iScheduleService.synchronizationGoodsByTenantId(tenantId);
  366. // });
  367. return AjaxResult.success();
  368. }
  369. @ApiOperation("处理商品关联")
  370. @GetMapping("/goods/dispose")
  371. public AjaxResult goodsDispose(){
  372. iScheduleService.goodsDispose();
  373. return AjaxResult.success();
  374. }
  375. @ApiOperation("同步一建商品(山西)")
  376. @GetMapping("/goods/copy/one")
  377. public AjaxResult goodsCopyOne(){
  378. iScheduleService.goodsCopyOne();
  379. return AjaxResult.success();
  380. }
  381. @ApiOperation("同步一二建商品")
  382. @GetMapping("/goods/copy/two")
  383. public AjaxResult goodsCopyTwo(){
  384. iScheduleService.goodsCopyTwo();
  385. return AjaxResult.success();
  386. }
  387. @ApiOperation("分销佣金解冻")
  388. @GetMapping("/distributionRebate")
  389. public AjaxResult distributionRebate(UserQueryBo bo){
  390. iScheduleService.distributionRebate();
  391. return AjaxResult.success();
  392. }
  393. @ApiOperation("七大员考场创建")
  394. @GetMapping("/examApply")
  395. public AjaxResult createExamApply(){
  396. iScheduleService.createExamApply();
  397. return AjaxResult.success();
  398. }
  399. @ApiOperation("每日汇总用户学习数据")
  400. @GetMapping("/syncUserDateStudyLog")
  401. public AjaxResult syncUserDateStudyLog(){
  402. iScheduleService.syncUserDateStudyLog();
  403. return AjaxResult.success();
  404. }
  405. @ApiOperation("七大员学员预约下载任务执行")
  406. @GetMapping("/user/download")
  407. public AjaxResult usbUserDownload(){
  408. iScheduleService.usbUserDownload();
  409. return AjaxResult.success();
  410. }
  411. @ApiOperation("经办订单超时关闭")
  412. @GetMapping("/order/closeOverHandle")
  413. public AjaxResult closeOverHandle(){
  414. iOrderHandleService.overTimeCloseOrder();
  415. return AjaxResult.success();
  416. }
  417. @ApiOperation("七大员重推")
  418. @GetMapping("/seven/resetQdyCheckInfo")
  419. public AjaxResult resetQdyCheckInfo(){
  420. iClassGradeUserService.resetQdyCheckInfo();
  421. return AjaxResult.success();
  422. }
  423. @ApiOperation("计算课程总数")
  424. @GetMapping("/order/courseNum")
  425. public AjaxResult orderCourseNum(){
  426. iScheduleService.orderCourseNum();
  427. return AjaxResult.success();
  428. }
  429. @ApiOperation("班级过期提示")
  430. @GetMapping("/class/expiration/reminder")
  431. public AjaxResult classExpirationReminder(){
  432. iScheduleService.classExpirationReminder();
  433. return AjaxResult.success();
  434. }
  435. }