Browse Source

修改bug

esb 8 years ago
parent
commit
6730665af0

+ 5 - 2
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/SignDataFilter.java

@ -386,9 +386,12 @@ public class SignDataFilter {
    private String getSex(SignFamily signFamily) {
        String returnLevel2Key;
        returnLevel2Key= IdCardUtil.getSexForIdcard(signFamily.getIdcard());
        if("3".equals(returnLevel2Key)){
        try{
            returnLevel2Key= IdCardUtil.getSexForIdcard(signFamily.getIdcard());
        }catch (Exception e){
            //如果解析失败 默认是男 并且纪录解析失败的签约code
            errorContent.append("签约code:"+signFamily.getCode()+",IdCard解析错误,分到未知的组里");
            return Constant.level_sex_2;
        }
        return returnLevel2Key;
    }

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

@ -20,10 +20,9 @@ public class IdCardUtil {
     * @return
     * @throws Exception
     */
    public static String getSexForIdcard(String CardCode){
    public static String getSexForIdcard(String CardCode) throws Exception{
        String sex = Constant.level_sex_2;
        try {
            if (CardCode.length() == 18) {
                if (Integer.parseInt(CardCode.substring(16).substring(0, 1)) % 2 == 0) {// 判断性别
                    // modifid by lyr 2016-09-29
@ -46,9 +45,6 @@ public class IdCardUtil {
                    sex = Constant.level_sex_2;
                }
            }
        }catch (Exception e){
            return  Constant.level_sex_2;
        }
        return sex;
    }