|
@@ -2,22 +2,23 @@ package me.zhengjie.domain.model;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import me.zhengjie.application.admin.controller.OrderCochainController;
|
|
|
|
|
-import me.zhengjie.application.admin.service.dto.UserDto;
|
|
|
|
|
import me.zhengjie.application.admin.controller.vo.NotaryNoteDto;
|
|
import me.zhengjie.application.admin.controller.vo.NotaryNoteDto;
|
|
|
-import me.zhengjie.base.util.ApplicationContextUtil;
|
|
|
|
|
-import me.zhengjie.base.util.DateUtils;
|
|
|
|
|
-import me.zhengjie.base.util.StatusEnum;
|
|
|
|
|
-import me.zhengjie.base.util.TextTempletUtil;
|
|
|
|
|
|
|
+import me.zhengjie.application.admin.service.dto.UserDto;
|
|
|
|
|
+import me.zhengjie.base.util.*;
|
|
|
import me.zhengjie.dao.mybatis.ContractOrderRepository;
|
|
import me.zhengjie.dao.mybatis.ContractOrderRepository;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.ModelRepository;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.OrderFileRepository;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.UserAXQInfoRepository;
|
|
|
import me.zhengjie.dao.mybatis.entity.*;
|
|
import me.zhengjie.dao.mybatis.entity.*;
|
|
|
import me.zhengjie.dao.mybatis.mapper.*;
|
|
import me.zhengjie.dao.mybatis.mapper.*;
|
|
|
import me.zhengjie.domain.order.OrderConstant;
|
|
import me.zhengjie.domain.order.OrderConstant;
|
|
|
import me.zhengjie.utils.DateUtil;
|
|
import me.zhengjie.utils.DateUtil;
|
|
|
|
|
+import me.zhengjie.utils.StringUtils;
|
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -26,12 +27,69 @@ import java.util.*;
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
public class ModelSynthesizerDomain {
|
|
public class ModelSynthesizerDomain {
|
|
|
private final ContractOrderRepository contractOrderRepository;
|
|
private final ContractOrderRepository contractOrderRepository;
|
|
|
|
|
+ private final ModelRepository modelRepository;
|
|
|
|
|
+ private final OrderFileRepository orderFileRepository;
|
|
|
private final BankMapper bankMapper;
|
|
private final BankMapper bankMapper;
|
|
|
private final SysUserMapper sysUserMapper;
|
|
private final SysUserMapper sysUserMapper;
|
|
|
private final NotaryOfficeMapper notaryOfficeMapper;
|
|
private final NotaryOfficeMapper notaryOfficeMapper;
|
|
|
private final CityMapper cityMapper;
|
|
private final CityMapper cityMapper;
|
|
|
private final ProvinceMapper provinceMapper;
|
|
private final ProvinceMapper provinceMapper;
|
|
|
private final ApplicationContextUtil contextUtil;
|
|
private final ApplicationContextUtil contextUtil;
|
|
|
|
|
+ private final UserAXQInfoRepository userAXQInfoRepository;
|
|
|
|
|
+ private final FileInfoMapper fileInfoMapper;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 生成普通公证文书
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param userId
|
|
|
|
|
+ * @param businessNo
|
|
|
|
|
+ */
|
|
|
|
|
+ public void generateCommonDoc(String userId, String businessNo) {
|
|
|
|
|
+ ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
|
|
|
|
|
+ List<ModelEntity> models = modelRepository.getCommonModel(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId());
|
|
|
|
|
+ // 在保存之前先删除数据
|
|
|
|
|
+ orderFileRepository.delFileWithBizNO(businessNo);
|
|
|
|
|
+ for (ModelEntity m : models) {
|
|
|
|
|
+ OrderFileEntity fileEntity = new OrderFileEntity();
|
|
|
|
|
+ fileEntity.setBusinessNo(businessNo);
|
|
|
|
|
+ fileEntity.setCode(m.getCode());
|
|
|
|
|
+ fileEntity.setSortNum(m.getSort());
|
|
|
|
|
+ String html = composeCommonTemplateWithData(businessNo, m.getContent(), "", false);
|
|
|
|
|
+ String htmlPath = FileUploadUtil.saveHtml(html, businessNo);
|
|
|
|
|
+ String pdfPath = FileUploadUtil.savePdf(html, businessNo);
|
|
|
|
|
+ fileEntity.setHtmlUrl(htmlPath);
|
|
|
|
|
+ fileEntity.setPdfUrl(pdfPath);
|
|
|
|
|
+ fileEntity.setCreateTime(new Date());
|
|
|
|
|
+ fileEntity.setCreatorId(Long.parseLong(userId));
|
|
|
|
|
+ fileEntity.setFileName(m.getTitle());
|
|
|
|
|
+ //
|
|
|
|
|
+ orderFileRepository.insert(fileEntity);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 重建普通公证文书
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param businessNo
|
|
|
|
|
+ */
|
|
|
|
|
+ public void recreateCommonDoc(String businessNo) {
|
|
|
|
|
+ ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
|
|
|
|
|
+ SysUserEntity notaryUser = sysUserMapper.selectById(contractOrderEntity.getNotaryUserId());
|
|
|
|
|
+ List<ModelEntity> models = modelRepository.getCommonModel(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId());
|
|
|
|
|
+ for (ModelEntity m : models) {
|
|
|
|
|
+ OrderFileEntity fileEntity = orderFileRepository.getOrderFileWithCode(businessNo, m.getCode());
|
|
|
|
|
+ OrderFileEntity saveFile = new OrderFileEntity();
|
|
|
|
|
+ saveFile.setId(fileEntity.getId());
|
|
|
|
|
+ String html = composeCommonTemplateWithData(businessNo, m.getContent(), notaryUser.getNickName(), true);
|
|
|
|
|
+ String htmlPath = FileUploadUtil.saveHtml(html, businessNo);
|
|
|
|
|
+ String pdfPath = FileUploadUtil.savePdf(html, businessNo);
|
|
|
|
|
+ saveFile.setHtmlUrl(htmlPath);
|
|
|
|
|
+ saveFile.setPdfUrl(pdfPath);
|
|
|
|
|
+ saveFile.setUpdateTime(new Date());
|
|
|
|
|
+ //
|
|
|
|
|
+ orderFileRepository.updateById(saveFile);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 合成公证书预览模板
|
|
* 合成公证书预览模板
|
|
@@ -68,7 +126,7 @@ public class ModelSynthesizerDomain {
|
|
|
*/
|
|
*/
|
|
|
public Map<String, String> prepareNotarizationTemplateData(ContractOrderEntity contractOrderEntity) {
|
|
public Map<String, String> prepareNotarizationTemplateData(ContractOrderEntity contractOrderEntity) {
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
- map.put("$Amounts$", contractOrderEntity.getContractMoney());
|
|
|
|
|
|
|
+ map.put("$Amounts$", formatAmount(contractOrderEntity.getContractMoney()));
|
|
|
if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_BORROWER) {
|
|
if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_BORROWER) {
|
|
|
map.put("$Type$", "借款合同");
|
|
map.put("$Type$", "借款合同");
|
|
|
} else if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_MORTGAGE) {
|
|
} else if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_MORTGAGE) {
|
|
@@ -97,24 +155,20 @@ public class ModelSynthesizerDomain {
|
|
|
map.put("$NotaryOffice$", notaryOffice.getName());
|
|
map.put("$NotaryOffice$", notaryOffice.getName());
|
|
|
// 当事人信息
|
|
// 当事人信息
|
|
|
try {
|
|
try {
|
|
|
- SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
- Date beginDate = monthformatter.parse(contractOrderEntity.getStartDate());
|
|
|
|
|
- Date endDate = monthformatter.parse(contractOrderEntity.getEndDate());
|
|
|
|
|
- Integer months = DateUtils.getDiffNaturalMonth(endDate, beginDate);
|
|
|
|
|
map.put("$Year$", DateUtil.formatYearToNum(new Date()));
|
|
map.put("$Year$", DateUtil.formatYearToNum(new Date()));
|
|
|
map.put("$Name$", contractOrderEntity.getName());
|
|
map.put("$Name$", contractOrderEntity.getName());
|
|
|
map.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
|
|
map.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
|
|
|
map.put("$Birthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getBirth(), "yyyy/M/d"));
|
|
map.put("$Birthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getBirth(), "yyyy/M/d"));
|
|
|
- map.put("$Phone$",contractOrderEntity.getPhone());
|
|
|
|
|
- map.put("$Addr$",contractOrderEntity.getResidence());
|
|
|
|
|
|
|
+ map.put("$Phone$", contractOrderEntity.getPhone());
|
|
|
|
|
+ map.put("$Addr$", contractOrderEntity.getResidence());
|
|
|
map.put("$IDNo$", contractOrderEntity.getIdCard());
|
|
map.put("$IDNo$", contractOrderEntity.getIdCard());
|
|
|
map.put("$LoanRate$", contractOrderEntity.getRate());
|
|
map.put("$LoanRate$", contractOrderEntity.getRate());
|
|
|
map.put("$Term$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getStartDate(), "yyyy-MM-dd").concat(" - ").concat(DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getEndDate(), "yyyy-MM-dd")));
|
|
map.put("$Term$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getStartDate(), "yyyy-MM-dd").concat(" - ").concat(DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getEndDate(), "yyyy-MM-dd")));
|
|
|
- map.put("$TotalMonth$", months.toString());
|
|
|
|
|
|
|
+ map.put("$TotalMonth$", getMonth(contractOrderEntity));
|
|
|
if (contractOrderEntity.getJointFlag() == 1) {
|
|
if (contractOrderEntity.getJointFlag() == 1) {
|
|
|
map.put("$MateName$", contractOrderEntity.getJointName());
|
|
map.put("$MateName$", contractOrderEntity.getJointName());
|
|
|
map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
|
|
map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
|
|
|
- map.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getIdCard().substring(6, 14), "yyyyMMdd"));
|
|
|
|
|
|
|
+ map.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getJointIdCard().substring(6, 14), "yyyyMMdd"));
|
|
|
map.put("$MateAddr$", contractOrderEntity.getJointResidence());
|
|
map.put("$MateAddr$", contractOrderEntity.getJointResidence());
|
|
|
map.put("$MatePhone$", contractOrderEntity.getJointPhone());
|
|
map.put("$MatePhone$", contractOrderEntity.getJointPhone());
|
|
|
map.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
|
|
map.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
|
|
@@ -305,14 +359,14 @@ public class ModelSynthesizerDomain {
|
|
|
noteValue.put("$Phone$", contractOrderEntity.getPhone());
|
|
noteValue.put("$Phone$", contractOrderEntity.getPhone());
|
|
|
noteValue.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
|
|
noteValue.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
|
|
|
noteValue.put("$Addr$", contractOrderEntity.getResidence());
|
|
noteValue.put("$Addr$", contractOrderEntity.getResidence());
|
|
|
- noteValue.put("$Amounts$", contractOrderEntity.getContractMoney());
|
|
|
|
|
|
|
+ noteValue.put("$Amounts$", formatAmount(contractOrderEntity.getContractMoney()));
|
|
|
noteValue.put("$Term$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getStartDate(), "yyyy-MM-dd") + "~" + DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getEndDate(), "yyyy-MM-dd"));
|
|
noteValue.put("$Term$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getStartDate(), "yyyy-MM-dd") + "~" + DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getEndDate(), "yyyy-MM-dd"));
|
|
|
noteValue.put("$LoanRate$", contractOrderEntity.getRate());
|
|
noteValue.put("$LoanRate$", contractOrderEntity.getRate());
|
|
|
noteValue.put("$McontractNO$", contractOrderEntity.getMainContractNo());
|
|
noteValue.put("$McontractNO$", contractOrderEntity.getMainContractNo());
|
|
|
if (contractOrderEntity.getJointFlag() == 1) {
|
|
if (contractOrderEntity.getJointFlag() == 1) {
|
|
|
noteValue.put("$MateName$", contractOrderEntity.getJointName());
|
|
noteValue.put("$MateName$", contractOrderEntity.getJointName());
|
|
|
noteValue.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
|
|
noteValue.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
|
|
|
- noteValue.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getIdCard().substring(6, 14), "yyyyMMdd"));
|
|
|
|
|
|
|
+ noteValue.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getJointIdCard().substring(6, 14), "yyyyMMdd"));
|
|
|
noteValue.put("$MateAddr$", contractOrderEntity.getJointResidence());
|
|
noteValue.put("$MateAddr$", contractOrderEntity.getJointResidence());
|
|
|
noteValue.put("$MatePhone$", contractOrderEntity.getJointPhone());
|
|
noteValue.put("$MatePhone$", contractOrderEntity.getJointPhone());
|
|
|
noteValue.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
|
|
noteValue.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
|
|
@@ -336,15 +390,7 @@ public class ModelSynthesizerDomain {
|
|
|
noteValue.put("$obligor$", obligor);
|
|
noteValue.put("$obligor$", obligor);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- try {
|
|
|
|
|
- SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
- Date beginDate = monthformatter.parse(contractOrderEntity.getStartDate());
|
|
|
|
|
- Date endDate = monthformatter.parse(contractOrderEntity.getEndDate());
|
|
|
|
|
- Integer months = DateUtils.getDiffNaturalMonth(endDate, beginDate);
|
|
|
|
|
- noteValue.put("$TotalMonth$", months.toString());
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ noteValue.put("$TotalMonth$", getMonth(contractOrderEntity));
|
|
|
// 准备银行信息
|
|
// 准备银行信息
|
|
|
BankEntity bank = bankMapper.selectById(contractOrderEntity.getBankId());
|
|
BankEntity bank = bankMapper.selectById(contractOrderEntity.getBankId());
|
|
|
noteValue.put("$Bank$", bank.getBankName());
|
|
noteValue.put("$Bank$", bank.getBankName());
|
|
@@ -382,8 +428,8 @@ public class ModelSynthesizerDomain {
|
|
|
* @param content
|
|
* @param content
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String composeCommonTemplateWithData(String businessNo, String content, String userName) {
|
|
|
|
|
- String replaceContent = TextTempletUtil.replaceContent(content, prepareCommonTemplateData(businessNo, content, userName));
|
|
|
|
|
|
|
+ private String composeCommonTemplateWithData(String businessNo, String content, String userName, boolean hasSignImg) {
|
|
|
|
|
+ String replaceContent = TextTempletUtil.replaceContent(content, prepareCommonTemplateData(businessNo, userName, hasSignImg));
|
|
|
String result = "";
|
|
String result = "";
|
|
|
try {
|
|
try {
|
|
|
InputStream inputStream = ModelSynthesizerDomain.class.getClassLoader().getResourceAsStream("template/note/notary-model.html");
|
|
InputStream inputStream = ModelSynthesizerDomain.class.getClassLoader().getResourceAsStream("template/note/notary-model.html");
|
|
@@ -398,16 +444,17 @@ public class ModelSynthesizerDomain {
|
|
|
* 准备通用模板替换数据
|
|
* 准备通用模板替换数据
|
|
|
*
|
|
*
|
|
|
* @param businessNo
|
|
* @param businessNo
|
|
|
- * @param contractNo
|
|
|
|
|
* @param userName
|
|
* @param userName
|
|
|
|
|
+ * @param hasSignImg
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private Map<String, String> prepareCommonTemplateData(String businessNo, String contractNo,String userName) {
|
|
|
|
|
|
|
+ private Map<String, String> prepareCommonTemplateData(String businessNo, String userName, boolean hasSignImg) {
|
|
|
ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
|
|
ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
|
|
|
//
|
|
//
|
|
|
Map<String, String> map = new HashMap<>();
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("$Greffier$", userName);
|
|
map.put("$Greffier$", userName);
|
|
|
map.put("$Date$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(new Date()));
|
|
map.put("$Date$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(new Date()));
|
|
|
|
|
+ map.put("$TotalMonth$", getMonth(contractOrderEntity));
|
|
|
// 准备订单信息
|
|
// 准备订单信息
|
|
|
try {
|
|
try {
|
|
|
map.put("$AcceptedNO$", contractOrderEntity.getConsultNo());
|
|
map.put("$AcceptedNO$", contractOrderEntity.getConsultNo());
|
|
@@ -421,7 +468,7 @@ public class ModelSynthesizerDomain {
|
|
|
if (contractOrderEntity.getJointFlag() == 1) {
|
|
if (contractOrderEntity.getJointFlag() == 1) {
|
|
|
map.put("$MateName$", contractOrderEntity.getJointName());
|
|
map.put("$MateName$", contractOrderEntity.getJointName());
|
|
|
map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
|
|
map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
|
|
|
- map.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getIdCard().substring(6, 14), "yyyyMMdd"));
|
|
|
|
|
|
|
+ map.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getJointIdCard().substring(6, 14), "yyyyMMdd"));
|
|
|
map.put("$MateAddr$", contractOrderEntity.getJointResidence());
|
|
map.put("$MateAddr$", contractOrderEntity.getJointResidence());
|
|
|
map.put("$MatePhone$", contractOrderEntity.getJointPhone());
|
|
map.put("$MatePhone$", contractOrderEntity.getJointPhone());
|
|
|
map.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
|
|
map.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
|
|
@@ -447,6 +494,25 @@ public class ModelSynthesizerDomain {
|
|
|
map.put("$PBName$", user.getNickName());
|
|
map.put("$PBName$", user.getNickName());
|
|
|
map.put("$PBSex$", user.getGender());
|
|
map.put("$PBSex$", user.getGender());
|
|
|
map.put("$PBPhone$", user.getPhone());
|
|
map.put("$PBPhone$", user.getPhone());
|
|
|
|
|
+ //
|
|
|
|
|
+ if (hasSignImg) {
|
|
|
|
|
+ List<String> imgIdList = new ArrayList<>();
|
|
|
|
|
+ Map<String,String> imgTypeMap = new HashMap<>();
|
|
|
|
|
+ imgIdList.add(user.getSignImgId());
|
|
|
|
|
+ imgTypeMap.put(user.getSignImgId(),"customer");
|
|
|
|
|
+ //
|
|
|
|
|
+ String userSignImgId = String.valueOf(userAXQInfoRepository.getUserAXQInfoWithIdcard(contractOrderEntity.getIdCard()).getImgSealId());
|
|
|
|
|
+ imgIdList.add(userSignImgId);
|
|
|
|
|
+ imgTypeMap.put(userSignImgId, "user");
|
|
|
|
|
+ //
|
|
|
|
|
+ if (contractOrderEntity.getJointFlag() == OrderConstant.JOINT_FLAG_TRUE) {
|
|
|
|
|
+ userSignImgId = String.valueOf(userAXQInfoRepository.getUserAXQInfoWithIdcard(contractOrderEntity.getJointIdCard()).getImgSealId());
|
|
|
|
|
+ imgIdList.add(userSignImgId);
|
|
|
|
|
+ imgTypeMap.put(userSignImgId, "user");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<FileInfoEntity> fileList = fileInfoMapper.selectBatchIds(imgIdList);
|
|
|
|
|
+ map.put("photograph", generateSignImgHtml(fileList, imgTypeMap));
|
|
|
|
|
+ }
|
|
|
// 准备公证处信息
|
|
// 准备公证处信息
|
|
|
NotaryOfficeEntity office = notaryOfficeMapper.selectById(contractOrderEntity.getNotaryOfficeId());
|
|
NotaryOfficeEntity office = notaryOfficeMapper.selectById(contractOrderEntity.getNotaryOfficeId());
|
|
|
String[] areas = office.getAreaCodesStr().split(",");
|
|
String[] areas = office.getAreaCodesStr().split(",");
|
|
@@ -468,4 +534,60 @@ public class ModelSynthesizerDomain {
|
|
|
//
|
|
//
|
|
|
return map;
|
|
return map;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 生成签名图片html文本
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param fileInfoList
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private String generateSignImgHtml(List<FileInfoEntity> fileInfoList, Map<String, String> imgTypeMap) {
|
|
|
|
|
+ String signImgHtml = "";
|
|
|
|
|
+ for (FileInfoEntity fileInfo : fileInfoList) {
|
|
|
|
|
+ if ("customer".equals(imgTypeMap.get(String.valueOf(fileInfo.getId())))) {
|
|
|
|
|
+ signImgHtml += "<img style=\"width: 160px;height: 60px;margin-right: 8px;\" title=\"客户经理签名\" src=\"" + FileUploadUtil.getPreviewUrl(fileInfo.getPath()) + "\"/>";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ signImgHtml += "<img style=\"width: 80px;height: 40px;margin-right: 8px;\" title=\"当事人签名\" src=\"" + FileUploadUtil.getPreviewUrl(fileInfo.getPath()) + "\"/>";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return signImgHtml;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取合同月份
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param contractOrderEntity
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private String getMonth(ContractOrderEntity contractOrderEntity) {
|
|
|
|
|
+ String month = "";
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (StringUtils.isNotBlank(contractOrderEntity.getContractTerm())) {
|
|
|
|
|
+ month = contractOrderEntity.getContractTerm();
|
|
|
|
|
+ } else if (StringUtils.isNotBlank(contractOrderEntity.getStartDate()) && StringUtils.isNotBlank(contractOrderEntity.getEndDate())) {
|
|
|
|
|
+ SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
+ Date beginDate = monthformatter.parse(contractOrderEntity.getStartDate());
|
|
|
|
|
+ Date endDate = monthformatter.parse(contractOrderEntity.getEndDate());
|
|
|
|
|
+ month = String.valueOf(DateUtils.getDiffNaturalMonth(endDate, beginDate));
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ return month + "个月";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 格式化金额字段
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param amount
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private String formatAmount(String amount) {
|
|
|
|
|
+ String formatAmount = "0";
|
|
|
|
|
+ if (StringUtils.isNotBlank(amount)) {
|
|
|
|
|
+ float iAmount = Float.parseFloat(amount) / 10000;
|
|
|
|
|
+ formatAmount = String.valueOf(new BigDecimal(iAmount).setScale(0, BigDecimal.ROUND_DOWN));
|
|
|
|
|
+ }
|
|
|
|
|
+ return formatAmount;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|