fix: 修复编译错误
This commit is contained in:
parent
dceff515b7
commit
c63c4a1e85
@ -756,9 +756,9 @@ public class AnalyticsService {
|
||||
// 解析月份
|
||||
String[] monthParts = currentMonth.split("-");
|
||||
if (monthParts.length == 2) {
|
||||
int year = Integer.parseInt(monthParts[0]);
|
||||
int month = Integer.parseInt(monthParts[1]);
|
||||
BigDecimal progressDeduction = progressDeductionLogMapper.sumMonthlyDeduction(designer.getId(), year, month);
|
||||
int yearNum = Integer.parseInt(monthParts[0]);
|
||||
int monthNum = Integer.parseInt(monthParts[1]);
|
||||
BigDecimal progressDeduction = progressDeductionLogMapper.sumMonthlyDeduction(designer.getId(), yearNum, monthNum);
|
||||
if (progressDeduction != null && progressDeduction.compareTo(BigDecimal.ZERO) > 0) {
|
||||
deductionScore = deductionScore.add(progressDeduction);
|
||||
log.debug("设计师 {} 本月进度未更新扣分: {}", designer.getRealName(), progressDeduction);
|
||||
|
||||
@ -176,13 +176,15 @@ public class ProgressCheckService {
|
||||
|
||||
try {
|
||||
User user = userMapper.selectById(userId);
|
||||
if (user == null || user.getDingtalkUserId() == null) {
|
||||
if (user == null || user.getPhone() == null) {
|
||||
// 如果没有手机号,无法发送钉钉通知
|
||||
log.warn("用户 {} 没有绑定手机号,跳过钉钉通知", userId);
|
||||
continue;
|
||||
}
|
||||
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.append("⚠️ 进度更新提醒\n\n");
|
||||
content.append("您有 ").append(tasks.size()).append(" 个进行中的任务今日未更新进度:\n");
|
||||
content.append("⚠️ **进度更新提醒**\n\n");
|
||||
content.append("您有 **").append(tasks.size()).append("** 个进行中的任务今日未更新进度:\n\n");
|
||||
|
||||
for (int i = 0; i < Math.min(tasks.size(), 5); i++) {
|
||||
content.append("• ").append(tasks.get(i)).append("\n");
|
||||
@ -191,10 +193,15 @@ public class ProgressCheckService {
|
||||
content.append("• ...等共 ").append(tasks.size()).append(" 个任务\n");
|
||||
}
|
||||
|
||||
content.append("\n已扣除积分:").append(deductionScore.multiply(BigDecimal.valueOf(tasks.size()))).append(" 分");
|
||||
content.append("\n**已扣除积分:").append(deductionScore.multiply(BigDecimal.valueOf(tasks.size()))).append(" 分**");
|
||||
content.append("\n\n💡 温馨提示:请每日下班前更新任务进度,以便跟进项目状态。");
|
||||
|
||||
dingTalkService.sendPersonalMessage(user.getDingtalkUserId(), content.toString());
|
||||
// 使用手机号作为钉钉用户标识发送通知
|
||||
dingTalkService.sendWorkNotification(
|
||||
java.util.Collections.singletonList(user.getPhone()),
|
||||
"进度更新提醒",
|
||||
content.toString()
|
||||
);
|
||||
log.info("已向用户 {} 发送进度提醒通知", user.getRealName());
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user