From 02af384faaa0572008405037e6e8917c7ad22136 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 10 十月 2024 17:11:48 +0800
Subject: [PATCH] 最新版本

---
 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