You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.6 KiB
112 lines
3.6 KiB
package com.example.demo.controller;
|
|
|
|
|
|
import com.example.demo.domain.vo.*;
|
|
import com.example.demo.mapper.StatisticsMapper;
|
|
import com.example.demo.serviceImpl.StatisticsServiceImpl;
|
|
import com.example.demo.serviceImpl.UserServiceImpl;
|
|
import com.example.demo.sevice.StatisticsService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
@RestController
|
|
@RequestMapping("/statistics")
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@CrossOrigin
|
|
public class StatisticsController {
|
|
@Autowired
|
|
private final StatisticsService statisticsService;
|
|
@Autowired
|
|
UserServiceImpl userService;
|
|
@Autowired
|
|
private StatisticsMapper statisticsMapper;
|
|
@Autowired
|
|
private StatisticsServiceImpl statisticsServiceImpl;
|
|
|
|
|
|
@PostMapping("/a")
|
|
public Result count() {
|
|
Statistics statistics = statisticsService.getStatistics();
|
|
return Result.success(statistics);
|
|
}
|
|
@PostMapping("/b")
|
|
public Result select() {
|
|
return Result.success(statisticsService.stats());
|
|
}
|
|
//--------------------------------------------------------------------------------------//
|
|
@PostMapping("/getSumCoin")
|
|
public Result getSumCoin(){
|
|
|
|
return Result.success(statisticsService.getSumCoin());
|
|
}
|
|
|
|
@PostMapping("/getYearConsumeCoin")
|
|
public Result getYearConsumeCoin(){
|
|
return Result.success(statisticsService.getYearConsumeCoin());
|
|
}
|
|
@PostMapping("/getDayConsumeCoin")
|
|
public Result getDayConsumeCoin(){
|
|
return Result.success(statisticsService.getDayConsumeCoin());
|
|
}
|
|
|
|
@PostMapping("/getMediuPayCoin")
|
|
public Result getMediuPayCoin(){
|
|
return Result.success(statisticsService.getMediuPayCoin());
|
|
}
|
|
|
|
@PostMapping("/getMediuConsumeCoin")
|
|
public Result getMediuConsumeCoin(){
|
|
return Result.success(statisticsService.getMediuConsumeCoin());
|
|
}
|
|
|
|
@PostMapping("/getMess/{jwcode}")
|
|
public Result getMess(@PathVariable("jwcode") Integer jwcode){
|
|
try {
|
|
UserVo userVo=new UserVo();
|
|
userVo.setJwcode(jwcode.toString());
|
|
userService.search(userVo);
|
|
return Result.success(statisticsService.getMess(jwcode));
|
|
}catch (Exception e){
|
|
log.error(Arrays.toString(e.getStackTrace()));
|
|
return Result.error(e.getMessage());
|
|
}
|
|
}
|
|
|
|
@PostMapping("/getMediumAreaPay")
|
|
public Result getMediumAreaPay(){
|
|
return Result.success(statisticsService.getMediumAreaPay());
|
|
}
|
|
@PostMapping("/getMediumAreaConsume")
|
|
public Result getMediumAreaConsume(){
|
|
return Result.success(statisticsService.getMediumAreaConsume());
|
|
}
|
|
|
|
|
|
//中间右侧:支付消费--部门--金币类型--时间
|
|
@PostMapping("/getMee")
|
|
public Result getMee(@RequestBody Meium meium){
|
|
return Result.success(statisticsService.getMee(meium));
|
|
}
|
|
@PostMapping("/getMediu")
|
|
public Result getMediu(){
|
|
return Result.success(statisticsService.getMediu());
|
|
}
|
|
|
|
@PostMapping("/getMediuConsumeCoin2")
|
|
public Result getMediuConsumeCoin2(@RequestBody SumCoin sumCoin){
|
|
System.out.println(sumCoin.getSearchStartTime()+" -------------searchStartTime----");
|
|
return Result.success(statisticsMapper.getMediuConsumeCoin2(sumCoin));
|
|
}
|
|
@PostMapping("/getCoinTime")
|
|
public Result getCoinTime(@RequestBody SumCoin sumcoin){
|
|
System.out.println(sumcoin.getSearchStartTime()+" -------------searchStartTime----");
|
|
return Result.success(statisticsServiceImpl.getCoinTime(sumcoin));
|
|
}
|
|
|
|
}
|