From 870dfdba90fc4062b66de669ad9ff3f4707bf496 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 09 六月 2025 10:32:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1

---
 server/service/src/main/java/com/doumee/core/utils/Constants.java |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java
index 00e3625..3be4154 100644
--- a/server/service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -21,7 +21,10 @@
 import java.math.RoundingMode;
 import java.net.URL;
 import java.net.URLDecoder;
+import java.time.Instant;
 import java.time.LocalDate;
+import java.time.Period;
+import java.time.ZoneId;
 import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.Date;
@@ -316,6 +319,38 @@
         }
         return Constants.countPriceVO(countCyclePriceDTO.getStartDate(),countCyclePriceDTO.getSolutions());
     }
+
+    public static int calculateAge(String idCard,Date dateDate) {
+        try{
+            Integer happenYear = Integer.valueOf(DateUtil.dateToString(dateDate,"yyyy"));
+            Integer birthYear = Integer.valueOf(idCard.substring(6,10));
+            return happenYear - birthYear;
+        }catch (Exception e){
+            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"骞撮緞淇℃伅閿欒");
+        }
+
+
+
+
+
+//        if (idCard == null || idCard.length() != 18) {
+//            throw new IllegalArgumentException("韬唤璇佸彿鐮佸繀椤绘槸18浣�");
+//        }
+//
+//        // 鎻愬彇鍑虹敓鏃ユ湡
+//        String birthDateStr = idCard.substring(6, 14); // 渚嬪锛�19900101
+//        LocalDate birthDate = LocalDate.parse(birthDateStr);
+//        Instant instant = dateDate.toInstant();
+//        // 鑾峰彇褰撳墠鏃ユ湡
+//        LocalDate currentDate = instant.atZone(ZoneId.systemDefault()).toLocalDate(); // 杞崲涓� LocalDate
+//
+//        // 璁$畻骞撮緞
+//        Period period = Period.between(birthDate, currentDate);
+//        int age = period.getYears(); // 鐩存帴鑾峰彇骞翠唤宸嵆涓哄勾榫�
+
+//        return age;
+    }
+
 
     public static CountCyclePriceVO countPriceVO(Date startDate, Solutions solutions){
         CountCyclePriceVO countCyclePriceVO = new CountCyclePriceVO();
@@ -1976,7 +2011,7 @@
         ACCEPTANCE(9, "宸插彈鐞�",3),//寰呯悊绠�
         WAIT_AUDIT_COMPENSATION(10, "寰呮牳璧�",4),
         COMPENSATION(11, "宸叉牳璧�",5),
-        CONFIRM_FEE(12, "宸茬‘璁ら噾棰�",5),
+        CONFIRM_FEE(12, "寰呯粨妗�",5),
         CLOSE_CASE(13, "宸茬粨妗�",6),
         RETURN(14, "宸叉挙妗�",7),
         ;
@@ -2035,7 +2070,7 @@
         SUPPLEMENT(5, "琛ュ厖璇存槑","鎻愪氦鎰忚锛�${param}"),
         PLATFORM_LP_DEAL(6, "骞冲彴鐞嗚禂澶勭悊","宸插湪骞冲彴瀹屾垚鐞嗚禂"),
         PLATFORM_REMARK(7, "澶囨敞鏍囩","${param}"),
-        PLATFORM_ADDCODE(8, "骞冲彴娣诲姞鎶ユ鍙�","澶囨鍙凤細${param}"),
+        PLATFORM_ADDCODE(8, "骞冲彴淇敼鎶ユ鍙�","澶囨鍙凤細${param}"),
         PLATFORM_UN_AGREE_BACK(9, "浼佷笟涓嬭浇璧勬枡",""),
         PLATFORM_DOWNLOAD(10, "骞冲彴涓嬭浇璧勬枡",""),
         PLATFORM_CHECK_PASS(11, "骞冲彴涓婁紶璧勬枡",""),
@@ -2143,7 +2178,6 @@
             }
             return null;
         }
-
 
         // 鏅�氭柟娉�
         public static SettleClaimsLogParentStatus getAll(int index) {

--
Gitblit v1.9.3