Browse Source

新增查询分享类型和增加字段

liaoyitao 2 weeks ago
parent
commit
7e876649eb

+ 15 - 0
src/main/java/com/lqkj/link/module/zone/controller/ZoneInfoController.java

@@ -8,6 +8,7 @@ import com.lqkj.link.module.base.service.BaseService;
8
 import com.lqkj.link.module.bulletin.domain.BulletinInfo;
8
 import com.lqkj.link.module.bulletin.domain.BulletinInfo;
9
 import com.lqkj.link.module.jwt.service.JwtService;
9
 import com.lqkj.link.module.jwt.service.JwtService;
10
 import com.lqkj.link.module.zone.domain.ZoneInfo;
10
 import com.lqkj.link.module.zone.domain.ZoneInfo;
11
+import com.lqkj.link.module.zone.service.ShareInfoService;
11
 import com.lqkj.link.module.zone.service.ZoneInfoService;
12
 import com.lqkj.link.module.zone.service.ZoneInfoService;
12
 import com.lqkj.link.util.FileUtils;
13
 import com.lqkj.link.util.FileUtils;
13
 import io.swagger.v3.oas.annotations.Operation;
14
 import io.swagger.v3.oas.annotations.Operation;
@@ -17,6 +18,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
17
 import io.swagger.v3.oas.annotations.tags.Tag;
18
 import io.swagger.v3.oas.annotations.tags.Tag;
18
 import jakarta.servlet.http.HttpServletRequest;
19
 import jakarta.servlet.http.HttpServletRequest;
19
 import org.apache.commons.lang3.StringUtils;
20
 import org.apache.commons.lang3.StringUtils;
21
+import org.springframework.beans.factory.annotation.Autowired;
20
 import org.springframework.data.domain.Page;
22
 import org.springframework.data.domain.Page;
21
 import org.springframework.web.bind.annotation.*;
23
 import org.springframework.web.bind.annotation.*;
22
 import org.springframework.web.multipart.MultipartFile;
24
 import org.springframework.web.multipart.MultipartFile;
