ludc
2023-12-06 27cf58be1f4a86aafadcee15b21ab245b1ca866b
导出bug修改
已修改2个文件
12 ■■■■■ 文件已修改
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
@@ -179,8 +179,8 @@
    @VciBusinessLog(operateName = "导出主题库的数据")
    @PostMapping("/exportCode")
    public void exportCode(CodeExportAttrDTO exportAttrDTO, HttpServletResponse response) throws IOException {
        String excelName = mdmIOService.exportCode(exportAttrDTO);
        try {
            String excelName = mdmIOService.exportCode(exportAttrDTO);
            ControllerUtil.writeFileToResponse(response,excelName);
        } catch (Throwable e) {
            //如果出错,把错误信息写到text
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -1831,10 +1831,10 @@
            tableName = VciBaseUtil.getTableName(btmTypeId);
        }
        String countSql = "select count(*) from (select * FROM " + tableName +" where 1=1" +
        String countSql = "select count(*) from " + tableName +" where 1=1" +
            " and lastr = '1'" +
            " and lastv='1'" +
            " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%' {}";
            " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%'";
        //先查询总数
        int total = 0;
@@ -1842,13 +1842,17 @@
            &&exportAttrDTO.getPage() !=null && exportAttrDTO.getPage() >0
            &&exportAttrDTO.getEndPage()>exportAttrDTO.getPage()){
            //从多少页到多少页的查询方式,
            String countPageSql = "select count(*) from (select * FROM " + tableName +" where 1=1" +
                " and lastr = '1'" +
                " and lastv='1'" +
                " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%' {}";
            for(int i = exportAttrDTO.getPage() ;i <= exportAttrDTO.getEndPage();i++){
                PageHelper thisPage = new PageHelper(exportAttrDTO.getLimit()==null?-1:exportAttrDTO.getLimit());
                thisPage.setPage(exportAttrDTO.getPage()==null?1:exportAttrDTO.getPage());
                thisPage.setSort(exportAttrDTO.getSort());
                thisPage.setOrder(exportAttrDTO.getOrder());
                thisPage.addDefaultDesc("createTime");
                total += commonsMapper.queryCountBySql(StringUtil.format(countSql," limit " + exportAttrDTO.getLimit() +" offset "+ i +")subquery;"));
                total += commonsMapper.queryCountBySql(StringUtil.format(countPageSql," limit " + exportAttrDTO.getLimit() +" offset "+ i +")subquery;"));
            }
        }else{
            total = commonsMapper.queryCountBySql(countSql);