TaskController.java 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. package com.ym.mec.web.controller;
  2. import com.ym.mec.biz.event.source.CourseEventSource;
  3. import com.ym.mec.biz.service.*;
  4. import com.ym.mec.common.controller.BaseController;
  5. import com.ym.mec.common.redis.service.RedisCache;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import java.util.ArrayList;
  11. import java.util.Arrays;
  12. import java.util.Date;
  13. @RequestMapping("task")
  14. @RestController
  15. public class TaskController extends BaseController {
  16. @Autowired
  17. private MusicGroupStudentFeeService musicGroupStudentFeeService;
  18. @Autowired
  19. private VipGroupService vipGroupService;
  20. @Autowired
  21. private CourseScheduleService courseScheduleService;
  22. @Autowired
  23. private TeacherAttendanceService teacherAttendanceService;
  24. @Autowired
  25. private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
  26. @Autowired
  27. private StudentCourseHomeworkService studentCourseHomeworkService;
  28. @Autowired
  29. private CourseHomeworkService courseHomeworkService;
  30. @Autowired
  31. private StudentPaymentOrderService studentPaymentOrderService;
  32. @Autowired
  33. private TenantPaymentOrderService tenantPaymentOrderService;
  34. @Autowired
  35. private TeacherCourseStatisticsService teacherCourseStatisticsService;
  36. @Autowired
  37. private PracticeGroupService practiceGroupService;
  38. @Autowired
  39. private CourseScheduleEvaluateService courseScheduleEvaluateService;
  40. @Autowired
  41. private CourseReviewService courseReviewService;
  42. @Autowired
  43. private CoursesGroupService coursesGroupService;
  44. @Autowired
  45. private ExtracurricularExercisesService extracurricularExercisesService;
  46. @Autowired
  47. private StudentService studentService;
  48. @Autowired
  49. private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
  50. @Autowired
  51. private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
  52. @Autowired
  53. private StudentServeService studentServeService;
  54. @Autowired
  55. private OperatingReportService operatingReportService;
  56. @Autowired
  57. private GoodsService goodsService;
  58. @Autowired
  59. private StudentGoodsSellService studentGoodsSellService;
  60. @Autowired
  61. private SysMessageService sysMessageService;
  62. @Autowired
  63. private CourseEventSource courseEventSource;
  64. @Autowired
  65. private RedisCache<String, Object> redisCache;
  66. @Autowired
  67. private IndexBaseMonthDataService indexBaseMonthDataService;
  68. @Autowired
  69. private InspectionItemPlanService inspectionItemPlanService;
  70. @Autowired
  71. private StudentInstrumentService studentInstrumentService;
  72. @GetMapping(value = "/autoAffirmReceiveTask")
  73. // 自动确认收货
  74. public void affirmReceive(){
  75. studentGoodsSellService.affirmReceive(null);
  76. }
  77. @GetMapping(value = "/closeStudentServiceTag")
  78. // 关闭指定学员服务指标
  79. public void closeStudentServiceTag(){
  80. studentServeService.closeStudentServiceTag();
  81. }
  82. @GetMapping(value = "/pushWaitSendMessageTask")
  83. // 每天9点推送前一天22点之后的推送消息
  84. public void pushWaitSendMessageTask(){
  85. sysMessageService.pushWaitSendMessageTask();
  86. }
  87. @GetMapping(value = "/repertoryWarn")
  88. // 商品库存预警
  89. public void repertoryWarn(){
  90. goodsService.repertoryWarn();
  91. }
  92. @GetMapping(value = "/refreshUserMusicGroupPaymentStatusTask")
  93. // 刷新学员乐团付费状态
  94. public void refreshUserMusicGroupPaymentStatusTask(){
  95. musicGroupPaymentCalenderDetailService.refreshUserMusicGroupPaymentStatusTask();
  96. }
  97. @GetMapping("/refreshPaymentFeeStatus")
  98. // 刷新付费状态
  99. public void refreshPaymentFeeStatus() {
  100. musicGroupStudentFeeService.refreshPaymentFeeStatus();
  101. }
  102. @GetMapping("/vipGroupAwardedMonthlyRewards")
  103. // vip课月度奖励
  104. public void vipGroupAwardedMonthlyRewards() {
  105. vipGroupService.awardedMonthlyRewards();
  106. }
  107. @GetMapping("/vipGroupTeacherSalarySettlement")
  108. // vip课课酬结算
  109. public void vipGroupTeacherSalarySettlement() {
  110. courseScheduleTeacherSalaryService.teacherSalarySettlement();
  111. redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "VIP");
  112. courseScheduleTeacherSalaryService.salaryMark();
  113. }
  114. @GetMapping("/practiceTeacherSalarySettlement")
  115. // 陪练课课酬结算
  116. public void practiceTeacherSalarySettlement() {
  117. courseScheduleTeacherSalaryService.practiceTeacherSalarySettlement();
  118. redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "PRACTICE");
  119. courseScheduleTeacherSalaryService.salaryMark();
  120. }
  121. // 乐团课课酬结算
  122. @GetMapping("/musicGroupTeacherSalarySettlement")
  123. public void musicGroupTeacherSalarySettlement() {
  124. courseScheduleTeacherSalaryService.musicGroupTeacherSalarySettlement();
  125. redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "MUSIC");
  126. courseScheduleTeacherSalaryService.salaryMark();
  127. }
  128. @GetMapping("/updateCourseScheduleToOverStatus")
  129. // 更新课程状态至已结束
  130. public void updateCourseScheduleToOverStatus() {
  131. courseScheduleService.updateCourseScheduleToOverStatus();
  132. courseScheduleService.updateCourseScheduleToUnderway();
  133. courseEventSource.courseStatusChange(null);
  134. }
  135. @GetMapping("/updateVipGroupToFinishedStatus")
  136. // 更新VIP课程状态至已结束
  137. public void updateVipGroupToFinishedStatus() {
  138. vipGroupService.updateVipGroupStatusToFinished();
  139. }
  140. @GetMapping("/stopVipGroupWithNoCreate")
  141. // 取消达到报名时间未达到报名人数的vip课
  142. public void stopVipGroupWithNoCreate() {
  143. vipGroupService.stopVipGroupWithNoCreate();
  144. }
  145. @GetMapping("/pushNoSignOutMessage")
  146. // 推送未签退消息提醒
  147. public void pushNoSignOutMessage() {
  148. teacherAttendanceService.pushNoSignOutMessage();
  149. }
  150. @GetMapping("/studentCoursesScheduleRemind")
  151. // 学生有课提醒
  152. public void studentCoursesScheduleRemind() {
  153. // courseScheduleService.studentCoursesScheduleRemind();
  154. }
  155. @GetMapping("/studentSignInRemind")
  156. // 学生上课提醒
  157. public void studentSignInRemind() {
  158. courseScheduleService.studentSignInRemind();
  159. }
  160. @GetMapping("/studentHomeworkRemind")
  161. // 学生作业提醒
  162. public void studentHomeworkRemind() {
  163. studentCourseHomeworkService.homeworkRemind();
  164. }
  165. @GetMapping("/teacherCoursesScheduleRemind")
  166. // 老师有课提醒
  167. public void teacherCoursesScheduleRemind() {
  168. courseScheduleService.teacherCoursesScheduleRemind();
  169. }
  170. @GetMapping("/teacherSignInRemind")
  171. // 老师上课提醒
  172. public void teacherSignInRemind() {
  173. // courseScheduleService.teacherSignInRemind();
  174. }
  175. @GetMapping("/homeworkNoReplyRemind")
  176. // 老师未回复作业提醒
  177. public void homeworkNoReplyRemind() {
  178. courseHomeworkService.homeworkNoReplyRemind();
  179. }
  180. // 查询订单状态
  181. @GetMapping("/queryOrderStatus")
  182. public void queryOrderStatus() throws Exception {
  183. try {
  184. studentPaymentOrderService.queryOrderStatus();
  185. } catch (Exception e) {
  186. e.printStackTrace();
  187. }
  188. tenantPaymentOrderService.queryOrderStatusFromRemote();
  189. }
  190. // 统计老师课酬
  191. @GetMapping("/teacherCourseStatistic")
  192. public void teacherCourseStatisticsService() throws Exception {
  193. teacherCourseStatisticsService.teacherCourseStatistic();
  194. }
  195. // 更新历史陪练课至已结束
  196. @GetMapping("/updateHistoryPracticeGroupStatus")
  197. public void updateHistoryPracticeGroupStatus() {
  198. practiceGroupService.updateHistoryPracticeGroupStatus();
  199. }
  200. // 练习报告定时推送
  201. @GetMapping("/pushStudyReport")
  202. public void pushStudyReport() {
  203. practiceGroupService.pushStudyReport(null, "JIGUANG");
  204. }
  205. // 新增待填写月报定时推送(推送老师)
  206. @GetMapping("/pushNeedPostReport")
  207. public void pushNeedPostReport() {
  208. courseScheduleEvaluateService.pushNeedPostReport();
  209. }
  210. // 定时预生成待提交月报
  211. @GetMapping("/createEvaluate")
  212. public void createEvaluate() {
  213. courseScheduleEvaluateService.createEvaluate(new Date());
  214. }
  215. // 新增待填写评论定时推送(推送老师)
  216. @GetMapping("/pushNeedReview2Teacher")
  217. public void pushNeedReview2Teacher() {
  218. courseReviewService.pushNeedReview2Teacher();
  219. }
  220. //对外无学生课程组提醒
  221. @GetMapping("/noStudentsCourseGroupRemind")
  222. public void noStudentsCourseGroupRemind(){
  223. coursesGroupService.noStudentsCourseGroupRemind();
  224. }
  225. //更新对外课程组状态至已结束
  226. @GetMapping("/finishCourseGroup")
  227. public void finishCourseGroup(){
  228. coursesGroupService.finishCourseGroup();
  229. }
  230. //学生服务信息统计
  231. @GetMapping("/exercisesSituationStatistics")
  232. public void exercisesSituationStatistics(String monday){
  233. studentServeService.exercisesSituationStatistics2(monday,null);
  234. // studentServeService.exercisesSituationStatistics2(null,new ArrayList<>(Arrays.asList(1095257)));
  235. // studentServeService.exercisesSituationStatistics(null);
  236. }
  237. //更新学生运营指标
  238. @GetMapping("/updateStudentOperatingTag")
  239. public void updateStudentOperatingTag(){
  240. studentService.updateOperatingTempTag();
  241. }
  242. // 更新乐团缴费日历的状态
  243. @GetMapping("/updateMusicGroupPaymentCalenderStatus")
  244. public void updateMusicGroupPaymentCalenderStatus() {
  245. musicGroupPaymentCalenderService.autoUpdateMusicGroupPaymentCalenderStatus();
  246. }
  247. // 更新乐团学员缴费状态
  248. @GetMapping("/updateMusicGroupStudentFeeStatus")
  249. public void updateMusicGroupStudentFeeStatus() {
  250. musicGroupPaymentCalenderService.autoUpdateMusicGroupStudentFeeStatus();
  251. }
  252. // 推送教师异常考勤
  253. @GetMapping("/pushTeacherExceptionAttendanceTask")
  254. public void pushTeacherExceptionAttendanceTask() {
  255. teacherAttendanceService.pushTeacherExceptionAttendanceTask();
  256. }
  257. //应布置课外训练提醒
  258. @GetMapping("/studentServeRemind")
  259. public void studentServeRemind(){
  260. extracurricularExercisesService.studentServeRemind();
  261. }
  262. //经营报表
  263. @GetMapping("/operatingReport")
  264. public void operatingReport(){
  265. operatingReportService.statistics();
  266. }
  267. @GetMapping("/updateCourseActualPrice")
  268. public void updateCourseActualPrice(){
  269. courseEventSource.courseStatusChange(null);
  270. }
  271. @GetMapping("/countIndexBaseData")
  272. public void countIndexBaseData(String month){
  273. indexBaseMonthDataService.indexBaseDataTask(month);
  274. }
  275. //乐团巡查计划当日9:00
  276. @GetMapping("/inspectionPlan")
  277. public void inspectionPlan(){
  278. inspectionItemPlanService.pushNotice();
  279. }
  280. //乐保到期提醒
  281. @GetMapping("/maintenanceNotice")
  282. public void maintenanceNotice(){
  283. studentInstrumentService.pushNotice();
  284. }
  285. //每年9.1升级学员的班级
  286. @GetMapping("/updateGrade")
  287. public void updateGrade(){
  288. studentService.updateGrade();
  289. }
  290. }