@@ -36,6 +38,9 @@ public class ZoneInfoController {
36
     private final JwtService jwtService;
38
     private final JwtService jwtService;
37
     private final BaseService baseService;
39
     private final BaseService baseService;
38
 
40
 
41
+    @Autowired
42
+    private ShareInfoService shareInfoService;
43
+
39
     public ZoneInfoController(ZoneInfoService zoneInfoService, JwtService jwtService, BaseService baseService) {
44
     public ZoneInfoController(ZoneInfoService zoneInfoService, JwtService jwtService, BaseService baseService) {
40
         this.zoneInfoService = zoneInfoService;
45
         this.zoneInfoService = zoneInfoService;
41
         this.jwtService = jwtService;
46
         this.jwtService = jwtService;
@@ -479,6 +484,16 @@ public class ZoneInfoController {
479
     }
484
     }
480
 
485
 
481
 
486
 
487
+    /**
488
+     * 查询共建类型
489
+     */
490
+    @PostMapping("/getShareType")
491
+    public MessageBean<Integer> getShareType(@RequestParam Integer zoneId,
492
+                                            @RequestParam Integer userId) {
493
+        return MessageBean.ok(shareInfoService.getShareType(zoneId, userId), "查询共建类型");
494
+    }
495
+
496
+
482
 
497
 
483
 
498
 
484
 
499
 

+ 3 - 0
src/main/java/com/lqkj/link/module/zone/domain/TmpGeomInfo.java

@@ -129,6 +129,9 @@ public class TmpGeomInfo {
129
     @Column(name = "tmp_layer_id")
129
     @Column(name = "tmp_layer_id")
130
     private Integer tmpLayerId;
130
     private Integer tmpLayerId;
131
 
131
 
132
+    @Column(name = "is_add")
133
+    private Boolean isAdd;
134
+
132
     public JSONObject getLocation() {
135
     public JSONObject getLocation() {
133
         if (location == null) return trans;
136
         if (location == null) return trans;
134
         return location;
137
         return location;

+ 4 - 0
src/main/java/com/lqkj/link/module/zone/domain/TmpLayerInfo.java

@@ -46,6 +46,10 @@ public class TmpLayerInfo {
46
     @Column(name = "layer_id")
46
     @Column(name = "layer_id")
47
     private String layerId;
47
     private String layerId;
48
 
48
 
49
+    @Column(name = "is_add")
50
+    private Boolean isAdd;
51
+
52
+
49
     public String getName() {
53
     public String getName() {
50
         return tmpLayerId.toString();
54
         return tmpLayerId.toString();
51
     }
55
     }

+ 20 - 0
src/main/java/com/lqkj/link/module/zone/service/ShareInfoService.java

@@ -0,0 +1,20 @@
1
+package com.lqkj.link.module.zone.service;
2
+
3
+
4
+import com.lqkj.link.module.zone.repository.ShareInfoRepository;
5
+import org.checkerframework.checker.units.qual.A;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Service;
8
+
9
+@Service
10
+public class ShareInfoService {
11
+
12
+    @Autowired
13
+    private ShareInfoRepository shareInfoRepository;
14
+
15
+
16
+    public Integer getShareType(Integer zoneId, Integer userId) {
17
+
18
+        return  shareInfoRepository.findByZoneIdAndSharedUserId(zoneId, userId).get(0).getShareType();
19
+    }
20
+}

+ 10 - 2
src/main/resources/db/migration/V14__2.0.8.sql

@@ -7,7 +7,8 @@ create table if not exists tmp_layer_info (
7
                                 user_id              INT4                 null,
7
                                 user_id              INT4                 null,
8
                                 status               INT2                 not null default 1,
8
                                 status               INT2                 not null default 1,
9
                                 layer_id             VARCHAR(255)         null,
9
                                 layer_id             VARCHAR(255)         null,
10
-                                constraint PK_TMP_LAYER_INFO primary key (tmp_layer_id)
10
+                                is_add               BOOL                 null,
11
+    constraint PK_TMP_LAYER_INFO primary key (tmp_layer_id)
11
 );
12
 );
12
 
13
 
13
 comment on table tmp_layer_info is
14
 comment on table tmp_layer_info is
@@ -37,6 +38,9 @@ comment on column tmp_layer_info.status is
37
 comment on column tmp_layer_info.layer_id is
38
 comment on column tmp_layer_info.layer_id is
38
 '图层ID';
39
 '图层ID';
39
 
40
 
41
+comment on column tmp_layer_info.is_add is
42
+'是否新增';
43
+
40
 
44
 
41
 create table if not exists tmp_geom_info (
45
 create table if not exists tmp_geom_info (
42
                                tmp_id               SERIAL               not null,
46
                                tmp_id               SERIAL               not null,
@@ -66,7 +70,8 @@ create table if not exists tmp_geom_info (
66
                                status               INT2                 not null default 1,
70
                                status               INT2                 not null default 1,
67
                                user_id              INT4                 null,
71
                                user_id              INT4                 null,
68
                                tmp_layer_id         INT4                 null,
72
                                tmp_layer_id         INT4                 null,
69
-                               constraint PK_TMP_GEOM_INFO primary key (tmp_id)
73
+                               is_add               BOOL                 null,
74
+    constraint PK_TMP_GEOM_INFO primary key (tmp_id)
70
 );
75
 );
71
 
76
 
72
 comment on table tmp_geom_info is
77
 comment on table tmp_geom_info is
@@ -153,6 +158,9 @@ comment on column tmp_geom_info.user_id is
153
 comment on column tmp_geom_info.tmp_layer_id is
158
 comment on column tmp_geom_info.tmp_layer_id is
154
 '临时图层ID';
159
 '临时图层ID';
155
 
160
 
161
+comment on column tmp_geom_info.is_add is
162
+'是否新增';
163
+
156
 alter table tmp_geom_info
164
 alter table tmp_geom_info
157
     add constraint FK_TMP_GEOM_REF_LAYER foreign key (tmp_layer_id)
165
     add constraint FK_TMP_GEOM_REF_LAYER foreign key (tmp_layer_id)
158
         references tmp_layer_info (tmp_layer_id)
166
         references tmp_layer_info (tmp_layer_id)