|
@@ -355,7 +355,7 @@ public class RecordSealController extends BaseController {
|
|
|
//获取授信编号
|
|
//获取授信编号
|
|
|
String zfiCoreQuotaId = CommonUtil.objToString(map.get("zfiCoreQuotaId"));
|
|
String zfiCoreQuotaId = CommonUtil.objToString(map.get("zfiCoreQuotaId"));
|
|
|
//获取产品
|
|
//获取产品
|
|
|
- String zfpcrProductId = CommonUtil.objToString(map.get("zfpcrProductId"));
|
|
|
|
|
|
|
+ String zfpcrProductId = CommonUtil.objToString(map.get("zfiProductId"));
|
|
|
//获取融信编号
|
|
//获取融信编号
|
|
|
String zfiId = CommonUtil.objToString(map.get("zfiId"));
|
|
String zfiId = CommonUtil.objToString(map.get("zfiId"));
|
|
|
//获取融信编号
|
|
//获取融信编号
|
|
@@ -457,6 +457,7 @@ public class RecordSealController extends BaseController {
|
|
|
//查询授信额度下的文件
|
|
//查询授信额度下的文件
|
|
|
LambdaQueryWrapper<ZcFinanceQuotaConRel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ZcFinanceQuotaConRel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(ZcFinanceQuotaConRel::getZfqcrCreditId,zfiCoreQuotaId);
|
|
lambdaQueryWrapper.eq(ZcFinanceQuotaConRel::getZfqcrCreditId,zfiCoreQuotaId);
|
|
|
|
|
+ //TODO 打断点看一下为空时是否为0
|
|
|
List<ZcFinanceQuotaConRel> relList = quotaConRelService.findZcFinanceQuotaConRels(lambdaQueryWrapper);
|
|
List<ZcFinanceQuotaConRel> relList = quotaConRelService.findZcFinanceQuotaConRels(lambdaQueryWrapper);
|
|
|
if(relList.size() > 0 ){
|
|
if(relList.size() > 0 ){
|
|
|
//提取合同编号
|
|
//提取合同编号
|
|
@@ -474,13 +475,11 @@ public class RecordSealController extends BaseController {
|
|
|
|
|
|
|
|
List<PubFileInf> fileInfList = new ArrayList<>();
|
|
List<PubFileInf> fileInfList = new ArrayList<>();
|
|
|
List<ZcFinanceContract> contractList = new ArrayList<>();
|
|
List<ZcFinanceContract> contractList = new ArrayList<>();
|
|
|
- if(contractIdList.size() < 1){
|
|
|
|
|
- return AjaxResult.success();
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ if(contractIdList.size() > 0){
|
|
|
//查询合同
|
|
//查询合同
|
|
|
LambdaQueryWrapper<ZcFinanceContract> contractLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ZcFinanceContract> contractLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
contractLambdaQueryWrapper.in(ZcFinanceContract::getZfcId,contractIdList);
|
|
contractLambdaQueryWrapper.in(ZcFinanceContract::getZfcId,contractIdList);
|
|
|
- contractLambdaQueryWrapper.like(ZcFinanceContract::getZfcNode,code);
|
|
|
|
|
|
|
+ contractLambdaQueryWrapper.like(ZcFinanceContract::getZfcNode,"01");
|
|
|
contractLambdaQueryWrapper.orderByAsc(ZcFinanceContract::getZfcFile);
|
|
contractLambdaQueryWrapper.orderByAsc(ZcFinanceContract::getZfcFile);
|
|
|
contractList = contractService.findZcFinanceContracts(contractLambdaQueryWrapper);
|
|
contractList = contractService.findZcFinanceContracts(contractLambdaQueryWrapper);
|
|
|
if(contractList.size() > 0 ){
|
|
if(contractList.size() > 0 ){
|
|
@@ -492,22 +491,45 @@ public class RecordSealController extends BaseController {
|
|
|
fileInfLambdaQueryWrapper.orderByAsc(PubFileInf::getPfiFileId);
|
|
fileInfLambdaQueryWrapper.orderByAsc(PubFileInf::getPfiFileId);
|
|
|
fileInfList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
|
|
fileInfList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+// if(contractIdList.size() < 1){
|
|
|
|
|
+// return AjaxResult.success();
|
|
|
|
|
+// }else{
|
|
|
|
|
+// //查询合同
|
|
|
|
|
+// LambdaQueryWrapper<ZcFinanceContract> contractLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+// contractLambdaQueryWrapper.in(ZcFinanceContract::getZfcId,contractIdList);
|
|
|
|
|
+// contractLambdaQueryWrapper.like(ZcFinanceContract::getZfcNode,code);
|
|
|
|
|
+// contractLambdaQueryWrapper.orderByAsc(ZcFinanceContract::getZfcFile);
|
|
|
|
|
+// contractList = contractService.findZcFinanceContracts(contractLambdaQueryWrapper);
|
|
|
|
|
+// if(contractList.size() > 0 ){
|
|
|
|
|
+// //提取文件编号
|
|
|
|
|
+// List<String> fileIdList = CommonUtil.getIdFromList(contractList,"zfcFile");
|
|
|
|
|
+// LambdaQueryWrapper<PubFileInf> fileInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+// fileInfLambdaQueryWrapper.in(PubFileInf::getPfiFileId,fileIdList);
|
|
|
|
|
+// fileInfLambdaQueryWrapper.eq(PubFileInf::getPfiIsDel,"00");
|
|
|
|
|
+// fileInfLambdaQueryWrapper.orderByAsc(PubFileInf::getPfiFileId);
|
|
|
|
|
+// fileInfList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
for(int i = 0 ; i < fileInfList.size(); i++){
|
|
for(int i = 0 ; i < fileInfList.size(); i++){
|
|
|
//判断是否为已盖章文件
|
|
//判断是否为已盖章文件
|
|
|
- LambdaQueryWrapper<ZcFinanceRecordFileRel> fileRelLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
- //融信id
|
|
|
|
|
- fileRelLambdaQueryWrapper.eq(ZcFinanceRecordFileRel::getZfrfrFinanceId, zfiId);
|
|
|
|
|
- //合同id
|
|
|
|
|
- fileRelLambdaQueryWrapper.eq(ZcFinanceRecordFileRel::getZfrfrContractId, contractList.get(i).getZfcId());
|
|
|
|
|
- List<ZcFinanceRecordFileRel> financeFileList = financeRecordFileRelService.findZcFinanceRecordFileRels(fileRelLambdaQueryWrapper);
|
|
|
|
|
|
|
+ LambdaQueryWrapper<ZcFinanceFileRel> fileRelLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ fileRelLambdaQueryWrapper.eq(ZcFinanceFileRel::getZffrFinanceId, zfiId);
|
|
|
|
|
+ fileRelLambdaQueryWrapper.eq(ZcFinanceFileRel::getZffrContractId, contractList.get(i).getZfcId());
|
|
|
|
|
+ List<ZcFinanceFileRel> financeFileList = financeFileRelService.findZcFinanceFileRels(fileRelLambdaQueryWrapper);
|
|
|
|
|
+// LambdaQueryWrapper<ZcFinanceRecordFileRel> fileRelLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+// //融信id
|
|
|
|
|
+// fileRelLambdaQueryWrapper.eq(ZcFinanceRecordFileRel::getZfrfrFinanceId, zfiId);
|
|
|
|
|
+// //合同id
|
|
|
|
|
+// fileRelLambdaQueryWrapper.eq(ZcFinanceRecordFileRel::getZfrfrContractId, contractList.get(i).getZfcId());
|
|
|
|
|
+// List<ZcFinanceRecordFileRel> financeFileList = financeRecordFileRelService.findZcFinanceRecordFileRels(fileRelLambdaQueryWrapper);
|
|
|
|
|
|
|
|
// 文件路径
|
|
// 文件路径
|
|
|
- String filePath;
|
|
|
|
|
|
|
+ String filePath = "";
|
|
|
// 文件名称
|
|
// 文件名称
|
|
|
- String fileName;
|
|
|
|
|
|
|
+ String fileName = "";
|
|
|
// 不是已盖章文件
|
|
// 不是已盖章文件
|
|
|
if (financeFileList.size() == 0) {
|
|
if (financeFileList.size() == 0) {
|
|
|
/**-------- word 变量替换 开始--------**/
|
|
/**-------- word 变量替换 开始--------**/
|
|
@@ -563,13 +585,14 @@ public class RecordSealController extends BaseController {
|
|
|
filePath = directory + fileName + currecntDate + ".pdf";
|
|
filePath = directory + fileName + currecntDate + ".pdf";
|
|
|
/**-------- word 转PDF 结束--------**/
|
|
/**-------- word 转PDF 结束--------**/
|
|
|
// 是已盖章文件
|
|
// 是已盖章文件
|
|
|
- } else {
|
|
|
|
|
- // 文件服务器的文件下载到本地
|
|
|
|
|
- PubFileInf fileInf = fileInfService.getById(financeFileList.get(0).getZfrfrFileId());
|
|
|
|
|
- filePath = downloadFile(fileInf.getPfiFileUrl(), fileInf.getPfiFileName());
|
|
|
|
|
- int index = fileInf.getPfiFileName().indexOf(".");
|
|
|
|
|
- fileName = fileInf.getPfiFileName().substring(0,index);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+// else {
|
|
|
|
|
+// // 文件服务器的文件下载到本地
|
|
|
|
|
+// PubFileInf fileInf = fileInfService.getById(financeFileList.get(0).getZfrfrFileId());
|
|
|
|
|
+// filePath = downloadFile(fileInf.getPfiFileUrl(), fileInf.getPfiFileName());
|
|
|
|
|
+// int index = fileInf.getPfiFileName().indexOf(".");
|
|
|
|
|
+// fileName = fileInf.getPfiFileName().substring(0,index);
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
/**-------- 获取合同盖章关键字 开始--------**/
|
|
/**-------- 获取合同盖章关键字 开始--------**/
|
|
|
//获取合同信息
|
|
//获取合同信息
|
|
@@ -603,8 +626,6 @@ public class RecordSealController extends BaseController {
|
|
|
/**-------- 获取合同盖章关键字 结束--------**/
|
|
/**-------- 获取合同盖章关键字 结束--------**/
|
|
|
/**-------- CFCA盖章 开始--------**/
|
|
/**-------- CFCA盖章 开始--------**/
|
|
|
//盖章
|
|
//盖章
|
|
|
- //当前公司
|
|
|
|
|
-// String companyId = tokenService.getLoginUser().getSysUser().getCompanyId();
|
|
|
|
|
//当前公司的cfca人员编号
|
|
//当前公司的cfca人员编号
|
|
|
//查询当前企业信息
|
|
//查询当前企业信息
|
|
|
SysCompany currentCompany = companyService.getById(companyId);
|
|
SysCompany currentCompany = companyService.getById(companyId);
|
|
@@ -653,19 +674,20 @@ public class RecordSealController extends BaseController {
|
|
|
MultipartFile multipartFile =new MockMultipartFile("file", file.getName(), "text/plain", IOUtils.toByteArray(input));
|
|
MultipartFile multipartFile =new MockMultipartFile("file", file.getName(), "text/plain", IOUtils.toByteArray(input));
|
|
|
R<com.tianhu.system.api.domain.PubFileInf> fileResult = remoteFileService.uploadFile(multipartFile,"01", "02","00",companyId,token);
|
|
R<com.tianhu.system.api.domain.PubFileInf> fileResult = remoteFileService.uploadFile(multipartFile,"01", "02","00",companyId,token);
|
|
|
|
|
|
|
|
- ZcFinanceRecordFileRel recordFileRel;
|
|
|
|
|
|
|
+ ZcFinanceRecordFileRel recordFileRel =new ZcFinanceRecordFileRel();
|
|
|
// 不是已盖章文件
|
|
// 不是已盖章文件
|
|
|
- if (financeFileList.size() == 0) {
|
|
|
|
|
|
|
+// if (financeFileList.size() == 0) {
|
|
|
// zc_finance_file_rel 存入数据
|
|
// zc_finance_file_rel 存入数据
|
|
|
- recordFileRel = new ZcFinanceRecordFileRel();
|
|
|
|
|
|
|
+ //recordFileRel = new ZcFinanceRecordFileRel();
|
|
|
recordFileRel.setZfrfrId(IdUtils.fastSimpleUUID());
|
|
recordFileRel.setZfrfrId(IdUtils.fastSimpleUUID());
|
|
|
recordFileRel.setZfrfrFinanceId(zfiId);
|
|
recordFileRel.setZfrfrFinanceId(zfiId);
|
|
|
recordFileRel.setZfrfrContractId(contractList.get(i).getZfcId());
|
|
recordFileRel.setZfrfrContractId(contractList.get(i).getZfcId());
|
|
|
// 已盖章文件
|
|
// 已盖章文件
|
|
|
- } else {
|
|
|
|
|
- // 修改zc_finance_file_rel 数据
|
|
|
|
|
- recordFileRel = financeFileList.get(0);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// }
|
|
|
|
|
+// else {
|
|
|
|
|
+// // 修改zc_finance_file_rel 数据
|
|
|
|
|
+// recordFileRel = financeFileList.get(0);
|
|
|
|
|
+// }
|
|
|
recordFileRel.setZfrfrFileId(fileResult.getData().getPfiFileId());
|
|
recordFileRel.setZfrfrFileId(fileResult.getData().getPfiFileId());
|
|
|
recordFileRel.setZfrfrCfcaNumber(contractNo);
|
|
recordFileRel.setZfrfrCfcaNumber(contractNo);
|
|
|
// 融资企业盖章
|
|
// 融资企业盖章
|
|
@@ -674,26 +696,27 @@ public class RecordSealController extends BaseController {
|
|
|
recordFileRel.setZfrfrSupplierTime(new Date());
|
|
recordFileRel.setZfrfrSupplierTime(new Date());
|
|
|
|
|
|
|
|
// 不是已盖章文件
|
|
// 不是已盖章文件
|
|
|
- if (financeFileList.size() == 0) {
|
|
|
|
|
|
|
+// if (financeFileList.size() == 0) {
|
|
|
// zc_finance_file_rel 存入数据
|
|
// zc_finance_file_rel 存入数据
|
|
|
financeRecordFileRelService.createZcFinanceRecordFileRel(recordFileRel);
|
|
financeRecordFileRelService.createZcFinanceRecordFileRel(recordFileRel);
|
|
|
// 已盖章文件
|
|
// 已盖章文件
|
|
|
- } else {
|
|
|
|
|
- // 修改zc_finance_file_rel 数据
|
|
|
|
|
- financeRecordFileRelService.updateById(recordFileRel);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// }
|
|
|
|
|
+// else {
|
|
|
|
|
+// // 修改zc_finance_file_rel 数据
|
|
|
|
|
+// financeRecordFileRelService.updateById(recordFileRel);
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
/**-------- 盖章完成修改融信状态和融资状态 开始--------**/
|
|
/**-------- 盖章完成修改融信状态和融资状态 开始--------**/
|
|
|
- //修改融信状态
|
|
|
|
|
- ZcFinanceInf finance = new ZcFinanceInf();
|
|
|
|
|
- finance.setZfiId(zfiId);
|
|
|
|
|
- //已生效
|
|
|
|
|
- finance.setZfiStatus("02");
|
|
|
|
|
- //修改时间
|
|
|
|
|
- finance.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
- //修改人
|
|
|
|
|
- finance.setUpdateBy(userId);
|
|
|
|
|
- financeInfService.updateById(finance);
|
|
|
|
|
|
|
+// //修改融信状态
|
|
|
|
|
+// ZcFinanceInf finance = new ZcFinanceInf();
|
|
|
|
|
+// finance.setZfiId(zfiId);
|
|
|
|
|
+// //已生效
|
|
|
|
|
+// finance.setZfiStatus("02");
|
|
|
|
|
+// //修改时间
|
|
|
|
|
+// finance.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
+// //修改人
|
|
|
|
|
+// finance.setUpdateBy(userId);
|
|
|
|
|
+// financeInfService.updateById(finance);
|
|
|
//修改融资状态
|
|
//修改融资状态
|
|
|
LambdaQueryWrapper<ZcFinanceRecord> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ZcFinanceRecord> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(ZcFinanceRecord::getZfrFinanceId,zfiId);
|
|
queryWrapper.eq(ZcFinanceRecord::getZfrFinanceId,zfiId);
|
|
@@ -701,7 +724,7 @@ public class RecordSealController extends BaseController {
|
|
|
//融资状态(00:融资中 01:已放款 02:融资失败 03:已结算 04:合同待签署)
|
|
//融资状态(00:融资中 01:已放款 02:融资失败 03:已结算 04:合同待签署)
|
|
|
zcFinanceRecord.setZfrStatus("00");
|
|
zcFinanceRecord.setZfrStatus("00");
|
|
|
//修改时间
|
|
//修改时间
|
|
|
- zcFinanceRecord.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
+ zcFinanceRecord.setUpdateTime(DateUtils.getNowDate());
|
|
|
//修改人
|
|
//修改人
|
|
|
zcFinanceRecord.setUpdateBy(userId);
|
|
zcFinanceRecord.setUpdateBy(userId);
|
|
|
iZcFinanceRecordService.update(zcFinanceRecord,queryWrapper);
|
|
iZcFinanceRecordService.update(zcFinanceRecord,queryWrapper);
|