ScheduleController.java 13 KB

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