| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | 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); |
| | | } |
| | | } |