管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-10 014639637a80b0549cc0aee00b9a9670fb57827c
src/main/java/com/lf/server/service/sys/ReportService.java
@@ -3,10 +3,12 @@
import com.lf.server.entity.ctrl.CountEntity;
import com.lf.server.entity.sys.ReportEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.helper.WordHelper;
import com.lf.server.mapper.sys.ReportMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@@ -86,4 +88,25 @@
    public List<CountEntity> countOperates() {
        return reportMapper.countOperates();
    }
    /**
     * 创建 用户流量统计 Word
     */
    public void createCountSizesWord() {
        List<CountEntity> list = countOperates();
        if (null == list || list.isEmpty()) {
            return;
        }
        String inputFile = "D:\\LF\\用户流量统计.docx";
        String outPutFile = "D:\\LF\\用户流量统计_new.docx";
        ArrayList<String[]> addList = new ArrayList<>();
        for (CountEntity ce : list) {
            String[] strs = new String[]{ce.getM1(), ce.getM2(), ce.getCount().toString()};
            addList.add(strs);
        }
        WordHelper.generateWord(inputFile, outPutFile, null, addList);
    }
}