shichongfu
2023-04-25 ce0b49552668d3331055e2b1a1447a743dc54939
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
package com.product.admin.controller;
 
import com.product.admin.config.CmnConst;
import com.product.admin.config.SystemCode;
import com.product.admin.service.CodeService;
import com.product.admin.service.FunctionsService;
import com.product.admin.service.idel.IFunctionService;
import com.product.admin.util.ResultInfo;
import com.product.common.lang.StringUtils;
import com.product.core.config.CoreConst;
import com.product.core.controller.support.AbstractBaseController;
import com.product.core.entity.DataTableEntity;
import com.product.core.entity.FieldSetEntity;
import com.product.core.entity.RequestParameterEntity;
import com.product.core.exception.BaseException;
import com.product.core.permission.PermissionService;
import com.product.core.spring.context.SpringMVCContextHolder;
import com.product.module.sys.config.SystemErrorCode;
import com.product.module.sys.version.ApiVersion;
import com.product.util.BaseUtil;
import com.product.util.SavePage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
import javax.swing.*;
import java.util.Date;
import java.util.Map;
 
/**
 * Copyright  LX-BASE
 *
 * @Title: FunctionsController
 * @Project: LX-BASE-SERVER
 * @Date: 2020-06-03 11:47
 * @Author: ZhouJie
 * @Description: 功能管理
 */
@RequestMapping("/api/functions")
@RestController
public class FunctionsController extends AbstractBaseController {
 
    @Autowired
    private FunctionsService functionsService;
    @Autowired
    CodeService codeService;
    /**
     * 数据权限验证
     */
    @Autowired
    PermissionService permissionService;
 
    /**
     * 产品模块树
     *
     * @return
     * @auth cheng
     */
    @PostMapping("/product-module/{version}")
    @ApiVersion(1)
    public String getProductModuleTree() {
        try {
            return OK_List(functionsService.getProductModuleTree());
        } catch (BaseException e) {
            e.printStackTrace();
            return error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return error(new BaseException(e));
        }
    }
 
