|
|
@@ -1,5 +1,7 @@
|
|
|
package me.zhengjie.domain.model;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import me.zhengjie.application.admin.controller.vo.NotaryNoteDto;
|
|
|
@@ -8,7 +10,6 @@ import me.zhengjie.base.util.*;
|
|
|
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.mapper.*;
|
|
|
import me.zhengjie.domain.order.OrderConstant;
|
|
|
@@ -35,7 +36,6 @@ public class ModelSynthesizerDomain {
|
|
|
private final CityMapper cityMapper;
|
|
|
private final ProvinceMapper provinceMapper;
|
|
|
private final ApplicationContextUtil contextUtil;
|
|
|
- private final UserAXQInfoRepository userAXQInfoRepository;
|
|
|
private final FileInfoMapper fileInfoMapper;
|
|
|
|
|
|
/**
|
|
|
@@ -54,7 +54,7 @@ public class ModelSynthesizerDomain {
|
|
|
fileEntity.setBusinessNo(businessNo);
|
|
|
fileEntity.setCode(m.getCode());
|
|
|
fileEntity.setSortNum(m.getSort());
|
|
|
- String html = composeCommonTemplateWithData(businessNo, m.getContent(), "", false);
|
|
|
+ String html = composeCommonTemplateWithData(businessNo, m.getContent(), "", false, null);
|
|
|
String htmlPath = FileUploadUtil.saveHtml(html, businessNo);
|
|
|
String pdfPath = FileUploadUtil.savePdf(html, businessNo);
|
|
|
fileEntity.setHtmlUrl(htmlPath);
|
|
|
@@ -71,8 +71,9 @@ public class ModelSynthesizerDomain {
|
|
|
* 重建普通公证文书
|
|
|
*
|
|
|
* @param businessNo
|
|
|
+ * @param signUser
|
|
|
*/
|
|
|
- public void recreateCommonDoc(String businessNo) {
|
|
|
+ public void recreateCommonDoc(String businessNo, JSONArray signUser) {
|
|
|
ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
|
|
|
SysUserEntity notaryUser = sysUserMapper.selectById(contractOrderEntity.getNotaryUserId());
|
|
|
List<ModelEntity> models = modelRepository.getCommonModel(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId());
|
|
|
@@ -80,7 +81,7 @@ public class ModelSynthesizerDomain {
|
|
|
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 html = composeCommonTemplateWithData(businessNo, m.getContent(), notaryUser.getNickName(), true, signUser);
|
|
|
String htmlPath = FileUploadUtil.saveHtml(html, businessNo);
|
|
|
String pdfPath = FileUploadUtil.savePdf(html, businessNo);
|
|
|
saveFile.setHtmlUrl(htmlPath);
|
|
|
@@ -251,7 +252,7 @@ public class ModelSynthesizerDomain {
|
|
|
private String composeNotePartyList(String businessNo) {
|
|
|
ContractOrderEntity order = contractOrderRepository.getContractOrderWithBizNo(businessNo);
|
|
|
BankEntity bank = bankMapper.selectById(order.getBankId());
|
|
|
- String lender = "贷款人:" + bank.getBankName() + ",住所:" + bank.getAddress() + ",负责人:" + bank.getPrincipal() + "<br/><br/>";
|
|
|
+ String lender = "贷款人:" + bank.getBankName() + ",营业场所:" + bank.getAddress() + ",负责人:" + bank.getPrincipal() + "<br/><br/>";
|
|
|
String template = "$Title$:$Name$,$Sex$,$Birth$出生,公民身份证号码:$IdCard$,联系电话:$Phone$<br/><br/>";
|
|
|
List<Map<String, String>> userList = prepareNotePartyTemplateData(order);
|
|
|
String users = lender;
|
|
|
@@ -428,8 +429,8 @@ public class ModelSynthesizerDomain {
|
|
|
* @param content
|
|
|
* @return
|
|
|
*/
|
|
|
- private String composeCommonTemplateWithData(String businessNo, String content, String userName, boolean hasSignImg) {
|
|
|
- String replaceContent = TextTempletUtil.replaceContent(content, prepareCommonTemplateData(businessNo, userName, hasSignImg));
|
|
|
+ private String composeCommonTemplateWithData(String businessNo, String content, String userName, boolean hasSignImg, JSONArray signUser) {
|
|
|
+ String replaceContent = TextTempletUtil.replaceContent(content, prepareCommonTemplateData(businessNo, userName, hasSignImg, signUser));
|
|
|
String result = "";
|
|
|
try {
|
|
|
InputStream inputStream = ModelSynthesizerDomain.class.getClassLoader().getResourceAsStream("template/note/notary-model.html");
|
|
|
@@ -448,7 +449,7 @@ public class ModelSynthesizerDomain {
|
|
|
* @param hasSignImg
|
|
|
* @return
|
|
|
*/
|
|
|
- private Map<String, String> prepareCommonTemplateData(String businessNo, String userName, boolean hasSignImg) {
|
|
|
+ private Map<String, String> prepareCommonTemplateData(String businessNo, String userName, boolean hasSignImg, JSONArray signUser) {
|
|
|
ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
|
|
|
//
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
@@ -496,21 +497,19 @@ public class ModelSynthesizerDomain {
|
|
|
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");
|
|
|
+ List<FileInfoEntity> fileList = new ArrayList<>();
|
|
|
+ Map<String, String> imgTypeMap = new HashMap<>();
|
|
|
//
|
|
|
- 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");
|
|
|
+ for (Object object : signUser) {
|
|
|
+ JSONObject jsonObject = (JSONObject) object;
|
|
|
+ String imageId = jsonObject.getString("imageId");
|
|
|
+ FileInfoEntity fileInfo = fileInfoMapper.selectById(imageId);
|
|
|
+ fileList.add(fileInfo);
|
|
|
+ imgTypeMap.put(imageId, "user");
|
|
|
}
|
|
|
- List<FileInfoEntity> fileList = fileInfoMapper.selectBatchIds(imgIdList);
|
|
|
+ //
|
|
|
+ fileList.add(fileInfoMapper.selectById(user.getSignImgId()));
|
|
|
+ imgTypeMap.put(user.getSignImgId(), "customer");
|
|
|
map.put("photograph", generateSignImgHtml(fileList, imgTypeMap));
|
|
|
}
|
|
|
// 准备公证处信息
|
|
|
@@ -545,9 +544,9 @@ public class ModelSynthesizerDomain {
|
|
|
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()) + "\"/>";
|
|
|
+ signImgHtml += "<img style=\"width: 48px;height: 30px;margin-right: 8px;position:relative;top:5px;\" title=\"客户经理签名\" src=\"" + FileUploadUtil.getPreviewUrl(fileInfo.getPath()) + "\"/>";
|
|
|
} else {
|
|
|
- signImgHtml += "<img style=\"width: 80px;height: 40px;margin-right: 8px;\" title=\"当事人签名\" src=\"" + FileUploadUtil.getPreviewUrl(fileInfo.getPath()) + "\"/>";
|
|
|
+ signImgHtml += "<img style=\"width: 48px;height: 30px;margin-right: 8px;position:relative;top:5px;\" title=\"当事人签名\" src=\"" + FileUploadUtil.getPreviewUrl(fileInfo.getPath()) + "\"/>";
|
|
|
}
|
|
|
}
|
|
|
return signImgHtml;
|