Explorar o código

结算单下载

yangzian %!s(int64=3) %!d(string=hai) anos
pai
achega
d80e785b4d

+ 56 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/controller/ExportReportController.java

@@ -0,0 +1,56 @@
+package org.jeecg.ctop.finance.settlement.controller;
+
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.List;
+
+
+/**
+ * 导出 结算单 利润表
+ * Administrator
+ * 2021/7/28
+ **/
+
+@Slf4j
+@RestController
+@RequestMapping("/finance/exportReportController")
+public class ExportReportController {
+
+    @Autowired
+    private IReportSettlementService reportSettlementService;
+
+    @ApiOperation(value="财务结算-结算单导出", notes="财务结算-结算单导出")
+    @GetMapping(value = "/exportSettlementReport")
+    public Result exportSettlementReport(HttpServletResponse response) {
+
+        List<SettlementReportBytedanceVo> list = reportSettlementService.getAccountTransactionDayBytedance();
+
+        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("个人信息", "这是sheet名称"), SettlementReportBytedanceVo.class, list);
+        try {
+            response.setCharacterEncoding("UTF-8");
+            response.setHeader("content-Type", "application/vnd.ms-excel");
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("文件名称", "UTF-8"));
+            workbook.write(response.getOutputStream());
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+
+
+       return null;
+    }
+
+
+
+}

+ 53 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/SettlementReportBytedanceVo.java

@@ -0,0 +1,53 @@
+package org.jeecg.ctop.finance.settlement.entity.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ * @description: 头条 结算单
+ * @return:
+ * @author: zianY
+ */
+@Data
+public class SettlementReportBytedanceVo implements Serializable {
+
+    @Excel(name = "广告主ID")
+    private String advertiserId;
+
+    @Excel(name = "日期")
+    private String date;
+
+    @Excel(name = "日终结余(单位元)")
+    private String balance;
+
+    @Excel(name = "现金支出(单位元)")
+    private String cashCost;
+
+    @Excel(name = "总支出(单位元)")
+    private String cost;
+
+    @Excel(name = "冻结(单位元)")
+    private String frozen;
+
+    @Excel(name = "总存入(单位元)")
+    private String income;
+
+    @Excel(name = "赠款支出(单位元)")
+    private String rewardCost;
+
+    @Excel(name = "共享钱包支出(单位元)")
+    private String sharedWalletCost;
+
+    @Excel(name = "总转入(单位元)")
+    private String transferIn;
+
+    @Excel(name = "总转出(单位元)")
+    private String transferOut;
+
+
+
+
+}

+ 28 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/ReportSettlementMapper.java

@@ -0,0 +1,28 @@
+package org.jeecg.ctop.finance.settlement.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.lettuce.core.dynamic.annotation.Param;
+import org.jeecg.ctop.finance.settlement.entity.pojo.ctopCwjsSettlementInfo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+
+import java.util.List;
+
+
+/**
+ *
+ * @description:
+ *
+ * @return:
+ * @author: zianY
+ * @time: 2021/7/28 17:07
+ */
+public interface ReportSettlementMapper {
+
+    /**
+     *获取头条 账户 日流水信息
+     * @param
+     * @return
+     */
+    List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance();
+
+}

+ 17 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper">
+
+    <!-- 获取头条 账户 日流水信息 -->
+
+    <select id="getAccountTransactionDayBytedance" resultType="org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo">
+        select * from
+            ctop_account_transaction_day
+limit 100
+
+
+    </select>
+
+
+
+</mapper>

+ 15 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/IReportSettlementService.java

@@ -0,0 +1,15 @@
+package org.jeecg.ctop.finance.settlement.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.ctop.finance.settlement.entity.pojo.ctopCwjsSettlementInfo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+public interface IReportSettlementService {
+
+    List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance();
+
+}

+ 24 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/ReportSettlementServiceImpl.java

@@ -0,0 +1,24 @@
+package org.jeecg.ctop.finance.settlement.service.serviceImpl;
+
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+import org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper;
+import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+
+@Slf4j
+@Service
+public class ReportSettlementServiceImpl implements IReportSettlementService {
+
+    @Resource
+    private ReportSettlementMapper reportSettlementMapper;
+
+    @Override
+    public List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance() {
+        return reportSettlementMapper.getAccountTransactionDayBytedance();
+    }
+}