|
@@ -223,10 +223,32 @@ public class AuthAccessTokenServiceImpl extends ServiceImpl<AuthAccessTokenMappe
|
|
|
String licenseStr = AESUtil.desEncrypt(company.getLicense());
|
|
String licenseStr = AESUtil.desEncrypt(company.getLicense());
|
|
|
if(licenseStr != null ){
|
|
if(licenseStr != null ){
|
|
|
Map<String,Object> licenseMap = JSON.parseObject(licenseStr,Map.class);
|
|
Map<String,Object> licenseMap = JSON.parseObject(licenseStr,Map.class);
|
|
|
- company.setWebMaxNum(Integer.parseInt(licenseMap.get("web_max_num").toString()));
|
|
|
|
|
- company.setWxMaxNum(Integer.parseInt(licenseMap.get("wx_max_num").toString()));
|
|
|
|
|
- company.setEndDate(LocalDate.parse(licenseMap.get("end_date").toString()));
|
|
|
|
|
|
|
+ LocalDate endDate = LocalDate.parse(licenseMap.get("end_date").toString());
|
|
|
|
|
+ // 判断是否到期
|
|
|
|
|
+ LocalDate nowDate = LocalDate.now();
|
|
|
|
|
+ if(endDate.isBefore(nowDate)){
|
|
|
|
|
+ return ResponseResultUtil.error(ErrorCodeEnum.LICENSE_OVER_DATE.getCode(), ErrorCodeEnum.LICENSE_OVER_DATE.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ if(licenseMap.get("web_max_num") != null){
|
|
|
|
|
+ company.setWebMaxNum(Integer.parseInt(licenseMap.get("web_max_num").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(licenseMap.get("wx_max_num") != null){
|
|
|
|
|
+ company.setWxMaxNum(Integer.parseInt(licenseMap.get("wx_max_num").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ company.setEndDate(endDate);
|
|
|
|
|
+ if(licenseMap.get("user_end_date") != null){
|
|
|
|
|
+ company.setUserEndDate(LocalDate.parse(licenseMap.get("user_end_date").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(licenseMap.get("vip") != null){
|
|
|
|
|
+ company.setVip(Boolean.parseBoolean(licenseMap.get("vip").toString()));
|
|
|
|
|
+ }
|
|
|
company.setGradeCode(licenseMap.get("grade_code").toString());
|
|
company.setGradeCode(licenseMap.get("grade_code").toString());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // 获取最近一次的交易记录
|
|
|
|
|
+ List<TradeResponse> tradeResponses = tradeMapper.selectTrade(new Trade().setCpId(company.getCpId()));
|
|
|
|
|
+ if(tradeResponses != null && tradeResponses.size() >0){
|
|
|
|
|
+ company.setTrade(tradeResponses.get(0));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
JWTGenerator jwtGenerator = new JWTGenerator();
|
|
JWTGenerator jwtGenerator = new JWTGenerator();
|
|
|
jwtGenerator.setSalt(username);
|
|
jwtGenerator.setSalt(username);
|
|
@@ -557,6 +579,9 @@ public class AuthAccessTokenServiceImpl extends ServiceImpl<AuthAccessTokenMappe
|
|
|
if(licenseMap.get("user_end_date") != null){
|
|
if(licenseMap.get("user_end_date") != null){
|
|
|
company.setUserEndDate(LocalDate.parse(licenseMap.get("user_end_date").toString()));
|
|
company.setUserEndDate(LocalDate.parse(licenseMap.get("user_end_date").toString()));
|
|
|
}
|
|
}
|
|
|
|
|
+ if(licenseMap.get("vip") != null){
|
|
|
|
|
+ company.setVip(Boolean.parseBoolean(licenseMap.get("vip").toString()));
|
|
|
|
|
+ }
|
|
|
company.setGradeCode(licenseMap.get("grade_code").toString());
|
|
company.setGradeCode(licenseMap.get("grade_code").toString());
|
|
|
}else{
|
|
}else{
|
|
|
// 获取最近一次的交易记录
|
|
// 获取最近一次的交易记录
|