| | |
| | | package com.by4cloud.platformx.device.entity; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.extra.spring.SpringUtil; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.by4cloud.platformx.admin.api.utils.UpmsCacheUtil; |
| | | import com.by4cloud.platformx.common.data.mybatis.BaseModel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.MappedSuperclass; |
| | | import javax.persistence.Transient; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | columnDefinition = "char(1) default '0'" |
| | | ) |
| | | private String delFlag = "0"; |
| | | @Schema( |
| | | description = "单位id" |
| | | ) |
| | | @TableField( |
| | | fill = FieldFill.INSERT |
| | | ) |
| | | private Long compId; |
| | | @Transient |
| | | @TableField( |
| | | exist = false |
| | | ) |
| | | @Schema( |
| | | description = "单位名称" |
| | | ) |
| | | private String compName; |
| | | @Column( |
| | | columnDefinition = "varchar(100) comment '名称'" |
| | | ) |
| | |
| | | columnDefinition = "double(10,2) comment '单价'" |
| | | ) |
| | | private Double price; |
| | | public String getCompName() { |
| | | if (StrUtil.isEmpty(this.compName)) { |
| | | UpmsCacheUtil upmsCacheUtil = (UpmsCacheUtil) SpringUtil.getBean(UpmsCacheUtil.class); |
| | | this.compName = upmsCacheUtil.getCompNameById(this.compId); |
| | | } |
| | | |
| | | return this.compName; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | |
| | | public void setPrice(Double price) { |
| | | this.price = price; |
| | | } |
| | | |
| | | public void setCompId(final Long compId) { |
| | | this.compId = compId; |
| | | } |
| | | public Long getCompId() { |
| | | return this.compId; |
| | | } |
| | | public void setCompName(final String compName) { |
| | | this.compName = compName; |
| | | } |
| | | public Double getAmount() { |
| | | return amount; |
| | | } |