chenweida 7 лет назад
Родитель
Сommit
4ab976250f

+ 28 - 24
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/util/IdCardUtil.java

@ -49,8 +49,8 @@ public class IdCardUtil {
//        }
//        return age;
//    }
    public static void main(String[] args) throws Exception{
        System.out.println(getSexForIdcard("350206199109092048"));
    public static void main(String[] args) throws Exception {
        System.out.println(getSexForIdcard("350206199109092018"));
    }
    /**
@ -62,30 +62,34 @@ public class IdCardUtil {
     */
    public static String getSexForIdcard(String CardCode)
            throws Exception {
        String sex = "3";
        if (CardCode.length() == 18) {
            if (Integer.parseInt(CardCode.substring(16).substring(0, 1)) % 2 == 0) {// 判断性别
                // modifid by lyr 2016-09-29
                // sex =  Constant.level_sex_2;
                sex = "2";
                // modifid by lyr 2016-09-29
            } else {
                // modifid by lyr 2016-09-29
                // sex =  Constant.level_sex_1;
                sex = "1";
                // modifid by lyr 2016-09-29
            }
        } else if (CardCode.length() == 15) {
            String usex = CardCode.substring(14, 15);// 用户的性别
            if (Integer.parseInt(usex) % 2 == 0) {
                // sex =  Constant.level_sex_2;
                sex = "2";
            } else {
                // sex =  Constant.level_sex_1;
                sex = "1";
        try {
            String sex = "1";
            if (CardCode.length() == 18) {
                if (Integer.parseInt(CardCode.substring(16).substring(0, 1)) % 2 == 0) {// 判断性别
                    // modifid by lyr 2016-09-29
                    // sex =  Constant.level_sex_2;
                    sex = "2";
                    // modifid by lyr 2016-09-29
                } else {
                    // modifid by lyr 2016-09-29
                    // sex =  Constant.level_sex_1;
                    sex = "1";
                    // modifid by lyr 2016-09-29
                }
            } else if (CardCode.length() == 15) {
                String usex = CardCode.substring(14, 15);// 用户的性别
                if (Integer.parseInt(usex) % 2 == 0) {
                    // sex =  Constant.level_sex_2;
                    sex = "2";
                } else {
                    // sex =  Constant.level_sex_1;
                    sex = "1";
                }
            }
            return sex;
        } catch (Exception e) {
            return "1";
        }
        return sex;
    }
    /**

+ 2 - 2
patient-co/patient-co-statistics-es/src/main/resources/application-prod.yml

@ -3,11 +3,11 @@ spring:
  datasource:
    primaryReadWrite:
      url: jdbc:mysql://59.61.92.90:9069/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    primaryRead:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://59.61.92.90:8020/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    im: #im库: