| | |
| | | try { |
| | | VciBaseUtil.alertNotNull(baseModelDTO, "数据信息", baseModelDTO.getOid(), "主键", baseModelDTO.getBtmname(), "业务类型", baseModelDTO.getLcStatus(), "目标状态"); |
| | | List<String> oids = VciBaseUtil.str2List(baseModelDTO.getOid()); |
| | | List<BaseModel> baseModels = new ArrayList<>(); |
| | | baseModels = selectByTypeAndOid(baseModelDTO.getBtmname(), baseModelDTO.getOid()); |
| | | List<BaseModel> baseModels = selectByTypeAndOid(baseModelDTO.getBtmname(), baseModelDTO.getOid()); |
| | | if (baseModels.size() == 0) { |
| | | throw new VciBaseException("未查询到相关数据。"); |
| | | } |
| | |
| | | boolean ignoreCase = VciBaseUtil.getBoolean(resembleRuleVO.getIgnorecaseflag()); |
| | | boolean ignoreWidth = VciBaseUtil.getBoolean(resembleRuleVO.getIgnorewidthflag()); |
| | | boolean trimAll = VciBaseUtil.getBoolean(resembleRuleVO.getIgnoreallspaceflag()); |
| | | boolean trim = VciBaseUtil.getBoolean(resembleRuleVO.getIgnoreallspaceflag()); |
| | | boolean trim = VciBaseUtil.getBoolean(resembleRuleVO.getIgnorecaseflag()); |
| | | String temp = ""; |
| | | if (ignoreCase && ignoreSpace && ignoreWidth) { |
| | | //忽略大小写,且去空,忽略全半角 |
| | |
| | | temp = "replace(" + temp + ",'" + s + "','')"; |
| | | } |
| | | } |
| | | queryValue = String.format(temp, (trim ? value.trim() : value)); |
| | | queryValue = String.format(temp, (trim ? "'"+value.trim()+"'" : "'"+value+"'")); |
| | | temp = temp.replace("to_single_byte('%s')", "to_single_byte(%s)"); |
| | | queryKey = String.format(temp, "t." + attrId); |
| | | conditionMap.put(queryKey, QueryOptionConstant.OR + queryValue); |
| | |
| | | } catch (Exception e) { |
| | | String errorMessage = e.getMessage(); |
| | | if (errorMessage.contains("无法解析的成员访问表达式")) { |
| | | throw new ServiceException("缺少" + errorMessage.substring(errorMessage.indexOf("[t.") + 1, errorMessage.indexOf("]")) + "字段"); |
| | | throw new ServiceException("缺少" + errorMessage.substring(errorMessage.indexOf("[T.") + 1, errorMessage.indexOf("]")) + "字段"); |
| | | } |
| | | throw new ServiceException(e.getMessage()); |
| | | } |
| | |
| | | conditionMap.put("t.lastr", "1"); |
| | | conditionMap.put("t.lastv", "1"); |
| | | DataGrid<Map<String, String>> mapDataGrid = queryGrid(btmTypeId, templateVO, conditionMap, pageHelper); |
| | | if(templateVO.getAttributes().isEmpty()){ |
| | | throw new ServiceException(String.format("主键为:{}的模板下,模板属性配置为空!",templateVO.getOid())); |
| | | } |
| | | //处理返回数据与模板数据配置的字段不一样问题 |
| | | templateVO.getAttributes().stream().forEach(e -> { |
| | | for (Map<String, String> datum : mapDataGrid.getData()) { |
| | |
| | | dataList.add(cbo); |
| | | wrapperData(dataList, templateVO, sqlBO.getSelectFieldList(), true); |
| | | R<List<Map<String, String>>> result = R.data(Collections.singletonList(cbo)); |
| | | if(templateVO.getAttributes().isEmpty()){ |
| | | throw new ServiceException(String.format("主键为:{}的模板下,模板属性配置为空!",templateVO.getOid())); |
| | | } |
| | | //处理返回数据与模板数据配置的字段不一样问题 |
| | | templateVO.getAttributes().stream().forEach(e -> { |
| | | for (Map<String, String> datum : result.getData()) { |
| | |
| | | MdmUIInfoVO uiInfoVO = getTableDefineByTemplateVO(getUsedTemplateByClassifyOid(codeClassifyOid)); |
| | | uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0); |
| | | if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) { |
| | | List<Menu> buttonVOS = iSysClient.getMenuButtonByType(codeClassifyOid, uiInfoVO.getTemplateVO().getBtmTypeId(), "data_auth").getData(); |
| | | // List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId); |
| | | // if (operationVOS == null) { |
| | | // operationVOS = new ArrayList<>(); |
| | | // } |
| | | // //查询扩展按钮 |
| | | // List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid); |
| | | // TODO:2024-1-25 18:42模板上的btmtypeid有时候会存在大小写的问题,按理来说这儿直接用functionId就能满足查询菜单按钮了uiInfoVO.getTemplateVO().getBtmTypeId() |
| | | R<List<Menu>> buttonListR = iSysClient.getMenuButtonByType(codeClassifyOid, functionId, "data_auth"); |
| | | if(!buttonListR.isSuccess()){ |
| | | throw new ServiceException("获取按钮授权列表失败,原因:"+buttonListR.getMsg()); |
| | | } |
| | | List<Menu> buttonVOS = buttonListR.getData(); |
| | | |
| | | List<SmOperationVO> operationVOS = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(buttonVOS)) { |
| | | for (int i = 0; i < buttonVOS.size(); i++) { |