|  |  |  | 
|---|
|  |  |  | smsEmail.setType(Constants.ZERO); | 
|---|
|  |  |  | smsEmail.setTitle("短信验证码"); | 
|---|
|  |  |  | smsEmail.setContent(content); | 
|---|
|  |  |  | smsEmail.setObjType(Constants.ZERO+""); | 
|---|
|  |  |  | smsEmailMapper.insert(smsEmail); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return smsEmail.getId(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|