|
@@ -145,7 +145,9 @@ public class TStFeedbackController extends BaseController
|
|
|
BigDecimal avg = new BigDecimal("0.0"); // 子节点平均分
|
|
|
BigDecimal overall = new BigDecimal("0.0"); // 季度平均分
|
|
|
for (TStFeedback childNode : childNodes) {
|
|
|
- count = count.add(new BigDecimal("1.0"));
|
|
|
+ if (childNode.getFeedbackScore()!=null) {
|
|
|
+ count = count.add(new BigDecimal("1.0"));
|
|
|
+ }
|
|
|
sum = sum.add(new BigDecimal(childNode.getFeedbackScore()==null?"0.0":childNode.getFeedbackScore()));
|
|
|
}
|
|
|
// 计算子节点平均分
|
|
@@ -157,7 +159,7 @@ public class TStFeedbackController extends BaseController
|
|
|
overall = new BigDecimal(parentNode.getFeedbackScore());
|
|
|
} else { // 父节点占比60%,子节点平均分占比40%
|
|
|
overall = (new BigDecimal(parentNode.getFeedbackScore()).multiply(new BigDecimal("0.6")))
|
|
|
- .add(avg.multiply(new BigDecimal("0.4")));
|
|
|
+ .add(avg.multiply(new BigDecimal("0.4"))).divide(new BigDecimal("1.0"),1,BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
|
parentNode.setOverallScore(overall.toString());
|
|
|
// 更新季度平均分
|
|
@@ -546,24 +548,27 @@ public class TStFeedbackController extends BaseController
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody TStFeedback tStFeedback) throws PinyinException {
|
|
|
TStFeedback feedback = tStFeedbackService.selectTStFeedbackById(tStFeedback.getId());
|
|
|
- // 反馈类型为季度反馈
|
|
|
- if (feedback.getFeedbackType() == 2) {
|
|
|
- // 根据学员staffId获取用户对象
|
|
|
- SysUser successor = sysUserService.selectUserByStaffId(feedback.getSuccessorId());
|
|
|
- String email = successor.getEmail();
|
|
|
- String successorName = successor.getNickName();
|
|
|
- String successorNameEN = PinyinHelper.convertToPinyinString(successorName, " ", PinyinFormat.WITHOUT_TONE);
|
|
|
- String feedbackYear = feedback.getFeedbackYear();
|
|
|
- String feedbackMonth = feedback.getFeedbackMonth();
|
|
|
- // 根据导师staffId获取用户对象
|
|
|
- SysUser mentor = sysUserService.selectUserByStaffId(feedback.getMentorId());
|
|
|
- String mentorName = mentor.getNickName();
|
|
|
- String mentorNameEN = PinyinHelper.convertToPinyinString(mentorName, " ", PinyinFormat.WITHOUT_TONE);
|
|
|
- // TODO: 部署前开启
|
|
|
- // 邮件通知学员
|
|
|
+ Long feedbackType = feedback.getFeedbackType();
|
|
|
+ if (feedbackType != null) {
|
|
|
+ // 反馈类型为季度反馈
|
|
|
+ if (feedback.getFeedbackType() == 2) {
|
|
|
+ // 根据学员staffId获取用户对象
|
|
|
+ SysUser successor = sysUserService.selectUserByStaffId(feedback.getSuccessorId());
|
|
|
+ String email = successor.getEmail();
|
|
|
+ String successorName = successor.getNickName();
|
|
|
+ String successorNameEN = PinyinHelper.convertToPinyinString(successorName, " ", PinyinFormat.WITHOUT_TONE);
|
|
|
+ String feedbackYear = feedback.getFeedbackYear();
|
|
|
+ String feedbackMonth = feedback.getFeedbackMonth();
|
|
|
+ // 根据导师staffId获取用户对象
|
|
|
+ SysUser mentor = sysUserService.selectUserByStaffId(feedback.getMentorId());
|
|
|
+ String mentorName = mentor.getNickName();
|
|
|
+ String mentorNameEN = PinyinHelper.convertToPinyinString(mentorName, " ", PinyinFormat.WITHOUT_TONE);
|
|
|
+ // TODO: 部署前开启
|
|
|
+ // 邮件通知学员
|
|
|
// MonthlyFeedbackMailThread monthlyFeedbackMailThread = new MonthlyFeedbackMailThread(mailService, email, successorName, successorNameEN, mentorName, mentorNameEN, feedbackYear, feedbackMonth);
|
|
|
// Thread thread = new Thread(monthlyFeedbackMailThread);
|
|
|
// thread.start();
|
|
|
+ }
|
|
|
}
|
|
|
return toAjax(tStFeedbackService.updateTStFeedback(tStFeedback));
|
|
|
}
|