From 29d76f8a034cb2bbeccee258e97f66f2e2d87451 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期四, 10 十月 2024 14:57:39 +0800 Subject: [PATCH] 最新版本 --- server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java | 27 ++++++++++++++++++++++++++- 1 files changed, 26 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..66cc56e 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,27 @@ 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){ + //TODO 鏄惁鍙戦�佺煭淇� + + 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