Ver Fonte

兼容邮储产品

sakuya há 3 anos atrás
pai
commit
ae4b02663f

+ 4 - 13
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/AdminOrderServiceImpl.java

@@ -388,7 +388,7 @@ public class AdminOrderServiceImpl implements AdminOrderService {
 		notarizationNo.setCurrentNum(currentNum);
 		notarizationNoMapper.updateById(notarizationNo);
 		// 更新订单状态
-		updateStatusPass(req.getPartyId(), contractOrderEntity.getBusinessNo());
+		updateStatusPass(contractOrderEntity.getBusinessNo());
 
 		response.success("签发成功");
 		return response;
@@ -400,7 +400,7 @@ public class AdminOrderServiceImpl implements AdminOrderService {
 	 * @param orderId
 	 * @param businessNo
 	 */
-	private void updateStatusPass(String orderId, String businessNo) {
+	private void updateStatusPass(String businessNo) {
 		QueryWrapper<ContractOrderEntity> orderQw = new QueryWrapper<>();
 		orderQw.eq("business_no", businessNo);
 		ContractOrderEntity contractOrderEntity = contractOrderMapper.selectOne(orderQw);
@@ -473,27 +473,18 @@ public class AdminOrderServiceImpl implements AdminOrderService {
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public AppBaseResponse uploadNotarization(FileVo file) {
-		String code = "";
-		if ("10".equals(file.getContractId().substring(0, 2))) {
-			code = "10";
-		} else if ("11".equals(file.getContractId().substring(0, 2))) {
-			code = "12";
-		} else {
-			code = "11";
-		}
 		AppBaseResponse response = new AppBaseResponse<>();
 		FileInfoEntity fileInfoEntity = fileInfoService.getById(file.getImageId());
 		OrderFileEntity notaryOrderFile = new OrderFileEntity();
 		notaryOrderFile.setBusinessNo(file.getBusinessNo());
-
-		notaryOrderFile.setCode(code);
+		notaryOrderFile.setCode(ModelConstant.MODEL_TYPE_NOTARIZATION);
 		notaryOrderFile.setSignedPdfUrl(fileInfoEntity.getPath());
 		notaryOrderFile.setCreateTime(new Date());
 		notaryOrderFile.setCreatorId(contextUtil.getCurrentUserId());
 		notaryOrderFile.setFileName(file.getFileName());
 		orderFileMapper.insert(notaryOrderFile);
 
-		updateStatusPass(file.getContractId(), file.getBusinessNo());
+		updateStatusPass(file.getBusinessNo());
 		return response;
 	}
 

+ 45 - 89
eladmin-system/src/main/java/me/zhengjie/domain/model/ModelSynthesizerDomain.java

@@ -67,7 +67,7 @@ public class ModelSynthesizerDomain {
      */
     public Map<String, String> prepareNotarizationTemplateData(ContractOrderEntity contractOrderEntity) {
         Map<String, String> map = new HashMap<String, String>();
-        map.put("$ContractMoney$", contractOrderEntity.getContractMoney());
+        map.put("$Amounts$", contractOrderEntity.getContractMoney());
         if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_BORROWER) {
             map.put("$Type$", "借款合同");
         } else if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_MORTGAGE) {
@@ -94,7 +94,7 @@ public class ModelSynthesizerDomain {
         String usedLocation = provinceEntity.getProvinceName().concat(cityName);
         map.put("$Site$", usedLocation);
         map.put("$NotaryOffice$", notaryOffice.getName());
-        // 借款人信息
+        // 当事人信息
         try {
             SimpleDateFormat yearFormatter = new SimpleDateFormat("yyyy");
             SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
@@ -102,12 +102,14 @@ public class ModelSynthesizerDomain {
             Date endDate = monthformatter.parse(contractOrderEntity.getEndDate());
             Integer months = DateUtils.getDiffNaturalMonth(endDate, beginDate);
             map.put("$Year$", yearFormatter.format(new Date()));
-            map.put("$PartyName$", contractOrderEntity.getName());
-            map.put("$PartySex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
-            map.put("$PartyBirthdday$", contractOrderEntity.getBirth());
-            map.put("$PartyIDNo$", contractOrderEntity.getIdCard());
+            map.put("$Name$", contractOrderEntity.getName());
+            map.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
+            map.put("$Birthdday$", contractOrderEntity.getBirth());
+            map.put("$Phone$",contractOrderEntity.getPhone());
+            map.put("$Addr$",contractOrderEntity.getResidence());
+            map.put("$IDNo$", contractOrderEntity.getIdCard());
             map.put("$LoanRate$", contractOrderEntity.getRate());
-            map.put("$ContractTerm$", contractOrderEntity.getStartDate().concat(" - ").concat(contractOrderEntity.getEndDate()));
+            map.put("$LoanTerm$", contractOrderEntity.getStartDate().concat(" - ").concat(contractOrderEntity.getEndDate()));
             map.put("$TotalMonth$", months.toString());
         } catch (Exception e) {
             e.printStackTrace();
@@ -122,6 +124,7 @@ public class ModelSynthesizerDomain {
             map.put("$PBSex$", customer.getGender());
             map.put("$PBBirthday$", dateDestFormatter.format(date));
             map.put("$PBIDNo$", customer.getIdCard());
+            map.put("$PBPhone$", customer.getPhone());
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -130,6 +133,7 @@ public class ModelSynthesizerDomain {
         map.put("$Bank$", bankEntity.getBankName());
         map.put("$BankAddr$", bankEntity.getAddress());
         map.put("$BankLeader$", bankEntity.getPrincipal());
+        map.put("$BankPhone",bankEntity.getPhone());
         // 其他信息
         SimpleDateFormat dayFormatter = new SimpleDateFormat("yyyy-MM-dd");
         map.put("$Date$", dayFormatter.format(new Date()));
@@ -279,47 +283,24 @@ public class ModelSynthesizerDomain {
         // 设置主订单参数
         ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
         noteValue.put("$Bank$", contractOrderEntity.getBankName());
-        // 设置借款子订单参数
-        BorrowerEntity borrower = contractOrderRepository.getBorrowerWithBizNoAndContractNo(businessNo, contractNo);
-        noteValue.put("$LoanName$", borrower.getUsername());
-        noteValue.put("$LoanBirthday$", borrower.getBirth());
-        noteValue.put("$LoanIDNo$", borrower.getIdCard());
-        noteValue.put("$LoanAmount$", borrower.getSumMoney());
-        noteValue.put("$LoanTerm$", borrower.getStartDate() + "~" + borrower.getEndDate());
-        noteValue.put("$LoanRate$", borrower.getRate());
-        noteValue.put("$LoanPhone$", borrower.getPhone());
-        noteValue.put("$LoanSex$", "1".equals(borrower.getSex()) ? "男" : "女");
-        noteValue.put("$LoanAddr$", borrower.getResidence());
+        noteValue.put("$Name$", contractOrderEntity.getName());
+        noteValue.put("$Birthday$", contractOrderEntity.getBirth());
+        noteValue.put("$IDNo$", contractOrderEntity.getIdCard());
+        noteValue.put("$Phone$", contractOrderEntity.getPhone());
+        noteValue.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
+        noteValue.put("$Addr$", contractOrderEntity.getResidence());
+        noteValue.put("$Amounts$", contractOrderEntity.getContractMoney());
+        noteValue.put("$LoanTerm$", contractOrderEntity.getStartDate() + "~" + contractOrderEntity.getEndDate());
+        noteValue.put("$LoanRate$", contractOrderEntity.getRate());
         try {
             SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
-            Date beginDate = monthformatter.parse(borrower.getStartDate());
-            Date endDate = monthformatter.parse(borrower.getEndDate());
+            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();
         }
-        // 设置抵押子订单参数
-        MortgageEntity mortgage = contractOrderRepository.getMortgageWithBizNoAndContractNo(businessNo, contractNo);
-        if (mortgage != null) {
-            noteValue.put("$MortgagorName$", mortgage.getUsername());
-            noteValue.put("$MortgagorBirthdday$", mortgage.getBirth());
-            noteValue.put("$MortgagorIDNo$", mortgage.getIdCard());
-            noteValue.put("$HouseAddr$", mortgage.getHouseLocation());
-            noteValue.put("$MortgagorPhone$", mortgage.getPhone());
-            noteValue.put("$MortgagorSex$", "1".equals(mortgage.getSex()) ? "男" : "女");
-            noteValue.put("$MortgagorHomeAddr$", mortgage.getResidence());
-        }
-        // 设置担保子订单参数
-        GuaranteeEntity guarantee = contractOrderRepository.getGuaranteeWithBizNoAndContractNo(businessNo, contractNo);
-        if (guarantee != null) {
-            noteValue.put("$GuaranteeName$", guarantee.getUsername());
-            noteValue.put("$GuaranteeBirthdday$", guarantee.getBirth());
-            noteValue.put("$GuaranteeIDNo$", guarantee.getIdCard());
-            noteValue.put("$GuaranteePhone$", guarantee.getPhone());
-            noteValue.put("$GuaranteeSex$", "1".equals(guarantee.getSex()) ? "男" : "女");
-            noteValue.put("$GuaranteeHomeAddr$", guarantee.getResidence());
-        }
         // 准备银行信息
         BankEntity bank = bankMapper.selectById(contractOrderEntity.getBankId());
         noteValue.put("$Bank$", bank.getBankName());
@@ -373,56 +354,31 @@ public class ModelSynthesizerDomain {
         Map<String, String> map = new HashMap<>();
         map.put("$Date$", DateUtils.date2String(new Date(), 1));
         map.put("$BusinessOrderNo$", contractOrderEntity.getBusinessNo());
-        // 准备借款人信息
-        BorrowerEntity borrower = contractOrderRepository.getBorrowerWithBizNoAndContractNo(businessNo, contractNo);
-        if (borrower != null) {
-            map.put("$LoanName$", borrower.getUsername());
-            map.put("$LoanSex$", StatusEnum.SexStatusEnum.getValue(borrower.getSex()));
-            map.put("$LoanBirthday$", borrower.getBirth());
-            map.put("$LoanAddr$", borrower.getResidence());
-            map.put("$LoanIDNo$", borrower.getIdCard());
-            map.put("$LoanPhone$", borrower.getPhone());
-            if (borrower.getJointFlag() == 1) {
-                try {
-                    SimpleDateFormat dateSrcFormatter = new SimpleDateFormat("yyyyMMdd");
-                    SimpleDateFormat dateDestFormatter = new SimpleDateFormat("yyyy/MM/dd");
-                    Date date = dateSrcFormatter.parse(borrower.getIdCard().substring(6, 14));
-                    map.put("$MateName$", borrower.getSpouseName());
-                    map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(borrower.getSpouseSex()));
-                    map.put("$MateBirthday$", dateDestFormatter.format(date));
-                    map.put("$MateAddr$", borrower.getResidence());
-                    map.put("$MatePhone$", borrower.getSpousePhone());
+        map.put("$Name$", contractOrderEntity.getName());
+        map.put("$Sex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getSex()));
+        map.put("$Birthday$", contractOrderEntity.getBirth());
+        map.put("$Addr$", contractOrderEntity.getResidence());
+        map.put("$IDNo$", contractOrderEntity.getIdCard());
+        map.put("$Phone$", contractOrderEntity.getPhone());
+        if (contractOrderEntity.getJointFlag() == 1) {
+            try {
+                SimpleDateFormat dateSrcFormatter = new SimpleDateFormat("yyyyMMdd");
+                SimpleDateFormat dateDestFormatter = new SimpleDateFormat("yyyy/MM/dd");
+                Date date = dateSrcFormatter.parse(contractOrderEntity.getIdCard().substring(6, 14));
+                map.put("$MateName$", contractOrderEntity.getJointName());
+                map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
+                map.put("$MateBirthday$", dateDestFormatter.format(date));
+                map.put("$MatePhone$", contractOrderEntity.getJointPhone());
 
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            } else {
-                map.put("$MateName$", "无");
-                map.put("$MateSex$", "无");
-                map.put("$MateBirthday$", "无");
-                map.put("$MateAddr$", "无");
-                map.put("$MatePhone$", "无");
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-        }
-        // 准备抵押人信息
-        MortgageEntity mortgage = contractOrderRepository.getMortgageWithBizNoAndContractNo(businessNo, contractNo);
-        if (mortgage != null) {
-            map.put("$MortgageName$", mortgage.getUsername());
-            map.put("$MortgageSex$", StatusEnum.SexStatusEnum.getValue(mortgage.getSex()));
-            map.put("$MortgageBirthdday$", mortgage.getBirth());
-            map.put("$MortgageHomeAddr$", mortgage.getResidence());
-            map.put("$MortgageIDNo$", mortgage.getIdCard());
-            map.put("$MortgagePhone$", mortgage.getPhone());
-        }
-        // 准备担保人信息
-        GuaranteeEntity guarantee = contractOrderRepository.getGuaranteeWithBizNoAndContractNo(businessNo, contractNo);
-        if (guarantee != null) {
-            map.put("$GuaranteeName$", guarantee.getUsername());
-            map.put("$GuaranteeSex$", StatusEnum.SexStatusEnum.getValue(guarantee.getSex()));
-            map.put("$GuaranteeBirthdday$", guarantee.getBirth());
-            map.put("$GuaranteeHomeAddr$", guarantee.getResidence());
-            map.put("$GuaranteeIDNo$", guarantee.getIdCard());
-            map.put("$GuaranteePhone$", guarantee.getPhone());
+        } else {
+            map.put("$MateName$", "无");
+            map.put("$MateSex$", "无");
+            map.put("$MateBirthday$", "无");
+            map.put("$MateAddr$", "无");
+            map.put("$MatePhone$", "无");
         }
         // 准备银行信息
         BankEntity bank = bankMapper.selectById(contractOrderEntity.getBankId());