瀏覽代碼

更新俯视图

xiewenjie 3 年之前
父節點
當前提交
61c2b54bd1

+ 8 - 2
sxz-core/src/main/java/com/fdkk/sxz/other/listener/AddMoldelBuild.java

@@ -112,11 +112,12 @@ public class AddMoldelBuild {
                 renovationPartsDetailEntity.setName(modelUploadEntity.getFileId());
                 renovationPartsDetailEntity.setPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + ".glb");
                 String imgPath = buildPath + "upload/" + modelUploadEntity.getFileId() + "/" + modelUploadEntity.getFileId() + "_preview.jpg";
+                String birdPath = buildPath + "upload/" + modelUploadEntity.getFileId() + "/" + modelUploadEntity.getFileId() + "_bird.png";
 
                 // 加锁,同一个模型只能请求一次3d渲染,防止同一账号在登录多个客户端下同时操作一个模型导致出问题
                 Result result;
                 synchronized (param.getModelUploadId()) {
-                    result = synchronizedupdateByIdModel(param, modelUploadEntity, imgPath, renovationPartsDetailEntity);
+                    result = synchronizedupdateByIdModel(param, modelUploadEntity, imgPath, birdPath, renovationPartsDetailEntity);
                 }
             }
         } catch (Exception e) {
@@ -134,7 +135,7 @@ public class AddMoldelBuild {
     }
 
     private Result synchronizedupdateByIdModel(RequestRenovationPartsDetailManager param,
-                                               ModelUploadEntity modelUploadEntity, String imgPath,
+                                               ModelUploadEntity modelUploadEntity, String imgPath, String birdPath,
                                                RenovationPartsDetailEntity renovationPartsDetailEntity) throws Exception {
         if (checkReaptPost(param)) {
             AddMoldelBuild.log.info("模型已被提交,模型id-{}", param.getModelUploadId());
@@ -149,6 +150,11 @@ public class AddMoldelBuild {
             renovationPartsDetailEntity.setHighImg(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + "_preview.jpg");
         }
 
+        //判断缩略图是否存在,在就保存缩略图
+        if (new File(birdPath).exists()) {
+            uploadToOssUtil.uploadTo4dTjw(birdPath, "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + "_bird.png");
+            renovationPartsDetailEntity.setBirdPath(prefix + "domain/eHome/furniture/temp/" + modelUploadEntity.getFileId() + "_bird.png");
+        }
 
         //调用obj转换成toolbag文件
         objToToolbagUtil.convertobjTomview(modelUploadEntity.getFileId());

+ 3 - 0
sxz-core/src/main/java/com/fdkk/sxz/other/listener/RunBuild.java

@@ -801,6 +801,7 @@ public class RunBuild {
                 sceneLightEntity.setUpdateTime(new Date());
                 sceneLightService.updateById(sceneLightEntity);
             } catch (Exception e) {
+                e.printStackTrace();
                 //渲染失败,修改风格表和灯光预览相册集
                 updateSceneStyleEntity.setLightStatus(-1);
                 updateSceneStyleEntity.setLightVersion(entity.getLightVersion() + 1);
@@ -1255,6 +1256,7 @@ public class RunBuild {
                                 uploadToOssUtil.downloadFileTo4dTjw("domain/eHome/furniture/ue4data/" + productName + "/" + componentName + "/" + componentName + "-base.obj", uploadPath + ".obj");
                                 uploadToOssUtil.downloadFileTo4dTjw("domain/eHome/furniture/ue4data/" + productName + "/" + componentName + "/" + componentName + ".mtl", uploadPath + ".mtl");
                                 uploadToOssUtil.downloadFileTo4dTjw("domain/eHome/furniture/ue4data/" + productName + "/" + componentName + "/" + componentName + ".jpg", uploadPath + ".jpg");
+                                
                                 ComponentModelUploadEntity componentEntity = componentModelUploadService.findById(component.getLong("id"));
                                 if (componentEntity != null) {
                                     componentEntity.setThumPath(uploadPath.replace(buildPath, "") + "_preview.jpg");
@@ -1347,6 +1349,7 @@ public class RunBuild {
                         componentModelUploadEntity.setThumStatus(1);
                         componentModelUploadEntity.setThumProgress(100);
                         componentModelUploadEntity.setThumPath(objPath.replace(buildPath, "").replace(".obj", "") + "_preview.jpg");
+                        componentModelUploadEntity.setBirdPath(objPath.replace(buildPath, "").replace(".obj", "") + "_bird.png");
                         componentModelUploadEntity.setMtlPath(objPath.replace(buildPath, "").replace(".obj", "") + ".mtl");
 //                    componentModelUploadEntity.setImgPath(objPath.replace(buildPath, "").replace(".obj", "") + ".jpg");
                         componentModelUploadEntity.setObjPath(objPath.replace(buildPath, ""));

+ 7 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ManagerController.java

@@ -710,6 +710,13 @@ public class ManagerController extends BaseController {
                         renovationPartsDetailEntity.setPath(renovationPartsDetailEntity.getPath().replace("/temp/", "/models/"));
                     }
 
+                    if (ObjectUtil.isNotNull(renovationPartsDetailEntity.getBirdPath()) && renovationPartsDetailEntity.getPath().contains("temp")) {
+                        uploadToOssUtil.copyTo4dTjw(renovationPartsDetailEntity.getBirdPath().replace(prefix, ""),
+                                renovationPartsDetailEntity.getBirdPath().replace("/temp/", "/models/").replace(prefix, ""));
+                        uploadToOssUtil.deleteTo4dTjw(renovationPartsDetailEntity.getBirdPath().replace(prefix, ""));
+                        renovationPartsDetailEntity.setPath(renovationPartsDetailEntity.getBirdPath().replace("/temp/", "/models/"));
+                    }
+
                     if (ObjectUtil.isNotNull(renovationPartsDetailEntity.getMviewPath()) && renovationPartsDetailEntity.getMviewPath().contains("temp")) {
                         uploadToOssUtil.copyTo4dTjw(renovationPartsDetailEntity.getMviewPath().replace(prefix, ""),
                                 renovationPartsDetailEntity.getMviewPath().replace("/temp/", "/models/").replace(prefix, ""));

+ 27 - 1
sxz-core/src/main/resources/mapper/LogMapper.xml

@@ -61,5 +61,31 @@
         </trim>
         ORDER BY create_time DESC
     </select>
-
+    <!-- 分页查询操作日志 -->
+    <select id="selectLogList_COUNT" resultType="Long" parameterType="com.fdkk.sxz.system.dto.QueryLog">
+        SELECT count(0)
+        FROM tb_sys_log A
+        WHERE A.rec_status = 'A'
+        <trim prefix="AND (" suffix=")" prefixOverrides="AND">
+            <if test="log.methodName != null and log.methodName != ''">
+                AND A.method_name like concat( #{log.methodName}, '%')
+            </if>
+            <if test="log.traceId != null and log.traceId != ''">
+                AND a.trace_id = #{log.traceId}
+            </if>
+            <if test="log.url != null and log.url != ''">
+                AND A.url like concat( #{log.url}, '%')
+            </if>
+            <if test="log.logType != null and log.logType != ''">
+                AND A.log_type = #{log.logType}
+            </if>
+            <if test="log.startTime != null">
+                AND A.create_time &gt;= #{log.startTime}
+            </if>
+            <if test="log.endTime != null">
+                AND A.create_time &lt;= #{log.endTime}
+            </if>
+        </trim>
+        ORDER BY create_time DESC
+    </select>
 </mapper>

+ 7 - 5
sxz-modules/src/main/java/com/fdkk/sxz/entity/ComponentModelUploadEntity.java

@@ -1,13 +1,10 @@
 package com.fdkk.sxz.entity;
 
-import lombok.Data;
-import com.fdkk.sxz.entity.BaseEntity;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 
 /**
@@ -84,7 +81,12 @@ public class ComponentModelUploadEntity extends BaseEntity {
     @TableField("thum_path")
     @ApiModelProperty(value = "缩略图地址", name = "thum_path")
     private String thumPath;
-
+    /**
+     * 俯视图
+     */
+    @TableField("bird_path")
+    @ApiModelProperty(value = "俯视图", name = "bird_path")
+    private String birdPath;
     /**
      * 0转换中,1转成成功,-1转换失败
      */

+ 5 - 1
sxz-modules/src/main/java/com/fdkk/sxz/entity/RenovationPartsDetailEntity.java

@@ -80,5 +80,9 @@ public class RenovationPartsDetailEntity extends BaseEntity {
 
     @TableField("other_file_url")
     private String otherFileUrl;
-
+    /**
+     * 俯视图
+     */
+    @TableField("bird_path")
+    private String birdPath;
 }