报销单附件处理

This commit is contained in:
xiang2lin 2025-04-09 10:43:37 +08:00
parent 9ef284e9f3
commit fd6ec2e156
3 changed files with 5 additions and 11 deletions

View File

@ -44,15 +44,7 @@ public class ExpensePluginServiceImpl implements IExpensePluginService {
Assert.notEmpty(dataSouceCode,"数据源编码不能为空"); Assert.notEmpty(dataSouceCode,"数据源编码不能为空");
logger.info("准备开始组装参数"); logger.info("准备开始组装参数");
String param = oerDjmlExtService.saveExpensePrePlugin(json); String param = oerDjmlExtService.saveExpensePrePlugin(json);
logger.info("准备过滤fileInfo参数66666"); logger.info("OA单据组装好准备保存GRP的参数:{}",param);
//这里为了方便打印参数排除掉参数里的fileInfoList 这个字段比较大打印日志会卡死
String paramNew = new String(param);
OerDjmlEntity oerDjmlEntity = JSON.parseObject(paramNew, OerDjmlEntity.class);
if (null != oerDjmlEntity && CollectionUtils.isNotEmpty(oerDjmlEntity.getFileInfoList())){
oerDjmlEntity.setFileInfoList(null);
}
logger.info("过滤fileInfo参数完成77777");
logger.info("OA单据组装好准备保存GRP的参数:{}",JSONObject.toJSON(oerDjmlEntity));
JSONObject paramJSON = new JSONObject(); JSONObject paramJSON = new JSONObject();
paramJSON.put("jsonStr",param); paramJSON.put("jsonStr",param);
JsonResultEntity resultEntity = (JsonResultEntity) oerDjmlService.handleOerDjml(paramJSON); JsonResultEntity resultEntity = (JsonResultEntity) oerDjmlService.handleOerDjml(paramJSON);

View File

@ -11,6 +11,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File;
import java.util.List; import java.util.List;
/** /**
@ -47,9 +48,10 @@ public class PluginTest {
@Test @Test
public void fileDownloadTest(){ public void fileDownloadTest(){
List<FileInfoDTO> fileInfoDTOList = oerDjmlExtServiceImpl.fileDownload("3304665242408406647", "8000400011"); List<FileInfoDTO> fileInfoDTOList = oerDjmlExtServiceImpl.fileDownloadV1("3304665242408406647", "8000400011");
String djmlStr = JSONObject.toJSONString(fileInfoDTOList); String djmlStr = JSONObject.toJSONString(fileInfoDTOList);
System.out.println(djmlStr); System.out.println(djmlStr);
File file = new File(fileInfoDTOList.get(0).getZip_file_path());
System.out.println(fileInfoDTOList.size()); System.out.println(fileInfoDTOList.size());
} }
} }

View File

@ -709,7 +709,7 @@ public class OerDjmlExtServiceImpl implements IOerDjmlExtService {
try (FileInputStream fos = new FileInputStream(file); try (FileInputStream fos = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fos)) { BufferedInputStream bis = new BufferedInputStream(fos)) {
logger.info("=====压缩文件====="); logger.info("=====压缩文件=====");
zos.putNextEntry(new ZipEntry(fileUrl+fileName )); zos.putNextEntry(new ZipEntry(fileName ));
int len; int len;
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
while ((len = bis.read(buf, 0, 1024)) != -1) { while ((len = bis.read(buf, 0, 1024)) != -1) {