|
@ -169,9 +169,21 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
|
|
|
}
|
|
|
|
|
|
public List<DeviceHealthIndexVO> getExcelByFilter(String deviceSn,String date,String idcard,
|
|
|
String userName,String indexType,Double indexTypeMin1,Double indexTypeMax1,Double indexTypeMin2,Double indexTypeMax2)throws Exception{
|
|
|
String userName,String indexType,Double indexTypeMin1,Double indexTypeMax1,Double indexTypeMin2,Double indexTypeMax2,String doctorName)throws Exception{
|
|
|
|
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
User loginUser = (User) request.getSession().getAttribute("userInfo");
|
|
|
|
|
|
StringBuilder filter = new StringBuilder();
|
|
|
//1、管理员 2、医生 0、其他
|
|
|
if(loginUser.getType()==2){
|
|
|
Doctor doctor = doctorDao.findByCode(loginUser.getCode());
|
|
|
String[] codes =signFamilyDao.findByHospital(doctor.getHospital());
|
|
|
if(codes != null && codes.length >0){
|
|
|
filter.append("user="+StringUtils.join(codes, ","));
|
|
|
}
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(deviceSn)){
|
|
|
filter.append("deviceSn="+deviceSn+";");
|
|
|
}
|
|
@ -196,9 +208,44 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
|
|
|
filter.append("user="+StringUtils.join(codes, ","));
|
|
|
}
|
|
|
}
|
|
|
//根据医生名称过滤居民
|
|
|
if(!StringUtils.isEmpty(doctorName)){
|
|
|
String[] codes = signFamilyDao.findByDoctorName("%"+doctorName+"%");
|
|
|
if(codes != null && codes.length >0){
|
|
|
filter.append("user="+StringUtils.join(codes, ","));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(!StringUtils.isEmpty(indexType)){
|
|
|
filter.append("type="+indexType+";");
|
|
|
}
|
|
|
if("1".equals(indexType)||"2".equals(indexType)||"4".equals(indexType)){
|
|
|
if(indexTypeMin1!=null){
|
|
|
filter.append("value1>="+indexTypeMin1+";");
|
|
|
}
|
|
|
if(indexTypeMax1!=null){
|
|
|
filter.append("value1<="+indexTypeMax1+";");
|
|
|
}
|
|
|
if(indexTypeMin2!=null){
|
|
|
filter.append("value2>="+indexTypeMin2+";");
|
|
|
}
|
|
|
if(indexTypeMax2!=null){
|
|
|
filter.append("value2<="+indexTypeMax2+";");
|
|
|
}
|
|
|
}else{
|
|
|
if(indexTypeMin1!=null){
|
|
|
filter.append("value3>="+indexTypeMin1+";");
|
|
|
}
|
|
|
if(indexTypeMax1!=null){
|
|
|
filter.append("value3<="+indexTypeMax1+";");
|
|
|
}
|
|
|
if(indexTypeMin2!=null){
|
|
|
filter.append("value4>="+indexTypeMin2+";");
|
|
|
}
|
|
|
if(indexTypeMax2!=null){
|
|
|
filter.append("value4<="+indexTypeMax2+";");
|
|
|
}
|
|
|
}
|
|
|
List<DeviceHealthIndex> list = (List<DeviceHealthIndex>)search(filter.toString());
|
|
|
String regex = "(\\w{3})(\\w+)(\\w{3})";
|
|
|
List<DeviceHealthIndexVO> listTemp = new ArrayList<>();
|
|
@ -206,6 +253,7 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
|
|
|
for (DeviceHealthIndex info : list){
|
|
|
DeviceHealthIndexVO bean = new DeviceHealthIndexVO();
|
|
|
BeanUtils.copyProperties(info, bean);
|
|
|
// BeanUtils.copyProperties(bean, info);
|
|
|
Patient patient = findPatient(bean.getUser());
|
|
|
bean.setUserName(patient== null?"":patient.getName());
|
|
|
if(StringUtils.isNotBlank(bean.getIdcard())){
|