|
@@ -7,13 +7,16 @@ import com.ruoyi.common.redis.service.RedisService;
|
|
import com.sooka.sponest.event.index.domin.Index;
|
|
import com.sooka.sponest.event.index.domin.Index;
|
|
import com.sooka.sponest.event.index.service.ICenterevenTEventIndexService;
|
|
import com.sooka.sponest.event.index.service.ICenterevenTEventIndexService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Api(tags = "首页事件统计")
|
|
@Api(tags = "首页事件统计")
|
|
@RestController
|
|
@RestController
|
|
@@ -23,6 +26,15 @@ public class IndexController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private ICenterevenTEventIndexService centerevenTEventIndexService;
|
|
private ICenterevenTEventIndexService centerevenTEventIndexService;
|
|
|
|
|
|
|
|
+ static final String QR = "qr";
|
|
|
|
+ static final String QS = "qs";
|
|
|
|
+ static final String BJ = "bj";
|
|
|
|
+ static final String GD = "gd";
|
|
|
|
+ static final String BJ_GD = "bjgd";
|
|
|
|
+ static final String BJ_GD_RATE = "bjgdRate";
|
|
|
|
+ static final String TODAY_BJ_GD = "todaybjgd";
|
|
|
|
+ static final String TODAY_BJ_GD_RATE = "todaybjgdRate";
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 县区统计
|
|
* 县区统计
|
|
*/
|
|
*/
|
|
@@ -47,6 +59,191 @@ public class IndexController extends BaseController {
|
|
*/
|
|
*/
|
|
@GetMapping("/eventReport")
|
|
@GetMapping("/eventReport")
|
|
public R eventReport(@RequestParam(value = "timeArr", required = false) List<String> timeArr) {
|
|
public R eventReport(@RequestParam(value = "timeArr", required = false) List<String> timeArr) {
|
|
- return R.ok(centerevenTEventIndexService.selectStgz(timeArr));
|
|
|
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
+ Long countqr = 0L;
|
|
|
|
+ Long countcl = 0L;
|
|
|
|
+ Long countbj = 0L;
|
|
|
|
+ Long countgd = 0L;
|
|
|
|
+ // (一)
|
|
|
|
+ List<Map<String, Object>> list = centerevenTEventIndexService.selectdistrictAndCountyStatistics(timeArr);
|
|
|
|
+ for (Map<String, Object> map : list) {
|
|
|
|
+ Long qr = MapUtils.getLong(map, QR);
|
|
|
|
+ Long qs = MapUtils.getLong(map, QS);
|
|
|
|
+ Long bj = MapUtils.getLong(map, BJ);
|
|
|
|
+ Long gd = MapUtils.getLong(map, GD);
|
|
|
|
+ String bjgdRate = MapUtils.getString(map, BJ_GD_RATE);
|
|
|
|
+ Long todaybjgd = MapUtils.getLong(map, TODAY_BJ_GD);
|
|
|
|
+ String todaybjgdRate = MapUtils.getString(map, TODAY_BJ_GD_RATE);
|
|
|
|
+ countqr += qr;
|
|
|
|
+ countcl += qs;
|
|
|
|
+ countbj += bj;
|
|
|
|
+ countgd += gd;
|
|
|
|
+ if ("梨树县".equals(map.get("name"))) {
|
|
|
|
+ resultMap.put("count", qr + qs + bj + gd);
|
|
|
|
+ resultMap.put(QR, qr);
|
|
|
|
+ resultMap.put(QS, qs);
|
|
|
|
+ resultMap.put(BJ, bj);
|
|
|
|
+ resultMap.put(GD, gd);
|
|
|
|
+ resultMap.put("bjgd", bj + gd);
|
|
|
|
+ resultMap.put("bjgdRate", bjgdRate);
|
|
|
|
+ resultMap.put("today_bjgd", todaybjgd);
|
|
|
|
+ resultMap.put("today_bjgdRate", todaybjgdRate);
|
|
|
|
+ } else if ("伊通县".equals(map.get("name"))) {
|
|
|
|
+ resultMap.put("count1", qr + qs + bj + gd);
|
|
|
|
+ resultMap.put("qr1", qr);
|
|
|
|
+ resultMap.put("qs1", qs);
|
|
|
|
+ resultMap.put("bj1", bj);
|
|
|
|
+ resultMap.put("gd1", gd);
|
|
|
|
+ resultMap.put("bjgd1", bj + gd);
|
|
|
|
+ resultMap.put("bjgdRate1", bjgdRate);
|
|
|
|
+ resultMap.put("today_bjgd1", todaybjgd);
|
|
|
|
+ resultMap.put("today_bjgdRate1", todaybjgdRate);
|
|
|
|
+ } else if ("双辽市".equals(map.get("name"))) {
|
|
|
|
+ resultMap.put("count2", qr + qs + bj + gd);
|
|
|
|
+ resultMap.put("qr2", qr);
|
|
|
|
+ resultMap.put("qs2", qs);
|
|
|
|
+ resultMap.put("bj2", bj);
|
|
|
|
+ resultMap.put("gd2", gd);
|
|
|
|
+ resultMap.put("bjgd2", bj + gd);
|
|
|
|
+ resultMap.put("bjgdRate2", bjgdRate);
|
|
|
|
+ resultMap.put("today_bjgd2", todaybjgd);
|
|
|
|
+ resultMap.put("today_bjgdRate2", todaybjgdRate);
|
|
|
|
+ } else if ("铁东区".equals(map.get("name"))) {
|
|
|
|
+ resultMap.put("count3", qr + qs + bj + gd);
|
|
|
|
+ resultMap.put("qr3", qr);
|
|
|
|
+ resultMap.put("qs3", qs);
|
|
|
|
+ resultMap.put("bj3", bj);
|
|
|
|
+ resultMap.put("gd3", gd);
|
|
|
|
+ resultMap.put("bjgd3", bj + gd);
|
|
|
|
+ resultMap.put("bjgdRate3", bjgdRate);
|
|
|
|
+ resultMap.put("today_bjgd3", todaybjgd);
|
|
|
|
+ resultMap.put("today_bjgdRate3", todaybjgdRate);
|
|
|
|
+ } else if ("铁西区".equals(map.get("name"))) {
|
|
|
|
+ resultMap.put("count4", qr + qs + bj + gd);
|
|
|
|
+ resultMap.put("qr4", qr);
|
|
|
|
+ resultMap.put("qs4", qs);
|
|
|
|
+ resultMap.put("bj4", bj);
|
|
|
|
+ resultMap.put("gd4", gd);
|
|
|
|
+ resultMap.put("bjgd4", bj + gd);
|
|
|
|
+ resultMap.put("bjgdRate4", bjgdRate);
|
|
|
|
+ resultMap.put("today_bjgd4", todaybjgd);
|
|
|
|
+ resultMap.put("today_bjgdRate4", todaybjgdRate);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 五
|
|
|
|
+ resultMap.put("num", countqr + countcl + countbj + countgd);
|
|
|
|
+ resultMap.put("countqr", countqr);
|
|
|
|
+ resultMap.put("countcl", countcl);
|
|
|
|
+ resultMap.put("countbj", countbj);
|
|
|
|
+ resultMap.put("countgd", countgd);
|
|
|
|
+ // (二)
|
|
|
|
+ list = centerevenTEventIndexService.selectCentereventTEventmapdeptList(timeArr);
|
|
|
|
+ for (Map<String, Object> map : list) {
|
|
|
|
+ Long total = MapUtils.getLong(map, "total");
|
|
|
|
+ switch (MapUtils.getString(map, "dept_id")) {
|
|
|
|
+ case "367":
|
|
|
|
+ resultMap.put("ly", total);
|
|
|
|
+ resultMap.put("lyqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("lyqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("lybjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("lybjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_lybjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_lybjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "3776":
|
|
|
|
+ resultMap.put("ny", total);
|
|
|
|
+ resultMap.put("nyqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("nyqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("nybjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("nybjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_nybjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_nybjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "3778":
|
|
|
|
+ resultMap.put("sl", total);
|
|
|
|
+ resultMap.put("slqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("slqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("slbjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("slbjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_slbjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_slbjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "3773":
|
|
|
|
+ resultMap.put("hb", total);
|
|
|
|
+ resultMap.put("hbqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("hbqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("hbbjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("hbbjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_hbbjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_hbbjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "3774":
|
|
|
|
+ resultMap.put("yj", total);
|
|
|
|
+ resultMap.put("yjqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("yjqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("yjbjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("yjbjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_yjbjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_yjbjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "3775":
|
|
|
|
+ resultMap.put("jt", total);
|
|
|
|
+ resultMap.put("jtqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("jtqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("jtbjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("jtbjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_jtbjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_jtbjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "3772":
|
|
|
|
+ resultMap.put("zy", total);
|
|
|
|
+ resultMap.put("zyqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("zyqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("zybjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("zybjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_zybjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_zybjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "3777":
|
|
|
|
+ resultMap.put("xf", total);
|
|
|
|
+ resultMap.put("xfqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("xfqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("xfbjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("xfbjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_xfbjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_xfbjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "14449":
|
|
|
|
+ resultMap.put("sz", total);
|
|
|
|
+ resultMap.put("szqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("szqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("szbjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("szbjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_szbjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_szbjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "14450":
|
|
|
|
+ resultMap.put("ga", total);
|
|
|
|
+ resultMap.put("gaqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("gaqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("gabjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("gabjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_gabjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_gabjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ case "14451":
|
|
|
|
+ resultMap.put("fg", total);
|
|
|
|
+ resultMap.put("fgqr", MapUtils.getLong(map, QR));
|
|
|
|
+ resultMap.put("fgqs", MapUtils.getLong(map, QS));
|
|
|
|
+ resultMap.put("fgbjgd", MapUtils.getLong(map, BJ_GD));
|
|
|
|
+ resultMap.put("fgbjgdRate", MapUtils.getString(map, BJ_GD_RATE));
|
|
|
|
+ resultMap.put("today_fgbjgd", MapUtils.getLong(map, TODAY_BJ_GD));
|
|
|
|
+ resultMap.put("today_fgbjgdRate", MapUtils.getString(map, TODAY_BJ_GD_RATE));
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return R.ok(resultMap);
|
|
}
|
|
}
|
|
}
|
|
}
|