田源
2023-07-04 1d0042d823333554cc1b74b092496e5aff38d502
Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java
@@ -35,6 +35,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@@ -64,13 +65,15 @@
   /**
    * ddl数据操作服务
    */
   private final DdlMapperProcessor ddlMapper = DdlMapperProcessStrategy.getProcessor();
   @Autowired
   private DdlMapperProcessor ddlMapper;
   /**
    * dll数据操作服务
    */
   private final DllMapperProcessor dllMapper = DllMapperProcessorStrategy.getProcessor();
   @Autowired
   private DllMapperProcessor dllMapper;
   private static final String YES = "Y";
@@ -993,6 +996,19 @@
         R<List<ModifyAttributeInfo>> result = R.success("数据库操作成功");
         result.setData(changedList);
         return result;
      } catch (VciBaseException e) {
         try {
            // 建表失败有异常,捕获后返回,并释放线程中的内容
            if (!CollectionUtils.isEmpty(ddlDTO.getBtmTypeList())) {
               removeBtm(ddlDTO.getBtmTypeList().toArray(new BtmTypeVO[0]));
            }
            if (!CollectionUtils.isEmpty(ddlDTO.getLinkTypeList())) {
               removeLink(ddlDTO.getLinkTypeList().toArray(new LinkTypeVO[0]));
            }
            return R.fail(e.getMessage());
         }catch (ServiceException e2){
            throw new RuntimeException(e2.getMessage());
         }
      } catch (ServiceException e) {
         throw new RuntimeException(e.getMessage());
      }
@@ -1056,7 +1072,7 @@
               BtmTypeAttributeVO attributeVO = new BtmTypeAttributeVO();
               attributeVO.setId(col.getId().toLowerCase());
               attributeVO.setName(col.getName());
               attributeVO.setNullableFlag(col.getNullableFlag());
               attributeVO.setNullableFlag(StringUtils.equals(col.getNullableFlag(), BooleanEnum.TRUE.getValue()));
               attributeVO.setAttributeLength(col.getAttributeLength());
               attributeVO.setPrecisionLength(col.getPrecisionLength());
               attributeVO.setScaleLength(col.getScaleLength());