3 changed files with 71 additions and 0 deletions
@ -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; |
||||
|
} |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
@ -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…
Reference in new issue