|
|
@@ -15,10 +15,13 @@ import com.cyksj.model.dto.YhServiceChangeDto;
|
|
|
import com.cyksj.model.dto.YhServiceDto;
|
|
|
import com.cyksj.model.entity.CmsUser;
|
|
|
import com.cyksj.model.entity.SysConfigChangeRecord;
|
|
|
+import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.sys.SysConfigChangeRecordService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.time.DayOfWeek;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -38,6 +41,8 @@ public class SysConfigChangeRecordServiceImpl extends ServiceImpl<SysConfigChang
|
|
|
|
|
|
private final EnvCommonService envCommonService;
|
|
|
|
|
|
+ private final RedisService redisService;
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean changeRecord(Long adminId, String sysKey, String sysValue, String updateValue) throws Exception {
|
|
|
CmsUser cmsUser = cmsUserMapper.selectById(adminId);
|
|
|
@@ -94,8 +99,12 @@ public class SysConfigChangeRecordServiceImpl extends ServiceImpl<SysConfigChang
|
|
|
if (changeStr.length() > 0) {
|
|
|
sysConfigChangeRecord.setChangeStr(changeStr.toString());
|
|
|
}
|
|
|
- if (weekdayMsgNotifySb.length() > 0 && envCommonService.isPrdEnv()) {
|
|
|
- SmsUtil.sendLuoKey2Msg(Constant.DUTY_SERVICE_CHANGE_NOTIFY_PHONE, String.format(Constant.DUTY_SERVICE_CHANGE_MSG, weekdayMsgNotifySb));
|
|
|
+ DayOfWeek nowDayOfWeek = LocalDateTime.now().getDayOfWeek();
|
|
|
+ if (weekdayMsgNotifySb.length() > 0 && (nowDayOfWeek == DayOfWeek.SATURDAY || nowDayOfWeek == DayOfWeek.SUNDAY) && envCommonService.isPrdEnv()) {
|
|
|
+ //一个小时内 不重复发送
|
|
|
+ if (redisService.setNx(RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getEnvName(), RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getName(), RedisService.key.WEEKEND_DUTY_UNDERSTAFFED_NOTIFY.getTimeout())) {
|
|
|
+ SmsUtil.sendLuoKey2Msg(Constant.DUTY_SERVICE_CHANGE_NOTIFY_PHONE, String.format(Constant.DUTY_SERVICE_CHANGE_MSG, weekdayMsgNotifySb));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
this.save(sysConfigChangeRecord);
|