|
@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -121,12 +122,41 @@ public class BizFinancialIndividualIncomeTaxDetailController extends BaseControl
|
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
{
|
|
{
|
|
BizFinancialIndividualIncomeTaxDetail biz= bizFinancialIndividualIncomeTaxDetailService.getById(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()));
|
|
biz.setReportFiles(bizFinancialIndividualIncomeTaxDetailService.getFiles(biz.getId()));
|
|
-
|
|
|
|
return success(biz);
|
|
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')")
|
|
@PreAuthorize("@ss.hasPermi('business:individualIncomeTaxDetail:saveDetail')")
|
|
@ApiOperation("保存detail")
|
|
@ApiOperation("保存detail")
|
|
@Log(title = "个税详情", businessType = BusinessType.UPDATE)
|
|
@Log(title = "个税详情", businessType = BusinessType.UPDATE)
|