|
@@ -167,11 +167,19 @@ public class XmCqdtfyServiceImpl extends BaseServiceImpl<XmCqdtfyMapper, XmCqdtf
|
|
|
@Override
|
|
@Override
|
|
|
public void exportXmCqdtfy(OutputStream os, List<XmCqdtfyVO> list, String yearAndMonth) {
|
|
public void exportXmCqdtfy(OutputStream os, List<XmCqdtfyVO> list, String yearAndMonth) {
|
|
|
AtomicInteger index = new AtomicInteger(1);
|
|
AtomicInteger index = new AtomicInteger(1);
|
|
|
- list.forEach(temp -> {
|
|
|
|
|
- temp.setXh(index.getAndIncrement() + "");
|
|
|
|
|
- temp.setYftxe(temp.getYtxe().multiply(temp.getSyzb()));
|
|
|
|
|
- temp.setSyzb(temp.getSyzb().multiply(new BigDecimal("100")));
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Integer sysmSum = 0, ysyysSum = 0;
|
|
|
|
|
+ BigDecimal zcyzSum = BigDecimal.ZERO;
|
|
|
|
|
+ for (XmCqdtfyVO vo : list) {
|
|
|
|
|
+ vo.setXh(index.getAndIncrement() + "");
|
|
|
|
|
+ vo.setYftxe(vo.getYtxe().multiply(vo.getSyzb()));
|
|
|
|
|
+ vo.setSyzb(vo.getSyzb().multiply(new BigDecimal("100")));
|
|
|
|
|
+
|
|
|
|
|
+ sysmSum += vo.getSysm();
|
|
|
|
|
+ ysyysSum += vo.getYsyys();
|
|
|
|
|
+ zcyzSum = zcyzSum.add(vo.getZcyz());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
InputStream templateFileName = this.getClass().getClassLoader().getResourceAsStream("export-template/研发费用管理/折旧费用与长期待摊费用/每月长期待摊费用分配表.xls");
|
|
InputStream templateFileName = this.getClass().getClassLoader().getResourceAsStream("export-template/研发费用管理/折旧费用与长期待摊费用/每月长期待摊费用分配表.xls");
|
|
|
ExcelWriter excelWriter = EasyExcel.write(os)
|
|
ExcelWriter excelWriter = EasyExcel.write(os)
|
|
|
.withTemplate((templateFileName))
|
|
.withTemplate((templateFileName))
|
|
@@ -184,6 +192,9 @@ public class XmCqdtfyServiceImpl extends BaseServiceImpl<XmCqdtfyMapper, XmCqdtf
|
|
|
excelWriter.fill(list, fillConfig, writeSheet);
|
|
excelWriter.fill(list, fillConfig, writeSheet);
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("yearAndMonth", yearAndMonth);
|
|
map.put("yearAndMonth", yearAndMonth);
|
|
|
|
|
+ map.put("sysmSum", sysmSum);
|
|
|
|
|
+ map.put("ysyysSum", ysyysSum);
|
|
|
|
|
+ map.put("zcyzSum", zcyzSum);
|
|
|
excelWriter.fill(map, writeSheet);
|
|
excelWriter.fill(map, writeSheet);
|
|
|
excelWriter.finish();
|
|
excelWriter.finish();
|
|
|
if (templateFileName != null) {
|
|
if (templateFileName != null) {
|