管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-25 b6b0cb226fcf184525ee7b36af3a09471e9c0057
src/main/java/com/lf/server/service/all/TestService.java
@@ -8,12 +8,12 @@
import com.lf.server.entity.all.PermsAuthEntity;
import com.lf.server.entity.all.ResAuthEntity;
import com.lf.server.entity.bd.DlgagnpEntity;
import com.lf.server.entity.ctrl.CountEntity;
import com.lf.server.entity.data.MetaEntity;
import com.lf.server.entity.data.MetaFileEntity;
import com.lf.server.entity.md.MdzxcgEntity;
import com.lf.server.helper.*;
import com.lf.server.mapper.bd.DlgagnpMapper;
import com.lf.server.service.data.FmeService;
import com.lf.server.service.data.MetaService;
import com.lf.server.service.data.UploadService;
import com.lf.server.service.show.LocateService;
@@ -71,14 +71,7 @@
    @Autowired
    MetaService metaService;
    @Autowired
    FmeService fmeService;
    private final static Log log = LogFactory.getLog(TestService.class);
    public void testRegiste() {
        //
    }
    public void testGdal() {
        GdalHelper.readTif("E:\\data\\7.Insar\\insartest.tif");
@@ -165,7 +158,7 @@
        // 页数 / 每页记录数
        Page<DlgagnpEntity> page = new Page<>(1, 10);
        // 升序排序
        page.addOrder(OrderItem.asc("gid"));
        page.addOrder(OrderItem.desc("gid"));
        // 分页:Wrapper查询条件
        Page<DlgagnpEntity> userPage = dlgagnpMapper.selectPage(page, null);
        // 总页数 / 总记录数:325 / 3247
@@ -205,7 +198,7 @@
        List<PermsAuthEntity> pauList = permsService.selectPermsEntity("admin");
        List<PermsAuthEntity> pauList2 = permsService.selectPermsEntity("admin");
        permsService.clearResCache();
        // permsService.clearResCache()
        permsService.clearPermsCache();
        raeList = permsService.selectRes("admin");
@@ -273,4 +266,44 @@
            //
        }
    }
    public void testWord() {
        String inputFile = "C:\\Users\\Administrator\\Desktop\\ts\\项目数据分类统计.docx";
        String outPutFile = "C:\\Users\\Administrator\\Desktop\\ts\\NewWord.docx";
        Map<String, String> textMap = new HashMap<>(1);
        textMap.put("title", "深圳液化天然气应急调峰站外输管道工程(XQ03T04)");
        List<String[]> tableList = new ArrayList<>();
        tableList.add(new String[]{"" + 1, "数字线划图", "123.54平方米"});
        tableList.add(new String[]{"" + 2, "地灾点", "120个"});
        WordHelper.generateWord(inputFile, outPutFile, textMap, tableList);
    }
    public void testExcel() {
        String source = "C:\\Users\\Administrator\\Desktop\\ts\\项目数据分类统计.xlsx";
        String target = "C:\\Users\\Administrator\\Desktop\\ts\\NewWord.xlsx";
        List<CountEntity> list = new ArrayList<>();
        CountEntity c1 = new CountEntity();
        c1.setNo(1);
        c1.setM1("数字线划图");
        c1.setM2("123.54平方米");
        list.add(c1);
        CountEntity c2 = new CountEntity();
        c2.setNo(2);
        c2.setM1("地灾点");
        c2.setM2("120个");
        list.add(c2);
        Map<String, Object> map = new HashMap<>(1);
        map.put("title", "深圳液化天然气应急调峰站外输管道工程(XQ03T04)");
        Map<String, List<CountEntity>> listMap = new HashMap<>(1);
        listMap.put("data", list);
        ExcelHelper.writeToTemplate(source, target, map, listMap);
    }
}