| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.SmsConstants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.core.utils.*; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.SmsEmailService; |
| | | import com.doumee.service.business.third.EmayService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | 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; |
| | | |
| | | import java.util.Arrays; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 短信邮件信息表Service实现 |
| | |
| | | @Value("${debug_model}") |
| | | private boolean debugModel; |
| | | |
| | | public static void isCaptcheValide(SmsEmailMapper smsEmailMapper, String phone, String captche) { |
| | | public static void isCaptcheValide(com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper, String phone, String captche) { |
| | | SmsEmail model = smsEmailMapper.selectOne(new QueryWrapper<SmsEmail>().lambda() |
| | | .eq(SmsEmail::getType, Constants.ZERO) |
| | | .eq(SmsEmail::getPhone, phone) |
| | |
| | | model.setEditDate(new Date()); |
| | | smsEmailMapper.updateById(model); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Integer create(SmsEmail smsEmail) { |
| | |
| | | |
| | | String content = systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode()+"验证码为:"+code+",此验证码有效为3分钟。请勿泄露"; |
| | | |
| | | boolean result= emayService.sendSingleSms(smsEmail.getPhone(),content); |
| | | if(!result){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,短信验证码发送失败,请稍后重试!"); |
| | | } |
| | | // boolean result= emayService.sendSingleSms(smsEmail.getPhone(),content); |
| | | emayService.sendSmsByHk(smsEmail.getPhone(),content); |
| | | // if(!result){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,短信验证码发送失败,请稍后重试!"); |
| | | // } |
| | | |
| | | smsEmail.setRemark(code); |
| | | smsEmail.setIsdeleted(Constants.ZERO); |
| | |
| | | * @param msg |
| | | * @param auditUser |
| | | */ |
| | | public static void sendVisitSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | public static void sendVisitSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | VisitsMapper visitsMapper, Integer objId, String objCode, String msg, List<String> auditUser){ |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | |
| | | * @param msg |
| | | * @param auditUser |
| | | */ |
| | | public static void sendVisitReportSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | VisitsMapper visitsMapper, Integer objId, String objCode, String msg, List<String> auditUser){ |
| | | public static void sendVisitReportSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | VisitsMapper visitsMapper, Integer objId, String objCode, String msg, List<String> auditUser){ |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | | objCode).last(" limit 1 ")); |
| | |
| | | * @param objCode |
| | | * @param auditUser |
| | | */ |
| | | public static void sendHiddenDangerSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | HiddenDangerMapper hiddenDangerMapper, Integer objId, String objCode,List<String> auditUser){ |
| | | public static void sendHiddenDangerSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | HiddenDangerMapper hiddenDangerMapper, Integer objId, String objCode, List<String> auditUser){ |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | | objCode).last(" limit 1 ")); |
| | |
| | | * @param msg |
| | | * @param userList |
| | | */ |
| | | public static void sendCarUseSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | CarUseBookMapper carUseBookMapper, Integer objId, String objCode, String msg, List<String> userList){ |
| | | public static void sendCarUseSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | CarUseBookMapper carUseBookMapper, Integer objId, String objCode, String msg, List<String> userList){ |
| | | //您有一条【用车申请】需要处理,详细信息请前往微信公众号查看。 |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | |
| | | * @param msg |
| | | * @param auditUser |
| | | */ |
| | | public static void sendPlatformBookSms(SystemDictDataBiz systemDictDataBiz,EmayService emayService ,SmsEmailMapper smsEmailMapper ,SmsConfigMapper smsConfigMapper, |
| | | PlatformBooksMapper platformBooksMapper,Integer objId,String objCode,String msg,List<String> auditUser){ |
| | | public static void sendPlatformBookSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | PlatformBooksMapper platformBooksMapper, Integer objId, String objCode, String msg, List<String> auditUser){ |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | | objCode).last(" limit 1 ")); |
| | |
| | | * @param objCode |
| | | * @param platformName |
| | | */ |
| | | public static void sendPlatformJobSms(SystemDictDataBiz systemDictDataBiz,EmayService emayService , SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | PlatformJobMapper platformJobMapper, Integer objId, String objCode, String platformName,String newPlatformName){ |
| | | public static void sendPlatformJobSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | PlatformJobMapper platformJobMapper, Integer objId, String objCode, String platformName, String newPlatformName){ |
| | | //platformJobNewJob {车牌号}车主您好,您有一个新的运输任务,详细信息请前往微信公众号查看。 |
| | | //platformJobStopJob {车牌号}车主您好,您的运输任务已被取消,详细信息请前往微信公众号查看。 |
| | | //platformJobCallIn {车牌号}车主您好,请在10分钟内,前往园区等待区等待叫号作业。 |
| | |
| | | smsEmail.setObjType(objType); |
| | | smsEmail.setObjId(objId); |
| | | smsEmailMapper.insert(smsEmail); |
| | | emayService.sendSingleSms(phone,content); |
| | | emayService.sendSmsByHk(phone,content); |
| | | |
| | | |
| | | } |
| | | } |