多单位版国产化地质资料管理系统
zs
2026-02-04 fe02f176b512a9d6a4e12437d929e04e99bb7567
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
package com.zbooksoft.gdmis.controller;
 
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruili.wcp.common.JSONUtil;
import com.ruili.wcp.data.entity.config.DesktopLayout;
import com.ruili.wcp.data.vo.config.DesktopLayoutVO;
import com.ruili.wcp.service.config.DesktopLayoutService;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
 
import java.sql.Array;
import java.util.*;
 
 
/**
 * @Description: 借阅
 * @Author: zhai
 * @Date: 2024/8/28
 **/
 
@Controller
@RequestMapping("/screen")
public class ScreenController {
    @Autowired
    DesktopLayoutService desktopLayoutService;
 
    private static final Logger logger = LoggerFactory.getLogger(ScreenController.class);
    @Autowired
    private JdbcTemplate jdbcTemplate;
 
 
    @RequestMapping
    @RequiresUser
    public ModelAndView index(Long layoutId) {
        ModelAndView mav = new ModelAndView("/gh/screen/desktop");
        DesktopLayout layout = this.desktopLayoutService.getById(layoutId);
 
        List<DesktopLayoutVO> rowList = JSONUtil.string2Obj(layout.getRowLayout(), ArrayList.class, new Class[]{DesktopLayoutVO.class});
        mav.addObject("layout", layout);
        mav.addObject("rowList", rowList);
        return mav;
    }
 
    // 获取条件搜索的饼状图数据
    @RequestMapping("/getSearchConditionEchartsPie")
    @ResponseBody
    public Object getSearchConditionEchartsPie() {
        JSONArray sourceList = new JSONArray();
        HashMap<String, Object> map = new HashMap<>();
        map.put("name", "原始资料");
        map.put("value", 120);
        sourceList.add(map);
 
        HashMap<String, Object> map1 = new HashMap<>();
        map1.put("name", "成果资料");
        map1.put("value", 40);
        sourceList.add(map1);
 
        HashMap<String, Object> map2 = new HashMap<>();
        map2.put("name", "实物资料");
        map2.put("value", 70);
        sourceList.add(map2);
 
        return sourceList;
 
    }
 
 
    // 获取条件搜索的饼状图数据
    @RequestMapping("/getBorrowEchartsPie")
    @ResponseBody
    public Object getBorrowEchartsPie() {
        HashMap<String, Object> result = new HashMap<>();
 
        // 纸质借阅数据
        JSONArray paperList = new JSONArray();
        paperList.add(createDataMap("非密", 100));
        paperList.add(createDataMap("内部", 80));
        paperList.add(createDataMap("秘密", 60));
        paperList.add(createDataMap("机密", 40));
 
        // 电子借阅数据
        JSONArray electronicList = new JSONArray();
        electronicList.add(createDataMap("非密", 40));
        electronicList.add(createDataMap("内部", 120));
        electronicList.add(createDataMap("秘密", 70));
        electronicList.add(createDataMap("机密", 50));
 
        result.put("paperData", paperList);
        result.put("electronicData", electronicList);
 
        return result;
    }
 
