| | |
| | | import com.vci.ubcs.omd.dto.BtmTypeDTO; |
| | | import com.vci.ubcs.omd.entity.BtmType; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | |
| | | import java.util.Date; |
| | |
| | | public BtmTypeVO entityVO(BtmType entity) { |
| | | BtmTypeVO vo = Objects.requireNonNull(BeanUtil.copy(entity, BtmTypeVO.class)); |
| | | // 在这里设置枚举显示值 |
| | | vo.setRevisionFlag(BooleanEnum.TRUE.getValue().equals(entity.getRevisionFlag())); |
| | | vo.setSecretFlag(BooleanEnum.TRUE.getValue().equals(entity.getSecretFlag())); |
| | | vo.setLifeCycleFlag(BooleanEnum.TRUE.getValue().equals(entity.getLifeCycleFlag())); |
| | | vo.setInputRevisionFlag(BooleanEnum.TRUE.getValue().equals(entity.getInputRevisionFlag())); |
| | | vo.setViewFlag(BooleanEnum.TRUE.getValue().equalsIgnoreCase(entity.getViewFlag())); |
| | | vo.setAbstractFlag(BooleanEnum.TRUE.getValue().equals(entity.getAbstractFlag())); |
| | | return vo; |
| | | } |
| | | |
| | |
| | | return entity; |
| | | } |
| | | |
| | | public BtmType entityBeforeInsert(BtmType btmType) { |
| | | btmType = entityBeforeSave(btmType); |
| | | String userAccount = AuthUtil.getUserAccount(); |
| | | btmType.setOwner(userAccount); |
| | | btmType.setCreator(userAccount); |
| | | Date now = new Date(); |
| | | btmType.setCreateTime(now); |
| | | return btmType; |
| | | } |
| | | |
| | | /** |
| | | * 插入前包装默认字段 |
| | | * @param btmTypeDO do数据 |
| | | * @return 包装后 |
| | | */ |
| | | public BtmType entityBeforeSave(BtmType btmTypeDO) { |
| | | btmTypeDO.setOid(VciBaseUtil.getPk()); |
| | | btmTypeDO.setBtmname("btmType"); |
| | | Date now = new Date(); |
| | | String userAccount = AuthUtil.getUserAccount(); |
| | | btmTypeDO.setLastModifier(userAccount); |
| | | btmTypeDO.setLastModifyTime(now); |
| | | btmTypeDO.setTs(now); |
| | | return btmTypeDO; |
| | | } |
| | | } |