From 0d6bb65549a15f9681710c283f21927ff861aa56 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 25 一月 2024 09:57:14 +0800
Subject: [PATCH] 开发业务接口

---
 server/service/src/main/java/com/doumee/core/utils/Constants.java |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 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 4fdef25..2325066 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
@@ -3,6 +3,7 @@
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
 import com.doumee.dao.business.model.Solutions;
+import io.swagger.models.auth.In;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 
@@ -13,6 +14,8 @@
 import java.math.BigDecimal;
 import java.net.URL;
 import java.net.URLDecoder;
+import java.time.LocalDate;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.Date;
 import java.util.regex.Matcher;
@@ -76,6 +79,7 @@
     public static final String TAXES_FILE = "TAXES_FILE";
     public static final String APPLY_FILE ="APPLY_FILE" ;
     public static final String SETTLE_FILE ="SETTLE_FILE" ;
+    public static final String SIGN_DONE_NOTIFY_URL = "SIGN_DONE_NOTIFY_URL";
 
     /**
      * 浼佷笟鏁版嵁鏉ユ簮 0骞冲彴娉ㄥ唽 1鍚庡彴瀵煎叆
@@ -144,6 +148,36 @@
         }
         return d.intValue();
     }
+
+    public static long getAgeByIdCard(String idCard){
+        int birthYear = Integer.parseInt(idCard.substring(6, 10));
+        int birthMonth = Integer.parseInt(idCard.substring(10, 12));
+        int birthDay = Integer.parseInt(idCard.substring(12, 14));
+
+        LocalDate birthDate = LocalDate.of(birthYear, birthMonth, birthDay);
+        LocalDate currentDate = LocalDate.now();
+        long age = ChronoUnit.YEARS.between(birthDate, currentDate);
+        return age;
+    }
+
+    public static Integer getSexByIdCard(String idCard){
+        Pattern pattern = Pattern.compile("\\d{17}[\\d|x]"); // 瀹氫箟韬唤璇佸彿鐮佹牸寮忕殑姝e垯琛ㄨ揪寮�
+        Matcher matcher = pattern.matcher(idCard);
+        Integer sex = 1;
+        if (matcher.matches()) {
+            int genderCode = Integer.parseInt(idCard.substring(16, 17)); // 浠庣17浣嶅紑濮嬫彁鍙栨�у埆缂栫爜锛堝鏁颁负鐢锋�э紝鍋舵暟涓哄コ鎬э級
+
+            if ((genderCode % 2 == 1)) {
+                sex = 1;
+            } else {
+                sex = 2;
+            }
+        } else {
+           sex = -1;
+        }
+        return sex;
+    }
+
     /**
      * 鐘舵�� 0宸蹭繚瀛樸��1寰呭鏍搞��2瀹℃牳閫氳繃銆�3閫�鍥炰慨鏀广��4瀹℃牳椹冲洖銆�5寰呮湇鍔℃満鏋勭‘璁ゃ��6鏈嶅姟鏈烘瀯鎷掔粷銆�7宸插垎閰嶆湇鍔℃満鏋勩��8璇婃柇涓�
      * 锛堟垚鍔熶笂浼犵涓�浠芥湇鍔¤祫鏂欙級銆�9鏈嶅姟瀹屾垚銆�10宸插垎閰嶈瘎鍒嗕笓瀹躲��11宸插畬鎴愶紙涓撳涓婁紶璇勫垎锛� 12閫�鍥炰慨鏀逛腑 13 宸插畬鎴愰��鍥炰慨鏀�
@@ -372,8 +406,9 @@
         BD_SIGNED_PDF(9, "绛剧讲鍚庝繚鍗曠敵璇疯〃PDF", "绛剧讲鍚庝繚鍗曠敵璇疯〃PDF"),
         COM_SING_IMG(10, "浼佷笟鍗扮珷", "浼佷笟鍗扮珷"),
         BD_DONE_PDF(11, "鏈�缁堟姤鍗�", "鏈�缁堟姤鍗�"),
-
         CA_PD_PDF(12, "鏈�缁堟姤鍗�", "鏈�缁堟姤鍗�"),
+        CA_APPLY_JIAJIAN_SIGN(13, "鍔犲噺淇濈敵璇风绔犳枃浠�", "鍔犲噺淇濈敵璇风绔犳枃浠�"),
+        CA_APPLY_CHANGEUNIT_SIGN(14, "鎹㈠巶鐢宠绛剧珷鏂囦欢", "鎹㈠巶鐢宠绛剧珷鏂囦欢"),
 
 
         ;
@@ -649,6 +684,9 @@
         CA_PALTFORM_REFUSE_APPLY(20, "椹冲洖閫�鍥炵敵璇�",""),
         CA_PALTFORM_EDIT_PIDAN(21, "淇敼鎵瑰崟","淇敼鍘熷洜锛�${param}"),
         PALTFORM_EDIT_BD(22, "淇敼淇濆崟","淇敼鍘熷洜锛�${param}"),
+
+        CA_CHANGUNIT_APPLY_SIGN(24, "鎹㈡垚鐢宠浼佷笟绛剧珷",""),
+        CA_JIAJIAN_APPLY_SIGN(23, "鍔犲噺淇濈敵璇蜂紒涓氱绔�",""),
         ;
         // 鎴愬憳鍙橀噺
         private String name;

--
Gitblit v1.9.3