|
@@ -3,14 +3,14 @@ package com.ygj.yuemum.utils;
|
|
|
public class IDcard {
|
|
|
private final static int[] dayArr = new int[] { 20, 19, 21, 20, 21, 22, 23,
|
|
|
23, 23, 24, 23, 22 };
|
|
|
- private final static String[] constellationArr = new String[] { "摩羯座",
|
|
|
- "水瓶座", "双鱼座", "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座",
|
|
|
- "天蝎座", "射手座", "摩羯座" };
|
|
|
+ private final static String[] constellationArr = new String[] { "10",
|
|
|
+ "11", "12", "1", "2", "3", "4", "5", "6", "7",
|
|
|
+ "8", "9", "10" };
|
|
|
|
|
|
/**
|
|
|
* 根据出生日期计算属相和星座
|
|
|
*
|
|
|
- * @param args
|
|
|
+ * @param
|
|
|
*/
|
|
|
// public static void main(String[] args) throws Exception{
|
|
|
// String idcardt ="130202198307080017";
|
|
@@ -29,9 +29,9 @@ public class IDcard {
|
|
|
public String getidcard(String idcard){
|
|
|
String id;
|
|
|
String res = "";
|
|
|
- int month = 7;
|
|
|
- int day = 8;
|
|
|
- int year = 1983;
|
|
|
+ int month = 1;
|
|
|
+ int day = 1;
|
|
|
+ int year = 1981;
|
|
|
res = "constellation: "+getConstellation(month, day)+",";
|
|
|
res = res+"zodiac: "+getYear(year)+",";
|
|
|
return res;
|
|
@@ -59,8 +59,8 @@ public class IDcard {
|
|
|
return "未知";
|
|
|
}
|
|
|
int start = 1900;
|
|
|
- String[] years = new String[] { "鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊",
|
|
|
- "猴", "鸡", "狗", "猪" };
|
|
|
+ String[] years = new String[] { "1", "2", "3", "4", "5", "6", "7", "8",
|
|
|
+ "9", "10", "11", "12" };
|
|
|
return years[(year - start) % years.length];
|
|
|
}
|
|
|
}
|