44323
2023-11-24 ae9bfd2d66f68a553786ac78b12f4390e65e4e09
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/GateDataController.java
@@ -22,9 +22,11 @@
import com.dsh.guns.modular.system.model.*;
import com.dsh.guns.modular.system.service.ICityService;
import com.dsh.guns.modular.system.service.IRegionService;
import com.dsh.guns.modular.system.service.TOperatorService;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import com.google.maps.internal.ApiResponse;
import groovyjarjarpicocli.CommandLine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -52,12 +54,15 @@
    @Autowired
    private SiteClient siteClient;
    private String PREFIX = "/system/gateData/";
    @Autowired
    private TOperatorService operatorService;
    /**
     * 跳转到充值记录页面
     */
    @RequestMapping("")
    public String index(Model model) {
        List<TOperator> list = operatorService.list(new QueryWrapper<TOperator>().ne("state", 3));
        model.addAttribute("list",list);
        return PREFIX + "GateData.html";
    }
    /**
@@ -65,9 +70,10 @@
     */
    @RequestMapping("/list")
    @ResponseBody
    public Object list() {
    public Object list(Integer storeId) {
        try {
                String apiUrl = "https://try.daowepark.com/v7/user_api/general/spaceDoorData?space_id=1001";
            if (storeId!=null){
                String apiUrl = "https://try.daowepark.com/v7/user_api/general/spaceDoorData?space_id="+storeId;
                URL url = new URL(apiUrl);
                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                connection.setRequestMethod("GET");
@@ -102,6 +108,8 @@
                } else {
                    System.out.println("请求失败: " + responseCode);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
@@ -112,9 +120,9 @@
     */
    @RequestMapping("/totalNum")
    @ResponseBody
    public Object totalNum() {
    public Object totalNum(Integer storeId) {
        try {
            String apiUrl = "https://try.daowepark.com/v7/user_api/general/spaceDoorData?space_id=1001";
            String apiUrl = "https://try.daowepark.com/v7/user_api/general/spaceDoorData?space_id="+storeId;
            URL url = new URL(apiUrl);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");