|
@@ -54,6 +54,7 @@ import com.ym.mec.biz.service.VipGroupService;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.thirdparty.eseal.ESealPlugin;
|
|
|
import com.ym.mec.thirdparty.storage.StoragePlugin;
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
|
import com.ym.mec.util.freemarker.FreemarkerTemplateEngine;
|
|
|
import com.ym.mec.util.money.MoneyUtil;
|
|
|
import com.ym.mec.util.pdf.PDFUtil;
|
|
@@ -110,6 +111,8 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
private String contractBaseDir;
|
|
|
|
|
|
private DateFormat dateFormatOss = new SimpleDateFormat("yyyy/MM/dd");
|
|
|
+
|
|
|
+ private DateFormat dateFormat1 = new SimpleDateFormat("yyMMddHHmmSS");
|
|
|
|
|
|
@Override
|
|
|
public void afterPropertiesSet() throws Exception {
|
|
@@ -218,6 +221,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
Date date = new Date();
|
|
|
// 上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|
|
|
+ dateStrOss = dateStrOss + "/" + DateUtil.getHour(date);
|
|
|
String pdfFilePath = storagePlugin.uploadFile(dateStrOss, srcFile);
|
|
|
|
|
|
SysUserContracts sysUserContracts = new SysUserContracts();
|
|
@@ -275,9 +279,10 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
}
|
|
|
sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
|
|
|
}
|
|
|
+ Date date = new Date();
|
|
|
|
|
|
// 合成freemarker
|
|
|
- String srcPdfPath = contractBaseDir + "/courses/" + userId + ".pdf";
|
|
|
+ String srcPdfPath = contractBaseDir + "/courses/" + dateFormat1.format(date) + "/" + userId + ".pdf";
|
|
|
|
|
|
File srcFile = new File(srcPdfPath);
|
|
|
|
|
@@ -357,9 +362,9 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
eSealPlugin.organSign(organTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
|
|
|
- Date date = new Date();
|
|
|
// 上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|
|
|
+ dateStrOss = dateStrOss + "/" + DateUtil.getHour(date);
|
|
|
String pdfFilePath = storagePlugin.uploadFile(dateStrOss, srcFile);
|
|
|
|
|
|
SysUserContracts sysUserContracts = new SysUserContracts();
|
|
@@ -461,9 +466,10 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
}
|
|
|
sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
|
|
|
}
|
|
|
+ Date date = new Date();
|
|
|
|
|
|
// 合成freemarker
|
|
|
- String srcPdfPath = contractBaseDir + "/courses/" + userId + ".pdf";
|
|
|
+ String srcPdfPath = contractBaseDir + "/courses/" + dateFormat1.format(date) + "/" + userId + ".pdf";
|
|
|
|
|
|
File srcFile = new File(srcPdfPath);
|
|
|
|
|
@@ -517,9 +523,9 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
|
|
|
- Date date = new Date();
|
|
|
// 上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|
|
|
+ dateStrOss = dateStrOss + "/" + DateUtil.getHour(date);
|
|
|
String pdfFilePath = storagePlugin.uploadFile(dateStrOss, srcFile);
|
|
|
|
|
|
SysUserContracts sysUserContracts = new SysUserContracts();
|
|
@@ -597,9 +603,10 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
}
|
|
|
sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
|
|
|
}
|
|
|
+ Date date = new Date();
|
|
|
|
|
|
// 合成freemarker
|
|
|
- String srcPdfPath = contractBaseDir + "/goods/" + userId + ".pdf";
|
|
|
+ String srcPdfPath = contractBaseDir + "/courses/" + dateFormat1.format(date) + "/" + userId + ".pdf";
|
|
|
|
|
|
File srcFile = new File(srcPdfPath);
|
|
|
|
|
@@ -681,9 +688,9 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
|
|
|
- Date date = new Date();
|
|
|
// 上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|
|
|
+ dateStrOss = dateStrOss + "/" + DateUtil.getHour(date);
|
|
|
String pdfFilePath = storagePlugin.uploadFile(dateStrOss, srcFile);
|
|
|
|
|
|
SysUserContracts sysUserContracts = new SysUserContracts();
|