Browse Source

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

liuwenbin 6 years ago
parent
commit
a98171a4dc

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/QuestionnaireManageService.java

@ -155,7 +155,7 @@ public class QuestionnaireManageService extends BaseJpaService {
        List<SurveyQuestionnaire> questionList = surveyQuestionnaireDao.findBySurveyCode(surverCode);
        //查找选项和答案
        Map<String, Object> answerMap = new HashMap<>();
        String sql = "SELECT soa.*, sqo.content FROM wlyy_survey_option_answers soa LEFT JOIN wlyy_survey_questions_options sqo ON soa.options_code= sqo.code WHERE soa.screen_result_code = ? AND soa.patient=? AND soa.survey_code=?";
        String sql = "SELECT soa.*, sqo.content FROM wlyy_survey_option_answers soa LEFT JOIN wlyy_survey_questionnaire_options sqo ON soa.options_code= sqo.code WHERE soa.screen_result_code = ? AND soa.patient=? AND soa.survey_code=?";
        List<Map<String, Object>> optionAnswersList = jdbcTemplate.queryForList(sql, new Object[]{code, patient, surverCode});
        for (SurveyQuestionnaire question : questionList) {
            List<Map<String, Object>> optionList = new ArrayList<>();

+ 37 - 49
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -374,46 +374,18 @@ public class SynergyManageService extends BaseJpaService {
        map.put("createTime", sdf.format(workorderDO.getCreateTime()));
        map.put("createUserName", workorderDO.getCreateUserName());
        map.put("hospitalName", workorderDO.getHospitalName());
        //获取服务对象
        if(StringUtils.isNotBlank(patient)){
            //获取单个居民处理完成的工单信息
            ManageSynergyWorkorderServicerDO workorderServicerDO = workorderServicerDao.findByWorkOrderCodeAndPatientCode(workorderCode, patient);
            map.put("patientName", workorderServicerDO.getServicePatientName());
            map.put("idcard", workorderServicerDO.getIdcard());
            map.put("ssc", workorderServicerDO.getSsc());
            map.put("completeTime", sdf.format(workorderServicerDO.getCompleteTime()));
        }else {
            if(status == 2 || status == 3){
                //获取工单完成人数
                int count = workorderServicerDao.findByWorkorderCodeCount(workorderCode, 3);
                map.put("count", count);
            }
            map.put("servicerKey", workorderDO.getServicerKey());
            map.put("servicerCount", workorderDO.getServicerCount());
        }
        //如果是随访,查出对象的信息
        if(workorderDO.getType() == 3){
            List<ManageSynergyWorkorderServicerDO> workorderServicerDO = workorderServicerDao.findByWorkorderCode(workorderCode);
            map.put("patientName", workorderServicerDO.get(0).getServicePatientName());
            map.put("patient", workorderServicerDO.get(0).getServicePatientCode());
            map.put("idcard", workorderServicerDO.get(0).getIdcard());
            map.put("ssc", workorderServicerDO.get(0).getSsc());
        }else if(workorderDO.getType() == 5) {
            String diseaseType = surveyTemplateDao.findByCode(workorderDO.getRelationCode());
            map.put("diseaseType", diseaseType);
        }
        map.put("servicerKey", workorderDO.getServicerKey());
        map.put("servicerCount", workorderDO.getServicerCount());
        //超时标签
        map.put("delayStatus", this.isServiceOverTime(workorderDO.getServiceTime()));
        //根据角色显示对应工单状态
        if(workorderDO.getCreateUserType() == 1 && role == 3){
            map.put("status", "待接收");
        }else if(workorderDO.getCreateUserType() == 2 && role == 1){
            map.put("status", "未接收");
        }
        if(status == 2){
        //获取退回原因
        if(status == 4){
            map.put("returnedRemark", workorderDO.getReturnedRemark());
        }else if(status == 2 || status == 3){
            //获取工单完成人数
            int count = workorderServicerDao.findByWorkorderCodeCount(workorderCode, 3);
            map.put("count", count);
            //接收者
            map.put("receiverName", workorderDO.getReceiverName());
            map.put("receiverTime", sdf.format(workorderDO.getReceiverTime()));
@ -431,22 +403,38 @@ public class SynergyManageService extends BaseJpaService {
            for(ManageSynergyWorkorderExecutorDO one : collaboratorList){
                collaborator += "、" + one.getExecutorName();
            }
            map.put("collaboratorList", StringUtils.isNotEmpty(collaborator) ? collaborator.substring(1) : "");//参与人可能有多个
        }
        if(status == 3){
            //获取单个服务对象
            if(StringUtils.isNotBlank(patient)){
                //获取单个居民处理完成的工单信息
                ManageSynergyWorkorderServicerDO workorderServicerDO = workorderServicerDao.findByWorkOrderCodeAndPatientCode(workorderCode, patient);
                map.put("patientName", workorderServicerDO.getServicePatientName());
                map.put("idcard", workorderServicerDO.getIdcard());
                map.put("ssc", workorderServicerDO.getSsc());
                map.put("completeTime", sdf.format(workorderServicerDO.getCompleteTime()));
            }
            //获取处理结果
            map.put("resultRemark", workorderDO.getDealResultRemark());
            map.put("accessory", workorderDO.getDealResultAccessory());
            if(workorderDO.getType() == 4)
            map.put("relationCode", workorderDO.getRelationCode());
        }else if(status == 4){
            //获取退回原因
            map.put("returnedRemark", workorderDO.getReturnedRemark());
            if(status == 3) {
                map.put("resultRemark", workorderDO.getDealResultRemark());
                map.put("completeTime", workorderDO.getCompleteTime());
                List<ManageSynergyAccessoryDO> accessoryList = accessoryList(workorderCode);
                map.put("accessoryList",accessoryList);//附件列表
            }
        }
        //如果是随访,查出对象的信息
        if(workorderDO.getType() == 3){
            List<ManageSynergyWorkorderServicerDO> workorderServicerDO = workorderServicerDao.findByWorkorderCode(workorderCode);
            map.put("patientName", workorderServicerDO.get(0).getServicePatientName());
            map.put("patient", workorderServicerDO.get(0).getServicePatientCode());
            map.put("idcard", workorderServicerDO.get(0).getIdcard());
            map.put("ssc", workorderServicerDO.get(0).getSsc());
        }else if(workorderDO.getType() == 5) {
            //如果是疾病筛查添加疾病类型
            String diseaseType = surveyTemplateDao.findByCode(workorderDO.getRelationCode());
            map.put("diseaseType", diseaseType);
        }
        List<ManageSynergyAccessoryDO> accessoryList = accessoryList(workorderCode);
        map.put("accessoryList",accessoryList);//附件列表
        return map;
    }