| | |
| | | @Autowired |
| | | @Lazy |
| | | private EmayService emayService; |
| | | @Autowired |
| | | private SmsConfigMapper smsConfigMapper; |
| | | |
| | | @Value("${debug_model}") |
| | | private boolean debugModel; |
| | |
| | | )>=3){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,超出发送次数,请稍后重试!"); |
| | | } |
| | | |
| | | String code = Constants.getRandom6Num(); |
| | | |
| | | String content = systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode()+"验证码为:"+code+",此验证码有效为3分钟。请勿泄露"; |
| | | |
| | | // boolean result= emayService.sendSingleSms(smsEmail.getPhone(),content); |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getObjType, |
| | | SmsConstants.inventCode).last(" limit 1 ")); |
| | | //开启短信通知 |
| | | if(Objects.nonNull(smsConfig) || Constants.equalsInteger(smsConfig.getStatus(),Constants.ZERO)){ |
| | | if(StringUtils.isNotBlank(smsConfig.getContent())){ |
| | | String content = smsConfig.getContent().replace("{验证码}",code); |
| | | emayService.sendSmsByHk(smsEmail.getPhone(),content); |
| | | // if(!result){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,短信验证码发送失败,请稍后重试!"); |
| | | // } |
| | | |
| | | smsEmail.setRemark(code); |
| | | smsEmail.setIsdeleted(Constants.ZERO); |
| | | smsEmail.setCreateDate(new Date()); |
| | |
| | | smsEmail.setContent(content); |
| | | smsEmail.setObjType(Constants.ZERO+""); |
| | | smsEmailMapper.insert(smsEmail); |
| | | |
| | | return smsEmail.getId(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Override |