|
@@ -545,11 +545,15 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
private Map<String, Object> getContractParam(TenantInfoInfoPageVo tenantInfo, Date now) {
|
|
private Map<String, Object> getContractParam(TenantInfoInfoPageVo tenantInfo, Date now) {
|
|
//将数据转换为Map
|
|
//将数据转换为Map
|
|
Map<String, Object> param = toMap(tenantInfo);
|
|
Map<String, Object> param = toMap(tenantInfo);
|
|
|
|
+ //当前时间
|
|
param.put("nowDate", DateUtils.formatDate(now, "yyyy年MM月dd日"));
|
|
param.put("nowDate", DateUtils.formatDate(now, "yyyy年MM月dd日"));
|
|
|
|
+ //服务过期时间
|
|
param.put("expireDate", DateUtils.formatDate(getExpiryDate(tenantInfo.getExpiryCount(), tenantInfo.getExpiryUnit(), now), "yyyy年MM月dd日"));
|
|
param.put("expireDate", DateUtils.formatDate(getExpiryDate(tenantInfo.getExpiryCount(), tenantInfo.getExpiryUnit(), now), "yyyy年MM月dd日"));
|
|
|
|
+ //购买服务的时长单位
|
|
param.put("expiryUnit", TenantProductInfo.MONTH.equals(tenantInfo.getExpiryUnit()) ? "月" : "年");
|
|
param.put("expiryUnit", TenantProductInfo.MONTH.equals(tenantInfo.getExpiryUnit()) ? "月" : "年");
|
|
|
|
+ //乙方公章
|
|
param.put("officialSealB", "https://daya.ks3-cn-beijing.ksyun.com/202202/Sx6rzWm.png");
|
|
param.put("officialSealB", "https://daya.ks3-cn-beijing.ksyun.com/202202/Sx6rzWm.png");
|
|
- //写入产品名称
|
|
|
|
|
|
+ //获取产品名称
|
|
opsContractData(tenantInfo.getServeId(), platformServeService::queryProductNameById,
|
|
opsContractData(tenantInfo.getServeId(), platformServeService::queryProductNameById,
|
|
"未查询到产品信息!",
|
|
"未查询到产品信息!",
|
|
param::put, "productName", PlatformServePageVo::getProductName);
|
|
param::put, "productName", PlatformServePageVo::getProductName);
|
|
@@ -565,13 +569,15 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
TenantConfig tenantConfig = opsContractData(tenantInfo.getId(), tenantConfigService::queryByTenantId,
|
|
TenantConfig tenantConfig = opsContractData(tenantInfo.getId(), tenantConfigService::queryByTenantId,
|
|
"未查询到机构配置信息!",
|
|
"未查询到机构配置信息!",
|
|
param::put, "chargeRate", TenantConfig::getChargeRate);
|
|
param::put, "chargeRate", TenantConfig::getChargeRate);
|
|
|
|
+ //甲方企业公章
|
|
|
|
+ param.put("officialSealA", tenantConfig.getCorporateChops());
|
|
//获取云教室规则 String人数 BigDecimal每分钟扣费标准
|
|
//获取云教室规则 String人数 BigDecimal每分钟扣费标准
|
|
Map<String, BigDecimal> rule = opsContractData(tenantConfig.getConfig(), tenantConfigService::getCloudRoomRule,
|
|
Map<String, BigDecimal> rule = opsContractData(tenantConfig.getConfig(), tenantConfigService::getCloudRoomRule,
|
|
"未查询到云教室的价格配置!",
|
|
"未查询到云教室的价格配置!",
|
|
param::put, "rowspan", Map::size);
|
|
param::put, "rowspan", Map::size);
|
|
|
|
|
|
AtomicReference<String> rowspanData = new AtomicReference<>("");
|
|
AtomicReference<String> rowspanData = new AtomicReference<>("");
|
|
- //生成默认云教室数据
|
|
|
|
|
|
+ //生成云教室扣费的样式
|
|
rule.forEach((k, v) -> {
|
|
rule.forEach((k, v) -> {
|
|
//人数
|
|
//人数
|
|
int count = Integer.parseInt(k) - 1;
|
|
int count = Integer.parseInt(k) - 1;
|
|
@@ -620,7 +626,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
*/
|
|
*/
|
|
public String getContractAndUpLoad(Integer tenantId) {
|
|
public String getContractAndUpLoad(Integer tenantId) {
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
- //创建地址
|
|
|
|
|
|
+ //创建PDF本次缓存地址
|
|
String srcPdfPath = contractBaseDir + lexiaoyaContract + DateUtils.formatDate(now, "yyyyMMddHHmmss") + "/" + tenantId + "_" + java.time.LocalDateTime.now().getSecond() + ".pdf";
|
|
String srcPdfPath = contractBaseDir + lexiaoyaContract + DateUtils.formatDate(now, "yyyyMMddHHmmss") + "/" + tenantId + "_" + java.time.LocalDateTime.now().getSecond() + ".pdf";
|
|
//生成文件
|
|
//生成文件
|
|
File srcFile = new File(srcPdfPath);
|
|
File srcFile = new File(srcPdfPath);
|
|
@@ -640,7 +646,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
String dateStrOss = DateUtils.formatDate(now, "yyyy/MM/dd");
|
|
String dateStrOss = DateUtils.formatDate(now, "yyyy/MM/dd");
|
|
dateStrOss = "oa/" + dateStrOss + "/" + DateUtil.getHour(now);
|
|
dateStrOss = "oa/" + dateStrOss + "/" + DateUtil.getHour(now);
|
|
String pdfFilePath = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, dateStrOss, srcFile);
|
|
String pdfFilePath = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, dateStrOss, srcFile);
|
|
- //删除生成的文件
|
|
|
|
|
|
+ //删除本次PDF生成的文件缓存
|
|
FileUtils.deleteQuietly(srcFile);
|
|
FileUtils.deleteQuietly(srcFile);
|
|
return pdfFilePath;
|
|
return pdfFilePath;
|
|
}
|
|
}
|