| | |
| | | @Resource |
| | | private ICodeClassifyService classifyService; |
| | | |
| | | @Resource |
| | | private MdmEngineService mdmEngineService; |
| | | |
| | | /** |
| | | * 通用查询 |
| | | */ |
| | | @Resource |
| | | private CommonsMapper commonsMapper; |
| | | |
| | | /**** |
| | | * 码值服务 |
| | | */ |
| | |
| | | @Override |
| | | public String createImportExcel(String codeClassifyOid, boolean isHistory) { |
| | | List<CodeClassifyTemplateVO> templateVOList=new ArrayList<>(); |
| | | |
| | | VciBaseUtil.alertNotNull("导出模板","导出的配置",codeClassifyOid,"主题库分类的主键"); |
| | | |
| | | CodeClassifyVO codeClassifyVO = classifyService.getObjectByOid(codeClassifyOid); |
| | | |
| | | //获取码段宽度 |
| | | //String secWidth = getCodeSegmentWidth(codeClassifyVO.getOid()); |
| | | |
| | | if(isHistory){ |
| | | templateVOList= templateService.childTemplates(codeClassifyOid); |
| | |
| | | eo.addSheetDataList(templateVOList.size()+"模板信息【请勿删除或移动】",tempEDList); |
| | | ExcelUtil.writeDataToFile(excelName,eo); |
| | | return excelName; |
| | | } |
| | | |
| | | /** |
| | | * 获取码段宽度 |
| | | * @param codeClassifyOid |
| | | * @return |
| | | */ |
| | | private String getCodeSegmentWidth(String codeClassifyOid){ |
| | | CodeClassifyVO codeClassifyVO = classifyService.getObjectByOid(codeClassifyOid); |
| | | // 要获取码段宽度,先要获取规则,当前没有往上找 |
| | | CodeRuleVO codeRuleByClassifyFullInfo = mdmEngineService.getCodeRuleByClassifyFullInfo(classifyService.getClassifyFullInfo(codeClassifyOid)); |
| | | List<CodeBasicSecVO> secVOList = codeRuleByClassifyFullInfo.getSecVOList(); |
| | | if(secVOList.isEmpty()){ |
| | | return ""; |
| | | } |
| | | |
| | | StringBuffer secWidth = new StringBuffer(""); |
| | | |
| | | for (int j = 0; j < secVOList.size(); j++) { |
| | | CodeBasicSecVO secVO = secVOList.get(j); |
| | | int width = VciBaseUtil.getInt(secVO.getCodeSecLength()) + ((secVO.getPrefixCode() + secVO.getSuffixCode()).length()); |
| | | secWidth.append(width).append("#"); |
| | | } |
| | | return secWidth.toString().substring(0, secWidth.length() - 1); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * excel转换为cbo的对象 |
| | | * @param classifyFullInfo 分类的全部信息 |