|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendix; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAttachTypeEnum; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.*; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.flowable.AppSubmitContractInfoDto; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.flowable.CommonContractNodeQuery; |
|
|
@ -986,35 +987,35 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
AppCommonContractQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<CommonContract> qw = appCreateQueryWrapper(query); |
|
|
|
IPage<CommonContract> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<AppCommonContractPageVo> iPage = baseMapper.getContractList(page, qw); |
|
|
|
IPage<AppCommonContractPageVo> iPage = baseMapper.getContractList(page, qw,query.getNames()); |
|
|
|
List<AppCommonContractPageVo> records = iPage.getRecords(); |
|
|
|
records.removeAll(Collections.singleton(null)); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
for (AppCommonContractPageVo vo : records) { |
|
|
|
String sid = vo.getContractSid(); |
|
|
|
//根据sid查询合同
|
|
|
|
List<PrintConfirmVo> list = commonAppendixService.selectByType(sid, CommonAttachTypeEnum.CONTRACT_UPLOAD.getAttachType(), docPdfComponent.getPrefixTemplateUrl()); |
|
|
|
vo.setFiles(list); |
|
|
|
if (StringUtils.isNotBlank(vo.getCommonContractUrl())) { |
|
|
|
vo.setIsShowDownload(true); |
|
|
|
} else { |
|
|
|
vo.setIsShowDownload(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<AppCommonContractPageVo> p = PagerUtil.pageToVo(iPage, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<CommonContract> appCreateQueryWrapper(AppCommonContractQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
|
QueryWrapper<CommonContract> qw = new QueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(query.getType())) { //合同类型
|
|
|
|
// qw.eq("contractTypeKey", query.getType());
|
|
|
|
// }
|
|
|
|
if (StringUtils.isNotBlank(query.getNames())) { // 甲方名称
|
|
|
|
qw.like("partyA", query.getNames()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getNames())) { // 乙方名称
|
|
|
|
qw.like("partyB", query.getNames()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getNames())) { // 其他方名称
|
|
|
|
qw.like("partyC", query.getNames()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getUserSid())) { // 业务员sid
|
|
|
|
qw.eq("staffSid", query.getUserSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getType())) { // 业务员sid
|
|
|
|
if (StringUtils.isNotBlank(query.getType())) { |
|
|
|
qw.eq("state", query.getType()); |
|
|
|
} |
|
|
|
qw.orderByDesc("id"); |
|
|
|
return qw; |
|
|
|
} |
|
|
|
|
|
|
@ -1106,7 +1107,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (dto.getContractImages() != null) { |
|
|
|
if (dto.getSiteSigImages() != null) { |
|
|
|
for (String siteSigImages : dto.getSiteSigImages()) { |
|
|
|
if (siteSigImages.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
siteSigImages = siteSigImages.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
@ -1116,7 +1117,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (dto.getContractImages() != null) { |
|
|
|
if (dto.getIdCardImages() != null) { |
|
|
|
for (String idCardImage : dto.getIdCardImages()) { |
|
|
|
if (idCardImage.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
idCardImage = idCardImage.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
@ -1125,7 +1126,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
commonContract.setIdImagesUrl(s3.substring(0, s3.length() - 1)); |
|
|
|
} |
|
|
|
} |
|
|
|
updateById(commonContract); |
|
|
|
baseMapper.updateById(commonContract); |
|
|
|
return rb.success().setData(commonContract.getSid()); |
|
|
|
} |
|
|
|
|
|
|
@ -1423,6 +1424,32 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
commonContract.setOneDeposit(new BigDecimal(depositInfo.getDeposit())); |
|
|
|
commonContract.setCommonContractUrl(finalUrl); |
|
|
|
save(commonContract); |
|
|
|
if (list.size() > 0) { |
|
|
|
//添加合同下载路径
|
|
|
|
for (PrintConfirmVo vo : list) { |
|
|
|
String str = vo.getDownloadUrl(); |
|
|
|
String urlPrefix = docPdfComponent.getPrefixTemplateUrl(); |
|
|
|
String uploadPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
CommonAppendix commonAppendix = new CommonAppendix(); |
|
|
|
commonAppendix.setLinkSid(commonContract.getSid()); |
|
|
|
commonAppendix.setAttachType(CommonAttachTypeEnum.CONTRACT_UPLOAD.getAttachType()); |
|
|
|
String pathLoc = str.replace(urlPrefix, uploadPath); |
|
|
|
pathLoc = pathLoc.replace("/", File.separator); |
|
|
|
File file = new File(pathLoc); |
|
|
|
String size = ""; |
|
|
|
if (file != null) { |
|
|
|
size = FileUploadComponent.getPrintSize(file.length()); |
|
|
|
} |
|
|
|
String suffix = str.substring(str.lastIndexOf(".") + 1); // 文件类型
|
|
|
|
String fileName = str.substring(str.lastIndexOf("/") + 1, str.lastIndexOf(".")); // 文件名
|
|
|
|
commonAppendix.setFileName(vo.getName()); |
|
|
|
commonAppendix.setFileType(suffix); |
|
|
|
commonAppendix.setFileSize(size); |
|
|
|
commonAppendix.setFilePath(str.replace(urlPrefix, "")); |
|
|
|
commonAppendix.setRemarks("合同下载"); |
|
|
|
commonAppendixService.insert(commonAppendix); |
|
|
|
} |
|
|
|
} |
|
|
|
return commonContract.getSid(); |
|
|
|
}); |
|
|
|
} |
|
|
|