瀏覽代碼

代码修改

LAPTOP-KB9HII50\70708 3 周之前
父節點
當前提交
4fa7d2eedb

+ 9 - 17
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -137,7 +137,7 @@ public class RehabilitationManageService {
//                resultMap.put("age",age);
                resultMap.put("hospitalName", one.get("hospital_name"));
//                resultMap.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
                resultMap.put("patientName", one.get("patientName"));
                resultMap.put("patientName", one.get("name"));
                resultMap.put("patientCode", one.get("patient"));
                resultMap.put("id", one.get("id"));
                resultMap.put("status", one.get("status"));//康复计划状态
@ -491,7 +491,9 @@ public class RehabilitationManageService {
        for (int i = 1; i < planIdlist.length; i++) {
            planCondition.append(",'" + planIdlist[i] + "'");
        }
        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.code,IF(d.followup_detail_type=1,'社区随访(厦心)',i.name) name,1 as flag from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.code,IF(d.followup_detail_type=1,'社区随访(厦心)',i.name) name,1 as flag,p.disease " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on p.id = d.plan_id  " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id  " +
                " where  d.plan_id in (" + planCondition + " )AND  d.execute_time IS NOT NULL  and d.execute_time <>'' ";
        if (searchTask != null) {
@ -575,16 +577,14 @@ public class RehabilitationManageService {
        }
        String planDetailResult = StringUtils.isNotEmpty(planDetailList) ? planDetailList.substring(1) : "";
        String sql = "select i.name,i.code,i.content,d.execute_time,d.hospital_name,d.id,d.status,d.type as detailType,d.expense,d.doctor as executeDoctor," +
                " d.doctor_name as executeDoctorName,p.patient ,p.id AS planId,p.create_user as createDoctor,p.create_user_name as createDoctorName, p.status as planStatus  " +
                " d.doctor_name as executeDoctorName,p.patient ,p.id AS planId,p.create_user as createDoctor,p.create_user_name as createDoctorName, p.status as planStatus" +
                " ,pa.idcard,pa.birthday  " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id " +
                " LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " LEFT JOIN wlyy.wlyy_patient pa on pa.code=p.patient " +
                " where d.id in (" + planDetailResult + ") order BY d.execute_time ASC ";
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planCreateName(sql);
        sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailDoctorName(sql);
        List<Map<String, Object>> serviceItemList = jdbcTemplate.queryForList(sql);
//        if(serviceItemList.size()>0){
//            Map<String,Object> serviceItem = serviceItemList.get(0);
        List<Map<String, Object>> resultList = new ArrayList<>();
        for (Map<String, Object> one : serviceItemList) {
            Map<String, Object> resultMap = new HashMap<>();
@ -593,9 +593,6 @@ public class RehabilitationManageService {
                isMyTask = 1;
            }
            resultMap.put("isMyTask", isMyTask);//0不是自己的任务,1是自己的任务
//            if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
//                executeDoctorList.add(one.get("create_user_name")+"");
//            }
            List<String> executeDoctorList = new ArrayList<>();
            executeDoctorList.add(one.get("executeDoctorName") + "");
            resultMap.put("executeDoctorList", executeDoctorList);//执行医生名称列表
@ -603,6 +600,8 @@ public class RehabilitationManageService {
            resultMap.put("executeDoctorName", one.get("executeDoctorName") + "");//执行医生code
            resultMap.put("specialistDoctorCode", one.get("createDoctor") + "");//创建人(专科)医生code
            resultMap.put("specialistDoctorName", one.get("createDoctorName") + "");//创建人(专科)医生名字
            String birthday = one.get("birthday")==null?"":one.get("birthday")+"";
            resultMap.put("age", IdCardUtil.getAgeByBirthdayStrOrIdcard(one.get("idcard")+"",birthday));//年龄
            resultMap.put("title", one.get("name"));//项目标题
            resultMap.put("planDetaiId", one.get("id"));//计划服务项目id
            resultMap.put("planId", one.get("planId"));//计划id
@ -653,7 +652,6 @@ public class RehabilitationManageService {
            List<RehabilitationOperateRecordsDO> operateList = rehabilitationOperateRecordsDao.findByRehabilitationDetailId(one.get("id").toString());
            Integer operate = 0;
            if (operateList.size() > 0) {
                operate = 1;
                RehabilitationOperateRecordsDO temp = operateList.get(0);
                operate = 1;
                Date completeTime = temp.getCompleteTime();
@ -669,8 +667,6 @@ public class RehabilitationManageService {
            resultList.add(resultMap);
        }
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success, resultList);
//        }
//        return MixEnvelop.getError("没有该服务项详情信息!");
    }
    /**
@ -690,10 +686,6 @@ public class RehabilitationManageService {
                " LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " LEFT JOIN wlyy_specialist.wlyy_plan_detail_appointment a on d.id=.a.rehabilitation_plan_detail_id " +
                " where d.id = '" + planDetailId + "'";
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planName2(sql);
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planCreateName(sql);
        sql = TransforSqlUtl.wlyy_plan_detail_appointmentAppDoctorName(sql);
        sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailDoctorName(sql);
        List<Map<String, Object>> serviceItemList = jdbcTemplate.queryForList(sql);
        if (serviceItemList.size() == 0) {
            return ObjEnvelop.getSuccess(SpecialistMapping.api_success, new HashMap<>());