From 4e104b06fc508f44717518b3f366603175745954 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 10 十月 2024 14:37:04 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java
index c8798f8..f87b04b 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java
@@ -22,6 +22,7 @@
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -41,6 +42,7 @@
@Autowired
private SystemDictDataBiz systemDictDataBiz;
@Autowired
+ @Lazy
private EmayService emayService;
@Value("${debug_model}")
@@ -107,10 +109,10 @@
smsEmail.setType(Constants.ZERO);
smsEmail.setTitle("鐭俊楠岃瘉鐮�");
smsEmail.setContent(content);
+ smsEmail.setObjType(Constants.ZERO+"");
smsEmailMapper.insert(smsEmail);
return smsEmail.getId();
-
}
@@ -247,4 +249,32 @@
QueryWrapper<SmsEmail> wrapper = new QueryWrapper<>(smsEmail);
return smsEmailMapper.selectCount(wrapper);
}
+
+
+
+
+
+
+
+
+
+ public static void sendBusiness(EmayService emayService ,SmsEmailMapper smsEmailMapper ,List<String> phoneList,String objType,String content,Integer objId){
+ for (String phone:phoneList) {
+ boolean result= emayService.sendSingleSms(phone,content);
+ if(!result){
+ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"瀵逛笉璧凤紝鐭俊楠岃瘉鐮佸彂閫佸け璐ワ紝璇风◢鍚庨噸璇曪紒");
+ }
+ SmsEmail smsEmail = new SmsEmail();
+ smsEmail.setIsdeleted(Constants.ZERO);
+ smsEmail.setCreateDate(new Date());
+ smsEmail.setStatus(Constants.ONE);
+ smsEmail.setType(Constants.ZERO);
+ smsEmail.setTitle("涓氬姟鐭俊");
+ smsEmail.setContent(content);
+ smsEmail.setObjType(objType);
+ smsEmail.setObjId(objId);
+ smsEmailMapper.insert(smsEmail);
+ }
+ }
+
}
--
Gitblit v1.9.3