Browse Source

Merge branch 'develop'

ly 1 năm trước cách đây
mục cha
commit
d1b3055933

+ 1 - 1
run.sh

@@ -24,7 +24,7 @@ echo '----build image----'
 docker run -p ${app_port}:${app_port} --name ${app_name} --network yzbh_network \
 -e 'spring.profiles.active'=${profile_active} \
 -e TZ="Asia/Shanghai" \
--v /home/build/${volume_name}/logs:/var/logs \
+-v /home/build/${volume_name}/logs:/home/ruoyi/logs \
 -v /home/files:/home/files \
 -d ${group_name}/${app_name}:${app_version}
 echo '----start container----'

+ 32 - 2
src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTax/controller/BizFinancialIndividualIncomeTaxDetailController.java

@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -121,12 +122,41 @@ public class BizFinancialIndividualIncomeTaxDetailController extends BaseControl
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
         BizFinancialIndividualIncomeTaxDetail biz= bizFinancialIndividualIncomeTaxDetailService.getById(id);
+        List<SysFileStorage> files = bizFinancialIndividualIncomeTaxDetailService.getFiles(biz.getId());
+        if (CollectionUtils.isEmpty(files)){
+            ArrayList<SysFileStorage> objects = new ArrayList<>();
+            SysFileStorage sysFileStorage = new SysFileStorage();
+            sysFileStorage.setFileUrl(biz.getReportFile());
+            String[] parts = splitFileName(biz.getReportFile());
+            sysFileStorage.setFileName(parts[0]);
+            sysFileStorage.setOriginalFileName(parts[1]);
+            objects.add(sysFileStorage);
+            biz.setReportFiles(objects);
+            return success(biz);
+        }
         biz.setReportFiles(bizFinancialIndividualIncomeTaxDetailService.getFiles(biz.getId()));
-
         return success(biz);
     }
 
-
+    public  String[] splitFileName(String filePath) {
+        // 从路径中获取文件名部分
+        String[] pathParts = filePath.split("/");
+        String fileNameWithExtension = pathParts[pathParts.length - 1]; // 获取最后一部分,即文件名部分
+
+        // 从文件名中去除时间戳部分
+        int dotIndex = fileNameWithExtension.lastIndexOf('.');
+        String fileName = fileNameWithExtension.substring(0, dotIndex); // 获取文件名(不含扩展名)
+        String extension = fileNameWithExtension.substring(dotIndex); // 获取扩展名
+
+        // 去除时间戳部分
+        int underscoreIndex = fileName.lastIndexOf('_');
+        if (underscoreIndex != -1) {
+            String originalFilename = fileName.substring(0, underscoreIndex) + extension;
+            return new String[] { fileNameWithExtension, originalFilename };
+        } else {
+            return new String[] { fileNameWithExtension, fileNameWithExtension }; // 如果没有找到时间戳,则原始文件名与文件名相同
+        }
+    }
     @PreAuthorize("@ss.hasPermi('business:individualIncomeTaxDetail:saveDetail')")
     @ApiOperation("保存detail")
     @Log(title = "个税详情", businessType = BusinessType.UPDATE)

+ 1 - 0
src/main/resources/application-dev.yml

@@ -86,6 +86,7 @@ spring:
                 wall:
                     config:
                         multi-statement-allow: true
+            socket-timeout: 3600000
 # 文件上传
 ruoyi:
     profile: /home/ruoyi/yzbh/

+ 1 - 0
src/main/resources/application-linux.yml

@@ -82,6 +82,7 @@ spring:
                 wall:
                     config:
                         multi-statement-allow: true
+            socket-timeout: 3600000
 # 文件上传
 ruoyi:
     profile: /home/files/yzbh/