Browse Source

增加时间耗费计算

xuefy 3 years ago
parent
commit
fda4450493

+ 22 - 1
sc-service/src/main/java/com/huyi/service/credit/controller/OwnMessageController.java

@@ -489,10 +489,17 @@ public class OwnMessageController extends BaseController {
                 //替换word文档中的变量
                 //String directory = FileConstants.REMOTE_FILE_PATH;
                 String directory = configService.selectConfigByKey("credit_file_path").getMsg();
+                //获取开始时间
+                Long start = System.currentTimeMillis();
+
                 //文件下载
                 filePath = downloadFile(fileInfList.get(i).getPfiFileUrl(),fileInfList.get(i).getPfiFileName());
+                //获取结束时间
+                Long end = System.currentTimeMillis();
+                System.out.println("文件下载花费时间:"+(end-start));
                 //往word中填充数据
                 Map<String,Object> ps = new HashMap<>();
+
                 //开立方
                 ps.put(DocumentConstant.OPEN_NAME,openName);
                 //开立方社会统一代码
@@ -521,8 +528,11 @@ public class OwnMessageController extends BaseController {
                 ps.put(DocumentConstant.ZFI_PAYMENT_NUMBER,zfiPaymentNumber);
                 //承诺还款日
                 ps.put(DocumentConstant.EXPIRE_DATE,expireDateA);
+                Long startA = System.currentTimeMillis();
                 //调用替换word中的变量
                 WordUtil.wordTemplate(filePath,filePath,ps);
+                Long endA = System.currentTimeMillis();
+                System.out.println("替换word中的变量花费时间:"+(endA-startA));
                 /**-------- word 变量替换 结束--------**/
                 /**-------- word 转PDF 开始--------**/
                 //保存为PDF格式
@@ -538,7 +548,10 @@ public class OwnMessageController extends BaseController {
             } else {
                 // 文件服务器的文件下载到本地
                 PubFileInf fileInf = fileInfService.getById(financeFileList.get(0).getZffrFileId());
+                Long startB = System.currentTimeMillis();
                 filePath = downloadFile(fileInf.getPfiFileUrl(), fileInf.getPfiFileName());
+                Long endB = System.currentTimeMillis();
+                System.out.println("文件服务器的文件下载到本地花费时间:"+(endB-startB));
                 int index  = fileInf.getPfiFileName().lastIndexOf(".");
                 fileName = fileInf.getPfiFileName().substring(0,index);
             }
@@ -593,7 +606,10 @@ public class OwnMessageController extends BaseController {
             String channel = configService.selectConfigByKey("cfca_channel").getMsg();
             //platId
             String platId = configService.selectConfigByKey("cfca_platId").getMsg();
+            Long startC = System.currentTimeMillis();
             JSONObject jsonObject = AxqCommonUtil.contractSigning(userId,"MM",fileName,keyWords,"0","0","250","250",projectCode,filePath,new HttpConnector(jksPath,keyStorePassword, channel,platId));
+            Long endC = System.currentTimeMillis();
+            System.out.println("盖章花费时间:"+(endC-startC));
             /**-------- CFCA盖章 结束--------**/
             /**-------- CFCA盖章文件下载 开始--------**/
             //获取错误码
@@ -612,7 +628,10 @@ public class OwnMessageController extends BaseController {
             //String path = "D:/zhuomian/cfca/";
             String path = configService.selectConfigByKey("cfca_file_path").getMsg();
             //下载文件
+            Long startD = System.currentTimeMillis();
             AxqCommonUtil.downloadFile(contractNo,path,new HttpConnector(jksPath,keyStorePassword,channel,platId));
+            Long endD = System.currentTimeMillis();
+            System.out.println("axq文件下载花费时间:"+(endD-startD));
             /**-------- CFCA盖章文件下载 结束--------**/
             //上传到文件服务器
             //获取token
@@ -623,9 +642,11 @@ public class OwnMessageController extends BaseController {
             int index  = fileInfList.get(i).getPfiFileName().lastIndexOf(".");
 
 //            MultipartFile multipartFile =new MockMultipartFile("file", file.getName(), "text/plain", IOUtils.toByteArray(input));
+            Long startE = System.currentTimeMillis();
             MultipartFile multipartFile =new MockMultipartFile("file", fileInfList.get(i).getPfiFileName().substring(0,index)+".pdf", "text/plain", IOUtils.toByteArray(input));
             R<com.tianhu.system.api.domain.PubFileInf> fileResult = remoteFileService.uploadFile(multipartFile,"01", "02","00",companyId,token);
-
+            Long endE = System.currentTimeMillis();
+            System.out.println("文件上传服务器花费时间:"+(endE-startE));
             ZcFinanceFileRel financeFileRel;
             // 不是已盖章文件
             if (financeFileList.size() == 0) {