Compare commits
No commits in common. "cc-feature-xzh" and "cc-feature-dev" have entirely different histories.
cc-feature
...
cc-feature
@ -3,7 +3,6 @@ package com.zkj.loan.batch.tasklet;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.zkj.loan.common.internet.mapper.sys.SysMqRecordMapper;
|
import com.zkj.loan.common.internet.mapper.sys.SysMqRecordMapper;
|
||||||
import com.zkj.loan.common.internet.model.sys.SysMqRecord;
|
import com.zkj.loan.common.internet.model.sys.SysMqRecord;
|
||||||
import com.zkj.loan.common.internet.service.sys.impl.SysMqRecordServiceImpl;
|
|
||||||
import com.zkj.loan.common.internet.utils.DateUtil;
|
import com.zkj.loan.common.internet.utils.DateUtil;
|
||||||
import com.zkj.rcs.scheduler.model.JobReqEntity;
|
import com.zkj.rcs.scheduler.model.JobReqEntity;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -24,8 +23,6 @@ public abstract class MsxfContractBatchTasklet extends AbstractBatchTasklet {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysMqRecordMapper sysMqRecordMapper;
|
private SysMqRecordMapper sysMqRecordMapper;
|
||||||
@Resource
|
|
||||||
private SysMqRecordServiceImpl sysMqRecordService;
|
|
||||||
|
|
||||||
public String getDate(JobReqEntity jobReqEntity) {
|
public String getDate(JobReqEntity jobReqEntity) {
|
||||||
return (String) jobReqEntity.getJobParameter().get("tranDate");
|
return (String) jobReqEntity.getJobParameter().get("tranDate");
|
||||||
@ -86,14 +83,6 @@ public abstract class MsxfContractBatchTasklet extends AbstractBatchTasklet {
|
|||||||
log.info("任务耗时:{} 毫秒", end - start);
|
log.info("任务耗时:{} 毫秒", end - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateSysMqRecordStatus(SysMqRecord recordsToUpdate) {
|
|
||||||
long start = System.currentTimeMillis();
|
|
||||||
boolean b = sysMqRecordService.updateById(recordsToUpdate);
|
|
||||||
long end = System.currentTimeMillis();
|
|
||||||
log.info("bizNo: {} 更新 sys_mq_record 状态,更新状态:{},任务耗时:{} 毫秒", recordsToUpdate.getBizNo(), b, end - start);
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileType(JobReqEntity jobReqEntity) {
|
public String getFileType(JobReqEntity jobReqEntity) {
|
||||||
return (String) jobReqEntity.getJobParameter().get("fileType");
|
return (String) jobReqEntity.getJobParameter().get("fileType");
|
||||||
}
|
}
|
||||||
|
@ -13,37 +13,26 @@ import com.zkj.loan.batch.util.JsonUtil;
|
|||||||
import com.zkj.loan.common.internet.feign.MsxfSftpClient;
|
import com.zkj.loan.common.internet.feign.MsxfSftpClient;
|
||||||
import com.zkj.loan.common.internet.feign.pojo.MsxfSftpRespVO;
|
import com.zkj.loan.common.internet.feign.pojo.MsxfSftpRespVO;
|
||||||
import com.zkj.loan.common.internet.mapper.sys.SysMqRecordMapper;
|
import com.zkj.loan.common.internet.mapper.sys.SysMqRecordMapper;
|
||||||
import com.zkj.loan.common.internet.model.fac.LoanDuebill;
|
|
||||||
import com.zkj.loan.common.internet.model.pay.PayUseCreditExt;
|
|
||||||
import com.zkj.loan.common.internet.model.sys.SysMqRecord;
|
import com.zkj.loan.common.internet.model.sys.SysMqRecord;
|
||||||
import com.zkj.loan.common.internet.service.contract.entity.ContractConst;
|
|
||||||
import com.zkj.loan.common.internet.service.tranfer.FileTransferService;
|
import com.zkj.loan.common.internet.service.tranfer.FileTransferService;
|
||||||
import com.zkj.loan.common.internet.utils.DateUtil;
|
import com.zkj.loan.common.internet.utils.DateUtil;
|
||||||
import com.zkj.loan.common.internet.utils.ZipUtils;
|
import com.zkj.loan.common.internet.utils.ZipUtils;
|
||||||
import com.zkj.open.api.client.feign.api.Result;
|
import com.zkj.open.api.client.feign.api.Result;
|
||||||
import com.zkj.rcs.common.core.util.seq.IdGenerator;
|
|
||||||
import com.zkj.rcs.scheduler.model.JobReqEntity;
|
import com.zkj.rcs.scheduler.model.JobReqEntity;
|
||||||
import com.zkj.rcs.scheduler.model.JobRespEntity;
|
import com.zkj.rcs.scheduler.model.JobRespEntity;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Semaphore;
|
import java.util.concurrent.Semaphore;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.zkj.loan.batch.constants.JobStatusCode.*;
|
import static com.zkj.loan.batch.constants.JobStatusCode.*;
|
||||||
import static com.zkj.loan.common.internet.constant.BusinessConstant.SUCCESS_00000;
|
import static com.zkj.loan.common.internet.constant.BusinessConstant.SUCCESS_00000;
|
||||||
import static com.zkj.loan.common.internet.service.contract.entity.ContractConst.BIZ_TYPE_FILE_DOWNLOAD;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能描述: <br>
|
* 功能描述: <br>
|
||||||
@ -65,8 +54,7 @@ public class MsxfContractDownloadTasklet extends MsxfContractBatchTasklet {
|
|||||||
private MsxfSftpClient msxfSftpClient;
|
private MsxfSftpClient msxfSftpClient;
|
||||||
@Resource
|
@Resource
|
||||||
private SysMqRecordMapper sysMqRecordMapper;
|
private SysMqRecordMapper sysMqRecordMapper;
|
||||||
@Resource
|
|
||||||
private IdGenerator idGenerator;
|
|
||||||
private final static String MSG = "批量下载合同文件【msxfContractDownloadTasklet】";
|
private final static String MSG = "批量下载合同文件【msxfContractDownloadTasklet】";
|
||||||
private static final Semaphore SEMAPHORE = new Semaphore(10);
|
private static final Semaphore SEMAPHORE = new Semaphore(10);
|
||||||
private static final List<String> RETRY_LIST = new ArrayList<>();
|
private static final List<String> RETRY_LIST = new ArrayList<>();
|
||||||
@ -128,180 +116,48 @@ public class MsxfContractDownloadTasklet extends MsxfContractBatchTasklet {
|
|||||||
private void download(JSONObject jsonParams, List<String> fileNames, Boolean first) {
|
private void download(JSONObject jsonParams, List<String> fileNames, Boolean first) {
|
||||||
// 创建一个固定大小的线程池
|
// 创建一个固定大小的线程池
|
||||||
int size = CollUtil.size(fileNames);
|
int size = CollUtil.size(fileNames);
|
||||||
//ExecutorService executor = Executors.newFixedThreadPool(size);
|
ExecutorService executor = Executors.newFixedThreadPool(size);
|
||||||
List<SysMqRecord> recordList = new ArrayList<>();
|
|
||||||
String bizDate = jsonParams.getStr("bizDate");
|
|
||||||
QueryWrapper<SysMqRecord> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.lambda().eq(SysMqRecord::getBizDate,bizDate);
|
|
||||||
queryWrapper.lambda().eq(SysMqRecord::getBizType,ContractConst.BIZ_TYPE_FILE_DOWNLOAD);
|
|
||||||
List<SysMqRecord> list = sysMqRecordMapper.selectList(queryWrapper);
|
|
||||||
Map<String, SysMqRecord> map = list.stream().collect(Collectors.toMap
|
|
||||||
(SysMqRecord::getBizNo, SysMqRecord -> SysMqRecord, (a1, a2) -> a1));
|
|
||||||
// 最多10个任务执行
|
// 最多10个任务执行
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
String filename = CollUtil.get(fileNames, i);
|
String filename = CollUtil.get(fileNames, i);
|
||||||
try {
|
executor.submit(() -> {
|
||||||
log.info("开始下载文件 {} ...", filename);
|
try {
|
||||||
|
SEMAPHORE.acquire();
|
||||||
|
log.info("开始下载文件 {} ...", filename);
|
||||||
|
|
||||||
jsonParams.set("filename", filename);
|
jsonParams.set("filename", filename);
|
||||||
Result result = msxfSftpClient.contDownload(jsonParams);
|
Result result = msxfSftpClient.contDownload(jsonParams);
|
||||||
if (!SUCCESS_00000.equals(result.getCode())) {
|
if (!SUCCESS_00000.equals(result.getCode())) {
|
||||||
throw new RuntimeException("SFTP下载接口调用失败 code:" + result.getCode());
|
throw new RuntimeException("SFTP下载接口调用失败 code:" + result.getCode());
|
||||||
}
|
|
||||||
MsxfSftpRespVO msxfSftpRespVO = BeanUtil.toBean(result.getData(), MsxfSftpRespVO.class);
|
|
||||||
String saveFilePath = msxfSftpRespVO.getFilePatchName();
|
|
||||||
String zipLocalPath = saveFilePath + filename;
|
|
||||||
File file = FileUtil.writeBytes(msxfSftpRespVO.getFileContent(), zipLocalPath);
|
|
||||||
if (!file.exists()) {
|
|
||||||
throw new RuntimeException("SFTP文件下载失败,file is not exists");
|
|
||||||
}
|
|
||||||
log.info("文件 {} 下载完毕...", filename);
|
|
||||||
// 解压缩文件
|
|
||||||
String unzipFilePath = saveFilePath + StrUtil.removeSuffix(filename, ".zip") + File.separator;
|
|
||||||
ZipUtils.unzip(zipLocalPath, unzipFilePath);
|
|
||||||
log.info("文件 {} 解压完毕...", filename);
|
|
||||||
|
|
||||||
// 创建 File 对象
|
|
||||||
File directory = new File(unzipFilePath);
|
|
||||||
String bizNo = StrUtil.removeSuffix(filename, ".zip");
|
|
||||||
// 检查路径是否存在并且是一个目录
|
|
||||||
if (directory.exists() && directory.isDirectory()) {
|
|
||||||
// 获取目录下的文件列表
|
|
||||||
File[] files = directory.listFiles();
|
|
||||||
// 遍历文件列表
|
|
||||||
if (files != null) {
|
|
||||||
for (File fil : files) {
|
|
||||||
SysMqRecord mqRecord = map.get(bizNo);
|
|
||||||
if (Objects.nonNull(mqRecord)){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
addrecordList(recordList,fil,bizNo,bizDate);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
MsxfSftpRespVO msxfSftpRespVO = BeanUtil.toBean(result.getData(), MsxfSftpRespVO.class);
|
||||||
System.out.println("指定的路径不是一个有效的目录。");
|
String saveFilePath = msxfSftpRespVO.getFilePatchName();
|
||||||
}
|
String zipLocalPath = saveFilePath + filename;
|
||||||
} catch (Exception e) {
|
File file = FileUtil.writeBytes(msxfSftpRespVO.getFileContent(), zipLocalPath);
|
||||||
// 判断是否为首次下载,如果不是则不再尝试
|
if (!file.exists()) {
|
||||||
if (first) {
|
throw new RuntimeException("SFTP文件下载失败,file is not exists");
|
||||||
RETRY_LIST.add(filename);
|
}
|
||||||
} else {
|
log.info("文件 {} 下载完毕...", filename);
|
||||||
ERROR_LIST.add(filename);
|
// 解压缩文件
|
||||||
}
|
String unzipFilePath = saveFilePath + StrUtil.removeSuffix(filename, ".zip") + File.separator;
|
||||||
log.error("{} 文件 {} 下载失败 ==> {}", MSG, filename, e.getMessage());
|
ZipUtils.unzip(zipLocalPath, unzipFilePath);
|
||||||
} finally {
|
log.info("文件 {} 解压完毕...", filename);
|
||||||
SEMAPHORE.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 判断是否为首次下载,如果不是则不再尝试
|
||||||
|
if (first) {
|
||||||
|
RETRY_LIST.add(filename);
|
||||||
|
} else {
|
||||||
|
ERROR_LIST.add(filename);
|
||||||
|
}
|
||||||
|
log.error("{} 文件 {} 下载失败 ==> {}", MSG, filename, e.getMessage());
|
||||||
|
} finally {
|
||||||
|
SEMAPHORE.release();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty(recordList)) {
|
// 关闭线程池
|
||||||
sysMqRecordMapper.insertBatch(recordList);
|
executor.shutdown();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addrecordList(List<SysMqRecord> recordList,File fil,String bizNo,String bizDate) {
|
|
||||||
if (fil.getName().contains("_"+ContractConst.CONTRACT_POLICY)){
|
|
||||||
SysMqRecord mqRecordDown = new SysMqRecord();
|
|
||||||
mqRecordDown.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordDown.setBizType(ContractConst.BIZ_TYPE_FILE_DOWNLOAD);
|
|
||||||
mqRecordDown.setBizFileType(ContractConst.CONTRACT_POLICY);
|
|
||||||
mqRecordDown.setBizNo(bizNo);
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("appNo",bizNo);
|
|
||||||
jsonObject.put("filePath",fil.getAbsolutePath());
|
|
||||||
mqRecordDown.setData(jsonObject.toString());
|
|
||||||
mqRecordDown.setStatus(SysMqRecord.Status.DONE.getStatus());
|
|
||||||
mqRecordDown.setBizDate(bizDate);
|
|
||||||
recordList.add(mqRecordDown);
|
|
||||||
SysMqRecord mqRecordSign = new SysMqRecord();
|
|
||||||
BeanUtil.copyProperties(mqRecordDown,mqRecordSign);
|
|
||||||
mqRecordSign.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordSign.setBizType(ContractConst.BIZ_TYPE_FILE_SIGN);
|
|
||||||
mqRecordSign.setStatus(SysMqRecord.Status.DOING.getStatus());
|
|
||||||
recordList.add(mqRecordSign);
|
|
||||||
SysMqRecord mqRecordBack = new SysMqRecord();
|
|
||||||
BeanUtil.copyProperties(mqRecordDown,mqRecordBack);
|
|
||||||
mqRecordBack.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordBack.setBizType(ContractConst.BIZ_TYPE_FILE_BACK);
|
|
||||||
mqRecordBack.setStatus(SysMqRecord.Status.DOING.getStatus());
|
|
||||||
recordList.add(mqRecordBack);
|
|
||||||
} else if (fil.getName().contains("_"+ContractConst.CONTRACT_PROXY)){
|
|
||||||
SysMqRecord mqRecordDown = new SysMqRecord();
|
|
||||||
mqRecordDown.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordDown.setBizType(ContractConst.BIZ_TYPE_FILE_DOWNLOAD);
|
|
||||||
mqRecordDown.setBizFileType(ContractConst.CONTRACT_PROXY);
|
|
||||||
mqRecordDown.setBizNo(bizNo);
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("appNo",bizNo);
|
|
||||||
jsonObject.put("filePath",fil.getAbsolutePath());
|
|
||||||
mqRecordDown.setData(jsonObject.toString());
|
|
||||||
mqRecordDown.setStatus(SysMqRecord.Status.DONE.getStatus());
|
|
||||||
mqRecordDown.setBizDate(bizDate);
|
|
||||||
recordList.add(mqRecordDown);
|
|
||||||
SysMqRecord mqRecordSign = new SysMqRecord();
|
|
||||||
BeanUtil.copyProperties(mqRecordDown,mqRecordSign);
|
|
||||||
mqRecordSign.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordSign.setBizType(ContractConst.BIZ_TYPE_FILE_SIGN);
|
|
||||||
mqRecordSign.setStatus(SysMqRecord.Status.DOING.getStatus());
|
|
||||||
recordList.add(mqRecordSign);
|
|
||||||
SysMqRecord mqRecordBack = new SysMqRecord();
|
|
||||||
BeanUtil.copyProperties(mqRecordDown,mqRecordBack);
|
|
||||||
mqRecordBack.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordBack.setBizType(ContractConst.BIZ_TYPE_FILE_BACK);
|
|
||||||
mqRecordBack.setStatus(SysMqRecord.Status.DOING.getStatus());
|
|
||||||
recordList.add(mqRecordBack);
|
|
||||||
} else if (fil.getName().contains("_"+ContractConst.CONTRACT_FINANCING)) {
|
|
||||||
SysMqRecord mqRecordDown = new SysMqRecord();
|
|
||||||
mqRecordDown.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordDown.setBizType(ContractConst.BIZ_TYPE_FILE_DOWNLOAD);
|
|
||||||
mqRecordDown.setBizFileType(ContractConst.CONTRACT_FINANCING);
|
|
||||||
mqRecordDown.setBizNo(bizNo);
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("appNo",bizNo);
|
|
||||||
jsonObject.put("filePath",fil.getAbsolutePath());
|
|
||||||
mqRecordDown.setData(jsonObject.toString());
|
|
||||||
mqRecordDown.setStatus(SysMqRecord.Status.DONE.getStatus());
|
|
||||||
mqRecordDown.setBizDate(bizDate);
|
|
||||||
recordList.add(mqRecordDown);
|
|
||||||
SysMqRecord mqRecordSign = new SysMqRecord();
|
|
||||||
BeanUtil.copyProperties(mqRecordDown,mqRecordSign);
|
|
||||||
mqRecordSign.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordSign.setBizType(ContractConst.BIZ_TYPE_FILE_SIGN);
|
|
||||||
mqRecordSign.setStatus(SysMqRecord.Status.DOING.getStatus());
|
|
||||||
recordList.add(mqRecordSign);
|
|
||||||
SysMqRecord mqRecordBack = new SysMqRecord();
|
|
||||||
BeanUtil.copyProperties(mqRecordDown,mqRecordBack);
|
|
||||||
mqRecordBack.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordBack.setBizType(ContractConst.BIZ_TYPE_FILE_BACK);
|
|
||||||
mqRecordBack.setStatus(SysMqRecord.Status.DOING.getStatus());
|
|
||||||
recordList.add(mqRecordBack);
|
|
||||||
} else if (fil.getName().contains("_"+ContractConst.INSTALLMENT_GUARANTEE)) {
|
|
||||||
SysMqRecord mqRecordDown = new SysMqRecord();
|
|
||||||
mqRecordDown.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordDown.setBizType(ContractConst.BIZ_TYPE_FILE_DOWNLOAD);
|
|
||||||
mqRecordDown.setBizFileType(ContractConst.INSTALLMENT_GUARANTEE);
|
|
||||||
mqRecordDown.setBizNo(bizNo);
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("appNo",bizNo);
|
|
||||||
jsonObject.put("filePath",fil.getAbsolutePath());
|
|
||||||
mqRecordDown.setData(jsonObject.toString());
|
|
||||||
mqRecordDown.setStatus(SysMqRecord.Status.DONE.getStatus());
|
|
||||||
mqRecordDown.setBizDate(bizDate);
|
|
||||||
recordList.add(mqRecordDown);
|
|
||||||
SysMqRecord mqRecordSign = new SysMqRecord();
|
|
||||||
BeanUtil.copyProperties(mqRecordDown,mqRecordSign);
|
|
||||||
mqRecordSign.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordSign.setBizType(ContractConst.BIZ_TYPE_FILE_SIGN);
|
|
||||||
mqRecordSign.setStatus(SysMqRecord.Status.DOING.getStatus());
|
|
||||||
recordList.add(mqRecordSign);
|
|
||||||
SysMqRecord mqRecordBack = new SysMqRecord();
|
|
||||||
BeanUtil.copyProperties(mqRecordDown,mqRecordBack);
|
|
||||||
mqRecordBack.setId(idGenerator.nextIdStr());
|
|
||||||
mqRecordBack.setBizType(ContractConst.BIZ_TYPE_FILE_BACK);
|
|
||||||
mqRecordBack.setStatus(SysMqRecord.Status.DOING.getStatus());
|
|
||||||
recordList.add(mqRecordBack);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private JSONObject populateParams(JobReqEntity jobReqEntity) {
|
private JSONObject populateParams(JobReqEntity jobReqEntity) {
|
||||||
@ -329,7 +185,6 @@ public class MsxfContractDownloadTasklet extends MsxfContractBatchTasklet {
|
|||||||
jsonParams.set("saveFilePath", saveFilePath);
|
jsonParams.set("saveFilePath", saveFilePath);
|
||||||
jsonParams.set("downloadPath", downloadPath);
|
jsonParams.set("downloadPath", downloadPath);
|
||||||
jsonParams.set("uuid", uuid);
|
jsonParams.set("uuid", uuid);
|
||||||
jsonParams.set("bizDate",formattedDate);
|
|
||||||
|
|
||||||
String bizType = getEventType(jobReqEntity);
|
String bizType = getEventType(jobReqEntity);
|
||||||
Integer status = getStatus(jobReqEntity);
|
Integer status = getStatus(jobReqEntity);
|
||||||
|
@ -1,43 +1,28 @@
|
|||||||
package com.zkj.loan.batch.tasklet.msxf;
|
package com.zkj.loan.batch.tasklet.msxf;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.collection.CollStreamUtil;
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.zkj.loan.batch.tasklet.MsxfContractBatchTasklet;
|
import com.zkj.loan.batch.tasklet.MsxfContractBatchTasklet;
|
||||||
import com.zkj.loan.common.internet.feign.MsxfSftpClient;
|
|
||||||
import com.zkj.loan.common.internet.feign.pojo.MsxfSftpReqVO;
|
|
||||||
import com.zkj.loan.common.internet.feign.pojo.MsxfSftpRespVO;
|
|
||||||
import com.zkj.loan.common.internet.mapper.sys.SysMqRecordMapper;
|
import com.zkj.loan.common.internet.mapper.sys.SysMqRecordMapper;
|
||||||
import com.zkj.loan.common.internet.model.sys.SysMqRecord;
|
import com.zkj.loan.common.internet.model.sys.SysMqRecord;
|
||||||
import com.zkj.loan.common.internet.service.contract.entity.ContractConst;
|
|
||||||
import com.zkj.loan.common.internet.service.sub.msxf.domain.pojo.LmtSignRecordVO;
|
import com.zkj.loan.common.internet.service.sub.msxf.domain.pojo.LmtSignRecordVO;
|
||||||
import com.zkj.loan.common.internet.service.tranfer.FileTransferService;
|
import com.zkj.loan.common.internet.service.tranfer.FileTransferService;
|
||||||
import com.zkj.loan.common.internet.utils.BatchFileUtil;
|
import com.zkj.loan.common.internet.utils.BatchFileUtil;
|
||||||
import com.zkj.loan.common.internet.utils.DateUtil;
|
import com.zkj.loan.common.internet.utils.DateUtil;
|
||||||
import com.zkj.open.api.client.feign.api.Result;
|
|
||||||
import com.zkj.rcs.common.core.util.ftp.SFTPUtil;
|
import com.zkj.rcs.common.core.util.ftp.SFTPUtil;
|
||||||
import com.zkj.rcs.scheduler.model.JobReqEntity;
|
import com.zkj.rcs.scheduler.model.JobReqEntity;
|
||||||
import com.zkj.rcs.scheduler.model.JobRespEntity;
|
import com.zkj.rcs.scheduler.model.JobRespEntity;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.time.LocalDate;
|
import java.util.List;
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.zkj.loan.batch.constants.JobStatusCode.*;
|
import static com.zkj.loan.batch.constants.JobStatusCode.*;
|
||||||
import static com.zkj.loan.common.internet.constant.BusinessConstant.SUCCESS_00000;
|
|
||||||
import static com.zkj.loan.common.internet.service.sub.msxf.domain.enums.EventType.FILE_BACK;
|
import static com.zkj.loan.common.internet.service.sub.msxf.domain.enums.EventType.FILE_BACK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,97 +46,40 @@ public class MsxfContractToSFTPTasklet extends MsxfContractBatchTasklet {
|
|||||||
@Resource
|
@Resource
|
||||||
private FileTransferService fileTransferService;
|
private FileTransferService fileTransferService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MsxfSftpClient msxfSftpClient;
|
|
||||||
|
|
||||||
@Value("${msxf.file.transfer.sleep.enabled:true}")
|
|
||||||
private boolean sleepEnabled;
|
|
||||||
|
|
||||||
private final static String MSG = "回传签章合同给马上消费【msxfContractToSFTPTasklet】";
|
|
||||||
@Override
|
@Override
|
||||||
public void runJob(JobReqEntity jobReqEntity, JobRespEntity jobRespEntity) throws Exception {
|
public void runJob(JobReqEntity jobReqEntity, JobRespEntity jobRespEntity) throws Exception {
|
||||||
log.info("批量【msxfContractToSFTPTasklet】入参:[{}]", jobReqEntity);
|
log.info("批量【msxfContractToSFTPTasklet】入参:[{}]", jobReqEntity);
|
||||||
String date = getDate(jobReqEntity);
|
String date = getDate(jobReqEntity);
|
||||||
//String bizDate = StringUtils.isEmpty(date) ? LocalDate.now().toString() : date;
|
String coopNo = getCoopNo(jobReqEntity);
|
||||||
String formatDate = getYesDateFormats(date);
|
String prdCode = getPrdCode(jobReqEntity);
|
||||||
|
String fileType = getFileType(jobReqEntity);
|
||||||
|
//事件类型 参考EventType.java 枚举
|
||||||
|
String eventType = getEventType(jobReqEntity);
|
||||||
//状态枚举 参考SysMqRecord.java ,Status枚举
|
//状态枚举 参考SysMqRecord.java ,Status枚举
|
||||||
Integer status = getStatus(jobReqEntity);
|
Integer status = getStatus(jobReqEntity);
|
||||||
String eventType = getEventType(jobReqEntity);
|
|
||||||
// 使用逗号分割字符串
|
|
||||||
String[] array = eventType.split(",");
|
|
||||||
// 将数组转换为 List
|
|
||||||
List<String> list = Arrays.asList(array);
|
|
||||||
QueryWrapper<SysMqRecord> queryBack = new QueryWrapper<>();
|
|
||||||
queryBack.lambda().eq(SysMqRecord::getBizDate,formatDate)
|
|
||||||
.in(SysMqRecord::getBizFileType, list)
|
|
||||||
.in(SysMqRecord::getBizType, ContractConst.BIZ_TYPE_FILE_BACK)
|
|
||||||
.ne(SysMqRecord::getStatus, "2");
|
|
||||||
List<SysMqRecord> backFail = sysMqRecordMapper.selectList(queryBack);
|
|
||||||
|
|
||||||
QueryWrapper<SysMqRecord> querySign = new QueryWrapper<>();
|
|
||||||
querySign.lambda().eq(SysMqRecord::getBizDate,formatDate)
|
|
||||||
.in(SysMqRecord::getBizFileType, list)
|
|
||||||
.in(SysMqRecord::getBizType, ContractConst.BIZ_TYPE_FILE_SIGN)
|
|
||||||
.eq(SysMqRecord::getStatus, "2");
|
|
||||||
List<SysMqRecord> signSucc = sysMqRecordMapper.selectList(querySign);
|
|
||||||
// 使用循环将 List 转换为 Map
|
|
||||||
Map<String, SysMqRecord> signMap = new HashMap<>();
|
|
||||||
for (SysMqRecord obj : signSucc) {
|
|
||||||
String key = obj.getBizFileType() + "-" + obj.getBizNo(); // 拼接 key
|
|
||||||
signMap.put(key, obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SysMqRecord> recordsUpdated = uploadFiles(backFail,signMap, jobReqEntity);
|
|
||||||
Map<String, List<SysMqRecord>> uploadedGroup = CollStreamUtil.groupByKey(recordsUpdated, SysMqRecord::getBizDate);
|
|
||||||
|
|
||||||
|
|
||||||
// 上传马上sftp服务路径:/upload/DXBANK/back/contract/YYYYMMDD/
|
// 上传马上sftp服务路径:/upload/DXBANK/back/contract/YYYYMMDD/
|
||||||
/* String backSftpPath = getUploadPath(jobReqEntity, date);
|
String backSftpPath = getUploadPath(jobReqEntity, date);
|
||||||
String signFilePath = getSignFilePath(jobReqEntity, getYesDateFormats(date));
|
String signFilePath = getSignFilePath(jobReqEntity, getYesDateFormats(date));
|
||||||
List<String> eventTypeList = StrUtil.split(eventType, StrUtil.COMMA);
|
List<String> eventTypeList = StrUtil.split(eventType, StrUtil.COMMA);
|
||||||
|
|
||||||
List<SysMqRecord> recordsToUpload = queryRecordsToUpload(date, status, eventTypeList);
|
List<SysMqRecord> recordsToUpload = queryRecordsToUpload(date, status, eventTypeList);
|
||||||
String okDownloadFilename = "DXBANK_download.ok";
|
String okDownloadFilename = "DXBANK_download.ok";
|
||||||
*/
|
|
||||||
jobRespEntity.setRespCode(RESP_CODE_000000);
|
|
||||||
jobRespEntity.setRespMesg(RESP_MESG_000000);
|
|
||||||
|
|
||||||
}
|
try {
|
||||||
|
SFTPUtil sftpUtil = fileTransferService.getSftpUtilInstance(coopNo, prdCode, fileType);
|
||||||
private List<SysMqRecord> uploadFiles(List<SysMqRecord> recordsToUpload,Map<String, SysMqRecord> signMap, JobReqEntity jobReqEntity) {
|
sftpUtil.login();
|
||||||
for (SysMqRecord record : recordsToUpload) {
|
List<SysMqRecord> recordsToUpdate = uploadFiles(recordsToUpload, backSftpPath, signFilePath, sftpUtil);
|
||||||
try {
|
updateSysMqRecordStatus(recordsToUpdate);
|
||||||
String key = record.getBizFileType() + "-" + record.getBizNo();
|
String okfileContent = "0|" + recordsToUpdate.size();
|
||||||
SysMqRecord mqRecord = signMap.get(key);
|
BatchFileUtil.makeFile(signFilePath, okDownloadFilename, okfileContent.getBytes());
|
||||||
if (mqRecord == null){
|
sftpUtil.upload(backSftpPath, signFilePath + okDownloadFilename);
|
||||||
continue;
|
jobRespEntity.setRespCode(RESP_CODE_000000);
|
||||||
}
|
jobRespEntity.setRespMesg(RESP_MESG_000000);
|
||||||
// 上传马上sftp服务路径:/upload/DXBANK/back/contract/YYYYMMDD/
|
} catch (Exception e) {
|
||||||
String backSftpPath = getUploadPath(jobReqEntity, record.getBizDate());
|
log.error("msxfContractToSFTPTasklet 批量上传合同到马上消费SFTP失败", e);
|
||||||
// 获取远端服务器保存文件路径
|
jobRespEntity.setRespCode(RESP_CODE_000056);
|
||||||
String data = mqRecord.getData();
|
jobRespEntity.setRespMesg(RESP_MESG_000056);
|
||||||
String signedPath = JSONObject.parseObject(data).getString("signedPath");
|
|
||||||
if (StringUtils.isEmpty(signedPath)){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//String saveFilePath = getSaveFilePath(jobReqEntity, record.getBizDate());
|
|
||||||
|
|
||||||
boolean success = uploadFile(record, backSftpPath, signedPath);
|
|
||||||
record.setStatus(success ? SysMqRecord.Status.DONE.getStatus() : SysMqRecord.Status.FAILED.getStatus());
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("{} 上传合同失败,serNo:{}", MSG, record.getBizNo(), e);
|
|
||||||
record.setStatus(SysMqRecord.Status.FAILED.getStatus());
|
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
// 进行记录更新
|
|
||||||
updateSysMqRecordStatus(record);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
log.error("{} 记录更新异常", record.getBizNo());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return CollUtil.removeNull(recordsToUpload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<SysMqRecord> queryRecordsToUpload(String date, Integer status, List<String> eventTypeList) {
|
private List<SysMqRecord> queryRecordsToUpload(String date, Integer status, List<String> eventTypeList) {
|
||||||
@ -160,57 +88,47 @@ public class MsxfContractToSFTPTasklet extends MsxfContractBatchTasklet {
|
|||||||
return sysMqRecordMapper.selectList(queryWrapper);
|
return sysMqRecordMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<SysMqRecord> uploadFiles(List<SysMqRecord> recordsToUpload, String backSftpPath, String signFilePath, SFTPUtil sftpUtil) {
|
||||||
|
return recordsToUpload.stream()
|
||||||
|
.map(record -> {
|
||||||
|
try {
|
||||||
|
boolean success = uploadFile(record, backSftpPath, signFilePath, sftpUtil);
|
||||||
|
record.setBizType(FILE_BACK.name());
|
||||||
|
record.setStatus(success ? SysMqRecord.Status.DOING.getStatus() : SysMqRecord.Status.FAILED.getStatus());
|
||||||
|
return record;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("上传合同失败,serNo:{}", record.getBizNo(), e);
|
||||||
|
record.setStatus(SysMqRecord.Status.FAILED.getStatus());
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
private boolean uploadFile(SysMqRecord sysMqRecord, String backSftpPath, String saveFilePath) throws Exception {
|
private boolean uploadFile(SysMqRecord sysMqRecord, String backSftpPath, String signFilePath, SFTPUtil sftpUtil) throws Exception {
|
||||||
if(sleepEnabled){
|
|
||||||
log.info("******** 开启睡眠 。。。 2秒 ********");
|
|
||||||
Thread.sleep(2000);
|
|
||||||
}
|
|
||||||
String serNo = sysMqRecord.getBizNo();
|
String serNo = sysMqRecord.getBizNo();
|
||||||
if (StrUtil.isBlank(serNo)) {
|
if (StrUtil.isBlank(serNo)) {
|
||||||
log.error("serNo 不存在 id:{}", sysMqRecord.getId());
|
log.error("serNo 不存在 id:{}", sysMqRecord.getId());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isBlank(sysMqRecord.getData())) {
|
LmtSignRecordVO lmtSignRecordVO = JSONUtil.toBean(sysMqRecord.getData(), LmtSignRecordVO.class);
|
||||||
throw new RuntimeException("文件元信息不存在");
|
if (lmtSignRecordVO == null) {
|
||||||
|
signFilePath = signFilePath + serNo + "/" + "_contract.pdf";
|
||||||
|
lmtSignRecordVO = new LmtSignRecordVO(serNo, "", signFilePath, "", "", backSftpPath);
|
||||||
|
} else {
|
||||||
|
signFilePath = lmtSignRecordVO.getSignPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*LmtSignRecordVO lmtSignRecordVO = JSONUtil.toBean(sysMqRecord.getData(), LmtSignRecordVO.class);
|
File file = FileUtil.file(signFilePath);
|
||||||
String signFilePath = lmtSignRecordVO.getSignPath();*/
|
|
||||||
if (StrUtil.isBlank(saveFilePath)) {
|
|
||||||
throw new RuntimeException("签章合同文件路径不存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
File file = FileUtil.file(saveFilePath);
|
|
||||||
if (!FileUtil.exist(file)) {
|
if (!FileUtil.exist(file)) {
|
||||||
log.error("签章的电子合同不存在,serNo:{},signFilePath:{}", sysMqRecord.getBizNo(), saveFilePath);
|
log.error("签章的电子合同不存在,serNo:{},signFilePath:{}", sysMqRecord.getBizNo(), signFilePath);
|
||||||
|
lmtSignRecordVO.setSignMsg("签章的电子合同不存在,serNo:{},signFilePath:{}" + sysMqRecord.getBizNo() + signFilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
sftpUtil.upload(backSftpPath, signFilePath);
|
||||||
// 调用接口进行SFTP上传
|
sysMqRecord.setData(JSONUtil.toJsonStr(lmtSignRecordVO));
|
||||||
MsxfSftpReqVO msxfSftpReqVO = new MsxfSftpReqVO();
|
return true;
|
||||||
msxfSftpReqVO.setUuid(IdUtil.fastSimpleUUID());
|
|
||||||
msxfSftpReqVO.setSaveFilePath(saveFilePath);
|
|
||||||
msxfSftpReqVO.setFileName(FileUtil.getName(file));
|
|
||||||
msxfSftpReqVO.setSftpUploadPath(backSftpPath);
|
|
||||||
msxfSftpReqVO.setFileContent(FileUtil.readBytes(file));
|
|
||||||
Result result = msxfSftpClient.contBacksend(JSONUtil.parseObj(msxfSftpReqVO));
|
|
||||||
log.info("{} 调用接口进行SFTP回传结果:{}", MSG, result);
|
|
||||||
if (!SUCCESS_00000.equals(result.getCode())) {
|
|
||||||
throw new RuntimeException("调用接口进行SFTP回传失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
MsxfSftpRespVO msxfSftpRespVO = BeanUtil.toBean(result.getData(), MsxfSftpRespVO.class);
|
|
||||||
if (ObjectUtil.isNotNull(msxfSftpRespVO)) {
|
|
||||||
String returnCode = msxfSftpRespVO.getReturnCode();
|
|
||||||
if (StrUtil.isNotEmpty(returnCode) && "000000".equals(returnCode)) {
|
|
||||||
sysMqRecord.setData(JSONUtil.toJsonStr(msxfSftpRespVO));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -3,8 +3,6 @@ package com.zkj.loan.batch.tasklet.msxfold;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.zkj.loan.batch.tasklet.BaseBatchTasklet;
|
import com.zkj.loan.batch.tasklet.BaseBatchTasklet;
|
||||||
import com.zkj.loan.common.internet.mapper.bat.FacLoanDuebillMapper;
|
|
||||||
import com.zkj.loan.common.internet.model.bat.FacLoanDuebill;
|
|
||||||
import com.zkj.loan.common.internet.model.biz.CtrlLoanDetail;
|
import com.zkj.loan.common.internet.model.biz.CtrlLoanDetail;
|
||||||
import com.zkj.loan.common.internet.service.base.biz.CtrlLoanDetailService;
|
import com.zkj.loan.common.internet.service.base.biz.CtrlLoanDetailService;
|
||||||
import com.zkj.loan.common.internet.service.base.fac.LoanDetailsService;
|
import com.zkj.loan.common.internet.service.base.fac.LoanDetailsService;
|
||||||
@ -64,9 +62,6 @@ public class MsxfLoanDetailFileTasklet extends BaseBatchTasklet {
|
|||||||
@Resource
|
@Resource
|
||||||
private RedissonClient redissonClient;
|
private RedissonClient redissonClient;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private FacLoanDuebillMapper facLoanDuebillMapper;
|
|
||||||
|
|
||||||
private static final String[] CALC_FIELD = {
|
private static final String[] CALC_FIELD = {
|
||||||
"biz_date",
|
"biz_date",
|
||||||
"contNo",
|
"contNo",
|
||||||
@ -94,7 +89,7 @@ public class MsxfLoanDetailFileTasklet extends BaseBatchTasklet {
|
|||||||
String prdCode = (String) jobReqEntity.getJobParameter().get("prdCode");//文件名称
|
String prdCode = (String) jobReqEntity.getJobParameter().get("prdCode");//文件名称
|
||||||
if (Objects.nonNull(object)) {
|
if (Objects.nonNull(object)) {
|
||||||
String tranDate = (String) object;
|
String tranDate = (String) object;
|
||||||
date = LocalDate.parse(tranDate);
|
date = LocalDate.parse(tranDate).plusDays(-1);
|
||||||
} else {
|
} else {
|
||||||
RBucket<LocalDate> redisPreDate = redissonClient.getBucket(SysRedisConstant.PREDATE);
|
RBucket<LocalDate> redisPreDate = redissonClient.getBucket(SysRedisConstant.PREDATE);
|
||||||
date = redisPreDate.get();
|
date = redisPreDate.get();
|
||||||
@ -107,22 +102,12 @@ public class MsxfLoanDetailFileTasklet extends BaseBatchTasklet {
|
|||||||
queryWrapper.lambda().eq(CtrlLoanDetail::getPrdCode,prdCode);
|
queryWrapper.lambda().eq(CtrlLoanDetail::getPrdCode,prdCode);
|
||||||
ctrlLoanDetailService.remove(queryWrapper);
|
ctrlLoanDetailService.remove(queryWrapper);
|
||||||
|
|
||||||
/*QueryWrapper<FacLoanDuebill> loanDuebillQuery = new QueryWrapper<>();
|
|
||||||
loanDuebillQuery.lambda().eq(FacLoanDuebill::getBizDate,yesDate);
|
|
||||||
loanDuebillQuery.lambda().eq(FacLoanDuebill::getCoopNo,chanCode);
|
|
||||||
loanDuebillQuery.lambda().eq(FacLoanDuebill::getPrdCode,prdCode);
|
|
||||||
loanDuebillQuery.select("ifnull(sum(loan_bal),0) as loanBal,ifnull(sum(over_bal),0) as overBal");
|
|
||||||
FacLoanDuebill loanDuebill = facLoanDuebillMapper.selectOne(loanDuebillQuery);
|
|
||||||
*/
|
|
||||||
CtrlLoanDetail loanDetail = loanDetailsService.countLoanData(yesDate,chanCode,prdCode);
|
CtrlLoanDetail loanDetail = loanDetailsService.countLoanData(yesDate,chanCode,prdCode);
|
||||||
loanDetail.setId(idGenerator.nextIdStr());
|
loanDetail.setId(idGenerator.nextIdStr());
|
||||||
loanDetail.setOverLoanAmt(loanDetail.getOverAmt());
|
|
||||||
loanDetail.setCoopNo(chanCode);
|
loanDetail.setCoopNo(chanCode);
|
||||||
loanDetail.setPrdCode(prdCode);
|
loanDetail.setPrdCode(prdCode);
|
||||||
loanDetail.setCreateDate(LocalDate.now());
|
loanDetail.setCreateDate(LocalDate.now());
|
||||||
loanDetail.setCreateTime(LocalDateTime.now());
|
loanDetail.setCreateTime(LocalDateTime.now());
|
||||||
loanDetail.setUpdateDate(LocalDate.now());
|
|
||||||
loanDetail.setUpdateTime(LocalDateTime.now());
|
|
||||||
ctrlLoanDetailService.save(loanDetail);
|
ctrlLoanDetailService.save(loanDetail);
|
||||||
/* String ctrlFile = saveTmpPath + "/" + yesDate + "-filelist"+ "/" + getFileName() + ".ctrl";
|
/* String ctrlFile = saveTmpPath + "/" + yesDate + "-filelist"+ "/" + getFileName() + ".ctrl";
|
||||||
String ctrlFilePattern = replaceDatePattern(ctrlFile,yesDate);
|
String ctrlFilePattern = replaceDatePattern(ctrlFile,yesDate);
|
||||||
|
@ -2,19 +2,15 @@ package com.zkj.loan.batch.tasklet.msxfold;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.Query;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.zkj.loan.batch.tasklet.BaseBatchTasklet;
|
import com.zkj.loan.batch.tasklet.BaseBatchTasklet;
|
||||||
import com.zkj.loan.common.internet.mapper.biz.BizLoanClaimRepayMapper;
|
|
||||||
import com.zkj.loan.common.internet.mapper.cus.PlsRepayPlanDetailMapper;
|
import com.zkj.loan.common.internet.mapper.cus.PlsRepayPlanDetailMapper;
|
||||||
import com.zkj.loan.common.internet.mapper.pls.ext.RepayPlanDetailExtMapper;
|
import com.zkj.loan.common.internet.mapper.pls.ext.RepayPlanDetailExtMapper;
|
||||||
import com.zkj.loan.common.internet.model.biz.BizLoanClaimRepay;
|
|
||||||
import com.zkj.loan.common.internet.model.biz.CtrlRepayDetail;
|
import com.zkj.loan.common.internet.model.biz.CtrlRepayDetail;
|
||||||
import com.zkj.loan.common.internet.model.cus.CusCoopMapping;
|
import com.zkj.loan.common.internet.model.cus.CusCoopMapping;
|
||||||
import com.zkj.loan.common.internet.model.fac.LoanRepayPlan;
|
import com.zkj.loan.common.internet.model.fac.LoanRepayPlan;
|
||||||
import com.zkj.loan.common.internet.model.lmt.LmtCusCrdtLmt;
|
import com.zkj.loan.common.internet.model.lmt.LmtCusCrdtLmt;
|
||||||
import com.zkj.loan.common.internet.model.pls.RepayPlanDetail;
|
import com.zkj.loan.common.internet.model.pls.RepayPlanDetail;
|
||||||
import com.zkj.loan.common.internet.service.base.biz.BizLoanClaimRepayService;
|
|
||||||
import com.zkj.loan.common.internet.service.base.biz.CtrlRepayDetailService;
|
import com.zkj.loan.common.internet.service.base.biz.CtrlRepayDetailService;
|
||||||
import com.zkj.loan.common.internet.service.base.cus.CusCoopMappingService;
|
import com.zkj.loan.common.internet.service.base.cus.CusCoopMappingService;
|
||||||
import com.zkj.loan.common.internet.service.base.lmt.LmtCusCrdtLmtService;
|
import com.zkj.loan.common.internet.service.base.lmt.LmtCusCrdtLmtService;
|
||||||
@ -68,8 +64,7 @@ public class MsxfRepayFileTasklet extends BaseBatchTasklet {
|
|||||||
@Resource
|
@Resource
|
||||||
private IdGenerator idGenerator;
|
private IdGenerator idGenerator;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BizLoanClaimRepayMapper bizLoanClaimRepayMapper;
|
|
||||||
@Resource
|
@Resource
|
||||||
private CtrlRepayDetailService ctrlRepayDetailService;
|
private CtrlRepayDetailService ctrlRepayDetailService;
|
||||||
|
|
||||||
@ -120,18 +115,12 @@ public class MsxfRepayFileTasklet extends BaseBatchTasklet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String dateStr = date.toString().replace("-", "");
|
String dateStr = date.toString().replace("-", "");
|
||||||
BizLoanClaimRepay claimRepay = bizLoanClaimRepayMapper.countClaimData(dateStr,chanCode,prdCode);
|
|
||||||
CtrlRepayDetail repayDetail = plsRepayPlanDetailMapper.countRepayData(dateStr,chanCode,prdCode);
|
CtrlRepayDetail repayDetail = plsRepayPlanDetailMapper.countRepayData(dateStr,chanCode,prdCode);
|
||||||
repayDetail.setId(idGenerator.nextIdStr());
|
repayDetail.setId(idGenerator.nextIdStr());
|
||||||
repayDetail.setClaimPrinAmt(claimRepay.getRepayAmt());
|
|
||||||
repayDetail.setClaimIntAmt(claimRepay.getPaidIntAmt());
|
|
||||||
repayDetail.setClaimPnltAmt(claimRepay.getPaidPnltAmt());
|
|
||||||
repayDetail.setPrdCode(prdCode);
|
repayDetail.setPrdCode(prdCode);
|
||||||
repayDetail.setChanCode(chanCode);
|
repayDetail.setChanCode(chanCode);
|
||||||
repayDetail.setCreateDate(LocalDate.now());
|
repayDetail.setCreateData(LocalDate.now());
|
||||||
repayDetail.setCreateTime(LocalDateTime.now());
|
repayDetail.setCreateTime(LocalDateTime.now());
|
||||||
repayDetail.setUpdateDate(LocalDate.now());
|
|
||||||
repayDetail.setUpdateTime(LocalDateTime.now());
|
|
||||||
|
|
||||||
QueryWrapper<CtrlRepayDetail> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CtrlRepayDetail> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.lambda().eq(CtrlRepayDetail::getBizDate,dateStr);
|
queryWrapper.lambda().eq(CtrlRepayDetail::getBizDate,dateStr);
|
||||||
|
@ -32,9 +32,6 @@ public interface BizLoanClaimRepayMapper extends BaseMapper<BizLoanClaimRepay> {
|
|||||||
|
|
||||||
int countByBizDate(@Param("startDate") String startDate, @Param("endDate") String endDate,
|
int countByBizDate(@Param("startDate") String startDate, @Param("endDate") String endDate,
|
||||||
@Param("coopNo") String coopNo);
|
@Param("coopNo") String coopNo);
|
||||||
|
|
||||||
List<BizRecoveryBlackList> selectClaimCustList(@Param("createDate") LocalDate createDate,@Param("isUpdate") Boolean isUpdate);
|
List<BizRecoveryBlackList> selectClaimCustList(@Param("createDate") LocalDate createDate,@Param("isUpdate") Boolean isUpdate);
|
||||||
|
|
||||||
BizLoanClaimRepay countClaimData(@Param("bizDate")String dateStr,@Param("coopNo") String chanCode, @Param("prdCode")String prdCode);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -94,42 +94,42 @@
|
|||||||
|
|
||||||
<select id="selectLoanClaimRepay" resultMap="LoanClaimRepayMap">
|
<select id="selectLoanClaimRepay" resultMap="LoanClaimRepayMap">
|
||||||
SELECT
|
SELECT
|
||||||
'LN_LPHK' as scene,
|
'LN_LPHK' as scene,
|
||||||
blcr.duebill_no,
|
blcr.duebill_no,
|
||||||
blcr.repay_ser,
|
blcr.repay_ser,
|
||||||
blcr.repay_amt,
|
blcr.repay_amt,
|
||||||
blcr.paid_int_amt,
|
blcr.paid_int_amt,
|
||||||
blcr.paid_pnlt_amt,
|
blcr.paid_pnlt_amt,
|
||||||
fld.loan_bal,
|
fld.loan_bal,
|
||||||
fld.int_over_bal,
|
fld.int_over_bal,
|
||||||
fld.int_fine_bal,
|
fld.int_fine_bal,
|
||||||
fld.cust_no,
|
fld.cust_no,
|
||||||
fld.cust_name
|
fld.cust_name
|
||||||
FROM biz_loan_claim_repay blcr
|
FROM biz_loan_claim_repay blcr
|
||||||
left join fac_loan_duebill fld on
|
left join fac_loan_duebill fld on
|
||||||
fld.duebill_no = blcr.duebill_no
|
fld.duebill_no = blcr.duebill_no
|
||||||
where blcr.create_date = #{bizDate}
|
where blcr.create_date = #{bizDate}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectAllLoanClaimRepayPage" resultType="java.util.Map">
|
<select id="selectAllLoanClaimRepayPage" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
a.duebill_no duebillNo,b.curr_prin_amt currPrinAmt,b.ovd_prin_amt ovdPrinAmt,a.paid_int_amt paidIntAmt,
|
a.duebill_no duebillNo,b.curr_prin_amt currPrinAmt,b.ovd_prin_amt ovdPrinAmt,a.paid_int_amt paidIntAmt,
|
||||||
a.paid_pnlt_amt paidPnltAmt,a.biz_date bizDate
|
a.paid_pnlt_amt paidPnltAmt,a.biz_date bizDate
|
||||||
FROM biz_loan_claim_repay a left join fac_loan_repay_plan b on a.duebill_no = b.duebill_no and a.term_no = b.term_no
|
FROM biz_loan_claim_repay a left join fac_loan_repay_plan b on a.duebill_no = b.duebill_no and a.term_no = b.term_no
|
||||||
where a.biz_date = #{bizDate} and a.coop_no = #{coopNo}
|
where a.biz_date = #{bizDate} and a.coop_no = #{coopNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllLoanClaimRepayPageBetweenDate" resultType="java.util.Map">
|
<select id="selectAllLoanClaimRepayPageBetweenDate" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
a.duebill_no duebillNo,ifnull(sum(a.repay_amt),0) repayAmt,ifnull(sum(a.paid_int_amt),0) paidIntAmt,
|
a.duebill_no duebillNo,ifnull(sum(a.repay_amt),0) repayAmt,ifnull(sum(a.paid_int_amt),0) paidIntAmt,
|
||||||
ifnull(sum(a.paid_pnlt_amt),0) paidPnltAmt,a.biz_date bizDate
|
ifnull(sum(a.paid_pnlt_amt),0) paidPnltAmt,a.biz_date bizDate
|
||||||
FROM biz_loan_claim_repay a
|
FROM biz_loan_claim_repay a
|
||||||
where a.biz_date <= #{startDate} and a.biz_date > #{endDate} and a.coop_no = #{coopNo} group by a.duebill_no
|
where a.biz_date <= #{startDate} and a.biz_date > #{endDate} and a.coop_no = #{coopNo} group by a.duebill_no
|
||||||
</select>
|
</select>
|
||||||
<select id="countByBizDate" resultType="java.lang.Integer">
|
<select id="countByBizDate" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
count(*)
|
count(*)
|
||||||
FROM biz_loan_claim_repay a
|
FROM biz_loan_claim_repay a
|
||||||
where a.biz_date <= #{startDate} and a.biz_date > #{endDate} and a.coop_no = #{coopNo}
|
where a.biz_date <= #{startDate} and a.biz_date > #{endDate} and a.coop_no = #{coopNo}
|
||||||
</select>
|
</select>
|
||||||
@ -143,14 +143,4 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="countClaimData" resultType="com.zkj.loan.common.internet.model.biz.BizLoanClaimRepay">
|
|
||||||
SELECT ifnull(sum(blcr.repay_amt),0) as repay_amt , ifnull(sum(blcr.paid_int_amt),0) as paid_int_amt,
|
|
||||||
ifnull(sum(blcr.paid_pnlt_amt),0) as paid_pnlt_amt
|
|
||||||
FROM biz_loan_claim_repay blcr
|
|
||||||
left join fac_loan_duebill fld on blcr.duebill_no = fld.duebill_no
|
|
||||||
where blcr.biz_date = #{bizDate} and blcr.coop_no = #{coopNo} and fld.prd_code = #{prdCode}
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id,
|
id,
|
||||||
biz_date,
|
biz_date,
|
||||||
cont_no,
|
cont_no,
|
||||||
duebill_no,
|
duebill_no,
|
||||||
@ -84,9 +84,9 @@
|
|||||||
from
|
from
|
||||||
fac_loan_details
|
fac_loan_details
|
||||||
<where>
|
<where>
|
||||||
<if test="coopNo != null and coopNo!=''">
|
<if test="coopNo != null and coopNo!=''">
|
||||||
and coop_no = #{coopNo}
|
and coop_no = #{coopNo}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
group by
|
group by
|
||||||
(case
|
(case
|
||||||
@ -208,24 +208,24 @@
|
|||||||
|
|
||||||
<select id="selectLoanDetails" resultMap="LoanDetailsResultMap">
|
<select id="selectLoanDetails" resultMap="LoanDetailsResultMap">
|
||||||
select
|
select
|
||||||
'LN_ZCFK' as scene,
|
'LN_ZCFK' as scene,
|
||||||
flds.loan_amt,
|
flds.loan_amt,
|
||||||
flds.duebill_no,
|
flds.duebill_no,
|
||||||
flds.loan_term,
|
flds.loan_term,
|
||||||
fld.cust_no,
|
fld.cust_no,
|
||||||
fld.loan_bal,
|
fld.loan_bal,
|
||||||
fld.int_over_bal,
|
fld.int_over_bal,
|
||||||
fld.int_fine_bal,
|
fld.int_fine_bal,
|
||||||
fld.cust_name
|
fld.cust_name
|
||||||
from
|
from
|
||||||
fac_loan_details flds
|
fac_loan_details flds
|
||||||
left join fac_loan_duebill fld on
|
left join fac_loan_duebill fld on
|
||||||
fld.duebill_no = flds.duebill_no
|
fld.duebill_no = flds.duebill_no
|
||||||
where flds.biz_date = #{bizDate}
|
where flds.biz_date = #{bizDate}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByDuebillNo">
|
<select id="selectByDuebillNo">
|
||||||
select
|
select
|
||||||
<include refid="com.zkj.loan.common.internet.mapper.fac.LoanDetailsMapper.Base_Column_List"/>
|
<include refid="com.zkj.loan.common.internet.mapper.fac.LoanDetailsMapper.Base_Column_List"/>
|
||||||
from fac_loan_details where duebill_no = #{duebillNo} limit 1
|
from fac_loan_details where duebill_no = #{duebillNo} limit 1
|
||||||
</select>
|
</select>
|
||||||
@ -282,12 +282,11 @@
|
|||||||
|
|
||||||
<select id="countLoanData" resultType="com.zkj.loan.common.internet.model.biz.CtrlLoanDetail">
|
<select id="countLoanData" resultType="com.zkj.loan.common.internet.model.biz.CtrlLoanDetail">
|
||||||
SELECT
|
SELECT
|
||||||
fls.biz_date as bizDate, count(fls.id) as detailTotal, sum(fls.loan_amt) as loanAmtTotal,
|
fls.biz_date as bizDate, count(fls.id) as detailTotal, sum(fls.loan_amt) as loanAmtTotal
|
||||||
ifnull(sum(fld.loan_bal),0) as loanBal,ifnull(sum(fld.over_bal),0) as overAmt
|
|
||||||
FROM fac_loan_details fls
|
FROM fac_loan_details fls
|
||||||
left join fac_loan_duebill fld on fls.duebill_no = fld.duebill_no
|
left join fac_loan_duebill fld on fls.duebill_no = fld.duebill_no
|
||||||
where fls.biz_date = #{yesDate,jdbcType=VARCHAR} and fls.coop_no = #{chanCode,jdbcType=VARCHAR}
|
where fls.biz_date = #{yesDate,jdbcType=VARCHAR} and fls.coop_no = #{chanCode,jdbcType=VARCHAR}
|
||||||
and fld.prd_code = #{prdCode,jdbcType=VARCHAR}
|
and fld.prd_code = #{prdCode,jdbcType=VARCHAR}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -17,30 +17,30 @@
|
|||||||
<insert id="insertOne" parameterType="com.zkj.loan.common.internet.model.sys.SysMqRecord">
|
<insert id="insertOne" parameterType="com.zkj.loan.common.internet.model.sys.SysMqRecord">
|
||||||
INSERT INTO sys_mq_record
|
INSERT INTO sys_mq_record
|
||||||
(
|
(
|
||||||
id,
|
id,
|
||||||
biz_type,
|
biz_type,
|
||||||
biz_no,
|
biz_no,
|
||||||
data,
|
data,
|
||||||
status,
|
status,
|
||||||
biz_date,
|
biz_date,
|
||||||
create_time,
|
create_time,
|
||||||
update_time,
|
update_time,
|
||||||
cust_no,
|
cust_no,
|
||||||
duebill_no
|
duebill_no
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
(
|
(
|
||||||
#{id},
|
#{id},
|
||||||
#{bizType},
|
#{bizType},
|
||||||
#{bizNo},
|
#{bizNo},
|
||||||
#{data},
|
#{data},
|
||||||
#{status},
|
#{status},
|
||||||
DATE_FORMAT(NOW(), '%Y%m%d'),
|
DATE_FORMAT(NOW(), '%Y%m%d'),
|
||||||
NOW(),
|
NOW(),
|
||||||
NOW(),
|
NOW(),
|
||||||
#{custNo},
|
#{custNo},
|
||||||
#{duebillNo}
|
#{duebillNo}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertBatch" parameterType="java.util.List">
|
<insert id="insertBatch" parameterType="java.util.List">
|
||||||
@ -54,8 +54,7 @@
|
|||||||
create_time,
|
create_time,
|
||||||
update_time,
|
update_time,
|
||||||
cust_no,
|
cust_no,
|
||||||
duebill_no,
|
duebill_no
|
||||||
biz_file_type
|
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
<foreach collection="list" item="record" separator=",">
|
<foreach collection="list" item="record" separator=",">
|
||||||
@ -65,12 +64,11 @@
|
|||||||
#{record.bizNo},
|
#{record.bizNo},
|
||||||
#{record.data},
|
#{record.data},
|
||||||
#{record.status},
|
#{record.status},
|
||||||
#{record.bizDate},
|
DATE_FORMAT(NOW(), '%Y%m%d'),
|
||||||
NOW(),
|
NOW(),
|
||||||
NOW(),
|
NOW(),
|
||||||
#{record.custNo},
|
#{record.custNo},
|
||||||
#{record.duebillNo},
|
#{record.duebillNo}
|
||||||
#{record.bizFileType}
|
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
@ -91,20 +89,20 @@
|
|||||||
|
|
||||||
<select id="selectByBizNo" resultMap="SysMqRecordMap">
|
<select id="selectByBizNo" resultMap="SysMqRecordMap">
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
biz_type,
|
biz_type,
|
||||||
biz_no,
|
biz_no,
|
||||||
data,
|
data,
|
||||||
status,
|
status,
|
||||||
biz_date,
|
biz_date,
|
||||||
create_time,
|
create_time,
|
||||||
update_time,
|
update_time,
|
||||||
cust_no,
|
cust_no,
|
||||||
duebill_no
|
duebill_no
|
||||||
FROM
|
FROM
|
||||||
sys_mq_record
|
sys_mq_record
|
||||||
WHERE
|
WHERE
|
||||||
biz_no = #{bizNo, jdbcType=VARCHAR} AND biz_type = #{bizType, jdbcType=VARCHAR}
|
biz_no = #{bizNo, jdbcType=VARCHAR} AND biz_type = #{bizType, jdbcType=VARCHAR}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectListBySelectiveAndPage" resultMap="SysMqRecordMap" parameterType="com.zkj.loan.common.internet.model.sys.SysMqRecord">
|
<select id="selectListBySelectiveAndPage" resultMap="SysMqRecordMap" parameterType="com.zkj.loan.common.internet.model.sys.SysMqRecord">
|
||||||
|
@ -40,10 +40,4 @@ public class CtrlLoanDetail extends CommonEntity {
|
|||||||
private String coopNo;
|
private String coopNo;
|
||||||
|
|
||||||
private String prdCode;
|
private String prdCode;
|
||||||
|
|
||||||
private BigDecimal loanBal;
|
|
||||||
|
|
||||||
private BigDecimal overAmt;
|
|
||||||
|
|
||||||
private BigDecimal overLoanAmt;
|
|
||||||
}
|
}
|
||||||
|
@ -59,23 +59,6 @@ public class CtrlRepayDetail {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal repayPnltAmt;
|
private BigDecimal repayPnltAmt;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 理赔本金
|
|
||||||
*/
|
|
||||||
private BigDecimal claimPrinAmt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 理赔利息
|
|
||||||
*/
|
|
||||||
private BigDecimal claimIntAmt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 理赔罚息
|
|
||||||
*/
|
|
||||||
private BigDecimal claimPnltAmt;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品编号
|
* 产品编号
|
||||||
*/
|
*/
|
||||||
@ -86,11 +69,11 @@ public class CtrlRepayDetail {
|
|||||||
*/
|
*/
|
||||||
private String chanCode;
|
private String chanCode;
|
||||||
|
|
||||||
private LocalDate createDate;
|
private LocalDate createData;
|
||||||
|
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
private LocalDate updateDate;
|
private LocalDate updateData;
|
||||||
|
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ -28,6 +28,11 @@ public class SysMqRecord extends IdEntity {
|
|||||||
*/
|
*/
|
||||||
private String bizType;
|
private String bizType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件类型
|
||||||
|
*/
|
||||||
|
private String bizFileType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 交易流水号
|
* 交易流水号
|
||||||
*/
|
*/
|
||||||
@ -68,10 +73,6 @@ public class SysMqRecord extends IdEntity {
|
|||||||
*/
|
*/
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件类型
|
|
||||||
*/
|
|
||||||
private String bizFileType;
|
|
||||||
/**
|
/**
|
||||||
* 状态枚举
|
* 状态枚举
|
||||||
*/
|
*/
|
||||||
|
@ -58,10 +58,4 @@ public interface MsxfSftpClient {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/msxf/api/sftp/files/download")
|
@PostMapping("/msxf/api/sftp/files/download")
|
||||||
ResponseEntity<byte[]> downloadFileContent(@RequestBody JSONObject params) throws Exception;
|
ResponseEntity<byte[]> downloadFileContent(@RequestBody JSONObject params) throws Exception;
|
||||||
|
|
||||||
/**
|
|
||||||
* 马上电子合同文件sftp回传
|
|
||||||
*/
|
|
||||||
@PostMapping("/msxf/cont/backsend")
|
|
||||||
Result contBacksend(@RequestBody JSONObject params) throws Exception;
|
|
||||||
}
|
}
|
@ -7,8 +7,6 @@ import com.zkj.open.api.client.feign.api.Result;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Classname OpenApiFeignFallback
|
* @Classname OpenApiFeignFallback
|
||||||
@ -52,13 +50,6 @@ public class MsxfSftpFeignFallback implements MsxfSftpClient {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result contBacksend(JSONObject params) throws Exception {
|
|
||||||
Result result = new Result();
|
|
||||||
result.setCode(FeignConstant.FAIL_999999);
|
|
||||||
result.setMessage(FeignConstant.HYSTRIX_FAIL_MSG);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@Override
|
@Override
|
||||||
public Result loanImages(JSONObject params) {
|
public Result loanImages(JSONObject params) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
@ -69,6 +60,6 @@ public class MsxfSftpFeignFallback implements MsxfSftpClient {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<byte[]> downloadFileContent(JSONObject params) throws Exception {
|
public ResponseEntity<byte[]> downloadFileContent(JSONObject params) throws Exception {
|
||||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(FeignConstant.HYSTRIX_FAIL_MSG.getBytes());
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(FeignConstant.HYSTRIX_FAIL_MSG.getBytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
package com.zkj.loan.common.internet.feign.pojo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 马消SFTP请求对象
|
|
||||||
*
|
|
||||||
* @author xinrui.xiao
|
|
||||||
* @date 2023-04-18 11:20
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class MsxfSftpReqVO implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uuid
|
|
||||||
*/
|
|
||||||
private String uuid;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SFTP回传路径
|
|
||||||
*/
|
|
||||||
private String sftpUploadPath;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存文件路径
|
|
||||||
*/
|
|
||||||
private String saveFilePath;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件名称
|
|
||||||
*/
|
|
||||||
private String fileName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件内容
|
|
||||||
*/
|
|
||||||
private byte[] fileContent;
|
|
||||||
|
|
||||||
}
|
|
@ -38,6 +38,4 @@ public interface ContractConst {
|
|||||||
String FDD_FILE_UPLOAD_CODE_SUCC = "1000";
|
String FDD_FILE_UPLOAD_CODE_SUCC = "1000";
|
||||||
// 3.FDD-文件上传成功
|
// 3.FDD-文件上传成功
|
||||||
String FDD_FILE_UPLOAD_CODE_FAILD = "2002";
|
String FDD_FILE_UPLOAD_CODE_FAILD = "2002";
|
||||||
// 4.业务类型-文件下载
|
|
||||||
String BIZ_TYPE_FILE_DOWNLOAD = "FILE_DOWNLOAD";
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user