|
|
@@ -19,6 +19,7 @@ import org.apache.commons.io.IOUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
@@ -69,7 +70,7 @@ public class ModelSynthesizerDomain {
|
|
|
*/
|
|
|
public Map<String, String> prepareNotarizationTemplateData(ContractOrderEntity contractOrderEntity) {
|
|
|
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) {
|
|
|
map.put("$Type$", "借款合同");
|
|
|
} else if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_MORTGAGE) {
|
|
|
@@ -302,7 +303,7 @@ public class ModelSynthesizerDomain {
|
|
|
noteValue.put("$Phone$", contractOrderEntity.getPhone());
|
|
|
noteValue.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
|
|
|
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("$LoanRate$", contractOrderEntity.getRate());
|
|
|
noteValue.put("$McontractNO$", contractOrderEntity.getMainContractNo());
|
|
|
@@ -481,4 +482,19 @@ public class ModelSynthesizerDomain {
|
|
|
}
|
|
|
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;
|
|
|
+ }
|
|
|
}
|