|
@ -4210,6 +4210,50 @@ public class StatisticsService extends BaseService {
|
|
|
return new JSONArray(doctorList);
|
|
|
}
|
|
|
|
|
|
public JSONObject getTeamDoctorEduTitleFromEs(String teamCode, String startDate, String endDate, String doctor) {
|
|
|
startDate = changeDate(DateUtil.getNextDay(startDate,-1));
|
|
|
endDate = changeDate(endDate);
|
|
|
|
|
|
String totalSql = "select count(*) AS articleCount,count(DISTINCT batchNo) AS batchCount " +
|
|
|
" from " +esType+
|
|
|
" where adminTeamCode="+teamCode+" and doctorCode='"+doctor+"' and createTime <='"+endDate+"'";
|
|
|
String addSql = "SELECT " +
|
|
|
" COUNT(*) AS addCount, " +
|
|
|
" COUNT(DISTINCT batchNo) addBatchno " +
|
|
|
" FROM " + esType +
|
|
|
" WHERE " +
|
|
|
" adminTeamCode =" + teamCode +
|
|
|
" AND doctorCode ='" + doctor + "'" +
|
|
|
" AND createTime <= '" + endDate + "' " +
|
|
|
" AND createTime >= '" + startDate + "'";
|
|
|
List<HealthEduArticleESResult> totalList = elasticsearchUtil.excute(totalSql,HealthEduArticleESResult.class,esType,esIndex);
|
|
|
List<HealthEduArticleESResult> addList = elasticsearchUtil.excute(addSql,HealthEduArticleESResult.class,esType,esIndex);
|
|
|
JSONObject rs = new JSONObject();
|
|
|
//转换到map
|
|
|
List<Map<String,Object>> totalMapList = new ArrayList<>();
|
|
|
Map<String,Object> totalMap = new HashedMap();
|
|
|
totalMap.put("batchno","0");
|
|
|
totalMap.put("articleCount","0");
|
|
|
if (totalList!=null && totalList.size()>0){
|
|
|
totalMap.put("batchno",totalList.get(0).getBatchCount());
|
|
|
totalMap.put("articleCount",totalList.get(0).getArticleCount());
|
|
|
}
|
|
|
totalMapList.add(totalMap);
|
|
|
//转换到map
|
|
|
List<Map<String,Object>> addMapList = new ArrayList<>();
|
|
|
Map<String,Object> addMap = new HashedMap();
|
|
|
addMap.put("addCount","0");
|
|
|
addMap.put("addBatchno","0");
|
|
|
if (addList!=null && addList.size()>0){
|
|
|
totalMap.put("addCount",addList.get(0).getAddCount());
|
|
|
totalMap.put("addBatchno",addList.get(0).getAddBatchno());
|
|
|
}
|
|
|
addMapList.add(addMap);
|
|
|
rs.put("totalList", totalMapList);
|
|
|
rs.put("addList", addMapList);
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public JSONObject getTeamDoctorEduTitle(String teamCode, String startDate, String endDate, String doctor) {
|
|
|
startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
|
|
|
endDate = endDate + " 17:00:00";
|