Commit c07f4510 authored by 郑建's avatar 郑建

rollback

parent d30bfb99
...@@ -142,7 +142,7 @@ public class BaiHangZhuDaiService { ...@@ -142,7 +142,7 @@ public class BaiHangZhuDaiService {
private Boolean isDebug; private Boolean isDebug;
//众信利民助贷报送的资方id //众信利民助贷报送的资方id
private static Integer[] fundingCorpIds ={420, 520, 580, 650, 670, 810, 240, 640, 700,1080,100040,1030,100030}; //"420,520,580,650,670,810,240,640,700" private static Integer[] fundingCorpIds ={420, 520, 580, 650, 670, 810, 240, 640, 700}; //"420,520,580,650,670,810,240,640,700"
private static final String branchTemplate = "%s 报送 : \n 成功 %s 条,失败 %s 条,白名单跳过 %s 条"; private static final String branchTemplate = "%s 报送 : \n 成功 %s 条,失败 %s 条,白名单跳过 %s 条";
private static final String rootTemplate = "%s \n %s \n %s"; private static final String rootTemplate = "%s \n %s \n %s";
...@@ -1581,20 +1581,32 @@ public class BaiHangZhuDaiService { ...@@ -1581,20 +1581,32 @@ public class BaiHangZhuDaiService {
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
Stopwatch sendWatch = Stopwatch.createStarted(); Stopwatch sendWatch = Stopwatch.createStarted();
List<String> reportList = new ArrayList<>();
reportList.add("#singleLoanAccountInfo");
for (int i = 0; i < loanInfozdList.size(); i++) { for (int i = 0; i < loanInfozdList.size(); i++) {
LoanInfoZhuDai loanInfo = loanInfozdList.get(i); LoanInfoZhuDai loanInfo = loanInfozdList.get(i);
String id = ""; String id = "";
try { try {
String loanInfoReqId = loanInfo.getReqID(); String loanInfoReqId = loanInfo.getReqID();
/* if (loanInfo.getTotalTerm() > 1) {
List<String> targetRepaymentDayList = loanInfoMapper.findTargetRepaymentDayList(loanInfoReqId);
loanInfo.setTargetRepayDateList(String.join(",", targetRepaymentDayList));
}*/
List<String> targetRepaymentDayList = loanInfoMapper.findTargetRepaymentDayList(loanInfoReqId); List<String> targetRepaymentDayList = loanInfoMapper.findTargetRepaymentDayList(loanInfoReqId);
if (targetRepaymentDayList != null && targetRepaymentDayList.size() > 0) { if (targetRepaymentDayList != null && targetRepaymentDayList.size() > 0) {
loanInfo.setTargetRepayDateList(String.join(",", targetRepaymentDayList)); loanInfo.setTargetRepayDateList(String.join(",", targetRepaymentDayList));
// log.info("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList size=" + targetRepaymentDayList.size()); log.info("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList size=" + targetRepaymentDayList.size());
} else { } else {
// log.warn("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList is null."); log.warn("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList is null.");
} }
/*UUID loanInfoId = UUID.randomUUID();
id = loanInfoId.toString().replaceAll("-", "");
loanInfo.setRecordId(id);
try{
loanInfoDbMapper.saveLoanInfoRecordLog(loanInfo);
}catch(Exception e){}
loanInfo.setRecordId(null);
loanInfo.setReqID(id);*/
UUID loanInfoId = UUID.randomUUID(); UUID loanInfoId = UUID.randomUUID();
id = loanInfoId.toString().replaceAll("-", ""); id = loanInfoId.toString().replaceAll("-", "");
try { try {
...@@ -1605,21 +1617,12 @@ public class BaiHangZhuDaiService { ...@@ -1605,21 +1617,12 @@ public class BaiHangZhuDaiService {
} catch (Exception e) { } catch (Exception e) {
log.error("量化派助贷TO百行报送-放款申请保存记录失败", e); log.error("量化派助贷TO百行报送-放款申请保存记录失败", e);
} }
String jsonStr = JSONObject.toJSONString(loanInfo); loanInfo.setReqID(id);
LoanInfoZhuDaiVo loanInfoVo = JSONObject.parseObject(jsonStr, LoanInfoZhuDaiVo.class);
FinTechAgencyBusinessZhuDai finTechAgencyBusiness = JSONObject.parseObject(jsonStr, FinTechAgencyBusinessZhuDai.class); loanInfo.setName(interfaceUploadClient(loanInfo.getName()));
loanInfoVo.setFinTechAgencyBusiness(finTechAgencyBusiness); loanInfo.setPid(interfaceUploadClient(loanInfo.getPid()));
loanInfoVo.setReqID(id); loanInfo.setMobile(interfaceUploadClient(loanInfo.getMobile()));
String resultStr = iHttpService.postBaiHang(baiHangLoanInfoUrl, getHeader(), JSON.toJSONString(loanInfo));
loanInfoVo.setName(tuomin(loanInfo.getName()));
loanInfoVo.setPid(tuomin(loanInfo.getPid()));
loanInfoVo.setMobile(tuomin(loanInfo.getMobile()));
if (DateUtils.parseDate("yyyy-MM-dd'T'HH:mm:ss",loanInfoVo.getIssueDate()).getTime() < DateUtils.parseDate("yyyy-MM-dd'T'HH:mm:ss",loanInfoVo.getAccountOpenDate()).getTime()){
loanInfoVo.setAccountOpenDate(loanInfoVo.getIssueDate());
loanInfoVo.setApplyDate(loanInfoVo.getIssueDate());
}
reportList.add(JSON.toJSONString(loanInfoVo));
String resultStr = iHttpService.postBaiHang(baiHangLoanInfoUrl, getHeader(), JSON.toJSONString(loanInfoVo));
log.info("助贷放款用户报送结果, param: {} , resultStr: {} ", JSON.toJSONString(loanInfo), resultStr); log.info("助贷放款用户报送结果, param: {} , resultStr: {} ", JSON.toJSONString(loanInfo), resultStr);
if (Objects.isNull(resultStr) || !"success".equalsIgnoreCase(JSON.parseObject(resultStr).getString("status"))) { if (Objects.isNull(resultStr) || !"success".equalsIgnoreCase(JSON.parseObject(resultStr).getString("status"))) {
log.info("量化派助贷TO百行报送-放款返回结果不正确, recordId: {} , loanId: {} , bean: {} ", id, loanInfo.getLoanId(), JSON.toJSONString(loanInfo)); log.info("量化派助贷TO百行报送-放款返回结果不正确, recordId: {} , loanId: {} , bean: {} ", id, loanInfo.getLoanId(), JSON.toJSONString(loanInfo));
...@@ -1632,6 +1635,7 @@ public class BaiHangZhuDaiService { ...@@ -1632,6 +1635,7 @@ public class BaiHangZhuDaiService {
} }
} }
log.info("量化派助贷TO百行报送-放款申请完成, 实际大小: {} , 报送成功大小: {} , 耗时: {} ", loanInfozdList.size(), atomicInteger.get(), sendWatch.stop().elapsed(TimeUnit.MILLISECONDS)); log.info("量化派助贷TO百行报送-放款申请完成, 实际大小: {} , 报送成功大小: {} , 耗时: {} ", loanInfozdList.size(), atomicInteger.get(), sendWatch.stop().elapsed(TimeUnit.MILLISECONDS));
} catch (Exception e) { } catch (Exception e) {
log.error("量化派助贷TO百行报送-异常", e); log.error("量化派助贷TO百行报送-异常", e);
} }
...@@ -1639,8 +1643,6 @@ public class BaiHangZhuDaiService { ...@@ -1639,8 +1643,6 @@ public class BaiHangZhuDaiService {
} else if ("D3".equalsIgnoreCase(type)) { } else if ("D3".equalsIgnoreCase(type)) {
//非循环贷款贷后数据信息(D3) //非循环贷款贷后数据信息(D3)
for (int j = 0; j < 2; j++) { for (int j = 0; j < 2; j++) {
List<String> reportList = new ArrayList<>();
reportList.add("#singleLoanRepayInfo");
Stopwatch sendWatch = Stopwatch.createStarted(); Stopwatch sendWatch = Stopwatch.createStarted();
try { try {
List<RepaymentInfoZhuDai> repaymentLoanInfos = null; List<RepaymentInfoZhuDai> repaymentLoanInfos = null;
...@@ -1665,20 +1667,30 @@ public class BaiHangZhuDaiService { ...@@ -1665,20 +1667,30 @@ public class BaiHangZhuDaiService {
log.info("量化派助贷TO百行报送-实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} ", starTime, endTime, JSON.toJSONString(repaymentLoanInfo1)); log.info("量化派助贷TO百行报送-实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} ", starTime, endTime, JSON.toJSONString(repaymentLoanInfo1));
continue; continue;
} }
/*id = UUID.randomUUID().toString().replaceAll("-", "");
repaymentLoanInfo.setRecordId(id);
try {
repaymentLoanInfoDbMapper.saveRepaymentLoanInfoLog(repaymentLoanInfo);
} catch (Exception e) {
}
repaymentLoanInfo.setReqID(id);
repaymentLoanInfo.setRecordId(null);*/
id = UUID.randomUUID().toString().replaceAll("-", ""); id = UUID.randomUUID().toString().replaceAll("-", "");
try { try {
RepaymentInfoZhuDai record = new RepaymentInfoZhuDai(); RepaymentInfoZhuDai record = new RepaymentInfoZhuDai();
BeanUtils.copyProperties(repaymentLoanInfo, record); BeanUtils.copyProperties(repaymentLoanInfo, record);
record.setRecordId(id); record.setRecordId(id);
// repaymentLoanInfoDbMapper.saveRepaymentLoanInfoLog(record); repaymentLoanInfoDbMapper.saveRepaymentLoanInfoLog(record);
} catch (Exception e) { } catch (Exception e) {
log.error("量化派助贷TO百行报送-实时还款保存记录异常", e); log.error("量化派助贷TO百行报送-实时还款保存记录异常", e);
} }
repaymentLoanInfo.setReqID(id); repaymentLoanInfo.setReqID(id);
repaymentLoanInfo.setName(tuomin(repaymentLoanInfo.getName())); repaymentLoanInfo.setPid(interfaceUploadClient(repaymentLoanInfo.getPid()));
repaymentLoanInfo.setPid(tuomin(repaymentLoanInfo.getPid())); repaymentLoanInfo.setName(interfaceUploadClient(repaymentLoanInfo.getName()));
repaymentLoanInfo.setMobile(tuomin(repaymentLoanInfo.getMobile())); repaymentLoanInfo.setMobile(interfaceUploadClient(repaymentLoanInfo.getMobile()));
String resultStr = iHttpService.postBaiHang(baiHangRepayMentLoanInfoUrl, getHeader(), JSON.toJSONString(repaymentLoanInfo)); String resultStr = iHttpService.postBaiHang(baiHangRepayMentLoanInfoUrl, getHeader(), JSON.toJSONString(repaymentLoanInfo));
log.info("助贷还款用户报送结果, param: {} , resultStr: {} ", JSON.toJSONString(repaymentLoanInfo), resultStr); log.info("助贷还款用户报送结果, param: {} , resultStr: {} ", JSON.toJSONString(repaymentLoanInfo), resultStr);
if (Objects.isNull(resultStr) || !"success".equalsIgnoreCase(JSON.parseObject(resultStr).getString("status"))) { if (Objects.isNull(resultStr) || !"success".equalsIgnoreCase(JSON.parseObject(resultStr).getString("status"))) {
...@@ -1687,17 +1699,16 @@ public class BaiHangZhuDaiService { ...@@ -1687,17 +1699,16 @@ public class BaiHangZhuDaiService {
} else { } else {
atomicInteger.getAndIncrement(); atomicInteger.getAndIncrement();
} }
reportList.add(JSON.toJSONString(repaymentLoanInfo));
} catch (Exception e) { } catch (Exception e) {
log.error("量化派助贷TO百行报送-还款信息异常, recordId: {} , loanId: {} ", id, repaymentLoanInfo.getLoanId(), e); log.error("量化派助贷TO百行报送-还款信息异常, recordId: {} , loanId: {} ", id, repaymentLoanInfo.getLoanId(), e);
} }
} }
log.info("量化派助贷TO百行报送-还款申请完成 J: {} , 开始时间: {} , 结束时间: {} , 实际大小: {} , 报送成功大小: {} , 耗时: {} ", j, starTime, endTime, repaymentLoanInfos.size(), atomicInteger.get(), sendWatch.stop().elapsed(TimeUnit.MILLISECONDS)); log.info("量化派助贷TO百行报送-还款申请完成 J: {} , 开始时间: {} , 结束时间: {} , 实际大小: {} , 报送成功大小: {} , 耗时: {} ", j, starTime, endTime, repaymentLoanInfos.size(), atomicInteger.get(), sendWatch.stop().elapsed(TimeUnit.MILLISECONDS));
} catch (Exception e) { } catch (Exception e) {
log.error("量化派助贷TO百行报送-异常 J: {} , 开始时间: {} , 结束时间: {} ", j, starTime, endTime, e); log.error("量化派助贷TO百行报送-异常 J: {} , 开始时间: {} , 结束时间: {} ", j, starTime, endTime, e);
} }
} }
} else { } else {
return "其他未知类型type=" + type; return "其他未知类型type=" + type;
} }
...@@ -1982,8 +1993,51 @@ public class BaiHangZhuDaiService { ...@@ -1982,8 +1993,51 @@ public class BaiHangZhuDaiService {
if (logBeanList.size() == 1) { if (logBeanList.size() == 1) {
logBean = logBeanList.get(0); logBean = logBeanList.get(0);
} else { } else {
/* List<RepaymentLoanInfoLog> logBeanList_2 = new ArrayList<>();
for(RepaymentLoanInfoLog log : logBeanList){
if("M".equals(log.getOpCode())){
logBeanList_2.add(log);
}
}
if(logBeanList_2.size()==1){
logBean = logBeanList_2.get(0);
}else {
//M的方式
if(logBeanList_2.size()>1){
Collections.sort(logBeanList_2, new Comparator<RepaymentLoanInfoLog>() {
public int compare(RepaymentLoanInfoLog o1, RepaymentLoanInfoLog o2) {
//按时间进行降序排列
if (o1.getUpdatedAt().getTime() > o2.getUpdatedAt().getTime()) {
return -1;
}
if (o1.getUpdatedAt().getTime() == o2.getUpdatedAt().getTime()) {
return 0;
}
return 1;
}
});
logBean = logBeanList_2.get(0);
}
//A的方式
else{
Collections.sort(logBeanList, new Comparator<RepaymentLoanInfoLog>() {
public int compare(RepaymentLoanInfoLog o1, RepaymentLoanInfoLog o2) {
//按时间进行降序排列
if (o1.getUpdatedAt().getTime() > o2.getUpdatedAt().getTime()) {
return -1;
}
if (o1.getUpdatedAt().getTime() == o2.getUpdatedAt().getTime()) {
return 0;
}
return 1;
}
});
logBean = logBeanList.get(0);
}
}*/
Collections.sort(logBeanList, new Comparator<RepaymentLoanInfoLog>() { Collections.sort(logBeanList, new Comparator<RepaymentLoanInfoLog>() {
@Override
public int compare(RepaymentLoanInfoLog o1, RepaymentLoanInfoLog o2) { public int compare(RepaymentLoanInfoLog o1, RepaymentLoanInfoLog o2) {
//按时间进行降序排列 //按时间进行降序排列
if (o1.getUpdatedAt().getTime() > o2.getUpdatedAt().getTime()) { if (o1.getUpdatedAt().getTime() > o2.getUpdatedAt().getTime()) {
...@@ -2037,7 +2091,6 @@ public class BaiHangZhuDaiService { ...@@ -2037,7 +2091,6 @@ public class BaiHangZhuDaiService {
logBean_jq = logBeanList_jq.get(0); logBean_jq = logBeanList_jq.get(0);
} else { } else {
Collections.sort(logBeanList_jq, new Comparator<RepaymentLoanInfoLog>() { Collections.sort(logBeanList_jq, new Comparator<RepaymentLoanInfoLog>() {
@Override
public int compare(RepaymentLoanInfoLog o1, RepaymentLoanInfoLog o2) { public int compare(RepaymentLoanInfoLog o1, RepaymentLoanInfoLog o2) {
//按时间进行降序排列 //按时间进行降序排列
if (o1.getUpdatedAt().getTime() > o2.getUpdatedAt().getTime()) { if (o1.getUpdatedAt().getTime() > o2.getUpdatedAt().getTime()) {
...@@ -2103,7 +2156,7 @@ public class BaiHangZhuDaiService { ...@@ -2103,7 +2156,7 @@ public class BaiHangZhuDaiService {
//相同不用报送 //相同不用报送
if (s_hisStr.equals(s_newStr)) { if (s_hisStr.equals(s_newStr)) {
repaymentLoanInfo.setUploadTs(uploadTs_2); repaymentLoanInfo.setUploadTs(uploadTs_2);
wirteFile(writeFilePath + file_ + "_XT.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n"); this.wirteFile(writeFilePath + file_ + "_XT.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n");
} else { } else {
//不同,需要报送 //不同,需要报送
log.info("查询比较两次报送数据不相同, 修改以M报送, filePath: {} , loanId: {} , termNo: {} , logBean: {} , 数据log_run: {} , ", file_, loanId, termNo, JSON.toJSONString(logBean), hisStr.toString() + "|" + newStr.toString()); log.info("查询比较两次报送数据不相同, 修改以M报送, filePath: {} , loanId: {} , termNo: {} , logBean: {} , 数据log_run: {} , ", file_, loanId, termNo, JSON.toJSONString(logBean), hisStr.toString() + "|" + newStr.toString());
...@@ -2132,9 +2185,9 @@ public class BaiHangZhuDaiService { ...@@ -2132,9 +2185,9 @@ public class BaiHangZhuDaiService {
if (log_history_reqID != null && log_history_reqID.length() > 1) { if (log_history_reqID != null && log_history_reqID.length() > 1) {
repaymentLoanInfo.setRecordId(log_history_reqID); repaymentLoanInfo.setRecordId(log_history_reqID);
wirteFile(writeFilePath + file_ + "_M.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n"); this.wirteFile(writeFilePath + file_ + "_M.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n");
} else { } else {
wirteFile(writeFilePath + file_ + "_M_notfind_log_history_reqID.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n"); this.wirteFile(writeFilePath + file_ + "_M_notfind_log_history_reqID.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n");
} }
} }
...@@ -2143,6 +2196,8 @@ public class BaiHangZhuDaiService { ...@@ -2143,6 +2196,8 @@ public class BaiHangZhuDaiService {
log.warn("根据参数查询报送日志筛选数据为空, 新增以A报送, filePath: {} , loanId: {} , termNo: {} ", filePath, loanId, termNo); log.warn("根据参数查询报送日志筛选数据为空, 新增以A报送, filePath: {} , loanId: {} , termNo: {} ", filePath, loanId, termNo);
repaymentLoanInfo.setOpCode("A"); repaymentLoanInfo.setOpCode("A");
//repaymentLoanInfo.setRecordId(UUID.randomUUID().toString().replaceAll("-", ""));
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
repaymentLoanInfo.setUploadTs(nowTime.format(formatter)); repaymentLoanInfo.setUploadTs(nowTime.format(formatter));
...@@ -2163,7 +2218,7 @@ public class BaiHangZhuDaiService { ...@@ -2163,7 +2218,7 @@ public class BaiHangZhuDaiService {
} }
} }
wirteFile(writeFilePath + file_ + "_A.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n"); this.wirteFile(writeFilePath + file_ + "_A.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n");
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -2226,9 +2281,9 @@ public class BaiHangZhuDaiService { ...@@ -2226,9 +2281,9 @@ public class BaiHangZhuDaiService {
if (StringUtils.isEmpty(repaymentLoanInfo.getRecordId())) { if (StringUtils.isEmpty(repaymentLoanInfo.getRecordId())) {
repaymentLoanInfo.setRecordId(UUID.randomUUID().toString().replaceAll("-", "")); repaymentLoanInfo.setRecordId(UUID.randomUUID().toString().replaceAll("-", ""));
} }
wirteFile(writeFilePath + file_ + "_ok.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n"); this.wirteFile(writeFilePath + file_ + "_ok.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n");
} else { } else {
wirteFile(writeFilePath + file_ + "_isEmpty.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n"); this.wirteFile(writeFilePath + file_ + "_isEmpty.txt", JSON.toJSONString(repaymentLoanInfo) + "\r\n");
} }
} catch (Exception e) { } catch (Exception e) {
log.error("在到d2中查询d3数据异常, loanId: {} ", repaymentLoanInfo.getLoanId(), e); log.error("在到d2中查询d3数据异常, loanId: {} ", repaymentLoanInfo.getLoanId(), e);
...@@ -2272,7 +2327,7 @@ public class BaiHangZhuDaiService { ...@@ -2272,7 +2327,7 @@ public class BaiHangZhuDaiService {
repaymentLoanInfo.setReqID(repaymentLoanInfo.getRecordId()); repaymentLoanInfo.setReqID(repaymentLoanInfo.getRecordId());
repaymentLoanInfo.setRecordId(null); repaymentLoanInfo.setRecordId(null);
wirteFile(writeFilePath, JSON.toJSONString(repaymentLoanInfo) + "\r\n"); this.wirteFile(writeFilePath, JSON.toJSONString(repaymentLoanInfo) + "\r\n");
saveCount++; saveCount++;
} catch (Exception e) { } catch (Exception e) {
log.error("保存还款数据记录失败, fileName: {} , DATA: {} , 第i: {} ", filePath, strJson, i, e); log.error("保存还款数据记录失败, fileName: {} , DATA: {} , 第i: {} ", filePath, strJson, i, e);
...@@ -2309,7 +2364,7 @@ public class BaiHangZhuDaiService { ...@@ -2309,7 +2364,7 @@ public class BaiHangZhuDaiService {
} }
RepaymentInfoZhuDai repaymentLoanInfo = new Gson().fromJson(strJson, new TypeToken<RepaymentInfoZhuDai>() { RepaymentInfoZhuDai repaymentLoanInfo = new Gson().fromJson(strJson, new TypeToken<RepaymentInfoZhuDai>() {
}.getType()); }.getType());
wirteFile(writeFilePath, JSON.toJSONString(repaymentLoanInfo) + "\r\n"); this.wirteFile(writeFilePath, JSON.toJSONString(repaymentLoanInfo) + "\r\n");
saveCount++; saveCount++;
} catch (Exception e) { } catch (Exception e) {
log.error("d3_build2写数据记录失败, fileName: {} , DATA: {} , 第i: {} ", filePath, strJson, i, e); log.error("d3_build2写数据记录失败, fileName: {} , DATA: {} , 第i: {} ", filePath, strJson, i, e);
...@@ -2379,42 +2434,6 @@ public class BaiHangZhuDaiService { ...@@ -2379,42 +2434,6 @@ public class BaiHangZhuDaiService {
return allRepaymentLoanInfo; return allRepaymentLoanInfo;
} }
private static void createFile(String fileName){
String HOST = "D3-3S\\";
File host = new File(HOST);
if (!host.exists()){
host.mkdir();
}
//AES密钥(机构自行设置)
String AES_KEY = "fc4c1cbca5a46840f60";
FileUploadRequest req = new FileUploadRequest();
//设置未作压缩加密前的原始数据文件路径
req.setDataFile(HOST + fileName);
//设置压缩加密后的密文文件输出路径(为空表示与原始数据文件同目录)
req.setTargetFilePath(HOST);
BhFileCreditApiClient client = new BhFileCreditApiClient();
//初始化设置AES密钥和RSA公钥
client.init(BaiHangZhuDaiService.getBaihangZDPublickey(),AES_KEY);
//执行压缩加密操作
FileUploadResponse response = client.execute(req);
if(response.isSuccess){
System.out.println("zip And encrypt success;fileName = "+response.getEncryptFilePath() + response.getEncryptFileName());
}else{
System.out.println("zip And encrypt fail;errorMessage = "+response.getErrorMessage());
}
}
private static String tuomin(String s){
// if (StringUtils.isNumeric(s) || s.contains("X") || s.contains("x")){
// return s.substring(0,s.length()-4)+"0000";
// }else {
// return s.substring(0,1)+"零";
// }
return s;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment