Просмотр исходного кода

短信提醒日志内容修改

jingyuanchao 1 год назад
Родитель
Сommit
b905ded42d

+ 16 - 1
soc-modules/soc-modules-sms/src/main/java/com/xunmei/sms/service/SmsService.java

@@ -9,6 +9,7 @@ import com.xunmei.common.core.constant.*;
 import com.xunmei.common.core.domain.reminder.dto.ReminderScheduleMsgDto;
 import com.xunmei.common.core.domain.reminder.vo.ReminderScheduleMsgVo;
 import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.sms.utils.SmsNotifyType;
 import com.xunmei.sms.utils.SmsUtil;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.RemoteRoleService;
@@ -149,6 +150,7 @@ public class SmsService implements ISmsService {
 
     @Override
     public void sendSmsTodo(Long orgId, String type, String content, Date time) {
+        //checkParam(orgId, type, content, time);
         List<SysUser> userList = RemoteCallHandlerExecutor.executeRemoteCall(() ->
                 remoteRoleService.selectUserByRoleNameAndOrgId("网点负责人", orgId, 0, SecurityConstants.INNER), ErrorMsgConstants.QUERY_USER_DATA_ERROR);
         SysOrg sysOrg = remoteOrgService.selectOrgById(orgId, SecurityConstants.INNER);
@@ -165,13 +167,26 @@ public class SmsService implements ISmsService {
                 smsInfoVo.setOccurDate(day);
                 smsInfoVo.setOccurTime(sfm);
                 smsInfoVo.setRetMsg(type);
-                smsInfoVo.setBak3("任务【" + content + "】未完成,将于" + DateUtil.format(time, Constants.HMS_FORMAT) + "逾期。");
+                if (SmsNotifyType.OVERDUE_REMINDER.getDesc().equals(type)) {
+                    smsInfoVo.setBak3("任务【" + content + "】未完成,将于" + DateUtil.format(time, Constants.HMS_FORMAT) + "逾期。");
+                } else {
+                    smsInfoVo.setBak3("任务【" + content + "】将于" + DateUtil.format(time, Constants.HMS_FORMAT) + "开始,请及时完成。");
+                }
                 deal(sysOrg, sysUser, smsInfoVo);
             }
         }
 
     }
 
+    private void checkParam(Long orgId, String type, String content, Date time) {
+        if (ObjectUtil.hasEmpty(orgId, type, content, time)) {
+            log.error("短信发送时发生异常,有参数为空,orgId:{},type:{},content:{},time:{}", orgId, type, content, time);
+        }
+        if (!type.equals(SmsNotifyType.OVERDUE_REMINDER.getDesc()) && !type.equals(SmsNotifyType.EXPIRY_REMINDER.getDesc())) {
+            log.error("短信发送时发生异常,type参数错误,type:{}", type);
+        }
+    }
+
     @Override
     public List<ReminderScheduleMsgVo> sendReminderSms(List<ReminderScheduleMsgDto> msgDto) {
         Date now = new Date();