| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.Cache; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | data.put(CODE_TEMPLATE_OID_FIELD,templateVO.getOid()); |
| | | data.put(CODE_FULL_PATH_FILED,fullPath); |
| | | cbo.setData(data); |
| | | cbo.setOid(VciBaseUtil.getPk()); |
| | | cbo.setCreateTime(new Date()); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setCreator(AuthUtil.getUser().getUserName()); |
| | | cbo.setLastModifier(AuthUtil.getUser().getUserName()); |
| | | // cbo.setCodeclsfid(classifyFullInfo.getCurrentClassifyVO().getOid()); |
| | | // cbo.setTemplateOid(templateVO.getOid()); |
| | | // cbo.setCodeclsfpath(fullPath); |
| | |
| | | } |
| | | |
| | | int secret = VciBaseUtil.getInt(String.valueOf(cbo.getSecretGrade())); |
| | | //插个点,后续看密级服务是否可用 |
| | | //后续看密级服务是否可用 |
| | | // if (secret == 0 || !secretService.checkDataSecret(secret)) { |
| | | if (secret == 0 ) { |
| | | Integer userSecret = VciBaseUtil.getCurrentUserSecret(); |
| | |
| | | btmName = btmName.trim().toLowerCase(); |
| | | } |
| | | try { |
| | | String keyPrefix = BTM_NAME.concat(StringPool.DASH).concat(AuthUtil.getTenantId()).concat(StringPool.COLON); |
| | | String finalBtmName = btmName; |
| | | return CacheUtil.get(BTM_INIT_CACHE, keyPrefix, btmName, () -> { |
| | | BaseModel baseModel = createBaseModel(finalBtmName); |
| | | return baseModel; |
| | | }); |
| | | String keyPrefix = BTM_INIT_CACHE.concat(StringPool.COLON).concat(AuthUtil.getTenantId()).concat(StringPool.COLON); |
| | | // String finalBtmName = btmName; |
| | | Cache.ValueWrapper valueWrapper = CacheUtil.getCache(keyPrefix).get(keyPrefix.concat(String.valueOf(btmName))); |
| | | if(valueWrapper == null){ |
| | | CacheUtil.getCache(keyPrefix).put(keyPrefix.concat(String.valueOf(btmName)), createBaseModel(btmName)); |
| | | valueWrapper = CacheUtil.getCache(keyPrefix).get(keyPrefix.concat(String.valueOf(btmName))); |
| | | } |
| | | return (BaseModel) valueWrapper.get(); |
| | | } catch (Exception e) { |
| | | logger.error("创建业务类型对象",e); |
| | | throw new VciBaseException("initBtmError",new String[]{btmName}); |
| | |
| | | referVO.setTextField("name"); |
| | | } |
| | | //表需要改 |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referVO.getReferType())); |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | String referTable = "pl_code_wupin"; |
| | | String referTable = listR.getData().get(0).getTableName(); |
| | | // String referTable = "pl_code_classify"; |
| | | String referTableNick = attrVO.getId() + "0"; |
| | | String left = " left join " + referTable + " " + referTableNick + " on " + referTableNick + "." + referVO.getValueField() + " = t." + attrVO.getId(); |
| | | joinTableList.put(attrVO.getId(), left); |
| | |
| | | } |
| | | //要改,表明获取有问题 |
| | | // String tableName = VciBaseUtil.getTableName(btmType); |
| | | String tableName = "pl_code_wupin"; |
| | | // String tableName = "pl_code_wupin"; |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | String tableName = listR.getData().get(0).getTableName(); |
| | | String sql = "select " + selectFieldList.stream().map(s -> (s.contains(".") ? s : ("t." + s))).collect(Collectors.joining(",")) |
| | | + " from " + tableName + SPACE + "t" + SPACE |
| | | + joinTableList.values().stream().collect(Collectors.joining(SPACE)) |
| | |
| | | uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0); |
| | | if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) { |
| | | //功能按钮服务还未实现,等实现了,在进行调用 |
| | | //List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId); |
| | | // List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId); |
| | | // if (operationVOS == null) { |
| | | // operationVOS = new ArrayList<>(); |
| | | // } |
| | | //查询扩展按钮 |
| | | // //查询扩展按钮 |
| | | // List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid); |
| | | // if (!CollectionUtils.isEmpty(buttonVOS)) { |
| | | // for (int i = 0; i < buttonVOS.size(); i++) { |
| | |
| | | // operationVO.setUniqueFlag(buttonVO.getId()); |
| | | // operationVO.setName(buttonVO.getName()); |
| | | // operationVO.setAlias(operationVO.getName()); |
| | | // operationVO.setExecuteJs(buttonVO.getExecutejs()); |
| | | // operationVO.setIconCls(buttonVO.getIconcls()); |
| | | // operationVO.setExecuteJs(buttonVO.getExecuteJs()); |
| | | // operationVO.setIconCls(buttonVO.getIconCls()); |
| | | // operationVOS.add(operationVO); |
| | | // } |
| | | // } |
| | |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(boName)); |
| | | String userName = AuthUtil.getUser().getUserName(); |
| | | BaseModel bo = new BaseModel(); |
| | | bo.setOid(VciBaseUtil.getPk()); |
| | | // bo.setOid(VciBaseUtil.getPk()); |
| | | // bo.setRevisionid(VciBaseUtil.getPk()); |
| | | // bo.setNameoid(VciBaseUtil.getPk()); |
| | | bo.setBtmname(boName); |