Browse Source

后台管理系统:居民设备列表,居民体征记录身份证号隐藏中间几位

huangwenjie 7 years ago
parent
commit
5be07a8d64

+ 4 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java

@ -72,11 +72,15 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
        }
        List<DeviceHealthIndex> list = (List<DeviceHealthIndex>)search("", filter.toString(), "-czrq", page, pageSize);
        long count = 0;
        String regex = "(\\w{3})(\\w+)(\\w{3})";
        if(list !=null && list.size()>0){
            count = getCount(filter.toString());
            for (DeviceHealthIndex info : list){
                Patient patient = findPatient(info.getUser());
                info.setUserName(patient== null?"":patient.getName());
                if(StringUtils.isNotBlank(info.getIdcard())){
                    info.setIdcard(info.getIdcard().replaceAll(regex, "$1****$3"));
                }
            }
        }
        return new PageImpl<DeviceHealthIndex>(list,pageRequest,count);

+ 4 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/WlyyPatientDeviceService.java

@ -61,10 +61,14 @@ public class WlyyPatientDeviceService extends BaseJpaService<WlyyPatientDevice,W
        }
        List<WlyyPatientDevice> list = (List<WlyyPatientDevice>)search("", filters.toString(), "-czrq", page, pageSize);
        long count = 0;
        String regex = "(\\w{3})(\\w+)(\\w{3})";
        if(list !=null && list.size()>0){
            count = getCount(filters.toString());
            for (WlyyPatientDevice info : list){
                Patient patient = findPatient(info.getUser());
                if(StringUtils.isNotBlank(info.getUserIdcard())){
                    info.setUserIdcard(info.getUserIdcard().replaceAll(regex, "$1****$3"));
                }
                info.setUserName(patient== null?"":patient.getName());
            }
        }