From cb4e11b19446843188cf628ac8f6be5fe1fa68c7 Mon Sep 17 00:00:00 2001 From: fujunling <2984387807@qq.com> Date: 星期二, 06 六月 2023 18:01:52 +0800 Subject: [PATCH] 配置 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 42 ++++++++++++++---------------------------- 1 files changed, 14 insertions(+), 28 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java index 81ab0ca..3837b3e 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java @@ -50,7 +50,6 @@ 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; @@ -781,11 +780,6 @@ 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); @@ -807,7 +801,7 @@ } int secret = VciBaseUtil.getInt(String.valueOf(cbo.getSecretGrade())); - //鍚庣画鐪嬪瘑绾ф湇鍔℃槸鍚﹀彲鐢� + //鎻掍釜鐐癸紝鍚庣画鐪嬪瘑绾ф湇鍔℃槸鍚﹀彲鐢� // if (secret == 0 || !secretService.checkDataSecret(secret)) { if (secret == 0 ) { Integer userSecret = VciBaseUtil.getCurrentUserSecret(); @@ -834,14 +828,12 @@ btmName = btmName.trim().toLowerCase(); } try { - 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(); + 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; + }); } catch (Exception e) { logger.error("鍒涘缓涓氬姟绫诲瀷瀵硅薄",e); throw new VciBaseException("initBtmError",new String[]{btmName}); @@ -1569,11 +1561,8 @@ referVO.setTextField("name"); } //琛ㄩ渶瑕佹敼 - //浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃 - R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referVO.getReferType())); // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); - String referTable = listR.getData().get(0).getTableName(); -// String referTable = "pl_code_classify"; + String referTable = "pl_code_wupin"; String referTableNick = attrVO.getId() + "0"; String left = " left join " + referTable + " " + referTableNick + " on " + referTableNick + "." + referVO.getValueField() + " = t." + attrVO.getId(); joinTableList.put(attrVO.getId(), left); @@ -1664,10 +1653,7 @@ } //瑕佹敼锛岃〃鏄庤幏鍙栨湁闂 // String tableName = VciBaseUtil.getTableName(btmType); -// 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 tableName = "pl_code_wupin"; 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)) @@ -2875,11 +2861,11 @@ 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++) { @@ -2889,8 +2875,8 @@ // 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); // } // } @@ -3027,7 +3013,7 @@ 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); -- Gitblit v1.9.3