ソースを参照

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

huangwenjie 7 年 前
コミット
b446f6392d

+ 3 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/DeviceHealthIndexController.java

@ -97,9 +97,10 @@ public class DeviceHealthIndexController extends BaseController{
            @RequestParam(value = "indexTypeMax1",required = false) Double indexTypeMax1,
            @RequestParam(value = "indexTypeMin2",required = false) Double indexTypeMin2,
            @RequestParam(value = "indexTypeMax2",required = false) Double indexTypeMax2,
            @RequestParam(value = "doctorName",required = false) String doctorName,
            HttpServletResponse response){
        try {
            List<DeviceHealthIndexVO> deviceHealthIndexes = healthIndexService.getExcelByFilter(deviceSn,date, idcard, userName, indexType,indexTypeMin1,indexTypeMax1,indexTypeMin2,indexTypeMax2);
            List<DeviceHealthIndexVO> deviceHealthIndexes = healthIndexService.getExcelByFilter(deviceSn,date, idcard, userName, indexType,indexTypeMin1,indexTypeMax1,indexTypeMin2,indexTypeMax2,doctorName);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "patientHealthIndexDataList.xls"));
            OutputStream os = response.getOutputStream();
@ -182,7 +183,7 @@ public class DeviceHealthIndexController extends BaseController{
                addCell(ws, i, 1, format.format(m.getCzrq()),"");
                addCell(ws, i, 2, m.getIdcard(),"");
                addCell(ws, i, 3, m.getUserName(),"");
                addCell(ws, i, 4, "","");
                addCell(ws, i, 4, type,"");
                addCell(ws, i, 5, m.getValue1(),"");
                addCell(ws, i, 6, m.getValue2(),"");
                addCell(ws, i, 7, m.getValue3(),"");

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

@ -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())){

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -1242,8 +1242,7 @@ public class FamilyMemberService extends BaseService {
        WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey","xzcysq");
        String first = templateConfig.getFirst();
        first = first.replace("key1",(m.getName()==null?"":m.getName())).replace("key1",(p.getName()==null?"":p.getName()));
        first = first.replace("key1",(m.getName()==null?"":m.getName())).replace("key2",(p.getName()==null?"":p.getName()));
        String remark = templateConfig.getRemark();
        remark = remark.replace("key1",(p.getName()==null?"":p.getName()))
                .replace("key2",(relations.get(relation)==null?"":relations.get(relation)))