验证码
This commit is contained in:
@ -24,9 +24,8 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -47,7 +46,7 @@ public class BizSendMsgTemplateServiceImpl extends ServiceImpl<BizSendMsgTemplat
|
||||
private BizSendMsgLogService msgLogService;
|
||||
@Autowired
|
||||
private BizFuncSwitchConfigMapper funcSwitchConfigMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@Override
|
||||
@ -106,11 +105,12 @@ public class BizSendMsgTemplateServiceImpl extends ServiceImpl<BizSendMsgTemplat
|
||||
public Boolean interestOutcomSendMsg(InterestOutcome interestOutcome) {
|
||||
boolean result = false;
|
||||
BaseCacheUser user = cacheUserService.getCacheUser();
|
||||
// user.setOrganizationId("111").setUserId("ex-wanghy623").setFullName("曹鹏");
|
||||
String verifyCode = String.valueOf((int)(Math.random()*900000 + 100000));
|
||||
interestOutcome.setCheckCode(verifyCode);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
||||
String nowTime = df.format(now);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
|
||||
String nowTime = now.format(formatter);
|
||||
//模板ID
|
||||
String templateId = "interest_outcome_msg";
|
||||
QueryWrapper<BizSendMsgTemplate> query = new QueryWrapper<>(new BizSendMsgTemplate().setTemplateId(templateId));
|
||||
@ -142,7 +142,7 @@ public class BizSendMsgTemplateServiceImpl extends ServiceImpl<BizSendMsgTemplat
|
||||
}
|
||||
redisTemplate.opsForValue().set("subAcctNum:" + interestOutcome.getSubAcctNum(), JSON.toJSONString(interestOutcome), 5, TimeUnit.MINUTES);
|
||||
//active使能(1:是;0:否)
|
||||
int active =funcSwitchConfigMapper.selectByType("send-sms-func");
|
||||
int active =funcSwitchConfigMapper.selectByType("send-interest-sms-func");
|
||||
//发送状态;0-失败;1-成功;2-短信功能未开启
|
||||
int sendResult = 2;
|
||||
if (active==1) {
|
||||
|
@ -36,8 +36,8 @@ spring:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
username: mall
|
||||
password: unicom
|
||||
jdbc-url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
||||
jdbc-url: jdbc:mysql://10.125.160.30:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://10.125.160.30:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
||||
filters: stat,wall,log4j
|
||||
maxActive: 20
|
||||
initialSize: 1
|
||||
@ -172,6 +172,8 @@ mconfig:
|
||||
bss:
|
||||
app-id: 2ICalrrQ0F
|
||||
app-secret: 1mb6n6635cJkDb3pEQPUFXc2nRJ8RPaS
|
||||
app-url-test: 2ICalrrQ0F
|
||||
app-url: 1mb6n6635cJkDb3pEQPUFXc2nRJ8RPaS
|
||||
document:
|
||||
clientHttpUrl: http://10.242.31.158:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749
|
||||
|
||||
@ -197,3 +199,20 @@ xxl:
|
||||
port: 18181
|
||||
logpath: /data/applogs/xxl-job/jobhandler
|
||||
logretentiondays: 30
|
||||
|
||||
|
||||
unifast:
|
||||
sso:
|
||||
public-key: 11
|
||||
clientId: 1
|
||||
redirectUrl: 1
|
||||
getCode:
|
||||
url: 1
|
||||
|
||||
|
||||
client:
|
||||
clientHttpUrl: http://10.242.31.158:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749
|
||||
allow:
|
||||
apis:
|
||||
- ^GET\./?v1/send/msg/interest/getcode$
|
||||
- ^POST\./?v1/send/msg/interest/code$
|
Reference in New Issue
Block a user