Browse Source

首页统计信息

master
xyiege 4 years ago
parent
commit
ab18c5860f
  1. 42
      src/main/java/cn/chjyj/szwh/controller/admin/AdminIndexController.java
  2. 15
      src/main/java/cn/chjyj/szwh/service/IndexService.java
  3. 14
      src/main/java/cn/chjyj/szwh/service/impl/IndexServiceImpl.java

42
src/main/java/cn/chjyj/szwh/controller/admin/AdminIndexController.java

@ -0,0 +1,42 @@
package cn.chjyj.szwh.controller.admin;
import cn.chjyj.szwh.controller.BaseController;
import cn.chjyj.szwh.service.IndexService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
/**
* 首页各种统计信息
*/
@RestController
@RequestMapping("/admin/index")
public class AdminIndexController extends BaseController {
@Autowired
private IndexService indexService;
@PostMapping("/home")
public JSONObject home(@RequestParam("leftDate") String leftDate,
@RequestParam("rightDate") String rightDate,
@RequestParam("sale_ranking")String saleRanking,
@RequestParam("saleRankingDate")String saleRankingDate){
// 拼装查询条件
Map<String,Object> queryMap = new HashMap<>();
queryMap.put("leftDate",leftDate);
queryMap.put("rightDate",rightDate);
queryMap.put("sale_ranking",saleRanking);
queryMap.put("saleRankingDate",saleRankingDate);
// 执行查询操作
Map result =indexService.getCountSys(queryMap);
// 拼装结果
jsonObject.put("code",200);
jsonObject.put("data",result);
return jsonObject;
}
}

15
src/main/java/cn/chjyj/szwh/service/IndexService.java

@ -0,0 +1,15 @@
package cn.chjyj.szwh.service;
import java.util.Map;
/**
* 首页统计各种数据
*/
public interface IndexService {
/**
* 统计系统中的相关数据
* @param map 统计查询条件
* @return
*/
Map<String,Object> getCountSys(Map<String,Object> map);
}

14
src/main/java/cn/chjyj/szwh/service/impl/IndexServiceImpl.java

@ -0,0 +1,14 @@
package cn.chjyj.szwh.service.impl;
import cn.chjyj.szwh.service.IndexService;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service
public class IndexServiceImpl implements IndexService {
@Override
public Map<String, Object> getCountSys(Map<String, Object> map) {
return null;
}
}
Loading…
Cancel
Save