|
@@ -54,7 +54,6 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
|
|
*/
|
|
*/
|
|
public ProductServiceDTO genProductService(ProductServiceSaveVO productServiceSaveVO) {
|
|
public ProductServiceDTO genProductService(ProductServiceSaveVO productServiceSaveVO) {
|
|
ProductServiceDTO productServiceDTO = new ProductServiceDTO();
|
|
ProductServiceDTO productServiceDTO = new ProductServiceDTO();
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
LantoneProduct lantoneProduct = lantoneProductFacade.getById(productServiceSaveVO.getProductId());
|
|
LantoneProduct lantoneProduct = lantoneProductFacade.getById(productServiceSaveVO.getProductId());
|
|
if (lantoneProduct == null) {
|
|
if (lantoneProduct == null) {
|
|
@@ -107,7 +106,7 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
|
|
serviceToken.setStatus(StatusEnum.Enable.getKey());
|
|
serviceToken.setStatus(StatusEnum.Enable.getKey());
|
|
if (old_serviceToken != null && old_serviceToken.getType().equals(TokenTypeEnum.Trial.getKey())) {
|
|
if (old_serviceToken != null && old_serviceToken.getType().equals(TokenTypeEnum.Trial.getKey())) {
|
|
//如果试用已过期,不允许再生成
|
|
//如果试用已过期,不允许再生成
|
|
- if (calendar.after(old_serviceToken.getExpiringDate())) {
|
|
|
|
|
|
+ if (DateUtil.after(DateUtil.now(), old_serviceToken.getExpiringDate())) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"当前试用账号已过期,不允许再生成令牌");
|
|
"当前试用账号已过期,不允许再生成令牌");
|
|
}
|
|
}
|