|
@@ -2,12 +2,14 @@ package com.ruoyi.project.training.spec.controller;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import com.github.stuxuhai.jpinyin.PinyinException;
|
|
import com.github.stuxuhai.jpinyin.PinyinException;
|
|
|
import com.github.stuxuhai.jpinyin.PinyinFormat;
|
|
import com.github.stuxuhai.jpinyin.PinyinFormat;
|
|
|
import com.github.stuxuhai.jpinyin.PinyinHelper;
|
|
import com.github.stuxuhai.jpinyin.PinyinHelper;
|
|
|
import com.ruoyi.common.sendEmail.IMailService;
|
|
import com.ruoyi.common.sendEmail.IMailService;
|
|
|
|
|
+import com.ruoyi.common.thread.Trainning.MeetingInvitationMailThread;
|
|
|
import com.ruoyi.common.thread.Trainning.MonthlyFeedbackMailThread;
|
|
import com.ruoyi.common.thread.Trainning.MonthlyFeedbackMailThread;
|
|
|
import com.ruoyi.project.system.domain.SysUser;
|
|
import com.ruoyi.project.system.domain.SysUser;
|
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
@@ -513,8 +515,28 @@ public class TStFeedbackController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('spec:feedback:add')")
|
|
@PreAuthorize("@ss.hasPermi('spec:feedback:add')")
|
|
|
@Log(title = "专项培训反馈", businessType = BusinessType.INSERT)
|
|
@Log(title = "专项培训反馈", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody TStFeedback tStFeedback)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult add(@RequestBody TStFeedback tStFeedback) throws PinyinException {
|
|
|
|
|
+ // 新增受邀导师反馈记录
|
|
|
|
|
+ if (tStFeedback.getParentId() != null) {
|
|
|
|
|
+ // 根据学员staffId获取用户对象
|
|
|
|
|
+ SysUser successor = sysUserService.selectUserByStaffId(tStFeedback.getSuccessorId());
|
|
|
|
|
+ String successorName = successor.getNickName();
|
|
|
|
|
+ String successorNameEN = PinyinHelper.convertToPinyinString(successorName, " ", PinyinFormat.WITHOUT_TONE);
|
|
|
|
|
+ String feedbackYear = tStFeedback.getFeedbackYear();
|
|
|
|
|
+ String feedbackSeason = tStFeedback.getFeedbackSeason();
|
|
|
|
|
+ // 根据导师staffId获取用户对象
|
|
|
|
|
+ SysUser mentor = sysUserService.selectUserByStaffId(tStFeedback.getMentorId());
|
|
|
|
|
+ String email = mentor.getEmail();
|
|
|
|
|
+ String mentorName = mentor.getNickName();
|
|
|
|
|
+ String mentorNameEN = PinyinHelper.convertToPinyinString(mentorName, " ", PinyinFormat.WITHOUT_TONE);
|
|
|
|
|
+ Date meetingDate = tStFeedbackService.selectTStFeedbackById(tStFeedback.getParentId()).getMeetingDate();
|
|
|
|
|
+ String meetingDateString = "20" + (meetingDate.getYear() + "年" + (meetingDate.getMonth() + 1 + "月") + meetingDate.getDate() + "日").substring(1);
|
|
|
|
|
+ // TODO: 部署前开启
|
|
|
|
|
+ // 邮件通知导师
|
|
|
|
|
+// MeetingInvitationMailThread meetingInvitationMailThread = new MeetingInvitationMailThread(mailService, email, successorName, successorNameEN, mentorName, mentorNameEN, feedbackYear, feedbackSeason, meetingDateString);
|
|
|
|
|
+// Thread thread = new Thread(meetingInvitationMailThread);
|
|
|
|
|
+// thread.start();
|
|
|
|
|
+ }
|
|
|
return toAjax(tStFeedbackService.insertTStFeedback(tStFeedback));
|
|
return toAjax(tStFeedbackService.insertTStFeedback(tStFeedback));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -539,7 +561,8 @@ public class TStFeedbackController extends BaseController
|
|
|
SysUser mentor = sysUserService.selectUserByStaffId(feedback.getMentorId());
|
|
SysUser mentor = sysUserService.selectUserByStaffId(feedback.getMentorId());
|
|
|
String mentorName = mentor.getNickName();
|
|
String mentorName = mentor.getNickName();
|
|
|
String mentorNameEN = PinyinHelper.convertToPinyinString(mentorName, " ", PinyinFormat.WITHOUT_TONE);
|
|
String mentorNameEN = PinyinHelper.convertToPinyinString(mentorName, " ", PinyinFormat.WITHOUT_TONE);
|
|
|
- // 邮件通知导师
|
|
|
|
|
|
|
+ // TODO: 部署前开启
|
|
|
|
|
+ // 邮件通知学员
|
|
|
// MonthlyFeedbackMailThread monthlyFeedbackMailThread = new MonthlyFeedbackMailThread(mailService, email, successorName, successorNameEN, mentorName, mentorNameEN, feedbackYear, feedbackMonth);
|
|
// MonthlyFeedbackMailThread monthlyFeedbackMailThread = new MonthlyFeedbackMailThread(mailService, email, successorName, successorNameEN, mentorName, mentorNameEN, feedbackYear, feedbackMonth);
|
|
|
// Thread thread = new Thread(monthlyFeedbackMailThread);
|
|
// Thread thread = new Thread(monthlyFeedbackMailThread);
|
|
|
// thread.start();
|
|
// thread.start();
|