Kaynağa Gözat

上传后无法下载修复,风格id查询模型

zhujinghui 4 yıl önce
ebeveyn
işleme
b04e61e47a

+ 8 - 0
pom.xml

@@ -232,6 +232,14 @@
 				<groupId>org.springframework.boot</groupId>
 				<artifactId>spring-boot-maven-plugin</artifactId>
 			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<version>2.18.1</version>
+				<configuration>
+					<skipTests>true</skipTests>
+				</configuration>
+			</plugin>
 		</plugins>
 	</build>
 

+ 2 - 1
src/main/java/com/example/demo/controller/RenovationController.java

@@ -134,6 +134,7 @@ public class RenovationController {
     @RequestMapping(value = "/findPartsDetailById", method = RequestMethod.POST)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "colorId", value = "色系id", dataType = "String"),
+            @ApiImplicitParam(name = "classifyId", value = "风格id", dataType = "String"),
             @ApiImplicitParam(name = "id", value = "细类id", dataType = "String"),
             @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "String"),
             @ApiImplicitParam(name = "pageSize", value = "页数", dataType = "String")})
@@ -145,7 +146,7 @@ public class RenovationController {
     Page page = PageHelper.startPage(parts.getPageNum(), parts.getPageSize(), true);
 //        PageHelper.orderBy(" a.create_time desc");
 
-    List<ResponseRenovationPartsDetail> list = renovationPartsDetailService.findDetailByTypeId(parts.getId(), parts.getColorId());
+    List<ResponseRenovationPartsDetail> list = renovationPartsDetailService.findDetailByTypeId(parts.getId(), parts.getColorId(), parts.getClassifyId());
 
     Page<ResponseRenovationPartsDetail> a = new Page<ResponseRenovationPartsDetail>(parts.getPageNum(), parts.getPageSize());
     a.setTotal(page.getTotal());

+ 4 - 3
src/main/java/com/example/demo/listener/RunBuild.java

@@ -773,7 +773,7 @@ public class RunBuild {
 //                uploadToOssUtil.downloadFileTo4dTjw("domain/eHome/furniture/ue4data/" + fileId + "/" + fileId + ".fbx", filePath + fileId + ".fbx");
 //                uploadToOssUtil.downloadFileTo4dTjw("domain/eHome/furniture/ue4data/" + fileId + "/" + fileId + ".jpg", filePath + fileId + ".jpg");
 //                uploadToOssUtil.downloadFileTo4dTjw("domain/eHome/furniture/ue4data/" + fileId + "/" + fileId + "_preview.jpg", filePath + fileId + "_preview.jpg");
-                CreateObjUtil.ossCommonUtilCp("4d-tjw/domain/eHome/furniture/ue4data/" + fileId + "/", filePath);
+                CreateObjUtil.ossCommonUtilCp("domain/eHome/furniture/ue4data/" + fileId, filePath);
 
 //                if(new File(filePath + fileId + ".fbx").exists()){
 //                    OkHttpUtils.httpGet(maxObjUrl + "fbxToObjNoImg?uuid=" + fileId +"&fbx=" + fileId + ".fbx" +
@@ -793,6 +793,7 @@ public class RunBuild {
                 }
             }
 
+            log.info("obj路径-{}", objPath);
             if(!new File(objPath).exists()){
                 log.info("obj文件生成失败:" + objPath);
                 throw new RuntimeException("obj文件生成失败");
@@ -816,8 +817,8 @@ public class RunBuild {
             modelUploadEntity.setFacesNum(facesNum);
             modelUploadService.update(modelUploadEntity);
         }catch (Exception e){
-            e.printStackTrace();
-
+            log.error("修改模型报错-{}", e);
+            log.error("修改模型报错-{}", e);
             modelUploadEntity.setStatus(-1);
             modelUploadService.update(modelUploadEntity);
         }

+ 4 - 1
src/main/java/com/example/demo/mapper/IRenovationPartsDetailMapper.java

@@ -20,8 +20,11 @@ public interface IRenovationPartsDetailMapper extends IBaseMapper<RenovationPart
             "<if test= 'colorId != null'> " +
             " and parts_color_id = #{colorId} " +
             "</if> " +
+            "<if test= 'classifyId != null'> " +
+            " and parts_classify_id = #{classifyId} " +
+            "</if> " +
             "</script>")
-    List<ResponseRenovationPartsDetail> findDetailByTypeId(@Param("partsTypeId") Long partsTypeId, @Param("colorId") Long colorId);
+    List<ResponseRenovationPartsDetail> findDetailByTypeId(@Param("partsTypeId") Long partsTypeId, @Param("colorId") Long colorId, @Param("classifyId") Long classifyId);
 
     @Select("select id, key_word as keyWord, type, description, img, high_img as highImg, path, name, zh_name as zhName, has_toolbag as hasToolbag from tb_renovation_parts_detail where name = #{name} and rec_status = 'A' and is_show = 1 and examine = 1 ")
     ResponseRenovationPartsDetail findByName(String name);

+ 1 - 1
src/main/java/com/example/demo/service/IRenovationPartsDetailService.java

@@ -12,7 +12,7 @@ import java.util.List;
  */
 public interface IRenovationPartsDetailService extends IBaseService<RenovationPartsDetailEntity, Long> {
 
-    List<ResponseRenovationPartsDetail> findDetailByTypeId(Long id, Long colorId);
+    List<ResponseRenovationPartsDetail> findDetailByTypeId(Long id, Long colorId, Long classifyId);
 
     ResponseRenovationPartsDetail findByName(String name);
 

+ 5 - 4
src/main/java/com/example/demo/service/impl/RenovationPartsDetailServiceImpl.java

@@ -6,14 +6,12 @@ import com.example.demo.mapper.IRenovationPartsAttachingMapper;
 import com.example.demo.mapper.IRenovationPartsDetailMapper;
 import com.example.demo.mapper.IRenovationPartsSizeMapper;
 import com.example.demo.service.IRenovationPartsDetailService;
-import com.example.demo.util.Result;
 import com.example.demo.vo.response.ResponseRenovationPartsDetail;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import tk.mybatis.mapper.entity.Condition;
 
 import java.util.List;
 
@@ -39,11 +37,14 @@ public class RenovationPartsDetailServiceImpl extends BaseServiceImpl<Renovation
     }
 
     @Override
-    public List<ResponseRenovationPartsDetail> findDetailByTypeId(Long id, Long colorId) {
+    public List<ResponseRenovationPartsDetail> findDetailByTypeId(Long id, Long colorId, Long classifyId) {
         if(colorId != null && colorId.longValue() == 0){
             colorId = null;
         }
-        List<ResponseRenovationPartsDetail> detailList = mapper.findDetailByTypeId(id, colorId);
+        if(classifyId != null && classifyId.longValue() == 0){
+            classifyId = null;
+        }
+        List<ResponseRenovationPartsDetail> detailList = mapper.findDetailByTypeId(id, colorId, classifyId);
 
         for (ResponseRenovationPartsDetail responseRenovationPartsDetail : detailList) {
             responseRenovationPartsDetail.setEditing(renovationPartsAttachingMapper.findAttachinByDetailId(responseRenovationPartsDetail.getId()));

+ 4 - 1
src/main/java/com/example/demo/service/impl/RenovationPartsServiceImpl.java

@@ -6,6 +6,7 @@ import com.example.demo.service.IRenovationPartsService;
 import com.example.demo.vo.response.ResponseRenovationParts;
 import com.example.demo.vo.response.ResponseRenovationPartsDetail;
 import com.example.demo.vo.response.ResponseRenovationPartsType;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -17,6 +18,7 @@ import java.util.List;
  * Created by Hb_zzZ on 2020/8/11.
  */
 @Service
+@Slf4j
 @Transactional
 public class RenovationPartsServiceImpl extends BaseServiceImpl<RenovationPartsEntity, Long> implements IRenovationPartsService {
 
@@ -55,10 +57,11 @@ public class RenovationPartsServiceImpl extends BaseServiceImpl<RenovationPartsE
             keys = new ArrayList<>();
             for(ResponseRenovationPartsType type : typeList){
                 keys.add(type.getKeyWord());
-                List<ResponseRenovationPartsDetail> detailList = renovationPartsDetailMapper.findDetailByTypeId(type.getId(), null);
+                List<ResponseRenovationPartsDetail> detailList = renovationPartsDetailMapper.findDetailByTypeId(type.getId(), null, null);
                 type.setChildrens(detailList);
 
                 for (ResponseRenovationPartsDetail responseRenovationPartsDetail : detailList) {
+//                    log.info("出现报错-{}", responseRenovationPartsDetail.getId());
                     responseRenovationPartsDetail.setEditing(renovationPartsAttachingMapper.findAttachinByDetailId(responseRenovationPartsDetail.getId()));
                     responseRenovationPartsDetail.setSize(renovationPartsSizeMapper.findSizeByDetailId(responseRenovationPartsDetail.getId()));
                 }

+ 4 - 1
src/main/java/com/example/demo/util/ConvertCadKjl.java

@@ -244,7 +244,7 @@ public class ConvertCadKjl {
 				JSONObject point2 = new JSONObject();
 				point2.put("x", pos.getDouble(2));
 				point2.put("y", pos.getDouble(3));
-				polygon.add(point2);
+				//polygon.add(point2);
 
 				JSONObject point3 = new JSONObject();
 				point3.put("x", pos.getDouble(4));
@@ -255,6 +255,9 @@ public class ConvertCadKjl {
 				point4.put("x", pos.getDouble(6));
 				point4.put("y", pos.getDouble(7));
 				polygon.add(point4);
+
+				//4dkk的这个数据不是按照顺序来的。
+				polygon.add(point2);
 				item.put("id", column.getIntValue("line"));
 				item.put("polygon", polygon);
 

+ 1 - 1
src/main/java/com/example/demo/util/CreateObjUtil.java

@@ -62,7 +62,7 @@ public class CreateObjUtil {
 	}
 
 	public static void ossCommonUtilCp(String fileUrl , String path) throws Exception{
-		String command = "bash /opt/ossutil/ossCommon.sh " + fileUrl + " " + path;
+		String command = "/usr/bin/bash /opt/ossutil/ossCommon.sh " + fileUrl + File.separator + " " + path;
 		Long start = System.currentTimeMillis();
 		log.info("开始oss下载文件:" + command);
 		callshell(command);

+ 2 - 0
src/main/java/com/example/demo/vo/request/RequestRenovationParts.java

@@ -25,4 +25,6 @@ public class RequestRenovationParts extends RequestBase{
     private String userName;
 
     private String ids;
+
+    private Long classifyId;
 }

+ 3 - 3
src/main/resources/application.properties

@@ -8,9 +8,9 @@ spring.servlet.multipart.max-request-size=500MB
 spring.servlet.multipart.enabled=true
 spring.mvc.async.request-timeout=600000
 
-spring.datasource.url=jdbc:mysql://8.129.209.131:3306/4dkankan_v2?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.url=jdbc:mysql://192.168.0.47:3306/change_clothes?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
 spring.datasource.username=root
-spring.datasource.password=4dkk2020cuikuan%
+spring.datasource.password=123123
 spring.datasource.driverClassName=com.mysql.jdbc.Driver
 
 #spring.datasource.url=jdbc:mysql://47.112.166.173:3306/zhi_house?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
@@ -19,7 +19,7 @@ spring.datasource.driverClassName=com.mysql.jdbc.Driver
 #spring.datasource.driverClassName=com.mysql.jdbc.Driver
 
 #rabbitmq
-spring.rabbitmq.host=127.0.0.1
+spring.rabbitmq.host=192.168.0.47
 spring.rabbitmq.port=5672
 spring.rabbitmq.username=guest
 spring.rabbitmq.password=guest