| | |
| | | package com.vci.ubcs.omd.wrapper; |
| | | |
| | | import com.vci.ubcs.omd.cache.EnumCache; |
| | | import com.vci.ubcs.omd.constant.BtmTypeConstant; |
| | | import com.vci.ubcs.omd.dto.BtmTypeLinkAttributesDTO; |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | public BtmTypeAttributeVO entityVO(BtmTypeAttribute entity) { |
| | | BtmTypeAttributeVO vo = Objects.requireNonNull(BeanUtil.copy(entity, BtmTypeAttributeVO.class)); |
| | | // 在这里设置枚举显示值 |
| | | vo.setAttrDataTypeText(EnumCache.getValue("attributeType",vo.getAttrDataType())); |
| | | return vo; |
| | | } |
| | | |
| | |
| | | */ |
| | | public BtmTypeAttribute copyBtmTypeAttributeDTO2Entity(BtmTypeLinkAttributesDTO dto, String btmTypeOid, String creator, Date now){ |
| | | BtmTypeAttribute entity = Objects.requireNonNull(BeanUtil.copy(dto, BtmTypeAttribute.class)); |
| | | entity.setOid(VciBaseUtil.getPk()); |
| | | if (StringUtil.isBlank(entity.getOid())) { |
| | | entity.setOid(VciBaseUtil.getPk()); |
| | | } |
| | | entity.setBtmName(BtmTypeConstant.BTM_TYPE_ATTRIBUTE); |
| | | entity.setOwner(creator); |
| | | entity.setCreator(creator); |
| | |
| | | entity.setLastModifier(creator); |
| | | entity.setLastModifyTime(now); |
| | | entity.setTs(now); |
| | | entity.setPrecisionLength(0); |
| | | entity.setScaleLength(0); |
| | | entity.setPkBtmType(btmTypeOid); |
| | | // 在这进行通用字段处理 |
| | | return entity; |