Explorar el Código

1.新增上传资产债权测算表接口
2.优化

GouGengquan hace 5 meses
padre
commit
6a106cd235

+ 2 - 5
biz-base/src/main/java/com/dayou/controller/DocumentProductionController.java

@@ -8,10 +8,7 @@ import com.dayou.result.Result;
 import com.dayou.service.DocumentProductionService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 @RestController
 @RequestMapping("/production")
@@ -39,7 +36,7 @@ public class DocumentProductionController {
      * @return Boolean
      */
     @PostMapping("/save")
-    public Result<Boolean> saveDocumentProduction(DocumentProduction documentProduction) {
+    public Result<Boolean> saveDocumentProduction(@RequestBody DocumentProduction documentProduction) {
         return Result.build(documentProductionService.saveDocumentProduction(documentProduction));
     }
 }

+ 15 - 0
biz-base/src/main/java/com/dayou/controller/FileController.java

@@ -65,6 +65,21 @@ public class FileController {
     }
 
     /**
+     * 上传资产债权测算表
+     * @param multipartFile 文件
+     * @return Result<Map<String, String>> 文件信息
+     */
+    @PostMapping("/assets/uploadCRCalculate")
+    public Result<Map<String, String>> uploadAssetsCRCalculate(MultipartFile multipartFile){
+        // 判断文件类型
+        if (Objects.equals(multipartFile.getContentType(), "application/vnd.ms-excel") || Objects.equals(multipartFile.getContentType(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) {
+            return Result.build(FileNetUtil.uploadToServer(multipartFile, fileNetConfig.getBaseDir(), fileNetConfig.getAssetOutputCalculatePath(), System.currentTimeMillis() + "_债权测算表.xlsx"));
+        }else {
+            return Result.build(Status.PARAM_ERROR, "请上传xls或xlsx类型的excel文档!");
+        }
+    }
+
+    /**
      * 房地产报告-表单1(估价结果一览表、基本信息)
      * @param file
      * @return

+ 5 - 1
domain/src/main/java/com/dayou/enums/DocumentType.java

@@ -18,7 +18,11 @@ public enum DocumentType {
 
     EQPT_CALCULATE("EQPT_CALCULATE","机器设备测算表"),
 
-    EQPT_REPORT("EQPT_REPORT","机器设备融资报告")
+    EQPT_REPORT("EQPT_REPORT","机器设备融资报告"),
+
+    CR_CALCULATE("CR_CALCULATE","债权测算表"),
+
+    CR_REPORT("CR_REPORT","债权分析报告")
     ;
 
     private String name;

+ 1 - 1
service/src/main/java/com/dayou/service/impl/AssetsProjectServiceImpl.java

@@ -80,7 +80,7 @@ public class AssetsProjectServiceImpl extends ServiceImpl<AssetsProjectMapper, A
             // 如果更改了项目类型,且项目下已经创建了测算表或报告就不允许更改项目类型
             int calculateCount = assetsCalculateService.count(new LambdaQueryWrapper<AssetsCalculate>().eq(AssetsCalculate::getProjectId, assetsProject.getId()).eq(BaseEntity::getDeleteStatus, 0));
             int reportCount = assetsReportService.count(new LambdaQueryWrapper<AssetsReport>().eq(AssetsReport::getProjectId, assetsProject.getId()).eq(BaseEntity::getDeleteStatus, 0));
-            if ((ObjectUtil.isNotNull(calculateCount) && calculateCount > 0) || (ObjectUtil.isNotNull(reportCount) && reportCount > 0)) { // 创建了测算表或报告
+            if (calculateCount > 0 || reportCount > 0) { // 创建了测算表或报告
                 return false;
             }
             return this.updateById(assetsProject);