ScheduleController.java 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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. /**
  83. * 考试提醒
  84. * @return
  85. */
  86. @ApiOperation("考试预约提醒")
  87. @GetMapping("/issue")
  88. public AjaxResult updateIssue(UserQueryBo bo) throws ParseException {
  89. iScheduleService.updateIssue(bo);
  90. return AjaxResult.success();
  91. }
  92. /**
  93. * 计划更新每晚0点更新
  94. * @return
  95. */
  96. @ApiOperation("计划更新每晚0点更新")
  97. @GetMapping("/UpPlan")
  98. public AjaxResult UpPlan(UserQueryBo bo){
  99. iScheduleService.UpPlan(bo);
  100. return AjaxResult.success();
  101. }
  102. /**
  103. * 计划更新每晚0点更新
  104. * @return
  105. */
  106. @ApiOperation("更新过期时间")
  107. @GetMapping("/UpExam")
  108. public AjaxResult UpExam(UserQueryBo bo){
  109. iScheduleService.UpExam(bo);
  110. return AjaxResult.success();
  111. }
  112. /**
  113. * 商品下架状态更新
  114. * @return
  115. */
  116. @ApiOperation("更新商品下架状态")
  117. @GetMapping("/UpGoods")
  118. public AjaxResult UpGoods(UserQueryBo bo){
  119. iScheduleService.UpGoods(bo);
  120. return AjaxResult.success();
  121. }
  122. /**
  123. * 商品下架状态更新
  124. * @return
  125. */
  126. @ApiOperation("更新考次次数")
  127. @GetMapping("/UpExamNum")
  128. public AjaxResult UpExamNum(UserQueryBo bo){
  129. iScheduleService.UpExamNum(bo);
  130. return AjaxResult.success();
  131. }
  132. /**
  133. * 报考数据绑定前培
  134. * @return
  135. */
  136. @ApiOperation("报考数据绑定前培")
  137. @GetMapping("/bindBefore")
  138. public AjaxResult bindBefore(UserQueryBo bo){
  139. iScheduleService.bindBefore(bo);
  140. return AjaxResult.success();
  141. }
  142. /**
  143. * 官方信息推送
  144. * @return
  145. */
  146. @ApiOperation("定时官方信息推送")
  147. @GetMapping("/officialInfoPush")
  148. public AjaxResult officialInfoPush(UserQueryBo bo){
  149. iScheduleService.officialInfoPush(bo);
  150. return AjaxResult.success();
  151. }
  152. /**
  153. * 官方学时推送
  154. * @return
  155. */
  156. @ApiOperation("定时官方学时推送")
  157. @GetMapping("/officialPeriodPush")
  158. public AjaxResult officialPeriodPush(UserQueryBo bo){
  159. iScheduleService.officialPeriodPush(bo);
  160. return AjaxResult.success();
  161. }
  162. @ApiOperation("直播结束更新学时")
  163. @GetMapping("/overLive")
  164. public AjaxResult overLive(UserQueryBo bo){
  165. iScheduleService.overLive(bo);
  166. return AjaxResult.success();
  167. }
  168. @ApiOperation("保利威直播结束更新回放")
  169. @GetMapping("/liveToReplay")
  170. public AjaxResult liveToReplay(UserQueryBo bo) throws Exception {
  171. iScheduleService.liveToReplay(bo);
  172. return AjaxResult.success();
  173. }
  174. @ApiOperation("同步保利威场次vid")
  175. @GetMapping("/syncToReplay")
  176. public AjaxResult syncToReplay(UserQueryBo bo) throws Exception {
  177. iScheduleService.syncToReplay(bo);
  178. return AjaxResult.success();
  179. }
  180. /**
  181. * 模考预约提醒
  182. * @return
  183. */
  184. @ApiOperation("模考预约提醒")
  185. @GetMapping("/sendMockSubscribe")
  186. public AjaxResult sendMockSubscribe(UserQueryBo bo) {
  187. iScheduleService.sendMockSubscribe(bo);
  188. return AjaxResult.success();
  189. }
  190. /**
  191. * 模考开始提醒
  192. * @return
  193. */
  194. @ApiOperation("模考开始前60分钟提醒")
  195. @GetMapping("/mockTimeSend")
  196. public AjaxResult mockTimeSend(UserQueryBo bo) {
  197. iScheduleService.mockTimeSend(bo);
  198. return AjaxResult.success();
  199. }
  200. /**
  201. * 模考直播提醒
  202. * @return
  203. */
  204. @ApiOperation("模考直播开始前60分钟提醒")
  205. @GetMapping("/mockLiveSend")
  206. public AjaxResult mockLiveSend(UserQueryBo bo) {
  207. iScheduleService.mockLiveSend(bo);
  208. return AjaxResult.success();
  209. }
  210. @ApiOperation("获取关注列表")
  211. @GetMapping("/syncFollowList")
  212. public AjaxResult syncFollowList(){
  213. WxLoginBody loginBody = new WxLoginBody();
  214. wxLoginService.getWxGzhUserList(loginBody.getNextOpenid());
  215. return AjaxResult.success();
  216. }
  217. @ApiOperation("同步union")
  218. @GetMapping("/syncUnion")
  219. public AjaxResult syncUnion(){
  220. UserWxFollowQueryBo bo = new UserWxFollowQueryBo();
  221. asyncService.executeAsync(bo,0);
  222. return AjaxResult.success();
  223. }
  224. @ApiOperation("学生购买2天未学习提醒")
  225. @GetMapping("/buyNotReadToStudentTwo")
  226. public AjaxResult buyNotReadToStudentTwo(UserQueryBo bo){
  227. iScheduleService.buyNotReadToStudentTwo(bo);
  228. return AjaxResult.success();
  229. }
  230. @ApiOperation("学生购买5天未学习提醒")
  231. @GetMapping("/buyNotReadToStudentFive")
  232. public AjaxResult buyNotReadToStudentFive(UserQueryBo bo){
  233. iScheduleService.buyNotReadToStudentFive(bo);
  234. return AjaxResult.success();
  235. }
  236. @ApiOperation("学生购买15天未学习提醒")
  237. @GetMapping("/buyNotReadToStudentFifteen")
  238. public AjaxResult buyNotReadToStudentFifteen(UserQueryBo bo){
  239. iScheduleService.buyNotReadToStudentFifteen(bo);
  240. return AjaxResult.success();
  241. }
  242. @ApiOperation("学生购买30天未学习提醒")
  243. @GetMapping("/buyNotReadToStudentThirty")
  244. public AjaxResult buyNotReadToStudentThirty(UserQueryBo bo){
  245. iScheduleService.buyNotReadToStudentThirty(bo);
  246. return AjaxResult.success();
  247. }
  248. @ApiOperation("学生购买55天未学习提醒")
  249. @GetMapping("/buyNotReadToStudentFiftyFive")
  250. public AjaxResult buyNotReadToStudentFiftyFive(UserQueryBo bo){
  251. iScheduleService.buyNotReadToStudentFiftyFive(bo);
  252. return AjaxResult.success();
  253. }
  254. @ApiOperation("学生购买7天未学习教务提醒")
  255. @GetMapping("/buyNotReadToTeacher")
  256. public AjaxResult buyNotReadToTeacher(UserQueryBo bo){
  257. iScheduleService.buyNotReadToTeacher(bo);
  258. return AjaxResult.success();
  259. }
  260. @ApiOperation("学生购买15天未学习教务提醒")
  261. @GetMapping("/buyNotReadToTeacherFifteen")
  262. public AjaxResult buyNotReadToTeacherFifteen(UserQueryBo bo){
  263. iScheduleService.buyNotReadToTeacherFifteen(bo);
  264. return AjaxResult.success();
  265. }
  266. @ApiOperation("学生购买30天未学习教务提醒")
  267. @GetMapping("/buyNotReadToTeacherThirty")
  268. public AjaxResult buyNotReadToTeacherThirty(UserQueryBo bo){
  269. iScheduleService.buyNotReadToTeacherThirty(bo);
  270. return AjaxResult.success();
  271. }
  272. @ApiOperation("学生购买55天未学习教务提醒")
  273. @GetMapping("/buyNotReadToTeacherFiftyFive")
  274. public AjaxResult buyNotReadToTeacherFiftyFive(UserQueryBo bo){
  275. iScheduleService.buyNotReadToTeacherFiftyFive(bo);
  276. return AjaxResult.success();
  277. }
  278. @ApiOperation("学生长时间3天未学习提醒")
  279. @GetMapping("/longNotReadToStudentThree")
  280. public AjaxResult longNotReadToStudentThree(UserQueryBo bo){
  281. iScheduleService.longNotReadToStudentThree(bo);
  282. return AjaxResult.success();
  283. }
  284. @ApiOperation("学生长时间5天未学习提醒")
  285. @GetMapping("/longNotReadToStudentFive")
  286. public AjaxResult longNotReadToStudentFive(UserQueryBo bo){
  287. iScheduleService.longNotReadToStudentFive(bo);
  288. return AjaxResult.success();
  289. }
  290. @ApiOperation("学生长时间7天未学习教务提醒")
  291. @GetMapping("/longNotReadToTeacher")
  292. public AjaxResult longNotReadToTeacher(UserQueryBo bo){
  293. iScheduleService.longNotReadToTeacher(bo);
  294. return AjaxResult.success();
  295. }
  296. @ApiOperation("同步智慧考场")
  297. @GetMapping("/syncExamSite")
  298. public AjaxResult syncExamSite(UserQueryBo bo){
  299. iScheduleService.wisdomExamSite(bo);
  300. return AjaxResult.success();
  301. }
  302. @ApiOperation("批量同步考试计划用户")
  303. @GetMapping("/syncApplyUserInfo")
  304. public AjaxResult<Map<String,Object>> wisdomSyncApplyUserInfo(ExamApplyQueryBo bo){
  305. return AjaxResult.success(iScheduleService.wisdomSyncApplyUserInfo(bo));
  306. }
  307. @ApiOperation("同步考生考试状态信息")
  308. @GetMapping("/wisdomSyncExamStatus")
  309. public AjaxResult wisdomSyncExamStatus(ExamApplyQueryBo bo){
  310. iScheduleService.wisdomSyncExamStatus(bo);
  311. return AjaxResult.success();
  312. }
  313. @ApiOperation("同步考试视频信息")
  314. @GetMapping("/wisdomSyncExamVideo")
  315. public AjaxResult wisdomSyncExamVideo(ExamApplyQueryBo bo){
  316. iScheduleService.wisdomSyncExamVideo(bo);
  317. return AjaxResult.success();
  318. }
  319. @ApiOperation("手动刷新token")
  320. @GetMapping("/refreshToken")
  321. public AjaxResult refreshToken(UserQueryBo bo){
  322. iScheduleService.refreshToken(bo);
  323. return AjaxResult.success();
  324. }
  325. @ApiOperation("每日一练未打卡提醒")
  326. @GetMapping("/toDayExamNotRecordWarn")
  327. public AjaxResult toDayExamNotRecordWarn(){
  328. iScheduleService.toDayExamNotRecordWarn();
  329. return AjaxResult.success();
  330. }
  331. @ApiOperation("课程试卷未做完3天提醒")
  332. @GetMapping("/noFinishExamToStudentThree")
  333. public AjaxResult noFinishExamToStudentThree(UserQueryBo bo){
  334. iScheduleService.noFinishExamToStudentThree(bo);
  335. return AjaxResult.success();
  336. }
  337. @ApiOperation("课程试卷未做完5天提醒")
  338. @GetMapping("/noFinishExamToStudentFive")
  339. public AjaxResult noFinishExamToStudentFive(UserQueryBo bo){
  340. iScheduleService.noFinishExamToStudentFive(bo);
  341. return AjaxResult.success();
  342. }
  343. @ApiOperation("课程试卷未做完7天提醒")
  344. @GetMapping("/noFinishExamToStudentSeven")
  345. public AjaxResult noFinishExamToStudentSeven(UserQueryBo bo){
  346. iScheduleService.noFinishExamToStudentSeven(bo);
  347. return AjaxResult.success();
  348. }
  349. @ApiOperation("同步机构商品")
  350. @GetMapping("/synchronization/goods")
  351. public AjaxResult synchronizationGoods(){
  352. //湛江云学堂 972001468256950403
  353. //茂名市建设培训学校 680980002459417532
  354. //肇庆市建筑业协会 480813706424615769
  355. // List<String> tenantIds = Arrays.asList("972001468256950403", "680980002459417532", "480813706424615769");
  356. List<String> tenantIds = Arrays.asList("87440920140968","694515817698614");
  357. tenantIds.forEach(tenantId -> {
  358. iScheduleService.synchronizationGoodsByTenantId(tenantId);
  359. });
  360. return AjaxResult.success();
  361. }
  362. @ApiOperation("处理商品关联")
  363. @GetMapping("/goods/dispose")
  364. public AjaxResult goodsDispose(){
  365. iScheduleService.goodsDispose();
  366. return AjaxResult.success();
  367. }
  368. @ApiOperation("同步一建商品(山西)")
  369. @GetMapping("/goods/copy/one")
  370. public AjaxResult goodsCopyOne(){
  371. iScheduleService.goodsCopyOne();
  372. return AjaxResult.success();
  373. }
  374. @ApiOperation("同步一二建商品")
  375. @GetMapping("/goods/copy/two")
  376. public AjaxResult goodsCopyTwo(){
  377. iScheduleService.goodsCopyTwo();
  378. return AjaxResult.success();
  379. }
  380. @ApiOperation("分销佣金解冻")
  381. @GetMapping("/distributionRebate")
  382. public AjaxResult distributionRebate(UserQueryBo bo){
  383. iScheduleService.distributionRebate();
  384. return AjaxResult.success();
  385. }
  386. @ApiOperation("七大员考场创建")
  387. @GetMapping("/examApply")
  388. public AjaxResult createExamApply(){
  389. iScheduleService.createExamApply();
  390. return AjaxResult.success();
  391. }
  392. @ApiOperation("每日汇总用户学习数据")
  393. @GetMapping("/syncUserDateStudyLog")
  394. public AjaxResult syncUserDateStudyLog(){
  395. iScheduleService.syncUserDateStudyLog();
  396. return AjaxResult.success();
  397. }
  398. @ApiOperation("七大员学员预约下载任务执行")
  399. @GetMapping("/user/download")
  400. public AjaxResult usbUserDownload(){
  401. iScheduleService.usbUserDownload();
  402. return AjaxResult.success();
  403. }
  404. @ApiOperation("经办订单超时关闭")
  405. @GetMapping("/order/closeOverHandle")
  406. public AjaxResult closeOverHandle(){
  407. iOrderHandleService.overTimeCloseOrder();
  408. return AjaxResult.success();
  409. }
  410. @ApiOperation("七大员重推")
  411. @GetMapping("/seven/resetQdyCheckInfo")
  412. public AjaxResult resetQdyCheckInfo(){
  413. iClassGradeUserService.resetQdyCheckInfo();
  414. return AjaxResult.success();
  415. }
  416. }