فهرست منبع

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 7 سال پیش
والد
کامیت
2e1484e176

+ 3 - 8
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java

@ -108,7 +108,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
        this.endTime = DateUtil.getStringDate("yyyy-MM-dd HH:mm:ss");
        //初始化统计年份
        this.year = getNowYearByDate(endTime);
        this.year = getNowYearByDate();
        //初始化开始时间
        if ("2".equals(timeLevel)) {
@ -116,11 +116,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
            startTime = this.year + "-06-30 17:00:00";
        }else{
            //增量
            if (StringUtils.isEmpty(startTime)) {
                this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
            } else {
                startTime = startTime + " 17:00:00";
            }
            this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
        }
        this.quotaDate = DateUtil.strToDate(endTime, "yyyy-MM-dd");
@ -311,10 +307,9 @@ public class CurrentMysqlToEsQuotaJob implements Job {
    /**
     * 获取现在时间属于那个年度
     *
     * @param date
     * @return
     */
    public static String getNowYearByDate(String date) throws Exception {
    public static String getNowYearByDate() throws Exception {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date today = new Date();
        String todayString = simpleDateFormat.format(today);

+ 2 - 2
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/MysqlToEsQuotaJob.java

@ -303,11 +303,11 @@ public class MysqlToEsQuotaJob implements Job {
     */
    public static String getNowYearByDate(String date) throws Exception {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date today = new Date();
        Date today = simpleDateFormat.parse(date);
        String todayString = simpleDateFormat.format(today);
        String startDateString = (1900 + today.getYear()) + "-07-01";
        String startDateString = (1900 + today.getYear()) + "-06-30";
        Date startDate = simpleDateFormat.parse(startDateString);
        if (simpleDateFormat.parse(todayString).after(startDate)) {
            return (1900 + today.getYear()) + "";

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

@ -10,7 +10,7 @@ import java.util.Date;
 */
public class IdCardUtil {
//    /**
    //    /**
//     * 根据身份证的号码算出当前身份证持有者的年龄
//     *
//     * @param
@ -49,6 +49,10 @@ public class IdCardUtil {
//        }
//        return age;
//    }
    public static void main(String[] args) throws Exception{
        System.out.println(getSexForIdcard("350206199109092048"));
    }
    /**
     * 根据身份证的号码算出当前身份证持有者的性别
     * 1 女 2 男 3未知
@ -63,22 +67,22 @@ public class IdCardUtil {
            if (Integer.parseInt(CardCode.substring(16).substring(0, 1)) % 2 == 0) {// 判断性别
                // modifid by lyr 2016-09-29
                // sex =  Constant.level_sex_2;
                sex ="1";
                sex = "2";
                // modifid by lyr 2016-09-29
            } else {
                // modifid by lyr 2016-09-29
                // sex =  Constant.level_sex_1;
                sex ="2";
                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 = "1";
                sex = "2";
            } else {
                // sex =  Constant.level_sex_1;
                sex = "2";
                sex = "1";
            }
        }
        return sex;