DownloadContractRest.java
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.thinkgem.jeesite.modules.eci.method;
import com.thinkgem.jeesite.modules.eci.dao.ElecLicenseInfoDao;
import com.thinkgem.jeesite.modules.eci.entity.ElecLicenseInfo;
import com.thinkgem.jeesite.modules.eci.utils.EciHttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 合同下载
*/
@Component
public class DownloadContractRest {
// private static final String DOCUMENT_DOWNLOAD = "/document/download";
@Autowired
ElecLicenseInfoDao licenseInfoDao;
/**
* 下载合同方法
* @return
*/
public void accessDownload() {
List<ElecLicenseInfo> waitForDownloads = licenseInfoDao.getWaitForDownload();
for (ElecLicenseInfo waitForDownload : waitForDownloads) {
String bizId = waitForDownload.getBizId();
String documentId = waitForDownload.getDocumentId();
// String url = Global.ECI_HOST + DOCUMENT_DOWNLOAD + "?documentId=" + documentId;
String ofdPath = EciHttpUtil.download(documentId);
if (ofdPath != null) {
//入库ofd文件地址
licenseInfoDao.updateOfdWjdz(bizId, ofdPath);
}
}
}
}