|
@@ -21,7 +21,10 @@ import me.zhengjie.base.plus.QueryWrapperUtil;
|
|
|
import me.zhengjie.base.util.*;
|
|
import me.zhengjie.base.util.*;
|
|
|
import me.zhengjie.dao.mybatis.ModelRepository;
|
|
import me.zhengjie.dao.mybatis.ModelRepository;
|
|
|
import me.zhengjie.dao.mybatis.OrderFileRepository;
|
|
import me.zhengjie.dao.mybatis.OrderFileRepository;
|
|
|
|
|
+import me.zhengjie.domain.model.ModelConstant;
|
|
|
|
|
+import me.zhengjie.domain.model.ModelSynthesizerDomain;
|
|
|
import me.zhengjie.domain.order.OrderBizCodeMessage;
|
|
import me.zhengjie.domain.order.OrderBizCodeMessage;
|
|
|
|
|
+import me.zhengjie.domain.order.OrderConstant;
|
|
|
import me.zhengjie.domain.order.OrderFileConstant;
|
|
import me.zhengjie.domain.order.OrderFileConstant;
|
|
|
import me.zhengjie.domain.user.UserDomain;
|
|
import me.zhengjie.domain.user.UserDomain;
|
|
|
import me.zhengjie.application.admin.service.AdminOrderService;
|
|
import me.zhengjie.application.admin.service.AdminOrderService;
|
|
@@ -92,6 +95,8 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
ApplicationContextUtil contextUtil;
|
|
ApplicationContextUtil contextUtil;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
ContractOrderRepository contractOrderRepository;
|
|
ContractOrderRepository contractOrderRepository;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ ModelSynthesizerDomain modelSynthesizerDomain;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public AppBaseResponse<List<NotaryOrderQueryRsp>> query(NotaryOrderQueryReq req) {
|
|
public AppBaseResponse<List<NotaryOrderQueryRsp>> query(NotaryOrderQueryReq req) {
|
|
@@ -332,163 +337,40 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public AppBaseResponse partyPass(NotaryOrderQueryReq req) {
|
|
public AppBaseResponse partyPass(NotaryOrderQueryReq req) {
|
|
|
AppBaseResponse response = new AppBaseResponse();
|
|
AppBaseResponse response = new AppBaseResponse();
|
|
|
- ContractOrderEntity contractOrderEntity = contractOrderMapper.selectById(req.getId());
|
|
|
|
|
- if ("0".equals(contractOrderEntity.getAutoGenerate())) {
|
|
|
|
|
|
|
+ ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(req.getBusinessNo());
|
|
|
|
|
+ if (OrderConstant.NOTARIZATION_GENERATE_HAND.equals(contractOrderEntity.getAutoGenerate())) {
|
|
|
response.fail(OrderBizCodeMessage.NOTARIZATION_GENERATE_TYPE_ERROR);
|
|
response.fail(OrderBizCodeMessage.NOTARIZATION_GENERATE_TYPE_ERROR);
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
// 检查面谈笔录是否提交
|
|
// 检查面谈笔录是否提交
|
|
|
-
|
|
|
|
|
- OrderFileEntity orderFile = orderFileRepository.getOrderFileWithCode(contractOrderEntity.getProdId(),
|
|
|
|
|
- contractOrderEntity.getBusinessNo(), OrderFileConstant.TYPE_CODE_NOTE);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ OrderFileEntity orderFile = orderFileRepository.getOrderNote(req.getBusinessNo());
|
|
|
if (orderFile == null) {
|
|
if (orderFile == null) {
|
|
|
response.fail(ResultCode.INTERVIEW_NOTE_UNSUBMIT);
|
|
response.fail(ResultCode.INTERVIEW_NOTE_UNSUBMIT);
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
// 检查公证书模板是否处于编辑状态
|
|
// 检查公证书模板是否处于编辑状态
|
|
|
- String code = "";
|
|
|
|
|
- if ("10".equals(req.getPartyId().substring(0, 2))) {
|
|
|
|
|
- code = "10";
|
|
|
|
|
- } else if ("11".equals(req.getPartyId().substring(0, 2))) {
|
|
|
|
|
- code = "12";
|
|
|
|
|
- } else {
|
|
|
|
|
- code = "11";
|
|
|
|
|
- }
|
|
|
|
|
- if (modelRepository.existModelInEditing(contractOrderEntity.getProdId(),
|
|
|
|
|
- contractOrderEntity.getNotaryOfficeId(), code)) {
|
|
|
|
|
|
|
+ if (modelRepository.existModelInEditing(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_NOTARIZATION)) {
|
|
|
response.fail(OrderBizCodeMessage.MODEL_IN_EDITING);
|
|
response.fail(OrderBizCodeMessage.MODEL_IN_EDITING);
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
// 检查是否具备可用的公证书编号
|
|
// 检查是否具备可用的公证书编号
|
|
|
- SimpleDateFormat yearFormatter = new SimpleDateFormat("yyyy");
|
|
|
|
|
- QueryWrapper<NotarizationNoEntity> notarizationNoQw = new QueryWrapper<>();
|
|
|
|
|
- notarizationNoQw.eq("notary_office_id", contractOrderEntity.getNotaryOfficeId());
|
|
|
|
|
- notarizationNoQw.eq("no_status", 1);
|
|
|
|
|
- notarizationNoQw.eq("used_year", yearFormatter.format(new Date()));
|
|
|
|
|
- notarizationNoQw.apply("current_num < end_num");
|
|
|
|
|
- notarizationNoQw.orderByAsc("create_time");
|
|
|
|
|
- List<NotarizationNoEntity> notarizationNoList = notarizationNoMapper.selectList(notarizationNoQw);
|
|
|
|
|
|
|
+ List<NotarizationNoEntity> notarizationNoList = modelRepository.getListWithOfficeId(contractOrderEntity.getNotaryOfficeId());
|
|
|
if (notarizationNoList == null || notarizationNoList.size() == 0) {
|
|
if (notarizationNoList == null || notarizationNoList.size() == 0) {
|
|
|
response.fail(ResultCode.NO_NOTARIZARION_NO);
|
|
response.fail(ResultCode.NO_NOTARIZARION_NO);
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
- // Load公证书模板需要的信息
|
|
|
|
|
- // 订单相关信息
|
|
|
|
|
- Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
- map.put("$LoanAmount$", contractOrderEntity.getContractMoney());
|
|
|
|
|
- if ("10".equals(req.getPartyId().substring(0, 2))) {
|
|
|
|
|
- map.put("$Type$", "借款合同");
|
|
|
|
|
- } else if ("11".equals(req.getPartyId().substring(0, 2))) {
|
|
|
|
|
- map.put("$Type$", "抵押合同");
|
|
|
|
|
- } else {
|
|
|
|
|
- map.put("$Type$", "担保合同");
|
|
|
|
|
- }
|
|
|
|
|
- // 公证书编号
|
|
|
|
|
NotarizationNoEntity notarizationNoEntity = notarizationNoList.get(0);
|
|
NotarizationNoEntity notarizationNoEntity = notarizationNoList.get(0);
|
|
|
int currentNum = notarizationNoEntity.getCurrentNum() == 0 ? notarizationNoEntity.getBeginNum()
|
|
int currentNum = notarizationNoEntity.getCurrentNum() == 0 ? notarizationNoEntity.getBeginNum()
|
|
|
: notarizationNoEntity.getCurrentNum() + 1;
|
|
: notarizationNoEntity.getCurrentNum() + 1;
|
|
|
- map.put("$NotarialNumber$", String.valueOf(currentNum));
|
|
|
|
|
- // 公证处信息
|
|
|
|
|
- NotaryOfficeEntity notaryOffice = notaryOfficeMapper.selectById(contractOrderEntity.getNotaryOfficeId());
|
|
|
|
|
- String[] areas = notaryOffice.getAreaCodesStr().split(",");
|
|
|
|
|
- QueryWrapper<ProvinceEntity> provinceQW = new QueryWrapper<>();
|
|
|
|
|
- provinceQW.eq("code", areas[0]);
|
|
|
|
|
- ProvinceEntity provinceEntity = provinceDao.selectOne(provinceQW);
|
|
|
|
|
- String cityCodeZX = "110000,120000,310000,500000";
|
|
|
|
|
- String cityName = "";
|
|
|
|
|
- if (cityCodeZX.indexOf(provinceEntity.getCode()) <= -1) {
|
|
|
|
|
- QueryWrapper<CityEntity> cityQW = new QueryWrapper<>();
|
|
|
|
|
- cityQW.eq("code", areas[1]);
|
|
|
|
|
- CityEntity cityEntity = cityDao.selectOne(cityQW);
|
|
|
|
|
- cityName = cityEntity.getCityName();
|
|
|
|
|
- }
|
|
|
|
|
- String usedLocation = provinceEntity.getProvinceName().concat(cityName);
|
|
|
|
|
- map.put("$Site$", usedLocation);
|
|
|
|
|
- map.put("$NotaryOffice$", notaryOffice.getName());
|
|
|
|
|
- // 借款人信息
|
|
|
|
|
- try {
|
|
|
|
|
- QueryWrapper<BorrowerEntity> borrowQw = new QueryWrapper<>();
|
|
|
|
|
- borrowQw.eq("business_no", contractOrderEntity.getBusinessNo());
|
|
|
|
|
- BorrowerEntity borrowerEntity = borrowerMapper.selectOne(borrowQw);
|
|
|
|
|
- SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
- Date beginDate = monthformatter.parse(borrowerEntity.getStartDate());
|
|
|
|
|
- Date endDate = monthformatter.parse(borrowerEntity.getEndDate());
|
|
|
|
|
- Integer months = DateUtils.getDiffNaturalMonth(endDate, beginDate);
|
|
|
|
|
- map.put("$Year$", yearFormatter.format(new Date()));
|
|
|
|
|
- map.put("$LoanName$", borrowerEntity.getUsername());
|
|
|
|
|
- map.put("$LoanSex$", "1".equals(borrowerEntity.getSex()) ? "男" : "女");
|
|
|
|
|
- map.put("$LoanBirthdday$", borrowerEntity.getBirth());
|
|
|
|
|
- map.put("$LoanIDNo$", borrowerEntity.getIdCard());
|
|
|
|
|
- map.put("$LoanRate$", borrowerEntity.getRate());
|
|
|
|
|
- map.put("$LoanTerm$", borrowerEntity.getStartDate().concat(" - ").concat(borrowerEntity.getEndDate()));
|
|
|
|
|
- map.put("$TotalMonth$", months.toString());
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- // 抵押人信息
|
|
|
|
|
- QueryWrapper<MortgageEntity> mortgageQw = new QueryWrapper<>();
|
|
|
|
|
- mortgageQw.eq("business_no", contractOrderEntity.getBusinessNo());
|
|
|
|
|
- MortgageEntity mortgageEntity = mortgageMapper.selectOne(mortgageQw);
|
|
|
|
|
- if (mortgageEntity != null) {
|
|
|
|
|
- map.put("$MortgageName$", mortgageEntity.getUsername());
|
|
|
|
|
- map.put("$MortgageIDNo$", mortgageEntity.getIdCard());
|
|
|
|
|
- map.put("$MortgageSex$", "1".equals(mortgageEntity.getSex()) ? "男" : "女");
|
|
|
|
|
- map.put("$MortgageBirthdday$", mortgageEntity.getBirth());
|
|
|
|
|
- map.put("$HouseAddr$", mortgageEntity.getHouseLocation());
|
|
|
|
|
- }
|
|
|
|
|
- // 担保人信息
|
|
|
|
|
- QueryWrapper<GuaranteeEntity> guaranteeQw = new QueryWrapper<>();
|
|
|
|
|
- guaranteeQw.eq("business_no", contractOrderEntity.getBusinessNo());
|
|
|
|
|
- GuaranteeEntity guaranteeEntity = guaranteeMapper.selectOne(guaranteeQw);
|
|
|
|
|
- if (guaranteeEntity != null) {
|
|
|
|
|
- map.put("$GuaranteeName$", guaranteeEntity.getUsername());
|
|
|
|
|
- map.put("$GuaranteeIDNo$", guaranteeEntity.getIdCard());
|
|
|
|
|
- map.put("$GuaranteeSex$", "1".equals(guaranteeEntity.getSex()) ? "男" : "女");
|
|
|
|
|
- map.put("$GuaranteeBirthdday$", guaranteeEntity.getBirth());
|
|
|
|
|
- }
|
|
|
|
|
- // 客户经理
|
|
|
|
|
- try {
|
|
|
|
|
- SimpleDateFormat dateSrcFormatter = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
- SimpleDateFormat dateDestFormatter = new SimpleDateFormat("yyyy/MM/dd");
|
|
|
|
|
- SysUserEntity customer = userDao.selectById(contractOrderEntity.getCustomerId());
|
|
|
|
|
- Date date = dateSrcFormatter.parse(customer.getIdCard().substring(6, 14));
|
|
|
|
|
- map.put("$PBName$", customer.getNickName());
|
|
|
|
|
- map.put("$PBSex$", customer.getGender());
|
|
|
|
|
- map.put("$PBBirthday$", dateDestFormatter.format(date));
|
|
|
|
|
- map.put("$PBIDNo$", customer.getIdCard());
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- // 银行信息
|
|
|
|
|
- BankEntity bankEntity = bankMapper.selectById(contractOrderEntity.getBankId());
|
|
|
|
|
- map.put("$Bank$", bankEntity.getBankName());
|
|
|
|
|
- map.put("$BankAddr$", bankEntity.getAddress());
|
|
|
|
|
- map.put("$BankLeader$", bankEntity.getPrincipal());
|
|
|
|
|
- // 其他信息
|
|
|
|
|
- SimpleDateFormat dayFormatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
- map.put("$Date$", dayFormatter.format(new Date()));
|
|
|
|
|
// 生成并保存未签名公证书
|
|
// 生成并保存未签名公证书
|
|
|
- ModelEntity modelEntity = modelRepository.getModelEntity(contractOrderEntity.getProdId(),
|
|
|
|
|
- contractOrderEntity.getNotaryOfficeId(), code, "1");
|
|
|
|
|
- String result = "";
|
|
|
|
|
- String htmlPath = "";
|
|
|
|
|
- String pdfPath = "";
|
|
|
|
|
- try {
|
|
|
|
|
- InputStream inputStream = NotaryNoteServiceImpl.class.getClassLoader()
|
|
|
|
|
- .getResourceAsStream("template/note/notary-model.html");
|
|
|
|
|
- result = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
|
|
|
|
|
- String content = result.replace("${ModelContent}",
|
|
|
|
|
- TextTempletUtil.replaceContent(modelEntity.getContent(), map));
|
|
|
|
|
- htmlPath = FileUploadUtil.saveHtml(content, contractOrderEntity.getBusinessNo());
|
|
|
|
|
- pdfPath = FileUploadUtil.savePdf(content, contractOrderEntity.getBusinessNo());
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ModelEntity modelEntity = modelRepository.getModelEntity(contractOrderEntity.getProdId(),contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_NOTARIZATION, "1");
|
|
|
|
|
+ String content = modelSynthesizerDomain.composeNotarizationTemplate(currentNum, req.getContent());
|
|
|
|
|
+ String htmlPath = FileUploadUtil.saveHtml(content, contractOrderEntity.getBusinessNo());
|
|
|
|
|
+ String pdfPath = FileUploadUtil.savePdf(content, contractOrderEntity.getBusinessNo());
|
|
|
//
|
|
//
|
|
|
OrderFileEntity notaryOrderFile = new OrderFileEntity();
|
|
OrderFileEntity notaryOrderFile = new OrderFileEntity();
|
|
|
notaryOrderFile.setBusinessNo(contractOrderEntity.getBusinessNo());
|
|
notaryOrderFile.setBusinessNo(contractOrderEntity.getBusinessNo());
|
|
|
- notaryOrderFile.setCode(code);
|
|
|
|
|
|
|
+ notaryOrderFile.setCode(ModelConstant.MODEL_TYPE_NOTARIZATION);
|
|
|
notaryOrderFile.setDocNo(String.valueOf(currentNum));
|
|
notaryOrderFile.setDocNo(String.valueOf(currentNum));
|
|
|
notaryOrderFile.setHtmlUrl(htmlPath);
|
|
notaryOrderFile.setHtmlUrl(htmlPath);
|
|
|
notaryOrderFile.setPdfUrl(pdfPath);
|
|
notaryOrderFile.setPdfUrl(pdfPath);
|
|
@@ -535,93 +417,12 @@ public class AdminOrderServiceImpl implements AdminOrderService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public AppBaseResponse<NotaryOrderQueryRsp> previewNotarization(NotaryOrderQueryReq req) {
|
|
|
|
|
- AppBaseResponse<NotaryOrderQueryRsp> response = new AppBaseResponse<>();
|
|
|
|
|
- try {
|
|
|
|
|
- Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
- if ("10".equals(req.getOrderType())) {
|
|
|
|
|
- map.put("$Type$", "借款合同");
|
|
|
|
|
- } else if ("11".equals(req.getOrderType())) {
|
|
|
|
|
- map.put("$Type$", "担保合同");
|
|
|
|
|
- } else {
|
|
|
|
|
- map.put("$Type$", "抵押合同");
|
|
|
|
|
- }
|
|
|
|
|
- // 获取订单信息
|
|
|
|
|
- QueryWrapper<ContractOrderEntity> qw = new QueryWrapper<>();
|
|
|
|
|
- qw.eq("business_no", req.getBusinessNo());
|
|
|
|
|
- ContractOrderEntity contractOrderEntity = contractOrderMapper.selectOne(qw);
|
|
|
|
|
- // 获取公证处信息
|
|
|
|
|
- NotaryOfficeEntity notaryOffice = notaryOfficeMapper.selectById(contractOrderEntity.getNotaryOfficeId());
|
|
|
|
|
- map.put("$NotaryOffice$", notaryOffice.getName());
|
|
|
|
|
- // 获取借款人信息
|
|
|
|
|
- QueryWrapper<BorrowerEntity> borrowQw = new QueryWrapper<>();
|
|
|
|
|
- borrowQw.eq("business_no", req.getBusinessNo());
|
|
|
|
|
- BorrowerEntity borrowerEntity = borrowerMapper.selectOne(borrowQw);
|
|
|
|
|
- SimpleDateFormat yearFormatter = new SimpleDateFormat("yyyy");
|
|
|
|
|
- SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
- Date beginDate = monthformatter.parse(borrowerEntity.getStartDate());
|
|
|
|
|
- Date endDate = monthformatter.parse(borrowerEntity.getEndDate());
|
|
|
|
|
- Integer months = DateUtils.getDiffNaturalMonth(endDate, beginDate);
|
|
|
|
|
- map.put("$Year$", yearFormatter.format(new Date()));
|
|
|
|
|
- map.put("$LoanName$", borrowerEntity.getUsername());
|
|
|
|
|
- map.put("$LoanSex$", "1".equals(borrowerEntity.getSex()) ? "男" : "女");
|
|
|
|
|
- map.put("$LoanBirthdday$", borrowerEntity.getBirth());
|
|
|
|
|
- map.put("$LoanIDNo$", borrowerEntity.getIdCard());
|
|
|
|
|
- map.put("$LoanRate$", borrowerEntity.getRate());
|
|
|
|
|
- map.put("$LoanTerm$", borrowerEntity.getStartDate().concat(" - ").concat(borrowerEntity.getEndDate()));
|
|
|
|
|
- map.put("$TotalMonth$", months.toString());
|
|
|
|
|
- // 获取抵押人信息
|
|
|
|
|
- QueryWrapper<MortgageEntity> mortgageQw = new QueryWrapper<>();
|
|
|
|
|
- mortgageQw.eq("business_no", req.getBusinessNo());
|
|
|
|
|
- MortgageEntity mortgageEntity = mortgageMapper.selectOne(mortgageQw);
|
|
|
|
|
- if (mortgageEntity != null) {
|
|
|
|
|
- map.put("$MortgageName$", mortgageEntity.getUsername());
|
|
|
|
|
- map.put("$MortgageIDNo$", mortgageEntity.getIdCard());
|
|
|
|
|
- map.put("$MortgageSex$", "1".equals(mortgageEntity.getSex()) ? "男" : "女");
|
|
|
|
|
- map.put("$MortgageBirthdday$", mortgageEntity.getBirth());
|
|
|
|
|
- map.put("$HouseAddr$", mortgageEntity.getHouseLocation());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 获取担保人信息
|
|
|
|
|
- QueryWrapper<GuaranteeEntity> guaranteeQw = new QueryWrapper<>();
|
|
|
|
|
- guaranteeQw.eq("business_no", req.getBusinessNo());
|
|
|
|
|
-
|
|
|
|
|
- GuaranteeEntity guaranteeEntity = guaranteeMapper.selectOne(guaranteeQw);
|
|
|
|
|
- if (guaranteeEntity != null) {
|
|
|
|
|
- map.put("$GuaranteeName$", guaranteeEntity.getUsername());
|
|
|
|
|
- map.put("$GuaranteeIDNo$", guaranteeEntity.getIdCard());
|
|
|
|
|
- map.put("$GuaranteeSex$", "1".equals(guaranteeEntity.getSex()) ? "男" : "女");
|
|
|
|
|
- map.put("$GuaranteeBirthdday$", guaranteeEntity.getBirth());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 获取银行信息
|
|
|
|
|
- BankEntity bankEntity = bankMapper.selectById(contractOrderEntity.getBankId());
|
|
|
|
|
- map.put("$Bank$", bankEntity.getBankName());
|
|
|
|
|
- map.put("$BankAddr$", bankEntity.getAddress());
|
|
|
|
|
- map.put("$BankLeader$", bankEntity.getPrincipal());
|
|
|
|
|
- map.put("$LoanAmount$", contractOrderEntity.getContractMoney());
|
|
|
|
|
- SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
- map.put("$Date$", dateFormatter.format(new Date()));
|
|
|
|
|
- map.put("$Site$", bankEntity.getAddress());
|
|
|
|
|
- // 获取公证书编号
|
|
|
|
|
- QueryWrapper<NotarizationNoEntity> notarizationNoQw = new QueryWrapper<>();
|
|
|
|
|
- notarizationNoQw.eq("notary_office_id", contractOrderEntity.getNotaryOfficeId());
|
|
|
|
|
- notarizationNoQw.eq("no_status", 1);
|
|
|
|
|
- map.put("$NotarialNumber$", " ");
|
|
|
|
|
- // 获取模板信息
|
|
|
|
|
- QueryWrapper<ModelEntity> modelQw = new QueryWrapper<>();
|
|
|
|
|
- modelQw.eq("code", req.getOrderType());
|
|
|
|
|
- modelQw.eq("notary_office_id", contractOrderEntity.getNotaryOfficeId());
|
|
|
|
|
- modelQw.eq("status", 1);
|
|
|
|
|
- ModelEntity modelEntity = modelMapper.selectOne(modelQw);
|
|
|
|
|
- String content = TextTempletUtil.replaceContent(modelEntity.getContent(), map);
|
|
|
|
|
-
|
|
|
|
|
-// NotaryOrderQueryRsp notaryOrderQueryRsp = new NotaryOrderQueryRsp();
|
|
|
|
|
-// notaryOrderQueryRsp.setPreviewContent(content);
|
|
|
|
|
-// response.setData(new AppResultData<NotaryOrderQueryRsp>(notaryOrderQueryRsp));
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public AppBaseResponse<String> previewNotarization(NotaryOrderQueryReq req) {
|
|
|
|
|
+ AppBaseResponse<String> response = new AppBaseResponse<>();
|
|
|
|
|
+ ContractOrderEntity order = contractOrderRepository.getContractOrderWithBizNo(req.getBusinessNo());
|
|
|
|
|
+ ModelEntity model = modelRepository.getModelEntity(order.getProdId(), order.getContractType(), order.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_NOTARIZATION, "1");
|
|
|
|
|
+ String previewContent = modelSynthesizerDomain.composeNotarizationPreview(order, model.getContent());
|
|
|
|
|
+ response.setData(new AppResultData<String>(previewContent));
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
|
|
|