|
@@ -643,6 +643,20 @@ public class ProjectUtil {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public void checkLicense(String userId,Integer numSimulationLicense, Integer numDynamicLicense) {
|
|
|
|
+ String key1 = "user:" + userId + ":using-license:vtd";
|
|
|
|
+ final String usingLicense1 = customRedisClient.get(key1);
|
|
|
|
+ if (StringUtil.isEmpty(usingLicense1)) {
|
|
|
|
+ customRedisClient.set(key1, numSimulationLicense.toString());
|
|
|
|
+ }
|
|
|
|
+ String key2 = "user:" + userId + ":using-license:carsim";
|
|
|
|
+ final String usingLicense2 = customRedisClient.get(key2);
|
|
|
|
+ if (StringUtil.isEmpty(usingLicense2)) {
|
|
|
|
+ customRedisClient.set(key2, numDynamicLicense.toString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public Integer getUsingLicenseNumber(String userId, String modelType) {
|
|
public Integer getUsingLicenseNumber(String userId, String modelType) {
|
|
String key;
|
|
String key;
|
|
if (DictConstants.MODEL_TYPE_VTD.equals(modelType)) {
|
|
if (DictConstants.MODEL_TYPE_VTD.equals(modelType)) {
|
|
@@ -729,4 +743,5 @@ public class ProjectUtil {
|
|
throw new RuntimeException("未知项目类型:" + projectType);
|
|
throw new RuntimeException("未知项目类型:" + projectType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|