|
@ -2377,48 +2377,65 @@ public class StatisticsESService {
|
|
|
Integer interval = Integer.parseInt(type) + 1;
|
|
|
List<SaveModel> articleCountList = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.valueOf(SaveModel.teamLevel),"59",SaveModel.timeLevel_ZL,String.valueOf(interval));
|
|
|
List<SaveModel> batchNoCountList = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.valueOf(SaveModel.teamLevel),"71",SaveModel.timeLevel_ZL,String.valueOf(interval));
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
if(articleCountList!=null){
|
|
|
//循环人数集合
|
|
|
for (SaveModel one1:articleCountList){
|
|
|
String date = "";
|
|
|
if(one1.getQuotaDate()!=null){
|
|
|
date=dateFormat.format(one1.getQuotaDate());
|
|
|
}
|
|
|
if (one1.getResult2().intValue()!=0){
|
|
|
Map<String,Object> map = new HashedMap();
|
|
|
map.put("articleCount",one1.getResult2().intValue());
|
|
|
//查看批次集合里是否有同时间的数据
|
|
|
for (SaveModel one2:batchNoCountList) {
|
|
|
if (one2.getQuotaDate()!=null && dateFormat.format(one2.getQuotaDate()).equals(date)){
|
|
|
map.put("batchCount",one2.getResult2().intValue());
|
|
|
}
|
|
|
}
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo",date);
|
|
|
} else {
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(date));
|
|
|
//List<Map<String, Object>> list = new ArrayList<>();
|
|
|
Map<String,Object> articleMap = new HashedMap();
|
|
|
Map<String,Object> batchMap = new HashedMap();
|
|
|
|
|
|
//把list转换成 map
|
|
|
if (articleCountList!=null && articleCountList.size()>0){
|
|
|
articleCountList.stream().forEach(one1->{
|
|
|
articleMap.put(dateFormat.format(one1.getQuotaDate()),one1);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (batchNoCountList!=null && batchNoCountList.size()>0){
|
|
|
batchNoCountList.stream().forEach(one2->{
|
|
|
batchMap.put(dateFormat.format(one2.getQuotaDate()),one2);
|
|
|
});
|
|
|
}
|
|
|
//获取结果集
|
|
|
List<Map<String, Object>> resultList = DateUtil.findDateASWeeks(dateFormat.parse(startDate),dateFormat.parse(endDate));
|
|
|
String MondayWeekDateStr = DateUtil.getMondayOfThisDate(dateFormat.parse(startDate));
|
|
|
Date MondayWeekDate = DateUtil.strToDate(MondayWeekDateStr,"yyyy-MM-dd");
|
|
|
if (dateFormat.parse(startDate).after(MondayWeekDate)){
|
|
|
//开始时间不是当周的周一,则加入本周周一的时间
|
|
|
Map<String,Object> dateMap = new HashedMap();
|
|
|
dateMap.put("date",MondayWeekDateStr);
|
|
|
dateMap.put("count", 0.0D);
|
|
|
resultList.add(0,dateMap);
|
|
|
}
|
|
|
if (resultList!=null && resultList.size()>0){
|
|
|
for (Map<String, Object> reMap : resultList) {
|
|
|
//设置时间
|
|
|
if ("0".equals(type)) {
|
|
|
reMap.put("dateNo",dateFormat.format(reMap.get("date")));
|
|
|
} else {
|
|
|
if (dateFormat.parse(String.valueOf(reMap.get("date"))).before(dateFormat.parse(startDate))){
|
|
|
reMap.put("weekOfMonth", 1);
|
|
|
}else{
|
|
|
reMap.put("weekOfMonth", DateUtil.getWeekOfMonth(String.valueOf(reMap.get("date"))));
|
|
|
}
|
|
|
list.add(map);
|
|
|
}
|
|
|
//放置新增发送人数和批次
|
|
|
SaveModel one1 = (SaveModel) articleMap.get(reMap.get("date"));
|
|
|
SaveModel one2 = (SaveModel) batchMap.get(reMap.get("date"));
|
|
|
if (one1!=null){
|
|
|
reMap.put("articleCount",one1.getResult2().intValue());
|
|
|
}else{
|
|
|
//循环批次
|
|
|
for (SaveModel one2:batchNoCountList) {
|
|
|
if (one2.getResult2().intValue()!=0 && one2.getQuotaDate()!=null && dateFormat.format(one2.getQuotaDate()).equals(date)){
|
|
|
Map<String,Object> map = new HashedMap();
|
|
|
map.put("articleCount",0);
|
|
|
map.put("batchCount",one2.getResult2().intValue());
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo",dateFormat.format(date));
|
|
|
} else {
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(date));
|
|
|
}
|
|
|
list.add(map);
|
|
|
}
|
|
|
}
|
|
|
reMap.put("articleCount",0);
|
|
|
}
|
|
|
if (one2!=null){
|
|
|
reMap.put("batchCount",one2.getResult2().intValue());
|
|
|
}else{
|
|
|
reMap.put("batchCount",0);
|
|
|
}
|
|
|
//去除多余的key
|
|
|
reMap.remove("count");
|
|
|
reMap.remove("avg");
|
|
|
reMap.remove("date");
|
|
|
}
|
|
|
}
|
|
|
return new JSONArray(list);
|
|
|
return new JSONArray(resultList);
|
|
|
}
|
|
|
|
|
|
public JSONObject getRenewPercentAndChangePercent(String index, Integer level, String area, String year, String lowCode) {
|
|
@ -2982,7 +2999,7 @@ public class StatisticsESService {
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
|
|
|
} else {
|
|
|
map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(saveModel.getQuotaDate()));
|
|
|
}
|
|
|
map.put("signCount", saveModel.getResult2().longValue());
|
|
|
rs.add(map);
|
|
@ -3060,7 +3077,7 @@ public class StatisticsESService {
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
map.put("weekNo", dateFormat.format(one.getQuotaDate()));
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
}
|
|
|
map.put("avgCount", avgCountStr);
|
|
|
rs.add(map);
|
|
@ -3144,7 +3161,11 @@ public class StatisticsESService {
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
if (one.getQuotaDate().before(dateFormat.parse(startDate))){
|
|
|
map.put("weekOfMonth", 1);
|
|
|
}else{
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
}
|
|
|
}
|
|
|
map.put("followupCount", one.getResult2().intValue());
|
|
|
totalList.add(map);
|
|
@ -3158,7 +3179,11 @@ public class StatisticsESService {
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
if (one.getQuotaDate().before(dateFormat.parse(startDate))){
|
|
|
map.put("weekOfMonth", 1);
|
|
|
}else{
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
}
|
|
|
}
|
|
|
map.put("planCount", one.getResult2().intValue());
|
|
|
planList.add(map);
|
|
@ -3189,16 +3214,21 @@ public class StatisticsESService {
|
|
|
Map<String, Object> map = null;
|
|
|
List<Map<String, Object>> totalList = new ArrayList<>();
|
|
|
for (SaveModel one : list) {
|
|
|
if (one.getResult2().intValue()!=0){
|
|
|
map = new HashMap<>();
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
/*if (one.getResult2().intValue()!=0){
|
|
|
|
|
|
}*/
|
|
|
map = new HashMap<>();
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
if (one.getQuotaDate().before(dateFormat.parse(startDate))){
|
|
|
map.put("weekOfMonth","1");
|
|
|
}else{
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
}
|
|
|
map.put("reservationCount", one.getResult2().longValue());
|
|
|
totalList.add(map);
|
|
|
}
|
|
|
map.put("reservationCount", one.getResult2().longValue());
|
|
|
totalList.add(map);
|
|
|
}
|
|
|
return new JSONArray(totalList);
|
|
|
}
|
|
@ -3368,16 +3398,21 @@ public class StatisticsESService {
|
|
|
Map<String, Object> map = null;
|
|
|
List<Map<String, Object>> totalList = new ArrayList<>();
|
|
|
for (SaveModel one : list) {
|
|
|
if (one.getResult2().intValue()!=0){
|
|
|
map = new HashMap<>();
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
/* if (one.getResult2().intValue()!=0){
|
|
|
|
|
|
}*/
|
|
|
map = new HashMap<>();
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
if (one.getQuotaDate().before(dateFormat.parse(startDate))){
|
|
|
map.put("weekOfMonth", 1);
|
|
|
}else{
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
}
|
|
|
map.put("guidanceCount", one.getResult2().longValue());
|
|
|
totalList.add(map);
|
|
|
}
|
|
|
map.put("guidanceCount", one.getResult2().longValue());
|
|
|
totalList.add(map);
|
|
|
}
|
|
|
return new JSONArray(totalList);
|
|
|
}
|
|
@ -3406,7 +3441,11 @@ public class StatisticsESService {
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
if (one.getQuotaDate().before(dateFormat.parse(startDate))){
|
|
|
map.put("weekOfMonth", 1);
|
|
|
}else{
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
}
|
|
|
}
|
|
|
map.put("inCount", one.getResult2().longValue());
|
|
|
inList.add(map);
|
|
@ -3420,7 +3459,11 @@ public class StatisticsESService {
|
|
|
if ("0".equals(type)) {
|
|
|
map.put("dateNo", dateFormat.format(one.getQuotaDate()));
|
|
|
} else {
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
if (one.getQuotaDate().before(dateFormat.parse(startDate))){
|
|
|
map.put("weekOfMonth", 1);
|
|
|
}else{
|
|
|
map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
}
|
|
|
}
|
|
|
map.put("outCount", one.getResult2().longValue());
|
|
|
outList.add(map);
|