|
@@ -189,86 +189,87 @@ public class VppLicenseCodeServiceImpl implements VppLicenseCodeService {
|
|
|
});
|
|
|
//修改团队的剩余序列码数量
|
|
|
reduceLicenseRemainNum(memberIds.size() * productIds.size(), teamId);
|
|
|
- LICENSE_CODE_SEND_MAIL_THREAD_POOL.submit(() -> {
|
|
|
- //通知用户获得了哪个产品的序列码的授权
|
|
|
- memberCodeMap.forEach((key,value) -> {
|
|
|
- List<LicenseCodes> codes = value;
|
|
|
-// String text = "";
|
|
|
- String cdKey = "";
|
|
|
- String productName = "";
|
|
|
- // 跨平台标记3
|
|
|
- // 平台类型 1win 2mac 3cross
|
|
|
- int platformType = 0;
|
|
|
- String winDownloadUrl = "<tr>\n" +
|
|
|
- " <td style=\"padding-top: 8px; font-size: 20px; line-height: 28px; color: #121E3F;\"><a target=\"_blank\" href=\"https://www.pdfreaderpro.com/windows/download\" style=\"color: #3B99FC;\">Click HERE</a></td>\n" +
|
|
|
- " </tr>\n";
|
|
|
- String macDownloadUrl = "<tr>\n" +
|
|
|
- " <td style=\"padding-top: 8px; font-size: 20px; line-height: 28px; color: #121E3F;\"><a target=\"_blank\" href=\"https://www.pdfreaderpro.com/downloading\" style=\"color: #3B99FC;\">Click HERE</a></td>\n" +
|
|
|
- " </tr>\n";
|
|
|
- String platformDownloadUrl = "<tr>\n" +
|
|
|
- " <td style=\"padding-top: 8px; font-size: 20px; line-height: 28px; color: #121E3F;\">\n" +
|
|
|
- " <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/windows/download\" style=\"color: #3B99FC;\">-> Download Windows</a> <br/>\n" +
|
|
|
- " <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/downloading\" style=\"color: #3B99FC;\">-> Download Mac</a>\n" +
|
|
|
- " </td> \n" +
|
|
|
- " </tr>";
|
|
|
-
|
|
|
- String winHelpUrl = "<tr>\n" +
|
|
|
- " <td style=\"font-family: Rubik; padding: 0 40px 20px; font-size: 16px; line-height: 19px; color: #121E3F;\">\n" +
|
|
|
- " How to activate license? Click <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/windows/help/how-to-use-license\" style=\"color: #3B99FC;\">Here</a> to check. \n" +
|
|
|
- " </td>\n" +
|
|
|
- " </tr>\n";
|
|
|
- String macHelpUrl = "<tr>\n" +
|
|
|
- " <td style=\"font-family: Rubik; padding: 0 40px 20px; font-size: 16px; line-height: 19px; color: #121E3F;\">\n" +
|
|
|
- " How to activate license? Click <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/mac/help/how-to-use-license-code\" style=\"color: #3B99FC;\">Here</a> to check. \n" +
|
|
|
- " </td>\n" +
|
|
|
- " </tr>\n";
|
|
|
- String platformHelpUrl = "<tr>\n" +
|
|
|
- " <td style=\"font-family: Rubik; padding: 0 40px 20px; font-size: 16px; line-height: 19px; color: #121E3F;\">\n" +
|
|
|
- " How to activate license? <br/>\n" +
|
|
|
- " <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/mac/help/how-to-use-license-code\" style=\"color: #3B99FC;\">-> Activate license on Mac</a> <br/>\n" +
|
|
|
- " <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/windows/help/how-to-use-license\" style=\"color: #3B99FC;\">-> Activate license on Windows</a>\n" +
|
|
|
- " </td>\n" +
|
|
|
- " </tr>";
|
|
|
- for (LicenseCodes code : codes) {
|
|
|
- Products product = productService.getById(code.getProductId());
|
|
|
- productName = productName + product.getName() + "<br/>";
|
|
|
- cdKey = cdKey + code.getCdkey() + "<br/>";
|
|
|
- if (product.getCode().contains("platform")) {
|
|
|
- platformType = 3;
|
|
|
- }
|
|
|
- if (product.getCode().contains("windows")) {
|
|
|
- // 判断之前有没有别的平台,或者跨平台序列码
|
|
|
- if (platformType == 2 || platformType == 3) {
|
|
|
- platformType = 3;
|
|
|
- } else {
|
|
|
- platformType = 1;
|
|
|
- }
|
|
|
- }
|
|
|
- if (product.getCode().contains("mac")) {
|
|
|
- // 判断之前有没有别的平台,或者跨平台序列码
|
|
|
- if (platformType == 1 || platformType == 3) {
|
|
|
- platformType = 3;
|
|
|
- } else {
|
|
|
- platformType = 2;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- VppMember vppMember = vppMemberService.getById(key);
|
|
|
- // 根据平台发送序列码授权邮件
|
|
|
- log.info("根据平台发送序列码授权邮件:productWin{};cdKeyWin:{};platformType:{}", productName, cdKey, platformType);
|
|
|
- switch(platformType) {
|
|
|
- case 1:
|
|
|
- sendAssignEmail(cdKey, productName, vppMember, winDownloadUrl, winHelpUrl);
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- sendAssignEmail(cdKey, productName, vppMember, macDownloadUrl, macHelpUrl);
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- sendAssignEmail(cdKey, productName, vppMember, platformDownloadUrl, platformHelpUrl);
|
|
|
- break;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ //私有化部署不需要通知
|
|
|
+// LICENSE_CODE_SEND_MAIL_THREAD_POOL.submit(() -> {
|
|
|
+// //通知用户获得了哪个产品的序列码的授权
|
|
|
+// memberCodeMap.forEach((key,value) -> {
|
|
|
+// List<LicenseCodes> codes = value;
|
|
|
+//// String text = "";
|
|
|
+// String cdKey = "";
|
|
|
+// String productName = "";
|
|
|
+// // 跨平台标记3
|
|
|
+// // 平台类型 1win 2mac 3cross
|
|
|
+// int platformType = 0;
|
|
|
+// String winDownloadUrl = "<tr>\n" +
|
|
|
+// " <td style=\"padding-top: 8px; font-size: 20px; line-height: 28px; color: #121E3F;\"><a target=\"_blank\" href=\"https://www.pdfreaderpro.com/windows/download\" style=\"color: #3B99FC;\">Click HERE</a></td>\n" +
|
|
|
+// " </tr>\n";
|
|
|
+// String macDownloadUrl = "<tr>\n" +
|
|
|
+// " <td style=\"padding-top: 8px; font-size: 20px; line-height: 28px; color: #121E3F;\"><a target=\"_blank\" href=\"https://www.pdfreaderpro.com/downloading\" style=\"color: #3B99FC;\">Click HERE</a></td>\n" +
|
|
|
+// " </tr>\n";
|
|
|
+// String platformDownloadUrl = "<tr>\n" +
|
|
|
+// " <td style=\"padding-top: 8px; font-size: 20px; line-height: 28px; color: #121E3F;\">\n" +
|
|
|
+// " <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/windows/download\" style=\"color: #3B99FC;\">-> Download Windows</a> <br/>\n" +
|
|
|
+// " <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/downloading\" style=\"color: #3B99FC;\">-> Download Mac</a>\n" +
|
|
|
+// " </td> \n" +
|
|
|
+// " </tr>";
|
|
|
+//
|
|
|
+// String winHelpUrl = "<tr>\n" +
|
|
|
+// " <td style=\"font-family: Rubik; padding: 0 40px 20px; font-size: 16px; line-height: 19px; color: #121E3F;\">\n" +
|
|
|
+// " How to activate license? Click <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/windows/help/how-to-use-license\" style=\"color: #3B99FC;\">Here</a> to check. \n" +
|
|
|
+// " </td>\n" +
|
|
|
+// " </tr>\n";
|
|
|
+// String macHelpUrl = "<tr>\n" +
|
|
|
+// " <td style=\"font-family: Rubik; padding: 0 40px 20px; font-size: 16px; line-height: 19px; color: #121E3F;\">\n" +
|
|
|
+// " How to activate license? Click <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/mac/help/how-to-use-license-code\" style=\"color: #3B99FC;\">Here</a> to check. \n" +
|
|
|
+// " </td>\n" +
|
|
|
+// " </tr>\n";
|
|
|
+// String platformHelpUrl = "<tr>\n" +
|
|
|
+// " <td style=\"font-family: Rubik; padding: 0 40px 20px; font-size: 16px; line-height: 19px; color: #121E3F;\">\n" +
|
|
|
+// " How to activate license? <br/>\n" +
|
|
|
+// " <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/mac/help/how-to-use-license-code\" style=\"color: #3B99FC;\">-> Activate license on Mac</a> <br/>\n" +
|
|
|
+// " <a target=\"_blank\" href=\"https://www.pdfreaderpro.com/windows/help/how-to-use-license\" style=\"color: #3B99FC;\">-> Activate license on Windows</a>\n" +
|
|
|
+// " </td>\n" +
|
|
|
+// " </tr>";
|
|
|
+// for (LicenseCodes code : codes) {
|
|
|
+// Products product = productService.getById(code.getProductId());
|
|
|
+// productName = productName + product.getName() + "<br/>";
|
|
|
+// cdKey = cdKey + code.getCdkey() + "<br/>";
|
|
|
+// if (product.getCode().contains("platform")) {
|
|
|
+// platformType = 3;
|
|
|
+// }
|
|
|
+// if (product.getCode().contains("windows")) {
|
|
|
+// // 判断之前有没有别的平台,或者跨平台序列码
|
|
|
+// if (platformType == 2 || platformType == 3) {
|
|
|
+// platformType = 3;
|
|
|
+// } else {
|
|
|
+// platformType = 1;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (product.getCode().contains("mac")) {
|
|
|
+// // 判断之前有没有别的平台,或者跨平台序列码
|
|
|
+// if (platformType == 1 || platformType == 3) {
|
|
|
+// platformType = 3;
|
|
|
+// } else {
|
|
|
+// platformType = 2;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//// VppMember vppMember = vppMemberService.getById(key);
|
|
|
+//// // 根据平台发送序列码授权邮件
|
|
|
+//// log.info("根据平台发送序列码授权邮件:productWin{};cdKeyWin:{};platformType:{}", productName, cdKey, platformType);
|
|
|
+//// switch(platformType) {
|
|
|
+//// case 1:
|
|
|
+//// sendAssignEmail(cdKey, productName, vppMember, winDownloadUrl, winHelpUrl);
|
|
|
+//// break;
|
|
|
+//// case 2:
|
|
|
+//// sendAssignEmail(cdKey, productName, vppMember, macDownloadUrl, macHelpUrl);
|
|
|
+//// break;
|
|
|
+//// case 3:
|
|
|
+//// sendAssignEmail(cdKey, productName, vppMember, platformDownloadUrl, platformHelpUrl);
|
|
|
+//// break;
|
|
|
+//// }
|
|
|
+// });
|
|
|
+// });
|
|
|
|
|
|
}
|
|
|
|
|
@@ -463,14 +464,14 @@ public class VppLicenseCodeServiceImpl implements VppLicenseCodeService {
|
|
|
log.info("解绑激活设备{};{}", vppLicenseCode.getCdkey(), DateUtil.date().toString("yyyy-MM-dd HH:mm:ss:SSS"));
|
|
|
vppDeviceService.unBindByMemberId(null, Collections.singletonList(vppLicenseCode.getCdkey()));
|
|
|
count++;
|
|
|
- log.info("发送邮件前{}", DateUtil.date().toString("yyyy-MM-dd HH:mm:ss:SSS"));
|
|
|
- // 发送邮件
|
|
|
- ThreadPoolSingleUtil.getInstance().excute(() -> {
|
|
|
- String text = String.format(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.text(), vppMember.getEmail(), product.getName(), product.getName(), user.getEmail());
|
|
|
- // 替换图片动态地址和取消订阅链接
|
|
|
- text = text.replace("emailImagesUrl", emailImagesUrl).replace("cancelEmailUrl", readerproUrl + "/unsubscribe?email=" + vppMember.getEmail());
|
|
|
-// emailUtils.sendMail(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.subject(), text, Collections.singletonList(vppMember.getEmail()));
|
|
|
- });
|
|
|
+// log.info("发送邮件前{}", DateUtil.date().toString("yyyy-MM-dd HH:mm:ss:SSS"));
|
|
|
+// // 发送邮件
|
|
|
+// ThreadPoolSingleUtil.getInstance().excute(() -> {
|
|
|
+// String text = String.format(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.text(), vppMember.getEmail(), product.getName(), product.getName(), user.getEmail());
|
|
|
+// // 替换图片动态地址和取消订阅链接
|
|
|
+// text = text.replace("emailImagesUrl", emailImagesUrl).replace("cancelEmailUrl", readerproUrl + "/unsubscribe?email=" + vppMember.getEmail());
|
|
|
+//// emailUtils.sendMail(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.subject(), text, Collections.singletonList(vppMember.getEmail()));
|
|
|
+// });
|
|
|
}
|
|
|
}
|
|
|
} catch (IOException e) {
|