管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-11-12 4d8dd71b7d13fa41132c46831090c6282af502cb
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
package com.lf.server.controller.show;
 
import com.lf.server.aspect.SysLog;
import com.lf.server.controller.all.BaseController;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.data.DictEntity;
import com.lf.server.entity.show.ExportEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.service.show.ExportService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletRequest;
import java.util.List;
 
/**
 * 在线制图
 * @author WWW
 */
@Api(tags = "综合展示\\在线制图")
@RestController
@RequestMapping("/export")
public class ExportController  extends BaseController {
    @Autowired
    ExportService exportService;
 
    @Autowired
    TokenService tokenService;
 
    @SysLog()
    @ApiOperation(value = "分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ns", value = "表空间", dataType = "String", paramType = "query", example = "bd"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_hyda"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPage")
    public ResponseMsg<List<DictEntity>> selectByPage(String ns, String tab, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
 
            //
 
            return success(null);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
 
    @SysLog()
    @ApiOperation(value = "新建出图")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "在线制图实体类", dataType = "ExportEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/insertMap", produces = "application/json; charset=UTF-8")
    public ResponseMsg<String> insertMap(@RequestBody ExportEntity entity, HttpServletRequest req) {
        try {
            if (entity == null ||
                    StringHelper.isEmpty(entity.getLayers()) ||
                    StringHelper.isEmpty(entity.getToken()) ||
                    (entity.getXmin() == 0 && entity.getYmin() == 0 && entity.getXmax() == 0 && entity.getYmax() == 0)) {
                return fail("参数不完整");
            }
 
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue == null) {
                return fail("用户未登录");
            }
 
            String str = exportService.post(ue, entity);
            if (StringHelper.isNull(str)) {
                return fail("出图失败");
            }
 
            return success("出图成功", str);
        } catch (Exception ex) {
            return fail(ex.getMessage());
        }
    }
}