    /**
     * 根据模块查询功能
     *
     * @return
     * @auth cheng
     */
    @PostMapping("/get-function-by-module/{version}")
    @ApiVersion(1)
    public String getFunctionByModule(HttpServletRequest request) {
        try {
            return OK_List(functionsService.getFunctionByModule(BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_SYS_FUNCTIONS)));
        } catch (BaseException e) {
            e.printStackTrace();
            return error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return error(new BaseException(e));
        }
    }
 
 
    @RequestMapping(value = "/list-function/{version}")
    @ApiVersion(1)
    public String functionList(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            if (fse.getTableName() == null || !CmnConst.PRODUCT_SYS_FUNCTIONS.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            return OK_List(functionsService.getFunctionList(fse));
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(e.getMessage());
        }
    }
 
    /**
     * @Date: 2020-06-03 16:02
     * @Author: ZhouJie
     * @Description: 查看功能详情
     */
    @RequestMapping(value = "/find-function/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String findFunctionInfo(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            if (fse.getTableName() == null || !CmnConst.PRODUCT_SYS_FUNCTIONS.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            FieldSetEntity fss = functionsService.findFunction(fse);
            Map<String, DataTableEntity> subData = fss.getSubData();
            subData.remove("");
            return OK_List(fss);
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e);
        } catch (Exception e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(SystemCode.SYSTEM_FUNCTION_GET_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_GET_FAIL.getText());
        }
    }
 
    /**
     * @Date: 2020-06-03 11:49
     * @Author: ZhouJie
     * @Description: 新增功能
     */
    @RequestMapping(value = "/add-functions/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String addFunction(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            if (fse.getTableName() == null || !CmnConst.PRODUCT_SYS_FUNCTIONS.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            FieldSetEntity fsmk = functionsService.baseDao.getFieldSetEntity("product_sys_modules", fse.getString("module_uuid"), false);
            if (fsmk == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            codeService.createCode(fse, CmnConst.PRODUCT_SYS_FUNCTIONS, CmnConst.TRICODE, fsmk.getString(CmnConst.TRICODE));
            fse.setValue("created_by", SpringMVCContextHolder.getCurrentUser().getUser_id());// 获取登录帐号
            fse.setValue("created_utc_datetime", new Date());// 创建时间
            String uuid = functionsService.addFunction(fse);
            if (!StringUtils.isEmpty(uuid)) {
                return OK_Add(uuid);
            }
            SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FUNCTION_ADD_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_ADD_FAIL.getText());
            return error(SystemCode.SYSTEM_FUNCTION_ADD_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_ADD_FAIL.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e);
        } catch (Exception e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(SystemCode.SYSTEM_FUNCTION_ADD_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_ADD_FAIL.getText());
        }
    }
 
    /**
     * @Date: 2020-06-03 14:56
     * @Author: ZhouJie
     * @Description: 按钮修改
     */
    @RequestMapping(value = "/update-button/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String updateBottons(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            if (fse.getTableName() == null || !"product_sys_function_buttons".equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            String uuids = fse.getString("uuid");
            //周杰 2020年12月17日 上午11:16
            if (StringUtils.isEmpty(uuids)) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            //数据操作的权限验证
            if (!permissionService.validDataPermission(CmnConst.PRODUCT_SYS_FUNCTION_BUTTONS, uuids, CoreConst.DATA_PERMISSION_VALID_TYPE_USER)) {
                SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(),
                        SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText());
                return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText());
            }
            fse.setValue("updated_by", SpringMVCContextHolder.getCurrentUser().getUser_id());// 获取登录帐号
            fse.setValue("updated_utc_datetime", new Date());// 创建时间
            boolean success = functionsService.updateButton(fse);
            if (success) {
                return OK();
            }
            SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getText());
            return error(SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e);
        } catch (Exception e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getText());
        }
    }
 
    @PostMapping("/save-module/{version}")
    @ApiVersion(1)
    public String saveModule(HttpServletRequest request) {
        try {
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_SYS_FUNCTIONS);
            IFunctionService service = (IFunctionService) getProxyInstance(functionsService);
            return OK_List(service.saveModule(fse));
        } catch (BaseException e) {
            e.printStackTrace();
            return error(e);
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.SYSTEM_MODULE_UPDATE_FAIL);
        }
    }
 
    @PostMapping("/delete-module/{version}")
    @ApiVersion(1)
    public String deleteModule(HttpServletRequest request) {
        try {
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_SYS_FUNCTIONS);
            IFunctionService service = (IFunctionService) getProxyInstance(functionsService);
            service.deleteModule(fse);
            return OK();
        } catch (BaseException e) {
            e.printStackTrace();
            return error(e);
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.SYSTEM_MODULE_DELETE_FAIL);
        }
    }
 
    /**
     * @Date: 2020-06-03 14:56
     * @Author: ZhouJie
     * @Description: 功能修改
     */
    @RequestMapping(value = "/update-function/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String updateFunction(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            if (fse.getTableName() == null || !CmnConst.PRODUCT_SYS_FUNCTIONS.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            String uuids = fse.getString("uuid");
            //周杰 2020年12月17日 上午11:16
            if (StringUtils.isEmpty(uuids)) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            //数据操作的权限验证
            if (!permissionService.validDataPermission(CmnConst.PRODUCT_SYS_FUNCTIONS, uuids, CoreConst.DATA_PERMISSION_VALID_TYPE_USER)) {
                SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(),
                        SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText());
                return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText());
            }
            boolean success = functionsService.updatefunction(fse);
            if (success) {
                return OK();
            }
            SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getText());
            return error(SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e);
        } catch (Exception e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_UPDATE_FAIL.getText());
        }
    }
 
    /**
     * @Date: 2020-06-03 16:04
     * @Author: ZhouJie
     * @Description: 删除功能
     */
    @RequestMapping(value = "/delete-function/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String deleteFunction(HttpServletRequest request) {
        try {
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            FieldSetEntity fse = null;
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            String uuids = fse.getString("uuid");
            //周杰 2020年12月17日 上午11:16
            if (StringUtils.isEmpty(uuids)) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_PROMPT_DELETE_FAIL.getValue(), SystemCode.SYSTEM_PROMPT_DELETE_FAIL.getText());
                return this.error(SystemCode.SYSTEM_PROMPT_DELETE_FAIL.getValue(), SystemCode.SYSTEM_PROMPT_DELETE_FAIL.getText());
            }
            //数据操作的权限验证
            if (!permissionService.validDataPermission(CmnConst.PRODUCT_SYS_FUNCTIONS, uuids, CoreConst.DATA_PERMISSION_VALID_TYPE_USER)) {
                SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(),
                        SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText());
                return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText());
            }
            if (fse.getTableName() == null || !CmnConst.PRODUCT_SYS_FUNCTIONS.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            boolean success = functionsService.deletefunction(fse);
            if (success) {
                return OK();
            }
            SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FUNCTION_DELETE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_DELETE_FAIL.getText());
            return error(SystemCode.SYSTEM_FUNCTION_DELETE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_DELETE_FAIL.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e);
        } catch (Exception e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(SystemCode.SYSTEM_FUNCTION_DELETE_FAIL.getValue(), SystemCode.SYSTEM_FUNCTION_DELETE_FAIL.getText());
        }
    }
 
    /**
     * @Date: 2020-06-11 10:06
     * @Author: ZhouJie
     * @Description: 功能版本号
     */
    @RequestMapping(value = "/find-version/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String findVersion(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            if (fse.getTableName() == null || !CmnConst.PRODUCT_SYS_FUNCTIONS.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            FieldSetEntity fss = functionsService.findVersion(fse);
            return OK_List(fss);
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e);
        } catch (Exception e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
        }
    }
 
    /**
     * @Date: 2020-09-03 10:06
     * @Author: ZhouJie
     * @Description: 加载功能的所有按钮
     */
    @RequestMapping(value = "/onload-button/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String onloadButton(HttpServletRequest request) {
        try {
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            FieldSetEntity fse = null;
            String client_type = null;
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
                client_type = reqp.getOther().get(CoreConst.SYSTEM_CLIENT_TYPE_).toString();
            }
            //判断参数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            fse.setValue(CoreConst.SYSTEM_CLIENT_TYPE_, client_type);
            //updatetime 2021年1月14日20:03:21 判断客户端类型是否获取成功
            if (StringUtils.isEmpty(client_type)) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            return ResultInfo.success(functionsService.onloadButton(fse));
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e);
        } catch (Exception e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(SystemCode.SYSTEM_ACQUIRE_PARAM_FAIL.getValue(), SystemCode.SYSTEM_ACQUIRE_PARAM_FAIL.getText());
        }
    }
 
 
}