瀏覽代碼

fix: ue设置,贴图功能

liaoyitao 1 月之前
父節點
當前提交
645ca93f18

+ 18 - 0
src/main/java/com/lqkj/link/module/authority/controller/UserInfoController.java

@@ -217,4 +217,22 @@ public class UserInfoController {
217 217
         userInfoService.register(userInfo, false, userCode);
218 218
         return MessageBean.ok(null, "保存用户接口");
219 219
     }
220
+
221
+
222
+    /**
223
+     * 保存用户ue设置
224
+     * @param autosaveTime
225
+     * @param movingSpeed
226
+     * @param request
227
+     * @return
228
+     */
229
+    @PostMapping("/saveSettings")
230
+    public MessageBean<String> saveSettings(@RequestParam Integer autosaveTime,
231
+                                            @RequestParam Integer movingSpeed,
232
+                                            HttpServletRequest request) {
233
+        String authHeader = request.getHeader("Authorization");
234
+        String userCode = jwtService.decryptUsernameWithHeader(authHeader);
235
+        userInfoService.saveSettings(autosaveTime, movingSpeed, userCode);
236
+        return MessageBean.ok(null, "保存用户设置");
237
+    }
220 238
 }

+ 8 - 0
src/main/java/com/lqkj/link/module/authority/domain/UserInfo.java

@@ -81,6 +81,14 @@ public class UserInfo implements UserDetails {
81 81
     @Column(name = "refresh_resource")
82 82
     private Boolean refreshResource;
83 83
 
84
+    @Column(name = "autosave_time")
85
+    @Schema(description = "自动保存时间")
86
+    private Integer autosaveTime;
87
+
88
+    @Column(name = "moving_speed")
89
+    @Schema(description = "移动速度")
90
+    private Integer movingSpeed;
91
+
84 92
     @Override
85 93
     @JsonIgnore
86 94
     public Collection<? extends GrantedAuthority> getAuthorities() {

+ 8 - 0
src/main/java/com/lqkj/link/module/authority/repository/UserInfoRepository.java

@@ -110,4 +110,12 @@ public interface UserInfoRepository extends JpaRepository<UserInfo, Integer> {
110 110
             value = "update user_info set refresh_resource = false where user_code = :userCode"
111 111
     )
112 112
     void resourceRefreshed();
113
+
114
+    @Modifying
115
+    @Query(nativeQuery = true,
116
+            value = "update user_info set autosave_time = :autosaveTime, moving_speed = :movingSpeed where user_code = :userCode"
117
+    )
118
+    void saveSettings(@Param("autosaveTime") Integer autosaveTime,
119
+                      @Param("movingSpeed") Integer movingSpeed,
120
+                      @Param("userCode") String userCode);
113 121
 }

+ 11 - 0
src/main/java/com/lqkj/link/module/authority/service/UserInfoService.java

@@ -265,4 +265,15 @@ public class UserInfoService {
265 265
         }
266 266
 
267 267
     }
268
+
269
+
270
+    /**
271
+     * 保存ue设置
272
+     * @param autosaveTime
273
+     * @param movingSpeed
274
+     * @param userCode
275
+     */
276
+    public void saveSettings(Integer autosaveTime, Integer movingSpeed, String userCode) {
277
+        userInfoRepository.saveSettings(autosaveTime, movingSpeed, userCode);
278
+    }
268 279
 }

+ 10 - 2
src/main/java/com/lqkj/link/module/bulletin/service/NoticeInfoService.java

