| | |
| | | }, |
| | | // 属性池加载 |
| | | attrRefOnLoad(){ |
| | | if (!this.attrRef.queryNotIn || (this.attrRef.queryNotIn === '' && this.btmType.attributes !== [])){ |
| | | this.attrRef.queryNotIn = ''; |
| | | this.btmType.attributes.forEach(item => { |
| | | this.attrRef.queryNotIn += (item.id + ",") |
| | | }) |
| | | } |
| | | this.attrRef.loading = true; |
| | | queryPage(this.attrRef.key,this.attrRef.queryNotIn,this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | |
| | | @Override |
| | | public String toString() { |
| | | StringBuilder stringBuilder = new StringBuilder().append(dataType); |
| | | if (dataLength != null){ |
| | | if (dataLength != null && dataPrecision != null){ |
| | | stringBuilder.append(StringPool.SPACE).append(StringPool.LEFT_BRACKET).append(dataLength).append(StringPool.COMMA).append(dataPrecision).append(StringPool.RIGHT_BRACKET).append(StringPool.SPACE); |
| | | }else if (dataLength != null) { |
| | | stringBuilder.append(StringPool.SPACE).append(StringPool.LEFT_BRACKET).append(dataLength).append(StringPool.RIGHT_BRACKET).append(StringPool.SPACE); |
| | | } |
| | | if (dataPrecision != null){ |
| | | stringBuilder.append(StringPool.SPACE).append(StringPool.LEFT_BRACKET).append(dataLength == null ? 22 : dataLength).append(StringPool.COMMA).append(dataPrecision).append(StringPool.RIGHT_BRACKET).append(StringPool.SPACE); |
| | | } |
| | | if (!nullable){ |
| | | stringBuilder.append(StringPool.SPACE).append("not null").append(StringPool.SPACE); |
| | |
| | | public String getColumnTypeSql(VciFieldTypeEnum fieldType, BtmTypeAttributeVO attributeVO) { |
| | | DdlFieldMappingAttrBO mappingBO = getMappingBO(fieldType); |
| | | if (fieldType.equals(VciFieldTypeEnum.VTDouble)) { |
| | | mappingBO.setDataPrecision(attributeVO.getPrecisionLength()); |
| | | mappingBO.setDataPrecision(attributeVO.getPrecisionLength() == -1 ? 8 : attributeVO.getPrecisionLength()); |
| | | } |
| | | //先只针对数字类型的进行处理 |
| | | if (fieldType.equals(VciFieldTypeEnum.VTInteger) ){ |
| | |
| | | } |
| | | return R.fail(e.getMessage()); |
| | | }catch (ServiceException e2){ |
| | | throw new RuntimeException(e2.getMessage()); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | @InterceptorIgnore(tenantLine = "1") |
| | | Long batchInsert(@Param("records") List<BtmType> records); |
| | | |
| | | } |
| | |
| | | attributesDTOList.stream().forEachOrdered(s -> { |
| | | attributeService.checkAttribute(s); |
| | | btmTypeAttributeDOList.add(BtmTypeAttributeWrapper.build().copyBtmTypeAttributeDTO2Entity(s,btmTypeOid, creator, now)); |
| | | attributeIdList.add(s.getId().toLowerCase().trim()); |
| | | attributeIdList.add(s.getId().trim()); |
| | | }); |
| | | //检查属性是否都存在 |
| | | boolean exists = attributeService.checkAttributeExists(attributeIdList); |
| | |
| | | */ |
| | | @Override |
| | | public List<BtmType> listBtmTypeDOByIdCollection(Collection<String> idCollection) throws ServiceException { |
| | | return CollectionUtils.isEmpty(idCollection) ? null : baseMapper.selectList(Wrappers.<BtmType>query().lambda().in(BtmType::getId, idCollection)); |
| | | return CollectionUtils.isEmpty(idCollection) ? null : baseMapper.selectByIdCollection(idCollection); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (btmTypeDTO.getId().length() > 24) { |
| | | throw new VciBaseException("业务类型英文名称不能超过18,目前长度为{0}", new Object[]{btmTypeDTO.getId().length()}); |
| | | } |
| | | List<BtmType> btmTypeDOList = listBtmTypeDOByIdCollection(VciBaseUtil.str2List(btmTypeDTO.getId())); |
| | | List<BtmType> btmTypeDOList = listBtmTypeDOByIdCollection(VciBaseUtil.str2List(btmTypeDTO.getId().toLowerCase(Locale.ROOT))); |
| | | if (!CollectionUtils.isEmpty(btmTypeDOList) && btmTypeDOList.size() > 0) { |
| | | boolean exist = btmTypeDOList.stream().filter(btm -> StringUtils.isNotBlank(btm.getOid())).anyMatch(btm -> !StringUtils.equals(btmTypeDTO.getOid(), btm.getOid())); |
| | | BtmType existBtmType = btmTypeDOList.get(0); |
| | | throw new VciBaseException("业务类型英文名称已经存在(不区分大小写),这个英文名称对应的中文名称为{0},创建人{1},创建时间{2}" |
| | | , new Object[]{existBtmType.getName(), existBtmType.getCreator(), VciDateUtil.date2Str(existBtmType.getCreateTime(), VciDateUtil.DateFormat)}); |
| | | if (exist) { |
| | | throw new VciBaseException("业务类型英文名称已经存在(不区分大小写),这个英文名称对应的中文名称为{0},创建人{1},创建时间{2}" |
| | | , new Object[]{existBtmType.getName(), existBtmType.getCreator(), VciDateUtil.date2Str(existBtmType.getCreateTime(), VciDateUtil.DateFormat)}); |
| | | } |
| | | } |
| | | if (btmTypeDTO.isRevisionFlag()){ |
| | | // 需要控制版本 |
| | |
| | | update <include refid="tableName"/> set |
| | | id = #{item.id,jdbcType=VARCHAR}, |
| | | name = #{item.name,jdbcType=VARCHAR}, |
| | | descrption = #{item.decription,jdbcType=VARCHAR}, |
| | | description = #{item.description,jdbcType=VARCHAR}, |
| | | pk_btm_type = #{item.pkBtmType,jdbcType=VARCHAR}, |
| | | attribute_length = #{item.attributeLength,jdbcType=DECIMAL}, |
| | | attr_data_type = #{item.attrDataType,jdbcType=VARCHAR}, |