|
|
@@ -9,16 +9,19 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import lombok.SneakyThrows;
|
|
|
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
|
|
|
import org.sky.core.log.exception.ServiceException;
|
|
|
import org.sky.core.secure.utils.SecureUtil;
|
|
|
+import org.sky.core.tool.utils.DateUtil;
|
|
|
import org.sky.core.tool.utils.Func;
|
|
|
import org.sky.scientific.mapper.ArchiveAttachMapper;
|
|
|
import org.sky.scientific.mapper.SettingMapper;
|
|
|
-import org.sky.scientific.pojo.dto.XmTechnicianDto;
|
|
|
+import org.sky.scientific.pojo.dto.*;
|
|
|
import org.sky.scientific.pojo.entity.ArchiveAttachEntity;
|
|
|
import org.sky.scientific.pojo.entity.SettingEntity;
|
|
|
import org.sky.scientific.pojo.entity.XmFinanceEntity;
|
|
|
+import org.sky.scientific.pojo.entity.XmLeaseEntity;
|
|
|
import org.sky.scientific.pojo.vo.XmTechnicianHoursVO;
|
|
|
import org.sky.scientific.service.*;
|
|
|
import org.sky.scientific.utils.ZipDir;
|
|
|
@@ -34,6 +37,7 @@ import java.nio.file.Path;
|
|
|
import java.nio.file.Paths;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.zip.Deflater;
|
|
|
|
|
|
@Service
|
|
|
@@ -53,6 +57,18 @@ public class ArchiveServiceImpl implements IArchiveService {
|
|
|
private IXmTechnicianHoursService xmTechnicianHoursService;
|
|
|
@Resource
|
|
|
private ITechnicianService technicianService;
|
|
|
+ @Resource
|
|
|
+ private IXmGoodsService xmGoodsService;
|
|
|
+ @Resource
|
|
|
+ private IXmLeaseService xmLeaseService;
|
|
|
+ @Resource
|
|
|
+ private IXmAssetHoursService hoursService;
|
|
|
+ @Resource
|
|
|
+ private IXmFixedAssetService xmFixedAssetService;
|
|
|
+ @Resource
|
|
|
+ private IXmIntangibleAssetService xmIntangibleAssetService;
|
|
|
+ @Resource
|
|
|
+ private IXmService xmService;
|
|
|
|
|
|
@Value("${archive.dir}")
|
|
|
private String archiveDir;
|
|
|
@@ -202,42 +218,64 @@ public class ArchiveServiceImpl implements IArchiveService {
|
|
|
if (Func.isBlank(year)) {
|
|
|
throw new ServiceException("参数year不能为空");
|
|
|
}
|
|
|
-// try {
|
|
|
-//
|
|
|
-// Files.deleteIfExists(Paths.get(archiveDir, SecureUtil.getTenantId(), year));
|
|
|
-// } catch (IOException e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
|
|
|
ArchiveAttachEntity archiveAttach = attachMapper.selectOne(Wrappers.<ArchiveAttachEntity>lambdaQuery().eq(ArchiveAttachEntity::getYearAndMonth, year));
|
|
|
if (archiveAttach == null) {
|
|
|
archiveAttach = new ArchiveAttachEntity();
|
|
|
}
|
|
|
+ //1 高新技术企业资格证书:基础资源管理-企业基本信息-高企证书上传(按年度)。未上传则为空
|
|
|
generateD1(year);
|
|
|
- generateD2(archiveAttach.getD3(), year, "高新技术企业认定资料");
|
|
|
- generateD2(archiveAttach.getD10(), year, "加计扣除情况说明");
|
|
|
- generateD2(archiveAttach.getD13(), year, "研发立项决议文件");
|
|
|
- generateD5(year, 2, "高新-研发项目清单表");
|
|
|
- generateD5(year, 3, "加计扣除研发项目汇总表");
|
|
|
- generateD7(year, 2, "高新研发项目全套技术资料");
|
|
|
- generateD7(year, 3, "加计扣除研发项目全套技术资料");
|
|
|
- generateD11(year, 0, "全部知识产权资料");
|
|
|
- generateD11(year, 2, "高新项目知识产权资料");
|
|
|
- generateD11(year, 3, "加计扣除项目知识产权资料");
|
|
|
- generateD14(year, "高新口径研发费用辅助账");
|
|
|
- generateD15(year, "加计扣除口径研发费用辅助账");
|
|
|
- generateD16(year, "会计口径研发费用辅助账");
|
|
|
-
|
|
|
- generateD17(year, 1, "会计口径研发费用附件凭证资料及相关说明");
|
|
|
- generateD17(year, 2, "高新研发费用附件凭证资料及相关说明");
|
|
|
- generateD17(year, 3, "加计扣除研发费用附件凭证资料及相关说明");
|
|
|
- generateD20(year, "A107012研发费用加计扣除优惠明细表");
|
|
|
-
|
|
|
+ //2 高新技术企业认定资料:附件补充
|
|
|
+ generateD2(archiveAttach.getD3(), year, "2.高新技术企业认定资料");
|
|
|
+ //3 加计扣除情况说明:附件补充
|
|
|
+ generateD2(archiveAttach.getD10(), year, "3.加计扣除情况说明");
|
|
|
+ //4 研发立项决议文件:附件补充
|
|
|
+ generateD2(archiveAttach.getD13(), year, "4.研发立项决议文件");
|
|
|
+ //5 高新研发项目汇总表:对外报表-高新口径研发费用报表-高新-研发项目清单表
|
|
|
+ generateD5(year, 2, "5.高新研发项目汇总表");
|
|
|
+ //6 加计扣除研发项目汇总表:对外报表-加计扣除口径研发费用报表-加计扣除-研发项目清单表
|
|
|
+ generateD5(year, 3, "6.加计扣除研发项目汇总表");
|
|
|
+ //7.高新研发项目全套技术资料:对外报表-高新口径研发费用报表-高新-研发项目清单中的所有研发项目的全套技术资料,每一个项目,都包括:项目立项表+上传的所有附件;项目实施表(含多个表)+所有附件;项目变更(多个表)+所有附件;项目结题(多个表)+所有附件;委外项目表+所有附件。
|
|
|
+ generateD7(year, 2, "7.高新研发项目全套技术资料");
|
|
|
+ //8 加计扣除研发项目全套技术资料:对外报表-加计扣除口径研发费用报表-加计扣除-研发项目清单中的所有研发项目的全套技术资料,每一个项目,都包括:项目立项表+上传的所有附件;项目实施表(含多个表)+所有附件;项目变更(多个表)+所有附件;项目结题(多个表)+所有附件;委外项目表+所有附件。
|
|
|
+ generateD7(year, 3, "8.加计扣除研发项目全套技术资料");
|
|
|
+ //9 高新研发人员与科技人员资料:改成高新科技人员资料:即科技人员管理-年高新科技人员汇总表资料表,选出:对外报表-高新口径研发费用报表-高新-研发项目清单中项目人员汇总
|
|
|
+ generateD9(year, 2);
|
|
|
+ //10 加计扣除研发人员与科技人员资料:改成加计扣除项目科研人员资料:即科技人员管理-项目人员汇总表,选出:对外报表-加计扣除口径研发费用报表-加计扣除-研发项目清单中项目人员汇总
|
|
|
+ generateD9(year, 3);
|
|
|
+ //11 11.全部知识产权资料(汇总表、附件):当年度所有科研成果列表导出,及所有附件资料的下载
|
|
|
+ generateD11(year, 0, "11.全部知识产权资料");
|
|
|
+ //12 高新项目知识产权资料(汇总表、附件):对外报表-高新口径研发费用报表-高新-研发项目清单中的科研成果列表及所有附件资料的下载
|
|
|
+ generateD11(year, 2, "12.高新项目知识产权资料");
|
|
|
+ //13 加计扣除项目知识产权资料(汇总表、附件):对外报表-加计扣除口径研发费用报表-加计扣除-研发项目清单中的科研成果列表及所有附件资料的下载
|
|
|
+ generateD11(year, 3, "13.加计扣除项目知识产权资料");
|
|
|
+ //14 高新口径研发费用辅助账:对外报表-高新口径研发费用报表-高新-研发支出辅助账
|
|
|
+ generateD14(year, "14.高新口径研发费用辅助账");
|
|
|
+ //15 加计扣除口径研发费用辅助账:对外报表-加计扣除口径研发费用报表-加计扣除-研发支出辅助账
|
|
|
+ generateD15(year, "15.加计扣除口径研发费用辅助账");
|
|
|
+ //16 会计口径研发费用辅助账:对外报表-会计加计扣除口径研发费用报表-会计-研发支出辅助账
|
|
|
+ generateD16(year, "16.会计口径研发费用辅助账");
|
|
|
+ //17.会计口径研发费用附件凭证资料及相关说明:对外报表-会计加计扣除口径研发费用报表-会计-研发项目(见列表详细)
|
|
|
+ generateD17(year, 1, "17.会计口径研发费用附件支撑资料及相关说明");
|
|
|
+ //18.高新研发费用附件凭证资料及相关说明:对外报表-高新口径研发费用报表-高新-研发项目(见列表详细)
|
|
|
+ generateD17(year, 2, "18.高新研发费用附件支持资料及相关说明");
|
|
|
+ //19.加计扣除研发费用附件凭证资料及相关说明:对外报表-加计扣除口径研发费用报表-加计扣除-研发项目(见列表详细)
|
|
|
+ generateD17(year, 3, "19.加计扣除研发费用附件支撑资料及相关说明");
|
|
|
+ //20.A107012研发费用加计扣除优惠明细表:A107012导出表
|
|
|
+ generateD20(year, "20.A107012研发费用加计扣除优惠明细表");
|
|
|
+ //21.当年和前两个会计年度研发费用总额及占同期销售收入比例的说明:附件补充
|
|
|
+ //22.年度主要产品(服务)发挥核心支持作用的技术属于《国家重点支持的高新技术领域》规定范围的说明:附件补充
|
|
|
+ //23.高新技术产品(服务)及对应收入资料:附件补充
|
|
|
+ //24.研发管理制度:附件补充
|
|
|
+ //25.高新项目技术鉴定资料:附件补充
|
|
|
+ //26.加计扣除项目技术鉴定资料:附件补充
|
|
|
+ //27.其他高新备查资料:附件补充
|
|
|
+ //28.其他加计扣除备查资料:附件补充
|
|
|
}
|
|
|
|
|
|
private boolean generateD1(String year) {
|
|
|
try {
|
|
|
- Path path = Paths.get(archiveDir, SecureUtil.getTenantId(), year, "高新技术企业资格证书");
|
|
|
+ Path path = Paths.get(archiveDir, SecureUtil.getTenantId(), year, "1.高新技术企业资格证书");
|
|
|
FileUtil.mkdir(path);
|
|
|
SettingEntity one = settingMapper.selectOne(Wrappers.<SettingEntity>lambdaQuery().eq(SettingEntity::getYearAndMonth, year));
|
|
|
if (Func.notNull(one) && Func.isNotBlank(one.getHighTechUrl())) {
|
|
|
@@ -295,31 +333,55 @@ public class ArchiveServiceImpl implements IArchiveService {
|
|
|
dto.setYearAndMonth(year);
|
|
|
dto.setType(type);
|
|
|
List<XmFinanceEntity> list = xmFinanceService.selectXmFinanceList(dto);
|
|
|
+ AtomicInteger index = new AtomicInteger(1);
|
|
|
for (XmFinanceEntity xm : list) {
|
|
|
//创建项目文件夹
|
|
|
- Path xmmcPath = FileUtil.mkdir(Paths.get(path.toString(), xm.getXmmc()));
|
|
|
- //项目立项表\附件
|
|
|
-
|
|
|
- //项目实施表\附件
|
|
|
- //项目变更表\附件
|
|
|
- //项目结题表\\附件
|
|
|
- //委外项目表\\附件
|
|
|
+ Path xmmcPath = FileUtil.mkdir(Paths.get(path.toString(), index.get() + "." + xm.getXmmc()));
|
|
|
+ //1.项目立项
|
|
|
+ Path path1 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "1.项目立项"));
|
|
|
+ FileOutputStream os = new FileOutputStream(path1 + "/" + xm.getXmmc() + "项目立项表.doc");
|
|
|
+ xmService.exportApprovalInfo(os, xm.getXmId());
|
|
|
+ //2.研发预算编制
|
|
|
+ Path path2 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "2.研发预算编制"));
|
|
|
+ //3.项目实施
|
|
|
+ Path path3 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "3.项目实施"));
|
|
|
+ //4.项目变更
|
|
|
+ Path path4 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "4.项目变更"));
|
|
|
+ //5.项目结题
|
|
|
+ Path path5 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "5.项目结题"));
|
|
|
+ //6.项目成果
|
|
|
+ Path path6 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "6.项目成果"));
|
|
|
+ //7.委外项目
|
|
|
+ Path path7 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "7.委外项目"));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
-
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private ZipDir generateD8(String year) {
|
|
|
- ZipDir dir = new ZipDir("加计扣除研发项目全套技术资料");
|
|
|
- return dir;
|
|
|
- }
|
|
|
-
|
|
|
- private ZipDir generateD9(String year) {
|
|
|
- ZipDir dir = new ZipDir("高新研发人员与科技人员资料");
|
|
|
- return dir;
|
|
|
+ private boolean generateD9(String year, Integer type) {
|
|
|
+ //type,2:高科技人员资料,3:加计扣除人员资料
|
|
|
+ String title = type == 2 ? "9.高新科技人员资料" : "10.加计扣除项目科研人员资料";
|
|
|
+ Path path = Paths.get(archiveDir, SecureUtil.getTenantId(), year, title);
|
|
|
+ try {
|
|
|
+ FileUtil.mkdir(path);
|
|
|
+ XmFinanceEntity dto = new XmFinanceEntity();
|
|
|
+ dto.setYearAndMonth(year);
|
|
|
+ dto.setType(type);
|
|
|
+ List<XmFinanceEntity> list = xmFinanceService.selectXmFinanceList(dto);
|
|
|
+ List<Long> xmIdList = list.stream().map(XmFinanceEntity::getXmId).toList();
|
|
|
+ if (Func.isNotEmpty(xmIdList)) {
|
|
|
+ FileOutputStream out = new FileOutputStream(path + "/" + title + ".xlsx");
|
|
|
+ TechnicianDTO param = new TechnicianDTO();
|
|
|
+ param.setYearAndMonth(year);
|
|
|
+ param.setXmIdList(xmIdList);
|
|
|
+ technicianService.exportNdgkjryhzb(out, param);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
private ZipDir generateD10(String year) {
|
|
|
@@ -370,9 +432,9 @@ public class ArchiveServiceImpl implements IArchiveService {
|
|
|
}
|
|
|
|
|
|
private boolean generateD17(String year, Integer type, String title) {
|
|
|
- //会计口径研发费用附件凭证资料及相关说明
|
|
|
- //高新研发费用附件凭证资料及相关说明
|
|
|
- //加计扣除研发费用附件凭证资料及相关说明
|
|
|
+ //17 会计口径研发费用附件凭证资料及相关说明
|
|
|
+ //18 高新研发费用附件凭证资料及相关说明
|
|
|
+ //19 加计扣除研发费用附件凭证资料及相关说明
|
|
|
Path path = Paths.get(archiveDir, SecureUtil.getTenantId(), year, title);
|
|
|
|
|
|
try {
|
|
|
@@ -382,7 +444,6 @@ public class ArchiveServiceImpl implements IArchiveService {
|
|
|
dto.setYearAndMonth(year);
|
|
|
dto.setType(type);
|
|
|
List<XmFinanceEntity> list = xmFinanceService.selectXmFinanceList(dto);
|
|
|
-
|
|
|
for (XmFinanceEntity xm : list) {
|
|
|
//创建项目文件夹
|
|
|
Path xmmcPath = FileUtil.mkdir(Paths.get(path.toString(), xm.getXmmc()));
|
|
|
@@ -400,28 +461,37 @@ public class ArchiveServiceImpl implements IArchiveService {
|
|
|
}
|
|
|
//2 每月研发人员人工分配表
|
|
|
Path path2 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "每月研发人员人工分配表"));
|
|
|
+
|
|
|
for (int i = 1; i <= 12; i++) {
|
|
|
String yearAndMonth = year + (i < 10 ? "0" + i : i);
|
|
|
FileOutputStream fos = new FileOutputStream(path2 + "/" + yearAndMonth + "每月研发人员人工分配表.xlsx");
|
|
|
XmTechnicianDto param = new XmTechnicianDto();
|
|
|
param.setTenantId(SecureUtil.getTenantId());
|
|
|
param.setYearAndMonth(yearAndMonth);
|
|
|
+ param.setXmId(xm.getXmId());
|
|
|
technicianService.exportMeiyueyanfarengongfeiyongfeifenpeibiao(fos, param);
|
|
|
}
|
|
|
//3 研发领料单
|
|
|
Path path3 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "研发领料单"));
|
|
|
+ this.generateLinliaodan(year, path3, xm.getXmId(), "材料");
|
|
|
//4 研发动力消耗单
|
|
|
Path path4 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "研发动力消耗单"));
|
|
|
+ this.generateLinliaodan(year, path4, xm.getXmId(), "动力");
|
|
|
//5 研发燃料消耗单
|
|
|
Path path5 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "研发燃料消耗单"));
|
|
|
+ this.generateLinliaodan(year, path5, xm.getXmId(), "燃料");
|
|
|
//6 研发租赁资产费用分配表
|
|
|
Path path6 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "研发租赁资产费用分配表"));
|
|
|
+ this.generateLeaseAsset(year, path6, xm.getXmId());
|
|
|
//7 科研仪器设备工时登记表
|
|
|
Path path7 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "科研仪器设备工时登记表"));
|
|
|
+ this.generateHoursAsset(year, path7, xm.getXmId());
|
|
|
//8 科研仪器设备折旧费用分配表
|
|
|
Path path8 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "科研仪器设备折旧费用分配表"));
|
|
|
+ this.generateCostAsset(year, path8, xm.getXmId());
|
|
|
//9 科研无形资产摊销费用分配表
|
|
|
Path path9 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "科研无形资产摊销费用分配表"));
|
|
|
+ this.generateWxzctxAsset(year, path9, xm.getXmId());
|
|
|
//10委外研发
|
|
|
Path path10 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "委外研发"));
|
|
|
}
|
|
|
@@ -432,6 +502,96 @@ public class ArchiveServiceImpl implements IArchiveService {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @SneakyThrows
|
|
|
+ private void generateWxzctxAsset(String year, Path path, Long xmId) {
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
+ String yearAndMonth = year + (i < 10 ? "0" + i : i);
|
|
|
+ FileOutputStream os = new FileOutputStream(path + "/" + yearAndMonth + "科研无形资产摊销费用分配表.xlsx");
|
|
|
+ XmAssetQueryParam param = new XmAssetQueryParam();
|
|
|
+ param.setYearAndMonth(yearAndMonth);
|
|
|
+ param.setXmId(xmId);
|
|
|
+ xmIntangibleAssetService.exportKeyanwuxingzichanfenpeibiao(os, param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @SneakyThrows
|
|
|
+ private void generateCostAsset(String year, Path path, Long xmId) {
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
+ String yearAndMonth = year + (i < 10 ? "0" + i : i);
|
|
|
+ FileOutputStream os = new FileOutputStream(path + "/" + yearAndMonth + "科研仪器设备折旧费用分配表.xlsx");
|
|
|
+ XmAssetQueryParam param = new XmAssetQueryParam();
|
|
|
+ param.setYearAndMonth(yearAndMonth);
|
|
|
+ param.setXmId(xmId);
|
|
|
+ xmFixedAssetService.exportKeyanyiqishebeizhejiufeiyongfenpeibiao(os, param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @SneakyThrows
|
|
|
+ private void generateHoursAsset(String year, Path path, Long xmId) {
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
+ String yearAndMonth = year + (i < 10 ? "0" + i : i);
|
|
|
+ FileOutputStream os = new FileOutputStream(path + "/" + yearAndMonth + "科研仪器设备工时登记表.xlsx");
|
|
|
+ XmAssetHoursDto param = new XmAssetHoursDto();
|
|
|
+ param.setYearAndMonth(yearAndMonth);
|
|
|
+ param.setXmId(xmId);
|
|
|
+ hoursService.exportXmAssetHours(os, param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @SneakyThrows
|
|
|
+ private void generateLeaseAsset(String year, Path path, Long xmId) {
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
+ String yearAndMonth = year + (i < 10 ? "0" + i : i);
|
|
|
+ XmLeaseEntity param = new XmLeaseEntity();
|
|
|
+ param.setType("仪器设备");
|
|
|
+ param.setYearAndMonth(yearAndMonth);
|
|
|
+ param.setXmId(xmId);
|
|
|
+ List<JSONObject> leaseList = xmLeaseService.yanfazulinzichanfeiyongfenpeibiao(param);
|
|
|
+ if (Func.isEmpty(leaseList)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (JSONObject o : leaseList) {
|
|
|
+ for (String key : o.keySet()) {
|
|
|
+ String[] arr = key.split(":");
|
|
|
+ String useDate = arr[1];
|
|
|
+ FileOutputStream fos = new FileOutputStream(path + "/" + useDate + "研发租赁资产费用分配表.xlsx");
|
|
|
+ param.setLeaseDate(DateUtil.parse(useDate, DateUtil.PATTERN_DATE));
|
|
|
+ xmLeaseService.exportYanfazulinzichanfeiyongfenpeibiao(fos, param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @SneakyThrows
|
|
|
+ private void generateLinliaodan(String year, Path path, Long xmId, String type) {
|
|
|
+ String fileName = type.equals("材料") ? "研发领料单" : (type.equals("动力") ? "研发动力消耗单" : "研发燃料消耗单") + ".xlsx";
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
+ String yearAndMonth = year + (i < 10 ? "0" + i : i);
|
|
|
+ XmGoodsDTO param = new XmGoodsDTO();
|
|
|
+ param.setType(type);
|
|
|
+ param.setYearAndMonth(yearAndMonth);
|
|
|
+ param.setXmId(xmId);
|
|
|
+ List<JSONObject> cailiaoList = xmGoodsService.yanfalingliaodan(param);
|
|
|
+ if (Func.isEmpty(cailiaoList)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (JSONObject o : cailiaoList) {
|
|
|
+ for (String key : o.keySet()) {
|
|
|
+ String[] arr = key.split(":");
|
|
|
+
|
|
|
+ String useDate = arr[1];
|
|
|
+ FileOutputStream fos = new FileOutputStream(path + "/" + useDate + fileName);
|
|
|
+ param = new XmGoodsDTO();
|
|
|
+ param.setYearAndMonth(yearAndMonth);
|
|
|
+ param.setType(type);
|
|
|
+ param.setXmId(xmId);
|
|
|
+ param.setUseDate(DateUtil.parse(useDate, DateUtil.PATTERN_DATE));
|
|
|
+ xmGoodsService.exportYanfalingliaodan(fos, param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private boolean generateD20(String year, String title) {
|
|
|
//A107012研发费用加计扣除优惠明细表
|
|
|
Path path = Paths.get(archiveDir, SecureUtil.getTenantId(), year, title);
|