@@ -31,8 +31,16 @@ public class NoticeInfoService {
31 31
         List<NoticeInfo> noticeInfos = noticeInfoRepository.queryWithUserCode(userCode);
32 32
         noticeInfos.stream().forEach(noticeInfo -> {
33 33
             if (noticeInfo.getType() == 4) {
34
-                ShareInfo shareInfo = shareInfoRepository.findByZoneIdAndSharedUserId(noticeInfo.getZoneId(), noticeInfo.getUserId()).get(0);
35
-                noticeInfo.setAcceptStatus(Objects.isNull(shareInfo) ? false : shareInfo.getAcceptStatus());
34
+                if (shareInfoRepository.findByZoneIdAndSharedUserId(noticeInfo.getZoneId(), noticeInfo.getUserId()).size() > 0){
35
+                    ShareInfo shareInfo = shareInfoRepository.findByZoneIdAndSharedUserId(noticeInfo.getZoneId(), noticeInfo.getUserId()).get(0);
36
+                    if (Objects.nonNull(shareInfo.getAcceptStatus())){
37
+                        noticeInfo.setAcceptStatus(shareInfo.getAcceptStatus());
38
+                    }
39
+                }
40
+                else {
41
+                    noticeInfo.setAcceptStatus(false);
42
+                }
43
+
36 44
             }
37 45
         });
38 46
         return noticeInfos;

+ 6 - 0
src/main/java/com/lqkj/link/module/zone/domain/GeomInfo.java

@@ -55,6 +55,12 @@ public class GeomInfo {
55 55
     @Transient
56 56
     private String modelPath;
57 57
 
58
+    /**
59
+     * 材质ID
60
+     */
61
+    @Column(name = "material_id")
62
+    private Integer materialId;
63
+
58 64
     public JSONObject getLocation() {
59 65
         if (location == null) return trans;
60 66
         return location;

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

@@ -53,4 +53,8 @@ public class MaterialInfo {
53 53
     @Schema(description = "更新时间")
54 54
     private Date updateTime;
55 55
 
56
+    @Column(name = "user_id")
57
+    @Schema(description = "用户id")
58
+    private Integer userId;
59
+
56 60
 }

+ 1 - 1
src/main/java/com/lqkj/link/module/zone/repository/ShareInfoRepository.java

@@ -30,7 +30,7 @@ public interface ShareInfoRepository extends JpaRepository<ShareInfo, Integer> {
30 30
      * @return
31 31
      */
32 32
     @Query(nativeQuery = true,
33
-            value = "SELECT * FROM share_info WHERE zone_id = ?1"
33
+            value = "SELECT * FROM share_info WHERE zone_id = ?1 and ( accept_status ISNULL OR accept_status = TRUE ) "
34 34
     )
35 35
     List<ShareInfo> findByZoneId(Integer zoneId);
36 36
 

+ 2 - 1
src/main/java/com/lqkj/link/module/zone/service/ZoneInfoService.java

@@ -343,11 +343,12 @@ public class ZoneInfoService {
343 343
      */
344 344
     private void notifySharer(Integer zoneId) {
345 345
         List<NoticeInfo>  noticeInfos = new ArrayList<>();
346
+        ZoneInfo zoneInfo = zoneInfoRepository.findById(zoneId).get();
346 347
         shareInfoRepository.findByZoneId(zoneId).forEach(shareInfo -> {
347 348
             NoticeInfo noticeInfo = new NoticeInfo();
348 349
             noticeInfo.setUserId(shareInfo.getSharedUserId());
349 350
             noticeInfo.setType(6);
350
-            noticeInfo.setContent("经决定对团队进行调整。很遗憾地通知您,您将不再作为该项目的协作者。我们感谢您到目前为止的贡献。");
351
+            noticeInfo.setContent("经决定对" + zoneInfo.getZoneName() + "团队进行调整。很遗憾地通知您,您将不再作为该项目的协作者。我们感谢您到目前为止的贡献。");
351 352
             noticeInfo.setHasView(false);
352 353
             noticeInfo.setCreateTime(new Date());
353 354
             noticeInfo.setZoneId(zoneId);

+ 1 - 1
src/main/java/com/lqkj/link/module/zone/service/impl/MaterialInfoServiceImpl.java

@@ -92,7 +92,7 @@ public class MaterialInfoServiceImpl implements MaterialInfoService {
92 92
                         }
93 93
                         if (!materialMap.containsKey(modelFileName.substring(0, modelFileName.lastIndexOf(".")))) {
94 94
                             materialInfoList.add(new MaterialInfo(null, modelFileName.substring(0, modelFileName.lastIndexOf(".")), modelPath.substring(1),
95
-                                    modelPath.replace("model", "icon").replace("json", "png").substring(1), modelFileName, 1, new Date()));
95
+                                    modelPath.replace("model", "icon").replace("json", "png").substring(1), modelFileName, 1, new Date(), null));
96 96
                         } else {
97 97
                             MaterialInfo materialInfo = materialMap.get(modelFileName.substring(0, modelFileName.lastIndexOf(".")));
98 98
                             materialInfo.setMaterialIcon(modelPath.replace("model", "icon").replace("json", "png").substring(1));

+ 7 - 0
src/main/resources/db/migration/V6__2.0.3.sql

@@ -0,0 +1,7 @@
1
+ALTER TABLE share_info ADD COLUMN accept_status BOOL;
2
+comment on column share_info.accept_status is
3
+'接受状态: accept_status';
4
+
5
+ALTER TABLE material_info ADD COLUMN material_type INT4;
6
+comment on column material_info.material_type is
7
+'材质类型: 1:材质, 2:贴图';

+ 16 - 0
src/main/resources/db/migration/V7__2.0.4.sql

@@ -0,0 +1,16 @@
1
+
2
+ALTER TABLE material_info ADD COLUMN user_id INT4;
3
+comment on column material_info.user_id is
4
+'用户id: user_id';
5
+
6
+ALTER TABLE geom_info ADD COLUMN material_id INT4;
7
+comment on column material_info.material_id is
8
+'材质id: material_id';
9
+
10
+ALTER TABLE user_info ADD COLUMN autosave_time INT4 default 30;
11
+comment on column user_info.autosave_time is
12
+'自动保存时间: autosave_time';
13
+
14
+ALTER TABLE user_info ADD COLUMN moving_speed INT4 default 5000;
15
+comment on column user_info.moving_speed is
16
+'移动速度: moving_speed';