Forráskód Böngészése

【患者端】服务团队页面本年度服务统计有误。

liuwenbin 7 éve
szülő
commit
e2ca1f9498

BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApiTest.class


+ 2 - 2
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java

@ -34,7 +34,7 @@ public class ArticleApiTest {
		// System.out.println(api.getCollectionArticalList(im));
		// System.out.println(api.getArticalById(im));
		queryArticlePcList();
        saveBehavior();
//		System.out.printf("350200".substring(0,3));
	}
@ -120,7 +120,7 @@ public class ArticleApiTest {
		BehaviorApi api = new BehaviorApi();
		InterfaceMessage im = new InterfaceMessage();
		JSONObject obj = new JSONObject();
		obj.put("articleId","012EA731315E4E6F8F7227D09B730BEA");
		obj.put("articleId","8C409DD4C60B4DE395A3D266BDCE04A8");
		obj.put("cName","标题");//
		obj.put("userId","xh1D2017031502222");
		obj.put("userType","1");

+ 19 - 17
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -944,25 +944,26 @@ public class SignWebService extends BaseService {
        }
        Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+08:00"));
        int year = calendar.get(Calendar.YEAR);
        String yearBegin = DateUtil.dateToStrShort(beginTime) + " 00:00:00";
        String yearEnd = DateUtil.dateToStrShort(endTime) + " 23:59:59";
        //统计当年咨询数量
        String consult_sql = "select count(1) as count from wlyy_consult_team  w where w.doctor = ? and w.patient =? and YEAR(w.czrq) = ? ";
        String consult_sql = "select count(1) as count from wlyy_consult_team  w where w.doctor = ? and w.patient =? and w.czrq>='"+yearBegin+"' and w.czrq<'"+yearEnd+"'";
        //统计随访数量
        String followup_sql = "select count(1) as count from wlyy_followup  w where (w.doctor_code = ? or w.doctor_code =?) and w.patient_code =? and YEAR(w.create_time) = ?  and w.followup_class is not null ";
        String followup_sql = "select count(1) as count from wlyy_followup  w where (w.doctor_code = ? or w.doctor_code =?) and w.patient_code =? and w.create_time>='"+yearBegin+"' and w.create_time<'"+yearEnd+"'  and w.followup_class is not null ";
        //统计待预约数量
        String reservation_sql = "select count(1) as count from wlyy_patient_reservation  w where (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
        String reservation_sql = "select count(1) as count from wlyy_patient_reservation  w where (w.doctor = ? or w.doctor =?) and w.patient =? and w.czrq>='"+yearBegin+"' and w.czrq<'"+yearEnd+"'";
        //统计健康教育数量
        String yearBegin = DateUtil.dateToStrShort(beginTime) + " 00:00:00";
        String yearEnd = DateUtil.dateToStrShort(endTime) + " 23:59:59";
        String start = elasticsearchUtil.changeTime(yearBegin);
        String end = elasticsearchUtil.changeTime(yearEnd);
//        String article_sql = "select count(1) as count from wlyy_health_edu_article_patient  w where (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
        String article_sql = "SELECT COUNT(*) FROM "+esIndex+" where userType='1' and patientCode='"+patient+"' and (doctorCode='"+doctorHealth+"' or doctorCode='"+doctor+"') and createTime>='"+start+"' and createTime<'"+end+"'";
        //统计健康指导数量
        String guidance_sql = "select count(1) as count from wlyy_patient_health_guidance  w where (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
        String guidance_sql = "select count(1) as count from wlyy_patient_health_guidance  w where (w.doctor = ? or w.doctor =?) and w.patient =? and w.czrq>='"+yearBegin+"' and w.czrq<'"+yearEnd+"'";
        StringBuffer countSql = new StringBuffer();
        countSql.append(consult_sql).append(" union all ").append(followup_sql).append(" union all ").append(reservation_sql).append(" union all ").append(guidance_sql);
        List<Map<String, Object>> resultCount = jdbcTemplate.queryForList(countSql.toString(), new Object[]{doctorHealth, patient, year, doctorHealth, doctor, patient, year, doctorHealth, doctor, patient, year,  doctorHealth, doctor, patient, year});
        List<Map<String, Object>> resultCount = jdbcTemplate.queryForList(countSql.toString(), new Object[]{doctorHealth, patient, doctorHealth, doctor, patient,  doctorHealth, doctor, patient,  doctorHealth, doctor, patient});
        Long count = elasticsearchUtil.excuteForLong(article_sql,esType,esIndex);
        resultObject.put("consultNum", resultCount.get(0).get("count"));
        resultObject.put("followupNum", resultCount.get(1).get("count"));
@ -1056,18 +1057,19 @@ public class SignWebService extends BaseService {
        String doctor = signFamily.getDoctor();
        Patient p = patientService.findByCode(signFamily.getPatient());
        String patient = p.getCode();
        String yearBegin = DateUtil.dateToStrShort(signFamily.getBegin()) + " 00:00:00";
        String yearEnd = DateUtil.dateToStrShort(signFamily.getEnd()) + " 23:59:59";
        //获取咨询
        String consult_sql = "select w.consult,w.symptoms,w.czrq,w.status,1 as type from wlyy_consult_team  w where w.doctor = ? and w.patient =? and YEAR(w.czrq) = ? ";
        String consult_sql = "select w.consult,w.symptoms,w.czrq,w.status,1 as type from wlyy_consult_team  w where w.doctor = ? and w.patient =? and w.czrq>='"+yearBegin+"' and w.czrq<'"+yearEnd+"'";
        //获取随访
        String followup_sql = "select w.id,w.followup_type,w.followup_class,w.followup_date as czrq,w.followup_manager_status,w.status,2 as type from wlyy_followup  w where (w.doctor_code = ? or w.doctor_code =?) and w.patient_code =? and YEAR(w.create_time) = ?  ";
        String followup_sql = "select w.id,w.followup_type,w.followup_class,w.followup_date as czrq,w.followup_manager_status,w.status,2 as type from wlyy_followup  w where (w.doctor_code = ? or w.doctor_code =?) and w.patient_code =? and w.create_time>='"+yearBegin+"' and w.create_time<'"+yearEnd+"' and w.followup_class is not null";
        //获取待预约
        String reservation_sql = "select w.code,w.id, w.doctor_name,w.doctor_code,w.doctor_job,w.doctor,w.dname,w.org_code,w.status,w.start_time as czrq,3 as type from wlyy_patient_reservation  w where (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
        String reservation_sql = "select w.code,w.id, w.doctor_name,w.doctor_code,w.doctor_job,w.doctor,w.dname,w.org_code,w.status,w.start_time as czrq,3 as type from wlyy_patient_reservation  w where (w.doctor = ? or w.doctor =?) and w.patient =? and w.czrq>='"+yearBegin+"' and w.czrq<'"+yearEnd+"'";
        //获取健康教育
//        String article_sql = "select w.id,w.article,w2.title,w2.summary,w.czrq,w.doctor,w.doctor_name,w.is_read,4 as type from wlyy_health_edu_article_patient  w,wlyy_health_edu_article w2 where w.article = w2.code and  (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
//        Date startTime = DateUtil.getBeginDayOfYear();
//        Date endTime = DateUtil.getEndDayOfYear();
        String yearBegin = DateUtil.dateToStrShort(signFamily.getBegin()) + " 00:00:00";
        String yearEnd = DateUtil.dateToStrShort(signFamily.getEnd()) + " 23:59:59";
//        String startDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startTime);
//        String endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(endTime);
        String start = elasticsearchUtil.changeTime(yearBegin);
@ -1075,16 +1077,16 @@ public class SignWebService extends BaseService {
        String article_sql = "SELECT id,articleId as article,articleTitle as title,createTime as czrq,doctorCode as doctor,doctorName as doctor_name,isRead as is_read,articleContent as content FROM "+esIndex+" where userType='1' and patientCode='"+patient+"' and (doctorCode='"+doctorHealth+"' or doctorCode='"+doctor+"') and createTime>='"+start+"' and createTime<'"+end+"'";
        //获取健康指导
        String guidance_sql = "select w.id,w.doctor,w.content,w.czrq,w.read_status,5 as type  from wlyy_patient_health_guidance  w where (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
        String guidance_sql = "select w.id,w.doctor,w.content,w.czrq,w.read_status,5 as type  from wlyy_patient_health_guidance  w where (w.doctor = ? or w.doctor =?) and w.patient =? and w.czrq>='"+yearBegin+"' and  w.czrq<'"+yearEnd+"'";
        Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+08:00"));
        int year = calendar.get(Calendar.YEAR);
        //咨询量
        List<Map<String, Object>> consultResult = jdbcTemplate.queryForList(consult_sql, new Object[]{doctorHealth, patient, year});
        List<Map<String, Object>> consultResult = jdbcTemplate.queryForList(consult_sql, new Object[]{doctorHealth, patient});
        //随访量
        List<Map<String, Object>> followupResult = jdbcTemplate.queryForList(followup_sql, new Object[]{doctorHealth, doctor, patient, year});
        List<Map<String, Object>> followupResult = jdbcTemplate.queryForList(followup_sql, new Object[]{doctorHealth, doctor, patient});
        //待预约量
        List<Map<String, Object>> reservationResult = jdbcTemplate.queryForList(reservation_sql, new Object[]{doctorHealth, doctor, patient, year});
        List<Map<String, Object>> reservationResult = jdbcTemplate.queryForList(reservation_sql, new Object[]{doctorHealth, doctor, patient});
        //健康教育量
//        List<Map<String, Object>> articleResult = jdbcTemplate.queryForList(article_sql, new Object[]{doctorHealth, doctor, patient, year});
//        List<HealthEduArticleES> esList = elasticsearchUtil.excute(article_sql, HealthEduArticleES.class, esIndex, esType);
@ -1098,7 +1100,7 @@ public class SignWebService extends BaseService {
            map.put("summary",str!=null?(str.length()>40?str.substring(0,40):str):"");
        }
        //健康指导量
        List<Map<String, Object>> guidanceResult = jdbcTemplate.queryForList(guidance_sql, new Object[]{doctorHealth, doctor, patient, year});
        List<Map<String, Object>> guidanceResult = jdbcTemplate.queryForList(guidance_sql, new Object[]{doctorHealth, doctor, patient});
        List<JSONObject> objects = new ArrayList<>();
        int amount = consultResult.size() + followupResult.size() + reservationResult.size() + articleResult.size() + guidanceResult.size();
        int activeAmount = 0;