ScheduleController.java 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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.polyv.bo.PolyvLiveQueryBo;
  7. import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
  8. import com.zhongzheng.modules.schedule.service.IScheduleService;
  9. import com.zhongzheng.modules.user.bo.UserQueryBo;
  10. import com.zhongzheng.modules.user.bo.UserWxFollowQueryBo;
  11. import com.zhongzheng.modules.user.service.IUserWxFollowService;
  12. import com.zhongzheng.modules.wx.bo.WxLoginBody;
  13. import io.swagger.annotations.Api;
  14. import io.swagger.annotations.ApiOperation;
  15. import lombok.RequiredArgsConstructor;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.security.access.prepost.PreAuthorize;
  18. import org.springframework.web.bind.annotation.*;
  19. import java.text.ParseException;
  20. /**
  21. * 定时任务
  22. *
  23. * @author ruoyi
  24. * @date 2021-11-10
  25. */
  26. @Api(value = "定时任务", tags = {"定时任务管理"})
  27. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  28. @RestController
  29. @RequestMapping("/app/common")
  30. public class ScheduleController extends BaseController {
  31. private final IScheduleService iScheduleService;
  32. private final IPolyvLiveService iPolyvLiveService;
  33. private final AsyncService asyncService;
  34. private final WxLoginService wxLoginService;
  35. /**
  36. * 商品购买发送消息
  37. * @return
  38. */
  39. @ApiOperation("商品购买发送消息")
  40. @GetMapping("/updateGoodsSend")
  41. public AjaxResult updateGoodsSend(UserQueryBo bo) {
  42. iScheduleService.updateGoodsSend(bo);
  43. return AjaxResult.success();
  44. }
  45. /**
  46. * 考试提醒
  47. * @return
  48. */
  49. @ApiOperation("考试预约提醒")
  50. @GetMapping("/updateExamSend")
  51. public AjaxResult updateExamSend(UserQueryBo bo) {
  52. iScheduleService.updateExamSend(bo);
  53. return AjaxResult.success();
  54. }
  55. /**
  56. * 考试提醒
  57. * @return
  58. */
  59. @ApiOperation("每天10点请求的考试提醒")
  60. @GetMapping("/timeSend")
  61. public AjaxResult timeSend(UserQueryBo bo) {
  62. iScheduleService.timeSend(bo);
  63. return AjaxResult.success();
  64. }
  65. /**
  66. * 订单超时关闭
  67. * @return
  68. */
  69. @ApiOperation("订单超时关闭")
  70. @GetMapping("/outTimeOrder")
  71. public AjaxResult outTimeOrder() {
  72. iScheduleService.closeTimeOutOrder();
  73. return AjaxResult.success();
  74. }
  75. /**
  76. * 考试提醒
  77. * @return
  78. */
  79. @ApiOperation("考试预约提醒")
  80. @GetMapping("/issue")
  81. public AjaxResult updateIssue(UserQueryBo bo) throws ParseException {
  82. iScheduleService.updateIssue(bo);
  83. return AjaxResult.success();
  84. }
  85. /**
  86. * 计划更新每晚0点更新
  87. * @return
  88. */
  89. @ApiOperation("计划更新每晚0点更新")
  90. @GetMapping("/UpPlan")
  91. public AjaxResult UpPlan(UserQueryBo bo){
  92. iScheduleService.UpPlan(bo);
  93. return AjaxResult.success();
  94. }
  95. /**
  96. * 计划更新每晚0点更新
  97. * @return
  98. */
  99. @ApiOperation("更新过期时间")
  100. @GetMapping("/UpExam")
  101. public AjaxResult UpExam(UserQueryBo bo){
  102. iScheduleService.UpExam(bo);
  103. return AjaxResult.success();
  104. }
  105. /**
  106. * 商品下架状态更新
  107. * @return
  108. */
  109. @ApiOperation("更新商品下架状态")
  110. @GetMapping("/UpGoods")
  111. public AjaxResult UpGoods(UserQueryBo bo){
  112. iScheduleService.UpGoods(bo);
  113. return AjaxResult.success();
  114. }
  115. /**
  116. * 商品下架状态更新
  117. * @return
  118. */
  119. @ApiOperation("更新考次次数")
  120. @GetMapping("/UpExamNum")
  121. public AjaxResult UpExamNum(UserQueryBo bo){
  122. iScheduleService.UpExamNum(bo);
  123. return AjaxResult.success();
  124. }
  125. /**
  126. * 报考数据绑定前培
  127. * @return
  128. */
  129. @ApiOperation("报考数据绑定前培")
  130. @GetMapping("/bindBefore")
  131. public AjaxResult bindBefore(UserQueryBo bo){
  132. iScheduleService.bindBefore(bo);
  133. return AjaxResult.success();
  134. }
  135. /**
  136. * 官方信息推送
  137. * @return
  138. */
  139. @ApiOperation("定时官方信息推送")
  140. @GetMapping("/officialInfoPush")
  141. public AjaxResult officialInfoPush(UserQueryBo bo){
  142. iScheduleService.officialInfoPush(bo);
  143. return AjaxResult.success();
  144. }
  145. /**
  146. * 官方学时推送
  147. * @return
  148. */
  149. @ApiOperation("定时官方学时推送")
  150. @GetMapping("/officialPeriodPush")
  151. public AjaxResult officialPeriodPush(UserQueryBo bo){
  152. iScheduleService.officialPeriodPush(bo);
  153. return AjaxResult.success();
  154. }
  155. @ApiOperation("直播结束更新学时")
  156. @GetMapping("/overLive")
  157. public AjaxResult overLive(UserQueryBo bo){
  158. iScheduleService.overLive(bo);
  159. return AjaxResult.success();
  160. }
  161. @ApiOperation("保利威直播结束更新回放")
  162. @GetMapping("/liveToReplay")
  163. public AjaxResult liveToReplay(UserQueryBo bo) throws Exception {
  164. iScheduleService.liveToReplay(bo);
  165. return AjaxResult.success();
  166. }
  167. @ApiOperation("同步保利威场次vid")
  168. @GetMapping("/syncToReplay")
  169. public AjaxResult syncToReplay(UserQueryBo bo) throws Exception {
  170. iScheduleService.syncToReplay(bo);
  171. return AjaxResult.success();
  172. }
  173. /**
  174. * 模考预约提醒
  175. * @return
  176. */
  177. @ApiOperation("模考预约提醒")
  178. @GetMapping("/sendMockSubscribe")
  179. public AjaxResult sendMockSubscribe(UserQueryBo bo) {
  180. iScheduleService.sendMockSubscribe(bo);
  181. return AjaxResult.success();
  182. }
  183. /**
  184. * 模考开始提醒
  185. * @return
  186. */
  187. @ApiOperation("模考开始前60分钟提醒")
  188. @GetMapping("/mockTimeSend")
  189. public AjaxResult mockTimeSend(UserQueryBo bo) {
  190. iScheduleService.mockTimeSend(bo);
  191. return AjaxResult.success();
  192. }
  193. /**
  194. * 模考直播提醒
  195. * @return
  196. */
  197. @ApiOperation("模考直播开始前60分钟提醒")
  198. @GetMapping("/mockLiveSend")
  199. public AjaxResult mockLiveSend(UserQueryBo bo) {
  200. iScheduleService.mockLiveSend(bo);
  201. return AjaxResult.success();
  202. }
  203. @ApiOperation("获取关注列表")
  204. @GetMapping("/syncFollowList")
  205. public AjaxResult syncFollowList(){
  206. WxLoginBody loginBody = new WxLoginBody();
  207. wxLoginService.getWxGzhUserList(loginBody.getNextOpenid());
  208. return AjaxResult.success();
  209. }
  210. @ApiOperation("同步union")
  211. @GetMapping("/syncUnion")
  212. public AjaxResult syncUnion(){
  213. UserWxFollowQueryBo bo = new UserWxFollowQueryBo();
  214. asyncService.executeAsync(bo,0);
  215. return AjaxResult.success();
  216. }
  217. @ApiOperation("学生购买2天未学习提醒")
  218. @GetMapping("/buyNotReadToStudentTwo")
  219. public AjaxResult buyNotReadToStudentTwo(UserQueryBo bo){
  220. iScheduleService.buyNotReadToStudentTwo(bo);
  221. return AjaxResult.success();
  222. }
  223. @ApiOperation("学生购买5天未学习提醒")
  224. @GetMapping("/buyNotReadToStudentFive")
  225. public AjaxResult buyNotReadToStudentFive(UserQueryBo bo){
  226. iScheduleService.buyNotReadToStudentFive(bo);
  227. return AjaxResult.success();
  228. }
  229. @ApiOperation("学生购买7天未学习教务提醒")
  230. @GetMapping("/buyNotReadToTeacher")
  231. public AjaxResult buyNotReadToTeacher(UserQueryBo bo){
  232. iScheduleService.buyNotReadToTeacher(bo);
  233. return AjaxResult.success();
  234. }
  235. @ApiOperation("学生长时间3天未学习提醒")
  236. @GetMapping("/longNotReadToStudentThree")
  237. public AjaxResult longNotReadToStudentThree(UserQueryBo bo){
  238. iScheduleService.longNotReadToStudentThree(bo);
  239. return AjaxResult.success();
  240. }
  241. @ApiOperation("学生长时间5天未学习提醒")
  242. @GetMapping("/longNotReadToStudentFive")
  243. public AjaxResult longNotReadToStudentFive(UserQueryBo bo){
  244. iScheduleService.longNotReadToStudentFive(bo);
  245. return AjaxResult.success();
  246. }
  247. @ApiOperation("学生长时间7天未学习教务提醒")
  248. @GetMapping("/longNotReadToTeacher")
  249. public AjaxResult longNotReadToTeacher(UserQueryBo bo){
  250. iScheduleService.longNotReadToTeacher(bo);
  251. return AjaxResult.success();
  252. }
  253. @ApiOperation("同步智慧考场")
  254. @GetMapping("/syncExamSite")
  255. public AjaxResult syncExamSite(UserQueryBo bo){
  256. iScheduleService.wisdomExamSite(bo);
  257. return AjaxResult.success();
  258. }
  259. }