Browse Source

兼容邮储产品

sakuya 3 năm trước cách đây
mục cha
commit
3442aafcb9

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/NotaryNoteServiceImpl.java

@@ -42,7 +42,7 @@ public class NotaryNoteServiceImpl implements NotaryNoteService {
 
 
 	@Override
 	@Override
 	public JSONObject getNotaryNoteByType(NotaryNoteVo notary) {
 	public JSONObject getNotaryNoteByType(NotaryNoteVo notary) {
-		Map<String, String> map = modelSynthesizerDomain.prepareNoteTemplateData(notary.getBusinessNo(), notary.getContractNo());
+		Map<String, String> map = modelSynthesizerDomain.prepareNoteTemplateData(notary.getBusinessNo());
 		// 查询问题列表
 		// 查询问题列表
 		UserDto user = contextUtil.getCurrentUser().getUser();
 		UserDto user = contextUtil.getCurrentUser().getUser();
 		NotaryOfficeEntity entity = notaryOfficeMapper.selectById(user.getOrgId().split("_")[1]);
 		NotaryOfficeEntity entity = notaryOfficeMapper.selectById(user.getOrgId().split("_")[1]);

+ 16 - 0
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/ContractOrderRepository.java

@@ -215,4 +215,20 @@ public class ContractOrderRepository {
     public void insert(ContractOrderEntity order) {
     public void insert(ContractOrderEntity order) {
         contractOrderMapper.insert(order);
         contractOrderMapper.insert(order);
     }
     }
+
+    /**
+     * 根据合同号获取订单实体
+     *
+     * @param bankId
+     * @param prodId
+     * @param contractNo
+     * @return
+     */
+    public ContractOrderEntity getEntityWithContractNo(String bankId, String prodId, String contractNo) {
+        QueryWrapper<ContractOrderEntity> qw = new QueryWrapper<>();
+        qw.eq("bank_id", bankId);
+        qw.eq("prod_id", prodId);
+        qw.eq("contract_no", contractNo);
+        return contractOrderMapper.selectOne(qw);
+    }
 }
 }

+ 12 - 1
eladmin-system/src/main/java/me/zhengjie/domain/model/ModelSynthesizerDomain.java

@@ -2,6 +2,7 @@ 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.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.ApplicationContextUtil;
@@ -264,7 +265,7 @@ public class ModelSynthesizerDomain {
      * @param businessNo
      * @param businessNo
      * @return
      * @return
      */
      */
-    public Map<String, String> prepareNoteTemplateData(String businessNo, String contractNo) {
+    public Map<String, String> prepareNoteTemplateData(String businessNo) {
         Map<String, String> noteValue = new HashMap<String, String>();
         Map<String, String> noteValue = new HashMap<String, String>();
         // 设置默认值
         // 设置默认值
         noteValue.put("$Date$", DateUtils.date2String(new Date(), 1));
         noteValue.put("$Date$", DateUtils.date2String(new Date(), 1));
@@ -290,6 +291,16 @@ public class ModelSynthesizerDomain {
         noteValue.put("$Amounts$", contractOrderEntity.getContractMoney());
         noteValue.put("$Amounts$", contractOrderEntity.getContractMoney());
         noteValue.put("$Term$", contractOrderEntity.getStartDate() + "~" + contractOrderEntity.getEndDate());
         noteValue.put("$Term$", contractOrderEntity.getStartDate() + "~" + contractOrderEntity.getEndDate());
         noteValue.put("$LoanRate$", contractOrderEntity.getRate());
         noteValue.put("$LoanRate$", contractOrderEntity.getRate());
+        noteValue.put("$McontractNO$",contractOrderEntity.getMainContractNo());
+        // 抵押合同需要补充借款合同中借款人信息
+        if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_MORTGAGE) {
+            ContractOrderEntity mainOrder = contractOrderRepository.getEntityWithContractNo(contractOrderEntity.getBankId(), contractOrderEntity.getProdId(), contractOrderEntity.getMainContractNo());
+            if (mainOrder != null) {
+                String jointName = mainOrder.getJointFlag() == OrderConstant.JOINT_FLAG_TRUE ? "," + mainOrder.getJointName() : "";
+                String obligor = mainOrder.getName() + jointName;
+                noteValue.put("$obligor$", obligor);
+            }
+        }
         try {
         try {
             SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
             SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
             Date beginDate = monthformatter.parse(contractOrderEntity.getStartDate());
             Date beginDate = monthformatter.parse(contractOrderEntity.getStartDate());