From b6fde711bf33cede4cb84f85146c32b0c0c61aa5 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 04 十一月 2024 09:06:28 +0800
Subject: [PATCH] 优化需求
---
server/service/src/main/java/com/doumee/service/business/impl/SettleClaimsServiceImpl.java | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/SettleClaimsServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/SettleClaimsServiceImpl.java
index 73bb3b4..78951b8 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/SettleClaimsServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/SettleClaimsServiceImpl.java
@@ -40,6 +40,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URLEncoder;
+import java.nio.charset.Charset;
import java.util.*;
import java.util.stream.Collectors;
@@ -125,6 +126,11 @@
Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.SETTLE_CLAIMS;
//鍒犻櫎鍏朵粬寰呭姙
noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,model.getId()));
+
+ Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),model.getInformantName(),
+ model.getCompanyId(), Constants.NoticeType.FOUR);
+ noticesMapper.insert(notices);
+
Constants.SettleClaimsLogType applyLogType = Constants.SettleClaimsLogType.PLATFORM_RETURN;
String info =applyLogType.getInfo();
@@ -440,6 +446,7 @@
List<File> fileList = new ArrayList<>();
List<Multifile> multifileList = multifileJoinMapper.selectList(new QueryWrapper<Multifile>().lambda()
+ .eq(Multifile::getIsdeleted,Constants.ZERO)
.eq(Multifile::getObjId,id)
.isNotNull(Multifile::getFileurl)
.in(Multifile::getObjType, Arrays.asList(new Integer[]{
@@ -449,28 +456,31 @@
Constants.MultiFile.LP_SCZL_FILE.getKey(),
Constants.MultiFile.LP_JACL_FILE.getKey(),
}))
+ .orderByAsc(Multifile::getCreateDate)
);
if(multifileList== null || multifileList.size() == 0){
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.SETTLE_FILE).getCode();
+ Integer sn = 1;
for(Multifile l : multifileList){
- File f = Constants.getFileByNetFile(path + l.getFileurl(),StringUtils.defaultString(l.getName(),"鏈懡鍚�"));
+ File f = Constants.getFileByNetFile(path + l.getFileurl(),StringUtils.defaultString(sn + "_" +l.getName(),"鏈懡鍚�"));
if(f !=null && f.isFile()){
fileList.add(f);
}
+ sn = sn +1;
}
if(fileList == null || fileList.size() == 0){
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
- String fileName = model.getInformantName() +"鐞嗚禂璧勬枡涓媉"+System.currentTimeMillis()+".zip" ;
- String encodeFileName = URLEncoder.encode(fileName);
+ String fileName = model.getInformantName() +"-鐞嗚禂璧勬枡-" +System.currentTimeMillis();
+ String encodeFileName =URLEncoder.encode(fileName, Charset.forName("UTF-8").toString())+".zip";
response.setHeader("Content-Disposition","attachment;filename=" + encodeFileName);
response.setContentType("application/octet-stream");
response.setHeader("eva-opera-type", "download");
response.setHeader("eva-download-filename", encodeFileName);
Constants.packFilesToZip(fileList,response.getOutputStream());
- } catch (IOException e) {
+ } catch (Exception e) {
throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e);
}
}
@@ -795,6 +805,7 @@
.leftJoin(InsuranceApply.class,InsuranceApply::getId,SettleClaims::getInsuranceApplyId)
.leftJoin(Solutions.class,Solutions::getId,SettleClaims::getSolutionId);
queryWrapper.eq(DispatchUnit::getIsdeleted,Constants.ZERO);
+ queryWrapper.eq(SettleClaims::getIsdeleted,Constants.ZERO);
if(Constants.equalsInteger(user.getType(),Constants.ZERO)){
//鍙兘鐪嬫潈闄愯寖鍥村唴
if(user.getCompanyIdList() == null || user.getCompanyIdList().size() == 0){
--
Gitblit v1.9.3