|
@ -133,7 +133,7 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public long getWeiJiaoFei(String endDate,String area,int level){
|
|
|
public long getWeiJiaoFei(String endDate, String area, int level) {
|
|
|
// 查询语句
|
|
|
String sql = " select " +
|
|
|
" ifnull(result,'0') amount" +
|
|
@ -158,9 +158,9 @@ public class StatisticsService extends BaseService {
|
|
|
sql += " and qkdoctor_code = ?";
|
|
|
}
|
|
|
|
|
|
List<Map<String,Object>> result = jdbcTemplate.queryForList(sql, new Object[]{level, endDate, area});
|
|
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{level, endDate, area});
|
|
|
|
|
|
if (result != null && result.size() > 0) {
|
|
|
if (result != null && result.size() > 0) {
|
|
|
return (result.get(0).get("amount") != null ? Long.valueOf(result.get(0).get("amount").toString()) : 0);
|
|
|
} else {
|
|
|
return 0;
|
|
@ -1419,6 +1419,54 @@ public class StatisticsService extends BaseService {
|
|
|
map6.put("name", "50~65");
|
|
|
map6.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map6);
|
|
|
} else if (index.equals("14")) {
|
|
|
Map<String, Object> map1 = new HashMap<>();
|
|
|
map1.put("code", "0");
|
|
|
map1.put("name", "未缴费人数");
|
|
|
map1.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map1);
|
|
|
|
|
|
Map<String, Object> map2 = new HashMap<>();
|
|
|
map2.put("code", "1");
|
|
|
map2.put("name", "已缴费人数");
|
|
|
map2.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map2);
|
|
|
|
|
|
Map<String, Object> map3 = new HashMap<>();
|
|
|
map2.put("code", "2");
|
|
|
map2.put("name", "已退费人数");
|
|
|
map2.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map3);
|
|
|
} else if (index.equals("15")) {
|
|
|
Map<String, Object> map1 = new HashMap<>();
|
|
|
map1.put("code", "0");
|
|
|
map1.put("name", "未标注");
|
|
|
map1.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map1);
|
|
|
|
|
|
Map<String, Object> map2 = new HashMap<>();
|
|
|
map2.put("code", "1");
|
|
|
map2.put("name", "健康人群");
|
|
|
map2.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map2);
|
|
|
|
|
|
Map<String, Object> map3 = new HashMap<>();
|
|
|
map3.put("code", "2");
|
|
|
map3.put("name", "患病人群");
|
|
|
map3.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map3);
|
|
|
|
|
|
Map<String, Object> map4 = new HashMap<>();
|
|
|
map4.put("code", "3");
|
|
|
map4.put("name", "高危人群");
|
|
|
map4.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map4);
|
|
|
|
|
|
Map<String, Object> map5 = new HashMap<>();
|
|
|
map5.put("code", "4");
|
|
|
map5.put("name", "恢复期人群");
|
|
|
map5.put("amount", Double.valueOf("0.0"));
|
|
|
resultList.add(map5);
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -1458,31 +1506,7 @@ public class StatisticsService extends BaseService {
|
|
|
String code = String.valueOf(map.get("code"));
|
|
|
double rateG = (total > 0 ? ((long) map.get("amount")) * 1.0000 / total * 100 : 0);
|
|
|
map.put("rate", df.format(rateG));
|
|
|
// if (index.equals(GROUP)) {
|
|
|
// if (code.equals("1") || code.equals("2") || code.equals("3")) {
|
|
|
// rateTotal += rateG;
|
|
|
// }
|
|
|
// } else {
|
|
|
// rateTotal += rateG;
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
// if (1 - rateTotal > 0) {
|
|
|
// for (Map<String, Object> map : resultList) {
|
|
|
// if (index.equals(GROUP)) {
|
|
|
// String code = String.valueOf(map.get("code"));
|
|
|
// if ((long) map.get("amount") > 0 && (code.equals("1") || code.equals("2") || code.equals("3"))) {
|
|
|
// map.put("rate", df.format(Double.valueOf((String) map.get("rate")) + (1 - rateTotal)));
|
|
|
// break;
|
|
|
// }
|
|
|
// }else{
|
|
|
// if ((long) map.get("amount") > 0) {
|
|
|
// map.put("rate", df.format(Double.valueOf((String) map.get("rate")) + (1 - rateTotal)));
|
|
|
// break;
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
}
|
|
|
if (index.equals(SEX) && resultList.size() > 0) {
|
|
|
int i = 0;
|
|
@ -1844,19 +1868,19 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
json.put("taskNum",taskNum);
|
|
|
json.put("taskNum", taskNum);
|
|
|
|
|
|
if (interval == 1) {
|
|
|
JSONArray jsonArray = dateTotalStatistics(startDate, endDate, area, level, index);
|
|
|
json.put("data",jsonArray);
|
|
|
json.put("data", jsonArray);
|
|
|
return json;
|
|
|
} else if (interval == 2) {
|
|
|
JSONArray jsonArray = weekTotalStatistics(startDate, endDate, area, level, index);
|
|
|
json.put("data",jsonArray);
|
|
|
json.put("data", jsonArray);
|
|
|
return json;
|
|
|
} else if(interval == 3){
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray jsonArray = monthTotalStatistics(startDate, endDate, area, level, index);
|
|
|
json.put("data",jsonArray);
|
|
|
json.put("data", jsonArray);
|
|
|
return json;
|
|
|
}
|
|
|
|
|
@ -1871,7 +1895,7 @@ public class StatisticsService extends BaseService {
|
|
|
* @param index
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray dateTotalStatistics(String startDate, String endDate, String area, int level, String index) {
|
|
|
public JSONArray dateTotalStatistics(String startDate, String endDate, String area, int level, String index) {
|
|
|
String areaField = "";
|
|
|
String sql = "";
|
|
|
|
|
@ -2106,9 +2130,9 @@ public class StatisticsService extends BaseService {
|
|
|
String range = map.get("range").toString();
|
|
|
JSONObject json = countResult.get(range);
|
|
|
|
|
|
if(json != null) {
|
|
|
if (json != null) {
|
|
|
long amount = map.get("amount") == null ? 0L : Long.valueOf(map.get("amount").toString());
|
|
|
json.put("amount",amount);
|
|
|
json.put("amount", amount);
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -2261,9 +2285,9 @@ public class StatisticsService extends BaseService {
|
|
|
String range = map.get("range").toString();
|
|
|
JSONObject json = countResult.get(range);
|
|
|
|
|
|
if(json != null) {
|
|
|
if (json != null) {
|
|
|
long amount = map.get("amount") == null ? 0L : Long.valueOf(map.get("amount").toString());
|
|
|
json.put("amount",amount);
|
|
|
json.put("amount", amount);
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -2289,4 +2313,5 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|