humingfen il y a 6 ans
Parent
commit
ff44d44770

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

@ -52,8 +52,6 @@ public class SynergyManageService extends BaseJpaService {
    @Autowired
    private UserDao userDao;
    @Autowired
    private ManageSynergyWorkorderCustomerLogDao manageSynergyWorkorderCustomerLogDao;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
@ -394,8 +392,8 @@ public class SynergyManageService extends BaseJpaService {
            Map<String,Object> workorderMap = resultWorkorderList.get(0);
            //居民信息
            resultMap.put("mobile",workorderMap.get("mobile"));//电话号码
            resultMap.put("service_patient_name",workorderMap.get("service_patient_name"));//居民姓名
            Integer callNum = manageSynergyWorkorderCustomerLogDao.callNumByWorkorder(workorderMap.get("servicerCode")+"");
            resultMap.put("patientName",workorderMap.get("service_patient_name"));//居民姓名
            Integer callNum = customerLogDao.callNumByWorkorder(workorderMap.get("servicerCode")+"");
            resultMap.put("callNum",callNum);//已呼叫次数
            Patient patient =patientDao.findByCode(workorderMap.get("service_patient_code")+"");
            Integer sex = patient.getSex();
@ -544,13 +542,55 @@ public class SynergyManageService extends BaseJpaService {
        return customerLogDao.findExceptionCount(workorderCode, customerCode);
    }
    public JSONObject loadingInfo(String workorderCode, String customerCode) {
        JSONObject jsonObject = new JSONObject();
        String sql = "SELECT r.patient,r.patient_name from manage_synergy_workorder_customer_log cl LEFT JOIN manage_call_record r on cl.call_code = r.`code` " +
                "where cl.workorder_code = " + workorderCode + " and cl.create_user_code = " + customerCode + " and cl.`status` = 0 " +
                "ORDER BY cl.create_time LIMIT 0,1";
        jdbcTemplate.queryForList(sql, String.class);
    public Map<String, Object> loadingInfo(String workorderCode, String customerCode) {
        Map<String,Object> resultMap = new HashMap<>();
        String sql = "SELECT s.service_patient_name, s.service_patient_code, s.`code`, s.s.hospital_name,s.town_name " +
                "from (SELECT DISTINCT r.patient,cl.workorder_code from manage_synergy_workorder_customer_log cl " +
                "LEFT JOIN manage_call_record r on cl.call_code = r.`code` " +
                "where cl.workorder_code = " + workorderCode + " and cl.create_user_code = " + customerCode + " and cl.`status` = 0 ORDER BY cl.create_time LIMIT 0,1) p " +
                "LEFT JOIN manage_synergy_workorder_servicer s on p.workorder_code = s.workorder_code and s.service_patient_code = p.patient and s.`status`=1";
        return jsonObject;
        Map<String, Object> result = (Map<String, Object>) jdbcTemplate.queryForList(sql);
        String patientCode = (String) result.get("service_patient_name");
        resultMap.put("patientName", patientCode);
        resultMap.put("townName", result.get("town_name"));//所属区县
        resultMap.put("hospitalName", result.get("hospital_name"));//所属社区
        Integer callNum = customerLogDao.callNumByWorkorder((String) result.get("code"));
        resultMap.put("callNum",callNum);//已呼叫次数
        Patient patient = patientDao.findByCode(patientCode);
        Integer sex = patient.getSex();
        String sexName = "";
        if(sex==1){
            sexName="男";
        }else if(sex==2){
            sexName="女";
        }else{
            sexName="未知";
        }
        resultMap.put("sex",sexName);//性别
        Integer age = IdCardUtil.getAgeForIdcard(patient.getIdcard());
        resultMap.put("age",age);//年龄
        SignFamily signFamily = signFamilyDao.findSignByPatient(patientCode);
        resultMap.put("signDoctor", signFamily.getDoctor());//签约医生(即:工单创建医生)
        resultMap.put("healthDoctor", signFamily.getDoctorHealthName());//健管师
        List<SignPatientLabelInfo> labelDiseaseType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(patientCode,  "3", 1);
        String diseaseType="";
        for(SignPatientLabelInfo one:labelDiseaseType){
            diseaseType+=","+one.getLabelName();
        }
        resultMap.put("diseaseType", StringUtils.isNotEmpty(diseaseType) ? diseaseType.substring(1) : "");//疾病类型
        List<SignPatientLabelInfo> labelHealthType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(patientCode,  "2", 1);
        String healthType="";
        for(SignPatientLabelInfo one:labelHealthType){
            healthType+=","+one.getLabelName();
        }
        resultMap.put("healthType", StringUtils.isNotEmpty(healthType) ? healthType.substring(1) : "");//健康情况
        List<SignPatientLabelInfo> labelServeType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(patientCode,  "2", 1);
        String serveType="";
        for(SignPatientLabelInfo one:labelServeType){
            serveType+=","+one.getLabelName();
        }
        resultMap.put("serveType", StringUtils.isNotEmpty(serveType)?serveType.substring(1) : "");//服务类型
        return resultMap;
    }
}