Commit df069ea1 by YG8999

短信提醒代码

parent 8877557e
......@@ -10,7 +10,9 @@ public enum SmsTypeEnum {
SMS_CODE_TEMP(1,"sms.code.template","短信验证码"),
SMS_CLEAN_RECORDS_TEMP(2,"sms.clean.records.template","保洁任务短信提示"),
SMS_CLEAN_RECORDS_TEMP_15(3,"sms.clean.records.template.15","即将保洁任务短信提醒")
SMS_CLEAN_RECORDS_TEMP_15(3,"sms.clean.records.template.15","即将保洁任务短信提醒"),
SMS_ORDER_START_TEMP(4,"sms.order.start.template","订单即将开始提示短信"),
SMS_ORDER_END_TEMP(5,"sms.order.end.template","订单即结束始提示短信"),
;
private Integer code;
......
......@@ -123,12 +123,26 @@ public class SmsServiceImpl implements SmsService {
@Override
public boolean sendSmsOrderStartRemind(String phone, SStore store, SRoom room) {
return false;
// 通过配置获取短信模版
SysConfig config = sysConfigMapper.checkConfigKeyUnique(SmsTypeEnum.SMS_ORDER_START_TEMP.getValue());
if (config != null) {
String content = MessageFormat.format(config.getConfigValue(), room.getName(), store.getAddress());
return sendSms(phone, SmsTypeEnum.SMS_ORDER_START_TEMP.getCode(), content);
} else {
return Boolean.FALSE;
}
}
@Override
public boolean sendSmsOrderEndRemind(String phone, SStore store, SRoom room) {
return false;
// 通过配置获取短信模版
SysConfig config = sysConfigMapper.checkConfigKeyUnique(SmsTypeEnum.SMS_ORDER_END_TEMP.getValue());
if (config != null) {
String content = MessageFormat.format(config.getConfigValue(), room.getName());
return sendSms(phone, SmsTypeEnum.SMS_ORDER_END_TEMP.getCode(), content);
} else {
return Boolean.FALSE;
}
}
private String getSmsContent(String phone, Integer tag) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment