2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package com.landtool.lanbase.modules.api.controller.MapPortal;
 
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.landtool.lanbase.modules.api.utils.PageBean;
import com.landtool.lanbase.modules.res.entity.Res_BusinessRef;
import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate;
import com.landtool.lanbase.modules.res.entity.Res_MainInfo;
import com.landtool.lanbase.modules.res.service.ResBusinessRefService;
import com.landtool.lanbase.modules.res.service.ResExtBusinessLayerService;
import com.landtool.lanbase.modules.res.service.ResExtIntegrateService;
import com.landtool.lanbase.modules.res.service.ResExtMapUrlService;
import com.landtool.lanbase.modules.res.service.ResMainInfoService;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
 
@Controller
@RequestMapping("api")
@Api(value = "", tags = {"气泡关联分析"})
/**
 * 气泡——关联分析
 */ public class GuanLianFenXiController {
    
    @Autowired
    private ResBusinessRefService resBusinessRefService;
    
    @Autowired
    private ResMainInfoService resMainInfoService;
    
    @Autowired
    private ResExtBusinessLayerService resExtBusinessLayerService;
    
    @Autowired
    private ResExtMapUrlService resExtMapUrlService;
 
    @Autowired
    private ResExtIntegrateService resExtIntegrateService;
 
    /**
     * 获取相关关联图层列表
     * @param resBusinessRef
     * @return
     */
    @GetMapping("map/getResBusinessRefList")
    @ResponseBody
    @ApiOperation(value = "获取相关关联图层列表", notes = "")
    public String getResBusinessRefList(Res_BusinessRef resBusinessRef, PageBean pageBean) {
        pageBean.setLimit(10);
        PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());//设置当前页数及每页条数
        List<Res_BusinessRef> list = resBusinessRefService.getResBusinesssRefList(resBusinessRef);
        int countNums = (int) ((Page) list).getTotal();//获取记录总数
        PageBean<Res_BusinessRef> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums);
        pageData.setItems(list);
        List<Map<String, Object>> maps = new LinkedList<>();
        for (Integer i = 0; i < list.size(); i++) {
            Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(list.get(i).getRefresourceid());
            Res_BusinessRef resBusinessRef1 = resBusinessRefService.selectByPrimaryKey(list.get(i).getResourceid());
            Res_ExtIntegrate resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(list.get(i).getRefresourceid());
            Map<String, Object> map = new HashMap<>();
            map.put("title", resMainInfo.getTitle());
            map.put("resourceid", resMainInfo.getResourceid());
            map.put("resourceclass", resMainInfo.getResourceclass());
            map.put("createuserid", resMainInfo.getCreateuserid());
            if (resBusinessRef1 != null) {
                map.put("inputparam", resBusinessRef1.getInputparam());
                map.put("outputparam", resBusinessRef1.getOutputparam());
                map.put("reftype", resBusinessRef1.getReftype());
            } else {
                map.put("inputparam", "");
                map.put("outputparam", "");
                map.put("reftype", "");
            }
            if (resExtIntegrate != null) {
                map.put("serverurl", resExtIntegrate.getServerurl());
                map.put("showmodel", resExtIntegrate.getShowmodel());
            } else {
                map.put("serverurl", "");
                map.put("showmodel", "");
            }
            map.put("datasources", resMainInfo.getDatasources());
            maps.add(map);
        }
        Map<String, Object> result = new HashMap<>();
        result.put("Count", countNums);
        result.put("Page", pageBean.getPage());
        result.put("ShuJu", maps);
        
        return JSON.toJSONString(result, SerializerFeature.WriteMapNullValue);
    }
}