houweiyu 4 éve
szülő
commit
119c8fde6a

+ 1 - 1
src/main/java/fcb/project/manager/base/service/impl/TmAuditServiceImpl.java

@@ -60,7 +60,7 @@ public class TmAuditServiceImpl extends ServiceImpl<TmAuditDao, TmAudit> impleme
         if(null == tmAudit){
             return -1;
         }
-        if(null != tmAudit.getId()){
+        if(null == tmAudit.getId()){
             return -1;
         }
         tmAudit.setUpdateTime(LocalDateTime.now());

+ 16 - 5
src/main/java/fcb/project/manager/core/controller/AuditController.java

@@ -3,6 +3,7 @@ package fcb.project.manager.core.controller;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import fcb.project.manager.base.entity.TmAudit;
 import fcb.project.manager.base.entity.TmHouse;
+import fcb.project.manager.base.enums.HouseStatus;
 import fcb.project.manager.base.service.impl.TmAuditServiceImpl;
 import fcb.project.manager.base.service.impl.TmHouseServiceImpl;
 import fcb.project.manager.base.utils.DataUtils;
@@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
+import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -66,11 +68,12 @@ public class AuditController {
     @PostMapping("/doAudit")
     @ApiOperation(value = "审核")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "审核记录ID", paramType = "query", required = false, dataType = "String"),
-            @ApiImplicitParam(name = "auditStatus", value = "审核状态: 0->待审核;1->已审核;-1->不通过", paramType = "query", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "id", value = "审核记录ID", paramType = "query", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "auditStatus", value = "审核状态: 0->待审核;1->已审核;-1->不通过", paramType = "query", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "auditRemark", value = "审核备注", paramType = "query", required = true, dataType = "String"),
     })
     @Transactional(rollbackFor = Exception.class)
-    public Result<Object> audit(String id , Integer auditStatus){
+    public Result<Object> audit(String id , Integer auditStatus , String auditRemark){
 
         if(StringUtils.isBlank(id) || null == auditStatus){
             return Result.failure("审核记录ID或者审核结果不能为空");
@@ -93,16 +96,24 @@ public class AuditController {
             return Result.failure("抢锁失败");
         }
         TmHouse dbHouse = tmHouseService.selectForUpdate(tmAudit.getVrId());
-        if(null == tmAudit){
+        if(null == dbHouse){
             log.info("更新审核状态环节,审核记录[{}]抢锁失败" , id);
             return Result.failure("抢锁失败");
         }
-        //TODO:这里需要增加更新审核人
         tmAudit.setAuditStatus(auditStatus);
+        tmAudit.setAuditRemark(auditRemark);
         int update = tmAuditService.updateAudit(tmAudit);
         if(update != 1){
            throw new CommonBaseException(ResultCodeEnum.D101 , "更新审核记录失败");
         }
+        dbHouse.setStatus(HouseStatus.AUDITED.getCode());
+        dbHouse.setAuditId(tmAudit.getId());
+        dbHouse.setAuditTime(LocalDateTime.now());
+        //TODO:这里需要增加更新审核人
+        dbHouse.setAuditorName("");
+        if(!tmHouseService.updateHouse(dbHouse)){
+            throw new CommonBaseException(ResultCodeEnum.D101 , "更新房源记录失败");
+        }
         Map<String , Object> resMap = new HashMap<>();
         resMap.put("auditId" , tmAudit.getId());
         return Result.success("审核成功" , resMap);

+ 11 - 4
src/main/java/fcb/project/manager/core/controller/HouseManagerController.java

@@ -151,16 +151,22 @@ public class HouseManagerController {
         if(StringUtils.isBlank(tmHouse.getSceneNum())){
             return Result.failure("改房源未生成场景码");
         }
-
-        String localPath = imageLocalPath + file.getOriginalFilename();
-        String downLoanVideoPath = FileUtils.parseFile(file, localPath);
+        int index = file.getOriginalFilename().indexOf(".");
+        String newFileName = System.currentTimeMillis() + "";
+        if(index != -1){
+            newFileName = newFileName + file.getOriginalFilename().substring(index);
+        }
+        if(StringUtils.isBlank(newFileName)){
+            return Result.failure("获取文件后缀名失败");
+        }
+        String downLoanVideoPath = FileUtils.parseFile(file, imageLocalPath  , newFileName);
         log.info("照片文件已经下载到本地:{}", downLoanVideoPath);
 
         String totalVrUrl = sceneVrHost + sceneVrLink + tmHouse.getId() + "&s=" + tmHouse.getSceneNum();
         String outPutImageName = System.currentTimeMillis() + ".jpg";
         String outPutImageResultPath = imageLocalPath + outPutImageName;
         try {
-            DataUtils.createQRCode(totalVrUrl ,  outPutImageResultPath , localPath);
+            DataUtils.createQRCode(totalVrUrl ,  outPutImageResultPath , downLoanVideoPath);
         } catch (Exception e) {
             e.printStackTrace();
             log.info("生成分享二维码出现异常");
@@ -336,6 +342,7 @@ public class HouseManagerController {
                 throw new CommonBaseException(ResultCodeEnum.D101 , "抢锁失败");
             }
             dbHouse.setAuditId(tmAudit.getId());
+            dbHouse.setStatus(HouseStatus.WAITING_AUDIT.getCode());
             dbHouse.setUpdateTime(LocalDateTime.now());
             if(!tmHouseService.updateHouse(dbHouse)){
                 log.info("更新房源的审批id失败");

+ 1 - 1
src/main/resources/application-dev.properties

@@ -39,5 +39,5 @@ oss.bucket=4d-tjw
 share.logo.oss.path=domain/4dhouse/
 oss.query.url=https://houseoss.4dkankan.com/
 image.local.path=C:\\Users\\4dage\\Desktop\\logo-file\\
-vr.scene.host=test.com
+vr.scene.host=https://fcb.test.4dkankan.com/
 vr.scene.link=/vrscene/show.html?m=

+ 1 - 1
src/main/resources/application-prod.properties

@@ -40,5 +40,5 @@ oss.bucket=4d-tjw
 share.logo.oss.path=domain/4dhouse/
 oss.query.url=https://houseoss.4dkankan.com/
 image.local.path=/image/
-vr.scene.host=test.com
+vr.scene.host=https://fcb.test.4dkankan.com
 vr.scene.link=/vrscene/show.html?m=

+ 1 - 1
src/main/resources/application-test.properties

@@ -41,5 +41,5 @@ oss.bucket=4d-tjw
 share.logo.oss.path=domain/4dhouse/
 oss.query.url=https://houseoss.4dkankan.com/
 image.local.path=/image/
-vr.scene.host=test.com
+vr.scene.host=https://fcb.test.4dkankan.com
 vr.scene.link=/vrscene/show.html?m=

+ 7 - 2
src/main/resources/application.properties

@@ -1,8 +1,8 @@
 
 
 #spring.profiles.active=prod
-spring.profiles.active=dev
-#spring.profiles.active=test
+#spring.profiles.active=dev
+spring.profiles.active=test
 
 #应用名
 spring.application.name=fbc-project-manager
@@ -19,6 +19,11 @@ rocketmq.consumer.topic=abner-test
 mybatis-plus.global-config.db-config.logic-delete-value=1
 mybatis-plus.global-config.db-config.logic-not-delete-value=0
 
+# 设置单个文件大小
+spring.servlet.multipart.max-file-size= 50MB
+#设置单次请求文件的总大小
+spring.servlet.multipart.max-request-size= 50MB
+