TaskController.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. package com.ym.mec.web.controller;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  4. import com.ym.mec.biz.dal.dao.MusicGroupSchoolTermCourseDetailDao;
  5. import com.ym.mec.biz.dal.entity.MusicGroupSchoolTermCourseDetail;
  6. import com.ym.mec.biz.dal.entity.TenantInfo;
  7. import com.ym.mec.biz.dal.enums.IndexDataType;
  8. import com.ym.mec.biz.event.source.CourseEventSource;
  9. import com.ym.mec.biz.service.*;
  10. import com.ym.mec.common.controller.BaseController;
  11. import com.ym.mec.common.exception.BizException;
  12. import com.ym.mec.common.redis.service.RedisCache;
  13. import com.ym.mec.common.tenant.TenantContextHolder;
  14. import com.ym.mec.im.ImFeignService;
  15. import com.ym.mec.util.date.DateUtil;
  16. import com.yonge.log.service.HistoryMessageService;
  17. import io.swagger.annotations.ApiOperation;
  18. import org.apache.commons.io.FileUtils;
  19. import org.apache.commons.lang3.StringUtils;
  20. import org.redisson.api.RBucket;
  21. import org.springframework.beans.factory.annotation.Autowired;
  22. import org.springframework.web.bind.annotation.GetMapping;
  23. import org.springframework.web.bind.annotation.RequestMapping;
  24. import org.springframework.web.bind.annotation.RestController;
  25. import java.io.File;
  26. import java.net.URL;
  27. import java.util.*;
  28. import java.util.concurrent.TimeUnit;
  29. import java.util.stream.Collectors;
  30. @RequestMapping("task")
  31. @RestController
  32. public class TaskController extends BaseController {
  33. @Autowired
  34. private MusicGroupStudentFeeService musicGroupStudentFeeService;
  35. @Autowired
  36. private VipGroupService vipGroupService;
  37. @Autowired
  38. private CourseScheduleService courseScheduleService;
  39. @Autowired
  40. private TeacherAttendanceService teacherAttendanceService;
  41. @Autowired
  42. private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
  43. @Autowired
  44. private StudentCourseHomeworkService studentCourseHomeworkService;
  45. @Autowired
  46. private CourseHomeworkService courseHomeworkService;
  47. @Autowired
  48. private StudentPaymentOrderService studentPaymentOrderService;
  49. @Autowired
  50. private TeacherCourseStatisticsService teacherCourseStatisticsService;
  51. @Autowired
  52. private PracticeGroupService practiceGroupService;
  53. @Autowired
  54. private CourseScheduleEvaluateService courseScheduleEvaluateService;
  55. @Autowired
  56. private CourseReviewService courseReviewService;
  57. @Autowired
  58. private CoursesGroupService coursesGroupService;
  59. @Autowired
  60. private ExtracurricularExercisesService extracurricularExercisesService;
  61. @Autowired
  62. private StudentService studentService;
  63. @Autowired
  64. private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
  65. @Autowired
  66. private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
  67. @Autowired
  68. private StudentServeService studentServeService;
  69. @Autowired
  70. private OperatingReportService operatingReportService;
  71. @Autowired
  72. private GoodsService goodsService;
  73. @Autowired
  74. private StudentGoodsSellService studentGoodsSellService;
  75. @Autowired
  76. private SysMessageService sysMessageService;
  77. @Autowired
  78. private CourseEventSource courseEventSource;
  79. @Autowired
  80. private CourseScheduleStatisticsService courseScheduleStatisticsService;
  81. @Autowired
  82. private RedisCache<String, Object> redisCache;
  83. @Autowired
  84. private IndexBaseMonthDataService indexBaseMonthDataService;
  85. @Autowired
  86. private InspectionItemPlanService inspectionItemPlanService;
  87. @Autowired
  88. private StudentInstrumentService studentInstrumentService;
  89. @Autowired
  90. private HistoryMessageService historyMessageService;
  91. @Autowired
  92. private ImFeignService imFeignService;
  93. @Autowired
  94. private IndexErrDataRecordService indexErrDataRecordService;
  95. @Autowired
  96. private ClassGroupService classGroupService;
  97. @Autowired
  98. private MusicGroupSchoolTermCourseDetailDao musicGroupSchoolTermCourseDetailDao;
  99. @Autowired
  100. private MusicGroupSchoolTermCourseDetailService musicGroupSchoolTermCourseDetailService;
  101. @Autowired
  102. private SysMusicCompareRecordService sysMusicCompareRecordService;
  103. @Autowired
  104. private TenantInfoService tenantInfoService;
  105. @Autowired
  106. private TenantOrderRecordService tenantOrderRecordService;
  107. @Autowired
  108. private AppRedemptionCodeService appRedemptionCodeService;
  109. @Autowired
  110. private TeacherContractsService teacherContractsService;
  111. @Autowired
  112. private ImLiveBroadcastRoomService imLiveBroadcastRoomService;
  113. @Autowired
  114. private StudentStatisticsService studentStatisticsService;
  115. @Autowired
  116. private ImSendGroupMessageService imSendGroupMessageService;
  117. @Autowired
  118. private TempLittleArtistTrainingCampService tempLittleArtistTrainingCampService;
  119. @Autowired
  120. private OperatingReportNewService operatingReportNewService;
  121. @Autowired
  122. private CooperationShareProfitService cooperationShareProfitService;
  123. @Autowired
  124. private StudentTeacherMapperService studentTeacherMapperService;
  125. @Autowired
  126. private TeacherCloudCourseReportService teacherCloudCourseReportService;
  127. @Autowired
  128. private LessonExaminationService lessonExaminationService;
  129. @Autowired
  130. private DegreeService degreeService;
  131. @GetMapping(value = "/initSysMusicCompareDayData")
  132. public void initSysMusicCompareDayData(){
  133. sysMusicCompareRecordService.initSysMusicCompareDayData();
  134. }
  135. @GetMapping(value = "/updateStudentTeacherMapper")
  136. public void updateStudentTeacherMapper(){
  137. studentTeacherMapperService.init();
  138. }
  139. //每月经营报表
  140. @GetMapping(value = "/operatingReportMonth")
  141. public void operatingReportMonth(){
  142. Date month = DateUtil.addMonths(new Date(),-1);
  143. operatingReportNewService.operatingReportMonth(month);
  144. }
  145. @GetMapping(value = "/syncImHistoryMessageTask")
  146. // 同步即时通讯聊天记录
  147. public void syncImHistoryMessageTask(String date) throws Exception {
  148. if(date == null){
  149. date = DateUtil.format(DateUtil.addHours(new Date(),-2), DateUtil.YEAR_MONTH_DAY_HOUR);
  150. }
  151. Object o = imFeignService.historyGet(date);
  152. JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(o));
  153. if(jsonObject.get("code").equals(200)){
  154. Boolean success = redisCache.getRedisTemplate().opsForValue().setIfAbsent("syncImHistoryMessage" + date,date);
  155. if(!success){
  156. return;
  157. }
  158. String url = jsonObject.getString("url");
  159. if(StringUtils.isEmpty(url)){
  160. return;
  161. }
  162. File file = new File(FileUtils.getTempDirectoryPath() + url.substring(url.lastIndexOf("/")));
  163. URL url1 = new URL(url);
  164. FileUtils.copyURLToFile(url1,file);
  165. historyMessageService.saveImHistoryMessage(new File(file.getAbsolutePath()));
  166. }
  167. }
  168. @GetMapping(value = "/autoAffirmReceiveTask")
  169. // 自动确认收货
  170. public void affirmReceive(){
  171. studentGoodsSellService.affirmReceive(null);
  172. }
  173. @GetMapping(value = "/closeStudentServiceTag")
  174. // 关闭指定学员服务指标
  175. public void closeStudentServiceTag(){
  176. studentServeService.closeStudentServiceTag();
  177. }
  178. @GetMapping(value = "/pushWaitSendMessageTask")
  179. // 每天9点推送前一天22点之后的推送消息
  180. public void pushWaitSendMessageTask(){
  181. sysMessageService.pushWaitSendMessageTask();
  182. }
  183. @GetMapping(value = "/repertoryWarn")
  184. // 商品库存预警
  185. public void repertoryWarn(){
  186. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  187. if(tenantInfos != null && tenantInfos.size() > 0){
  188. for (TenantInfo tenantInfo : tenantInfos) {
  189. goodsService.repertoryWarn(tenantInfo.getId());
  190. }
  191. }
  192. }
  193. @GetMapping(value = "/refreshUserMusicGroupPaymentStatusTask")
  194. // 刷新学员乐团付费状态
  195. public void refreshUserMusicGroupPaymentStatusTask(){
  196. musicGroupPaymentCalenderDetailService.refreshUserMusicGroupPaymentStatusTask();
  197. }
  198. @GetMapping("/refreshPaymentFeeStatus")
  199. // 刷新付费状态
  200. public void refreshPaymentFeeStatus() {
  201. musicGroupStudentFeeService.refreshPaymentFeeStatus();
  202. }
  203. @GetMapping("/vipGroupAwardedMonthlyRewards")
  204. // vip课月度奖励
  205. public void vipGroupAwardedMonthlyRewards() {
  206. //问过测试了,这个功能没有用过
  207. // vipGroupService.awardedMonthlyRewards();
  208. }
  209. @GetMapping("/vipGroupTeacherSalarySettlement")
  210. // vip课课酬结算
  211. public void vipGroupTeacherSalarySettlement() {
  212. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  213. if(tenantInfos != null && tenantInfos.size() > 0){
  214. for (TenantInfo tenantInfo : tenantInfos) {
  215. courseScheduleTeacherSalaryService.teacherSalarySettlement(tenantInfo.getId());
  216. }
  217. }
  218. redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "VIP");
  219. }
  220. @GetMapping("/practiceTeacherSalarySettlement")
  221. // 陪练课课酬结算
  222. public void practiceTeacherSalarySettlement() {
  223. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  224. if(tenantInfos != null && tenantInfos.size() > 0){
  225. for (TenantInfo tenantInfo : tenantInfos) {
  226. courseScheduleTeacherSalaryService.practiceTeacherSalarySettlement(tenantInfo.getId());
  227. }
  228. }
  229. redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "PRACTICE");
  230. }
  231. // 乐团课课酬结算
  232. @GetMapping("/musicGroupTeacherSalarySettlement")
  233. public void musicGroupTeacherSalarySettlement() {
  234. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  235. if(tenantInfos != null && tenantInfos.size() > 0){
  236. for (TenantInfo tenantInfo : tenantInfos) {
  237. courseScheduleTeacherSalaryService.musicGroupTeacherSalarySettlement(tenantInfo.getId());
  238. }
  239. }
  240. redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "MUSIC");
  241. }
  242. @GetMapping("/updateCourseScheduleToOverStatus")
  243. // 更新课程状态至已结束
  244. public void updateCourseScheduleToOverStatus() throws Exception {
  245. List<Long> courseIds = courseScheduleService.updateCourseScheduleToOverStatus();
  246. //更新合作单位分润
  247. cooperationShareProfitService.init(courseIds);
  248. courseEventSource.courseStatusChange(courseIds);
  249. courseIds = courseScheduleService.updateCourseScheduleToUnderway();
  250. courseEventSource.courseStatusChange(courseIds);
  251. //发送定时群消息
  252. imSendGroupMessageService.sendTimedMessages();
  253. //更新乐团课统计信息
  254. courseScheduleStatisticsService.courseScheduleStatistics();
  255. //推送进度评测已截止消息
  256. lessonExaminationService.pushEndMsg();
  257. // 推送作业已截止消息
  258. studentCourseHomeworkService.pushEndMsg();
  259. }
  260. @GetMapping("/updateVipGroupToFinishedStatus")
  261. // 更新VIP课程状态至已结束
  262. public void updateVipGroupToFinishedStatus() {
  263. //更新vip课程状态
  264. vipGroupService.updateVipGroupStatusToFinished();
  265. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  266. if(tenantInfos != null && tenantInfos.size() > 0){
  267. for (TenantInfo tenantInfo : tenantInfos) {
  268. //更新直播课状态
  269. vipGroupService.createLiveCourse();
  270. }
  271. }
  272. }
  273. @GetMapping("/stopVipGroupWithNoCreate")
  274. // 取消达到报名时间未达到报名人数的vip课
  275. public void stopVipGroupWithNoCreate() {
  276. vipGroupService.stopVipGroupWithNoCreate(null);
  277. }
  278. @GetMapping("/pushNoSignOutMessage")
  279. // 推送未签退消息提醒
  280. public void pushNoSignOutMessage() {
  281. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  282. if(tenantInfos != null && tenantInfos.size() > 0){
  283. for (TenantInfo tenantInfo : tenantInfos) {
  284. TenantContextHolder.setTenantId(tenantInfo.getId());
  285. teacherAttendanceService.pushNoSignOutMessage(tenantInfo.getId());
  286. TenantContextHolder.clearTenantId();
  287. }
  288. }
  289. }
  290. @GetMapping("/studentCoursesScheduleRemind")
  291. // 学生有课提醒
  292. public void studentCoursesScheduleRemind() {
  293. // courseScheduleService.studentCoursesScheduleRemind();
  294. }
  295. @GetMapping("/studentSignInRemind")
  296. // 学生上课提醒
  297. public void studentSignInRemind() {
  298. courseScheduleService.studentSignInRemind();
  299. }
  300. @GetMapping("/studentHomeworkRemind")
  301. // 学生作业提醒
  302. public void studentHomeworkRemind() {
  303. studentCourseHomeworkService.homeworkRemind();
  304. }
  305. @GetMapping("/teacherCoursesScheduleRemind")
  306. // 老师有课提醒
  307. public void teacherCoursesScheduleRemind() {
  308. courseScheduleService.teacherCoursesScheduleRemind();
  309. }
  310. @GetMapping("/teacherSignInRemind")
  311. // 老师上课提醒
  312. public void teacherSignInRemind() {
  313. // courseScheduleService.teacherSignInRemind();
  314. }
  315. @GetMapping("/homeworkNoReplyRemind")
  316. // 老师未回复作业提醒
  317. public void homeworkNoReplyRemind() {
  318. courseHomeworkService.homeworkNoReplyRemind();
  319. }
  320. // 查询订单状态
  321. @GetMapping("/queryOrderStatus")
  322. public void queryOrderStatus() throws Exception {
  323. try {
  324. studentPaymentOrderService.queryOrderStatus();
  325. } catch (Exception e) {
  326. e.printStackTrace();
  327. }
  328. }
  329. // 统计老师课酬
  330. @GetMapping("/teacherCourseStatistic")
  331. public void teacherCourseStatisticsService() throws Exception {
  332. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  333. if(tenantInfos != null && tenantInfos.size() > 0){
  334. for (TenantInfo tenantInfo : tenantInfos) {
  335. TenantContextHolder.setTenantId(tenantInfo.getId());
  336. teacherCourseStatisticsService.teacherCourseStatistic();
  337. TenantContextHolder.clearTenantId();
  338. }
  339. }
  340. }
  341. // 更新历史陪练课至已结束
  342. @GetMapping("/updateHistoryPracticeGroupStatus")
  343. public void updateHistoryPracticeGroupStatus() {
  344. practiceGroupService.updateHistoryPracticeGroupStatus();
  345. }
  346. // 练习报告定时推送
  347. @GetMapping("/pushStudyReport")
  348. public void pushStudyReport() {
  349. practiceGroupService.pushStudyReport(null, "JIGUANG");
  350. }
  351. // 新增待填写月报定时推送(推送老师)
  352. @GetMapping("/pushNeedPostReport")
  353. public void pushNeedPostReport() {
  354. courseScheduleEvaluateService.pushNeedPostReport();
  355. }
  356. // 定时预生成待提交月报
  357. @GetMapping("/createEvaluate")
  358. public void createEvaluate() {
  359. courseScheduleEvaluateService.createEvaluate(new Date());
  360. }
  361. // 新增待填写评论定时推送(推送老师)
  362. @GetMapping("/pushNeedReview2Teacher")
  363. public void pushNeedReview2Teacher() {
  364. courseReviewService.pushNeedReview2Teacher();
  365. }
  366. //对外无学生课程组提醒
  367. @GetMapping("/noStudentsCourseGroupRemind")
  368. public void noStudentsCourseGroupRemind(){
  369. coursesGroupService.noStudentsCourseGroupRemind();
  370. }
  371. //更新对外课程组状态至已结束
  372. @GetMapping("/finishCourseGroup")
  373. public void finishCourseGroup(){
  374. coursesGroupService.finishCourseGroup();
  375. }
  376. //学生服务信息统计
  377. @GetMapping("/exercisesSituationStatistics")
  378. public void exercisesSituationStatistics(String monday){
  379. TenantContextHolder.setTenantId(1);
  380. studentServeService.exercisesSituationStatistics2(monday,1);
  381. TenantContextHolder.clearTenantId();
  382. }
  383. //更新学生运营指标
  384. @GetMapping("/updateStudentOperatingTag")
  385. public void updateStudentOperatingTag(){
  386. studentService.updateOperatingTempTag();
  387. }
  388. // 更新乐团缴费日历的状态
  389. @GetMapping("/updateMusicGroupPaymentCalenderStatus")
  390. public void updateMusicGroupPaymentCalenderStatus() {
  391. musicGroupPaymentCalenderService.autoUpdateMusicGroupPaymentCalenderStatus();
  392. }
  393. // 更新乐团学员缴费状态
  394. @GetMapping("/updateMusicGroupStudentFeeStatus")
  395. public void updateMusicGroupStudentFeeStatus() {
  396. // musicGroupPaymentCalenderService.autoUpdateMusicGroupStudentFeeStatus();
  397. }
  398. // 推送教师异常考勤
  399. @GetMapping("/pushTeacherExceptionAttendanceTask")
  400. public void pushTeacherExceptionAttendanceTask() {
  401. teacherAttendanceService.pushTeacherExceptionAttendanceTask();
  402. }
  403. //应布置课外训练提醒
  404. @GetMapping("/studentServeRemind")
  405. public void studentServeRemind(){
  406. extracurricularExercisesService.studentServeRemind();
  407. }
  408. //经营报表
  409. @GetMapping("/operatingReport")
  410. public void operatingReport(){
  411. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  412. if(tenantInfos != null && tenantInfos.size() > 0){
  413. for (TenantInfo tenantInfo : tenantInfos) {
  414. TenantContextHolder.setTenantId(tenantInfo.getId());
  415. operatingReportService.statistics(tenantInfo.getId());
  416. TenantContextHolder.clearTenantId();
  417. }
  418. }
  419. }
  420. @GetMapping("/updateCourseActualPrice")
  421. public void updateCourseActualPrice(){
  422. courseEventSource.courseStatusChange(null);
  423. }
  424. @GetMapping("/countIndexBaseData")
  425. public void countIndexBaseData(String month, String dataTypes){
  426. Set<IndexDataType> dataTypeSet = new HashSet<>();
  427. if(StringUtils.isNotBlank(dataTypes)){
  428. dataTypeSet = Arrays.stream(dataTypes.split(",")).map(s->IndexDataType.valueOf(s)).collect(Collectors.toSet());
  429. }
  430. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  431. if(tenantInfos != null && tenantInfos.size() > 0){
  432. for (TenantInfo tenantInfo : tenantInfos) {
  433. indexBaseMonthDataService.indexBaseDataTask(tenantInfo.getId(), month, dataTypeSet);
  434. }
  435. }
  436. }
  437. //乐团巡查计划当日9:00
  438. @GetMapping("/inspectionPlan")
  439. public void inspectionPlan(){
  440. inspectionItemPlanService.pushNotice();
  441. }
  442. //乐保到期提醒
  443. @GetMapping("/maintenanceNotice")
  444. public void maintenanceNotice(){
  445. studentInstrumentService.pushNotice();
  446. }
  447. //每年9.1升级学员的班级
  448. @GetMapping("/updateGrade")
  449. public void updateGrade(){
  450. studentService.updateGrade();
  451. }
  452. //乐保历史数据处理
  453. @GetMapping("/maintenanceOldDateAdd")
  454. public void maintenanceOldDateAdd(){
  455. studentInstrumentService.addOldStudentInstrument();
  456. }
  457. //更新学员指导老师和声部信息
  458. @GetMapping("/updateStudentTeacherAndSubject")
  459. public void updateStudentTeacherAndSubject(){
  460. studentService.updateStudentTeacherAndSubject();
  461. }
  462. //推送查看今日收入提醒
  463. @GetMapping("/todayIncomeRemind")
  464. public void todayIncomeRemind(){
  465. courseScheduleTeacherSalaryService.todayIncomeRemind();
  466. }
  467. //大雅基本工资标记
  468. @GetMapping("/salaryMarkNew")
  469. public void salaryMarkNew(Date startDay){
  470. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  471. if(tenantInfos != null && tenantInfos.size() > 0){
  472. for (TenantInfo tenantInfo : tenantInfos) {
  473. TenantContextHolder.setTenantId(tenantInfo.getId());
  474. courseScheduleTeacherSalaryService.salaryMarkNew(startDay,tenantInfo.getId());
  475. TenantContextHolder.clearTenantId();
  476. }
  477. }
  478. }
  479. //历史异常数据记录
  480. @GetMapping("/indexErrDataRecordTask")
  481. public void indexErrDataRecordTask(String date){
  482. indexErrDataRecordService.indexErrDataRecordTask(date);
  483. }
  484. //历史异常数据记录
  485. @GetMapping("/autoCleanPreCourseTask")
  486. public void autoCleanPreCourseTask(){
  487. //获取所有未确认的预排课数据
  488. List<MusicGroupSchoolTermCourseDetail> courseDetails = musicGroupSchoolTermCourseDetailDao.queryAllNoCourse();
  489. if(courseDetails.size() > 0){
  490. for (MusicGroupSchoolTermCourseDetail courseDetail : courseDetails) {
  491. classGroupService.cancelPreCourseSchedule(courseDetail.getId(),null);
  492. }
  493. }
  494. }
  495. @ApiOperation("每天10点推送排课、续费提醒")
  496. @GetMapping(value = "/musicSchoolTermPush")
  497. public void musicSchoolTermPush() {
  498. Object o = redisCache.get("musicSchoolTermPush");
  499. if(o != null){
  500. return;
  501. }
  502. List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
  503. if(tenantInfos != null && tenantInfos.size() > 0){
  504. for (TenantInfo tenantInfo : tenantInfos) {
  505. musicGroupSchoolTermCourseDetailService.musicSchoolTermPush(tenantInfo.getId());
  506. }
  507. }
  508. redisCache.getRedisTemplate().opsForValue().set("musicSchoolTermPush","musicSchoolTermPush",
  509. 23,
  510. TimeUnit.HOURS);
  511. }
  512. @ApiOperation("会员到期后清空会员信息")
  513. @GetMapping(value = "/cleanStudentMember")
  514. public void cleanStudentMember() {
  515. studentServeService.cleanStudentMember();
  516. }
  517. @ApiOperation("清理学员云教练连续使用天数")
  518. @GetMapping(value = "/cleanStudentCloudStudySequenceDays")
  519. public void cleanStudentCloudStudySequenceDays(){
  520. studentService.cleanStudentCloudStudySequenceDays();
  521. }
  522. @ApiOperation("本周学员训练提醒")
  523. @GetMapping(value = "/curWeekStudentTrainRemind")
  524. public void curWeekStudentTrainRemind(){
  525. sysMusicCompareRecordService.curWeekStudentTrainRemind();
  526. }
  527. @ApiOperation("标记进行中乐团在读学员+VIP、网管有课学员总数(除弦乐声部、去重,去除在云教练的乐团的学员")
  528. @GetMapping(value = "/remarkCountFlag")
  529. public void remarkCountFlag(){
  530. // studentService.remarkCountFlag();
  531. }
  532. @ApiOperation("兑换码分配量检测")
  533. @GetMapping(value = "/redemptionCodeWarn")
  534. public void redemptionCodeWarn(){
  535. appRedemptionCodeService.checkLowVolume();
  536. }
  537. @ApiOperation("定时校验-机构订单状态")
  538. @GetMapping(value = "/checkTenantOrder")
  539. public void checkTenantOrder(){
  540. tenantOrderRecordService.checkTenantOrder();
  541. }
  542. @ApiOperation("每晚12点-检查机构状态")
  543. @GetMapping(value = "/checkTenantState")
  544. public void checkTenantState(){
  545. tenantInfoService.checkTenantState();
  546. }
  547. @ApiOperation("查询老师协议签订状态")
  548. @GetMapping(value = "/queryTeacherContractSignStatus")
  549. public void queryTeacherContractSignStatus(){
  550. teacherContractsService.queryTeacherContractSignStatus();
  551. }
  552. @ApiOperation("每分钟-查询是否有直播间需要创建")
  553. @GetMapping(value = "/createLiveRoom")
  554. public void createLiveRoom(){
  555. imLiveBroadcastRoomService.createLiveRoom();
  556. }
  557. @ApiOperation("每分钟-查询是否有直播间需要销毁")
  558. @GetMapping(value = "/destroyExpiredLiveRoom")
  559. public void destroyExpiredLiveRoom(){
  560. imLiveBroadcastRoomService.destroyExpiredLiveRoom();
  561. }
  562. @ApiOperation("学员小课统计")
  563. @GetMapping(value = "/studentSmallClassStatistics")
  564. public void studentSmallClassStatistics(){
  565. studentStatisticsService.updateStudentStatistics();
  566. }
  567. @ApiOperation("定时任务-修改训练营状态-每天0点执行")
  568. @GetMapping(value = "/checkCampState")
  569. public void checkCampState(){
  570. //修改训练营状态
  571. tempLittleArtistTrainingCampService.checkCampState();
  572. }
  573. @ApiOperation("统计老师课程云教练使用时长")
  574. @GetMapping(value = "/teacherCloudCourseReport")
  575. public void teacherCloudCourseReport(){
  576. teacherCloudCourseReportService.taskReport();
  577. }
  578. @ApiOperation("每天早上8点执行-提醒当天开启训练营并已分群的用户开始训练")
  579. @GetMapping(value = "/pushStartTrain")
  580. public void pushStartTrain(){
  581. tempLittleArtistTrainingCampService.pushStartTrain();
  582. }
  583. @ApiOperation("每天凌晨2点钟-直播间销毁定时任务")
  584. @GetMapping("/destroyLiveRoom")
  585. public Object destroyLiveRoom() {
  586. imLiveBroadcastRoomService.destroyLiveRoom();
  587. return succeed();
  588. }
  589. @ApiOperation("考级状态变更 - 1分钟一次")
  590. @GetMapping("/degreeStatusChange")
  591. public Object degreeStatusChange() {
  592. degreeService.degreeStatusChange();
  593. return succeed();
  594. }
  595. @ApiOperation("直播课课程提醒")
  596. @GetMapping("/liveCourseRemind")
  597. public Object liveCourseRemind() {
  598. vipGroupService.liveCourseRemind();
  599. return succeed();
  600. }
  601. @ApiOperation("关闭直播课房间")
  602. @GetMapping("/closeLiveCourseRoom")
  603. public Object closeLiveCourseRoom() {
  604. vipGroupService.closeLiveCourseRoom();
  605. return succeed();
  606. }
  607. }