| | |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | |
| | | if (count > 0) { |
| | | reportCustomComponentDtos = reportCustomComponentV1InnerServiceSMOImpl.queryReportCustomComponents(reportCustomComponentDto); |
| | | desCode(reportCustomComponentDtos); |
| | | |
| | | } else { |
| | | reportCustomComponentDtos = new ArrayList<>(); |
| | | } |
| | |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | private void desCode(List<ReportCustomComponentDto> reportCustomComponentDtos) { |
| | | if (reportCustomComponentDtos == null || reportCustomComponentDtos.size() < 1) { |
| | | return; |
| | | } |
| | | for(ReportCustomComponentDto reportCustomComponentDto: reportCustomComponentDtos) { |
| | | try { |
| | | if (!StringUtil.isEmpty(reportCustomComponentDto.getComponentSql())) { |
| | | reportCustomComponentDto.setComponentSql(new String(Base64Convert.base64ToByte(reportCustomComponentDto.getComponentSql()),"UTF-8")); |
| | | } |
| | | if (!StringUtil.isEmpty(reportCustomComponentDto.getJavaScript())) { |
| | | reportCustomComponentDto.setJavaScript(new String(Base64Convert.base64ToByte(reportCustomComponentDto.getJavaScript()),"UTF-8")); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("编码失败", e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |