ScheduleController.java 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  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.polyv.bo.PolyvLiveQueryBo;
  8. import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
  9. import com.zhongzheng.modules.schedule.service.IScheduleService;
  10. import com.zhongzheng.modules.user.bo.UserQueryBo;
  11. import com.zhongzheng.modules.user.bo.UserWxFollowQueryBo;
  12. import com.zhongzheng.modules.user.service.IUserWxFollowService;
  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.security.access.prepost.PreAuthorize;
  19. import org.springframework.web.bind.annotation.*;
  20. import java.text.ParseException;
  21. import java.util.Map;
  22. /**
  23. * 定时任务
  24. *
  25. * @author ruoyi
  26. * @date 2021-11-10
  27. */
  28. @Api(value = "定时任务", tags = {"定时任务管理"})
  29. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  30. @RestController
  31. @RequestMapping("/app/common")
  32. public class ScheduleController extends BaseController {
  33. private final IScheduleService iScheduleService;
  34. private final IPolyvLiveService iPolyvLiveService;
  35. private final AsyncService asyncService;
  36. private final WxLoginService wxLoginService;
  37. /**
  38. * 商品购买发送消息
  39. * @return
  40. */
  41. @ApiOperation("商品购买发送消息")
  42. @GetMapping("/updateGoodsSend")
  43. public AjaxResult updateGoodsSend(UserQueryBo bo) {
  44. iScheduleService.updateGoodsSend(bo);
  45. return AjaxResult.success();
  46. }
  47. /**
  48. * 考试提醒
  49. * @return
  50. */
  51. @ApiOperation("考试预约提醒")
  52. @GetMapping("/updateExamSend")
  53. public AjaxResult updateExamSend(UserQueryBo bo) {
  54. iScheduleService.updateExamSend(bo);
  55. return AjaxResult.success();
  56. }
  57. /**
  58. * 考试提醒
  59. * @return
  60. */
  61. @ApiOperation("每天10点请求的考试提醒")
  62. @GetMapping("/timeSend")
  63. public AjaxResult timeSend(UserQueryBo bo) {
  64. iScheduleService.timeSend(bo);
  65. return AjaxResult.success();
  66. }
  67. /**
  68. * 订单超时关闭
  69. * @return
  70. */
  71. @ApiOperation("订单超时关闭")
  72. @GetMapping("/outTimeOrder")
  73. public AjaxResult outTimeOrder() {
  74. iScheduleService.closeTimeOutOrder();
  75. return AjaxResult.success();
  76. }
  77. /**
  78. * 考试提醒
  79. * @return
  80. */
  81. @ApiOperation("考试预约提醒")
  82. @GetMapping("/issue")
  83. public AjaxResult updateIssue(UserQueryBo bo) throws ParseException {
  84. iScheduleService.updateIssue(bo);
  85. return AjaxResult.success();
  86. }
  87. /**
  88. * 计划更新每晚0点更新
  89. * @return
  90. */
  91. @ApiOperation("计划更新每晚0点更新")
  92. @GetMapping("/UpPlan")
  93. public AjaxResult UpPlan(UserQueryBo bo){
  94. iScheduleService.UpPlan(bo);
  95. return AjaxResult.success();
  96. }
  97. /**
  98. * 计划更新每晚0点更新
  99. * @return
  100. */
  101. @ApiOperation("更新过期时间")
  102. @GetMapping("/UpExam")
  103. public AjaxResult UpExam(UserQueryBo bo){
  104. iScheduleService.UpExam(bo);
  105. return AjaxResult.success();
  106. }
  107. /**
  108. * 商品下架状态更新
  109. * @return
  110. */
  111. @ApiOperation("更新商品下架状态")
  112. @GetMapping("/UpGoods")
  113. public AjaxResult UpGoods(UserQueryBo bo){
  114. iScheduleService.UpGoods(bo);
  115. return AjaxResult.success();
  116. }
  117. /**
  118. * 商品下架状态更新
  119. * @return
  120. */
  121. @ApiOperation("更新考次次数")
  122. @GetMapping("/UpExamNum")
  123. public AjaxResult UpExamNum(UserQueryBo bo){
  124. iScheduleService.UpExamNum(bo);
  125. return AjaxResult.success();
  126. }
  127. /**
  128. * 报考数据绑定前培
  129. * @return
  130. */
  131. @ApiOperation("报考数据绑定前培")
  132. @GetMapping("/bindBefore")
  133. public AjaxResult bindBefore(UserQueryBo bo){
  134. iScheduleService.bindBefore(bo);
  135. return AjaxResult.success();
  136. }
  137. /**
  138. * 官方信息推送
  139. * @return
  140. */
  141. @ApiOperation("定时官方信息推送")
  142. @GetMapping("/officialInfoPush")
  143. public AjaxResult officialInfoPush(UserQueryBo bo){
  144. iScheduleService.officialInfoPush(bo);
  145. return AjaxResult.success();
  146. }
  147. /**
  148. * 官方学时推送
  149. * @return
  150. */
  151. @ApiOperation("定时官方学时推送")
  152. @GetMapping("/officialPeriodPush")
  153. public AjaxResult officialPeriodPush(UserQueryBo bo){
  154. iScheduleService.officialPeriodPush(bo);
  155. return AjaxResult.success();
  156. }
  157. @ApiOperation("直播结束更新学时")
  158. @GetMapping("/overLive")
  159. public AjaxResult overLive(UserQueryBo bo){
  160. iScheduleService.overLive(bo);
  161. return AjaxResult.success();
  162. }
  163. @ApiOperation("保利威直播结束更新回放")
  164. @GetMapping("/liveToReplay")
  165. public AjaxResult liveToReplay(UserQueryBo bo) throws Exception {
  166. iScheduleService.liveToReplay(bo);
  167. return AjaxResult.success();
  168. }
  169. @ApiOperation("同步保利威场次vid")
  170. @GetMapping("/syncToReplay")
  171. public AjaxResult syncToReplay(UserQueryBo bo) throws Exception {
  172. iScheduleService.syncToReplay(bo);
  173. return AjaxResult.success();
  174. }
  175. /**
  176. * 模考预约提醒
  177. * @return
  178. */
  179. @ApiOperation("模考预约提醒")
  180. @GetMapping("/sendMockSubscribe")
  181. public AjaxResult sendMockSubscribe(UserQueryBo bo) {
  182. iScheduleService.sendMockSubscribe(bo);
  183. return AjaxResult.success();
  184. }
  185. /**
  186. * 模考开始提醒
  187. * @return
  188. */
  189. @ApiOperation("模考开始前60分钟提醒")
  190. @GetMapping("/mockTimeSend")
  191. public AjaxResult mockTimeSend(UserQueryBo bo) {
  192. iScheduleService.mockTimeSend(bo);
  193. return AjaxResult.success();
  194. }
  195. /**
  196. * 模考直播提醒
  197. * @return
  198. */
  199. @ApiOperation("模考直播开始前60分钟提醒")
  200. @GetMapping("/mockLiveSend")
  201. public AjaxResult mockLiveSend(UserQueryBo bo) {
  202. iScheduleService.mockLiveSend(bo);
  203. return AjaxResult.success();
  204. }
  205. @ApiOperation("获取关注列表")
  206. @GetMapping("/syncFollowList")
  207. public AjaxResult syncFollowList(){
  208. WxLoginBody loginBody = new WxLoginBody();
  209. wxLoginService.getWxGzhUserList(loginBody.getNextOpenid());
  210. return AjaxResult.success();
  211. }
  212. @ApiOperation("同步union")
  213. @GetMapping("/syncUnion")
  214. public AjaxResult syncUnion(){
  215. UserWxFollowQueryBo bo = new UserWxFollowQueryBo();
  216. asyncService.executeAsync(bo,0);
  217. return AjaxResult.success();
  218. }
  219. @ApiOperation("学生购买2天未学习提醒")
  220. @GetMapping("/buyNotReadToStudentTwo")
  221. public AjaxResult buyNotReadToStudentTwo(UserQueryBo bo){
  222. iScheduleService.buyNotReadToStudentTwo(bo);
  223. return AjaxResult.success();
  224. }
  225. @ApiOperation("学生购买5天未学习提醒")
  226. @GetMapping("/buyNotReadToStudentFive")
  227. public AjaxResult buyNotReadToStudentFive(UserQueryBo bo){
  228. iScheduleService.buyNotReadToStudentFive(bo);
  229. return AjaxResult.success();
  230. }
  231. @ApiOperation("学生购买15天未学习提醒")
  232. @GetMapping("/buyNotReadToStudentFifteen")
  233. public AjaxResult buyNotReadToStudentFifteen(UserQueryBo bo){
  234. iScheduleService.buyNotReadToStudentFifteen(bo);
  235. return AjaxResult.success();
  236. }
  237. @ApiOperation("学生购买30天未学习提醒")
  238. @GetMapping("/buyNotReadToStudentThirty")
  239. public AjaxResult buyNotReadToStudentThirty(UserQueryBo bo){
  240. iScheduleService.buyNotReadToStudentThirty(bo);
  241. return AjaxResult.success();
  242. }
  243. @ApiOperation("学生购买55天未学习提醒")
  244. @GetMapping("/buyNotReadToStudentFiftyFive")
  245. public AjaxResult buyNotReadToStudentFiftyFive(UserQueryBo bo){
  246. iScheduleService.buyNotReadToStudentFiftyFive(bo);
  247. return AjaxResult.success();
  248. }
  249. @ApiOperation("学生购买7天未学习教务提醒")
  250. @GetMapping("/buyNotReadToTeacher")
  251. public AjaxResult buyNotReadToTeacher(UserQueryBo bo){
  252. iScheduleService.buyNotReadToTeacher(bo);
  253. return AjaxResult.success();
  254. }
  255. @ApiOperation("学生购买15天未学习教务提醒")
  256. @GetMapping("/buyNotReadToTeacherFifteen")
  257. public AjaxResult buyNotReadToTeacherFifteen(UserQueryBo bo){
  258. iScheduleService.buyNotReadToTeacherFifteen(bo);
  259. return AjaxResult.success();
  260. }
  261. @ApiOperation("学生购买30天未学习教务提醒")
  262. @GetMapping("/buyNotReadToTeacherThirty")
  263. public AjaxResult buyNotReadToTeacherThirty(UserQueryBo bo){
  264. iScheduleService.buyNotReadToTeacherThirty(bo);
  265. return AjaxResult.success();
  266. }
  267. @ApiOperation("学生购买55天未学习教务提醒")
  268. @GetMapping("/buyNotReadToTeacherFiftyFive")
  269. public AjaxResult buyNotReadToTeacherFiftyFive(UserQueryBo bo){
  270. iScheduleService.buyNotReadToTeacherFiftyFive(bo);
  271. return AjaxResult.success();
  272. }
  273. @ApiOperation("学生长时间3天未学习提醒")
  274. @GetMapping("/longNotReadToStudentThree")
  275. public AjaxResult longNotReadToStudentThree(UserQueryBo bo){
  276. iScheduleService.longNotReadToStudentThree(bo);
  277. return AjaxResult.success();
  278. }
  279. @ApiOperation("学生长时间5天未学习提醒")
  280. @GetMapping("/longNotReadToStudentFive")
  281. public AjaxResult longNotReadToStudentFive(UserQueryBo bo){
  282. iScheduleService.longNotReadToStudentFive(bo);
  283. return AjaxResult.success();
  284. }
  285. @ApiOperation("学生长时间7天未学习教务提醒")
  286. @GetMapping("/longNotReadToTeacher")
  287. public AjaxResult longNotReadToTeacher(UserQueryBo bo){
  288. iScheduleService.longNotReadToTeacher(bo);
  289. return AjaxResult.success();
  290. }
  291. @ApiOperation("同步智慧考场")
  292. @GetMapping("/syncExamSite")
  293. public AjaxResult syncExamSite(UserQueryBo bo){
  294. iScheduleService.wisdomExamSite(bo);
  295. return AjaxResult.success();
  296. }
  297. @ApiOperation("批量同步考试计划用户")
  298. @GetMapping("/syncApplyUserInfo")
  299. public AjaxResult<Map<String,Object>> wisdomSyncApplyUserInfo(ExamApplyQueryBo bo){
  300. return AjaxResult.success(iScheduleService.wisdomSyncApplyUserInfo(bo));
  301. }
  302. @ApiOperation("同步考生考试状态信息")
  303. @GetMapping("/wisdomSyncExamStatus")
  304. public AjaxResult wisdomSyncExamStatus(ExamApplyQueryBo bo){
  305. iScheduleService.wisdomSyncExamStatus(bo);
  306. return AjaxResult.success();
  307. }
  308. @ApiOperation("同步考试视频信息")
  309. @GetMapping("/wisdomSyncExamVideo")
  310. public AjaxResult wisdomSyncExamVideo(ExamApplyQueryBo bo){
  311. iScheduleService.wisdomSyncExamVideo(bo);
  312. return AjaxResult.success();
  313. }
  314. @ApiOperation("手动刷新token")
  315. @GetMapping("/refreshToken")
  316. public AjaxResult refreshToken(UserQueryBo bo){
  317. iScheduleService.refreshToken(bo);
  318. return AjaxResult.success();
  319. }
  320. @ApiOperation("每日一练未打卡提醒")
  321. @GetMapping("/toDayExamNotRecordWarn")
  322. public AjaxResult toDayExamNotRecordWarn(){
  323. iScheduleService.toDayExamNotRecordWarn();
  324. return AjaxResult.success();
  325. }
  326. @ApiOperation("课程试卷未做完3天提醒")
  327. @GetMapping("/noFinishExamToStudentThree")
  328. public AjaxResult noFinishExamToStudentThree(UserQueryBo bo){
  329. iScheduleService.noFinishExamToStudentThree(bo);
  330. return AjaxResult.success();
  331. }
  332. @ApiOperation("课程试卷未做完5天提醒")
  333. @GetMapping("/noFinishExamToStudentFive")
  334. public AjaxResult noFinishExamToStudentFive(UserQueryBo bo){
  335. iScheduleService.noFinishExamToStudentFive(bo);
  336. return AjaxResult.success();
  337. }
  338. @ApiOperation("课程试卷未做完7天提醒")
  339. @GetMapping("/noFinishExamToStudentSeven")
  340. public AjaxResult noFinishExamToStudentSeven(UserQueryBo bo){
  341. iScheduleService.noFinishExamToStudentSeven(bo);
  342. return AjaxResult.success();
  343. }
  344. }