    private HashMap<String, Object> createDataMap(String name, int value) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("name", name);
        map.put("value", value);
        return map;
    }
 
 
    // 获取条件搜索的柱状图数据
    @RequestMapping("/getSearchConditionEchartsHistogram")
    @ResponseBody
    public Object getSearchConditionEchartsHistogram(String columnName) {
        String Sql="select "+columnName+",count("+columnName+") as num FROM cat_item_yswjxx where "+columnName+" is not null group by "+columnName;
        List<Map<String,Object>> list=jdbcTemplate.queryForList(Sql);
        List<String> xAxisData = new ArrayList<String>();
        List<Object> yList = new ArrayList<Object>();
        for (Map<String,Object> map:list){
            xAxisData.add(map.get(columnName).toString());
            yList.add(map.get("num"));
        }
        List<JSONObject> seriesList = new ArrayList<JSONObject>();
        JSONObject job = new JSONObject();
        job.put("name", "档案数量");
        job.put("type", "bar");
        job.put("data", yList);
        seriesList.add(job);
 
        JSONObject json = new JSONObject();
        json.put("xAxisData", xAxisData);
        json.put("seriesList", seriesList);
        return json;
    }
 
 
    // 获取条件搜索的柱状图数据
    @RequestMapping("/getSearchCondition")
    @ResponseBody
    public Object getSearchCondition() {
        List<String> xAxisData = new ArrayList<String>();
        xAxisData.add("一月");
        xAxisData.add("二月");
        xAxisData.add("三月");
        xAxisData.add("四月");
        xAxisData.add("五月");
        xAxisData.add("六月");
        xAxisData.add("七月");
        xAxisData.add("八月");
        xAxisData.add("九月");
        xAxisData.add("十月");
        xAxisData.add("十一月");
        xAxisData.add("十二月");
        List<JSONObject> seriesList = new ArrayList<JSONObject>();
        List<Object> yList = new ArrayList<Object>();
        yList.add(10);
        yList.add(20);
        yList.add(80);
        yList.add(0);
        yList.add(30);
        yList.add(15);
        yList.add(10);
        yList.add(40);
        yList.add(50);
        yList.add(60);
        yList.add(100);
        yList.add(60);
 
        JSONObject job = new JSONObject();
        job.put("name", "档案数量");
        job.put("type", "line");
        job.put("data", yList);
        job.put("smooth", true);
        seriesList.add(job);
 
        JSONObject json = new JSONObject();
        json.put("xAxisData", xAxisData);
        json.put("seriesList", seriesList);
        return json;
    }
 
 
    // 获取条件搜索的柱状图数据
    @RequestMapping("/getSearchConditionByDeptName")
    @ResponseBody
    public Object getSearchConditionByDeptName() {
        List<String> xAxisData = new ArrayList<String>();
        xAxisData.add("地质资料馆");
 
        List<JSONObject> seriesList = new ArrayList<JSONObject>();
        List<Object> yList = new ArrayList<Object>();
        yList.add(45);
 
        JSONObject job = new JSONObject();
        job.put("name", "档案数量");
        job.put("type", "bar");
        job.put("data", yList);
        seriesList.add(job);
 
        JSONObject json = new JSONObject();
        json.put("xAxisData", xAxisData);
        json.put("seriesList", seriesList);
        return json;
    }
 
    // 获取条件搜索的柱状图数据
    @RequestMapping("/getBorrowConditionByDeptName")
    @ResponseBody
    public Object getBorrowConditionByDeptName() {
        List<String> xAxisData = new ArrayList<String>();
        xAxisData.add("杭州子书科技");
        xAxisData.add("测试部门");
        xAxisData.add("档案部门");
 
        List<JSONObject> seriesList = new ArrayList<JSONObject>();
        List<Object> yList = new ArrayList<Object>();
        yList.add(45);
 
        JSONObject job = new JSONObject();
        job.put("name", "原始");
        job.put("type", "bar");
        int[] data = {150, 120, 180};
        job.put("data", data);
        seriesList.add(job);
 
        JSONObject job1 = new JSONObject();
        job1.put("name", "成果");
        job1.put("type", "bar");
        int[] data1 = {200, 250, 180};
        job1.put("data", data1);
        seriesList.add(job1);
 
        JSONObject job2 = new JSONObject();
        job2.put("name", "实物");
        job2.put("type", "bar");
        int[] data2 = {200, 250, 180};
        job2.put("data", data2);
        seriesList.add(job2);
 
        JSONObject json = new JSONObject();
        json.put("xAxisData", xAxisData);
        json.put("seriesList", seriesList);
        return json;
    }
 
}