fujunling
2023-06-06 29d2aabc6a07be091d7b52ba51e12a6baf16f7ac
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -50,6 +50,7 @@
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;
@@ -780,6 +781,11 @@
         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);
@@ -801,7 +807,7 @@
         }
         int secret = VciBaseUtil.getInt(String.valueOf(cbo.getSecretGrade()));
         //插个点,后续看密级服务是否可用
         //后续看密级服务是否可用
//         if (secret == 0 || !secretService.checkDataSecret(secret)) {
         if (secret == 0 ) {
            Integer userSecret = VciBaseUtil.getCurrentUserSecret();
@@ -828,12 +834,14 @@
         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});
@@ -1561,8 +1569,11 @@
               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);
@@ -1653,7 +1664,10 @@
      }
      //要改,表明获取有问题
//      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))
@@ -2861,11 +2875,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++) {
@@ -2875,8 +2889,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);
//            }
//         }
@@ -3013,7 +3027,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);