Compare commits
No commits in common. "a4685cbf50ca3d41428cc2f21c6d9df857b97c8d" and "0d8fa5efb190a258ff982746ac40134a5b5c7be6" have entirely different histories.
a4685cbf50
...
0d8fa5efb1
@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.infra.clients;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -10,11 +9,5 @@ import java.util.Map;
|
||||
@FeignClient("datacenter-server")
|
||||
public interface LargeScreenClient {
|
||||
@GetMapping("/api/asset/type")
|
||||
Object assetMethod1();
|
||||
|
||||
@GetMapping("/api/saledata")
|
||||
Object saleDataTotal(@RequestParam("starTime") String starTime, @RequestParam("endTime") String endTime);
|
||||
|
||||
@GetMapping("/api/checkticket")
|
||||
Object checkTicketTotal(@RequestParam("starTime") String starTime, @RequestParam("endTime") String endTime);
|
||||
List<Object> assetMethod1();
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.ticketing;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.date.TickingDateUtils;
|
||||
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
|
||||
import cn.iocoder.yudao.module.infra.clients.LargeScreenClient;
|
||||
import cn.iocoder.yudao.module.infra.job.ticketing.TicketDataMigration;
|
||||
import cn.iocoder.yudao.module.infra.service.checkticket.CheckTicketService;
|
||||
import cn.iocoder.yudao.module.infra.service.saledata.SaleDataService;
|
||||
@ -12,10 +10,9 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 测试抽数接口
|
||||
@ -34,12 +31,6 @@ public class TicketingController {
|
||||
@Resource
|
||||
SaleDataService saleDataService;
|
||||
|
||||
@Resource
|
||||
private WebSocketSenderApi webSocketSenderApi;
|
||||
|
||||
@Resource
|
||||
private LargeScreenClient largeScreenClient;
|
||||
|
||||
@GetMapping
|
||||
public CommonResult<String> testTicketing(@RequestParam("startDate") String startDate, @RequestParam("endDate")String endDate, @RequestParam("method") String method) throws Exception {
|
||||
Calendar startCalendar = Calendar.getInstance();
|
||||
@ -48,29 +39,10 @@ public class TicketingController {
|
||||
endCalendar.setTime(TickingDateUtils.parse(endDate));
|
||||
return CommonResult.success(ticketDataMigration.getTicketDataByTimeZonesToMongo(startCalendar, endCalendar, method));
|
||||
}
|
||||
@GetMapping("/test1")
|
||||
@GetMapping("/test")
|
||||
public CommonResult<List<String>> testAll(){
|
||||
return CommonResult.success(checkTicketService.deleteTwoYearLastMonthAgo());
|
||||
}
|
||||
|
||||
private void methodUtils(Map<String, Object> map, String name, Object list){
|
||||
map.put(name,list);
|
||||
}
|
||||
private String methodDataUtils(){
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
return now.format(formatter);
|
||||
}
|
||||
@GetMapping("/test")
|
||||
public void test(){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String dataUtils = this.methodDataUtils();
|
||||
this.methodUtils(map, "assetCount", largeScreenClient.assetMethod1());
|
||||
this.methodUtils(map,"saleDataTotal",largeScreenClient.saleDataTotal(dataUtils,dataUtils));
|
||||
this.methodUtils(map,"checkTicketTotal",largeScreenClient.checkTicketTotal(dataUtils,dataUtils));
|
||||
webSocketSenderApi.sendObject(2,1L,"1",map);
|
||||
}
|
||||
|
||||
@GetMapping("/testa")
|
||||
public CommonResult<List<String>> testAlla(){
|
||||
return CommonResult.success(saleDataService.deleteTwoYearLastMonthAgo());
|
||||
|
@ -7,9 +7,6 @@ import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -22,25 +19,10 @@ public class LargeScreenHeartbeat {
|
||||
@Resource
|
||||
private LargeScreenClient largeScreenClient;
|
||||
|
||||
|
||||
private void methodUtils(Map<String, Object> map, String name, Object list){
|
||||
map.put(name,list);
|
||||
}
|
||||
|
||||
private String methodDataUtils(){
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
return now.format(formatter);
|
||||
}
|
||||
|
||||
@XxlJob("largeScreen")
|
||||
public void largeScreenToWebSocket(){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String dataUtils = this.methodDataUtils();
|
||||
this.methodUtils(map, "assetCount", largeScreenClient.assetMethod1());
|
||||
this.methodUtils(map,"saleDataTotal",largeScreenClient.saleDataTotal(dataUtils,dataUtils));
|
||||
this.methodUtils(map,"checkTicketTotal",largeScreenClient.checkTicketTotal(dataUtils,dataUtils));
|
||||
webSocketSenderApi.sendObject(2,1L,"1",map);
|
||||
List<Object> maps = largeScreenClient.assetMethod1();
|
||||
webSocketSenderApi.sendObject(1,"1",maps);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user