Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/resources/application-prod.yml
@@ -8,3 +8,7 @@ url: ${ubcs.datasource.mdm.prod.url} username: ${ubcs.datasource.mdm.prod.username} password: ${ubcs.datasource.mdm.prod.password} #关闭驼峰命名映射 mybatis-plus: configuration : map-underscore-to-camel-case: false 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 @@ -844,7 +844,7 @@ */ @GetMapping("/exportGroupCodeExcel") @VciBusinessLog(operateName = "导出集团码") public R exportGroupCodeExcel(String codeClassifyOid, HttpServletResponse response) throws IOException{ public R exportGroupCodeExcel(String codeClassifyOid, HttpServletResponse response){ try { String excelName = mdmIOService.exportGroupCodeExcel(codeClassifyOid); ControllerUtil.writeFileToResponse(response,excelName); @@ -854,6 +854,14 @@ if(StringUtils.isBlank(msg)){ msg = "未知错误"; } String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "错误.txt"; LocalFileUtil.writeContentToFile(LangBaseUtil.getErrorMsg(e),errorFile); try { ControllerUtil.writeFileToResponse(response,errorFile); } catch (IOException ex) { ex.printStackTrace(); } String uuid=ControllerUtil.putErrorFile(errorFile); return R.fail(msg); // ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null); } 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);