| package com.zy.asrs.common.wms.entity; | 
|   | 
| import java.text.SimpleDateFormat; | 
| import java.util.Date; | 
| import org.springframework.format.annotation.DateTimeFormat; | 
|   | 
| import com.baomidou.mybatisplus.annotation.IdType; | 
| import com.baomidou.mybatisplus.annotation.TableId; | 
| import com.baomidou.mybatisplus.annotation.TableLogic; | 
| import com.baomidou.mybatisplus.annotation.TableName; | 
| import io.swagger.annotations.ApiModel; | 
| import io.swagger.annotations.ApiModelProperty; | 
| import lombok.Data; | 
| import com.zy.asrs.framework.common.Cools; | 
| import com.zy.asrs.framework.common.SpringUtils; | 
| import com.zy.asrs.common.sys.entity.User; | 
| import com.zy.asrs.common.sys.entity.Host; | 
| import com.zy.asrs.common.sys.service.UserService; | 
| import com.zy.asrs.common.sys.service.HostService; | 
|   | 
| import java.io.Serializable; | 
| import java.util.Date; | 
|   | 
| @Data | 
| @TableName("wms_bas_barcode") | 
| public class BasBarcode implements Serializable { | 
|   | 
|     private static final long serialVersionUID = 1L; | 
|   | 
|     /** | 
|      * ID | 
|      */ | 
|     @ApiModelProperty(value= "ID") | 
|     @TableId(value = "id", type = IdType.AUTO) | 
|     private Long id; | 
|   | 
|     /** | 
|      * 条码值 | 
|      */ | 
|     @ApiModelProperty(value= "条码值") | 
|     private String barcode; | 
|   | 
|     /** | 
|      * 创建时间 | 
|      */ | 
|     @ApiModelProperty(value= "创建时间") | 
|     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 
|     private Date createTime; | 
|   | 
|     /** | 
|      * 仓库ID | 
|      */ | 
|     @ApiModelProperty(value= "仓库ID") | 
|     private Long hostId; | 
|   | 
|     public BasBarcode() {} | 
|   | 
|     public BasBarcode(Long id,String barcode,Date createTime,Long hostId) { | 
|         this.id = id; | 
|         this.barcode = barcode; | 
|         this.createTime = createTime; | 
|         this.hostId = hostId; | 
|     } | 
|   | 
| //    BasBarcode basBarcode = new BasBarcode( | 
| //            null,    // ID[非空] | 
| //            null,    // 条码值 | 
| //            null,    // 创建时间 | 
| //            null    // 授权商户 | 
| //    ); | 
|   | 
|     public String getCreateTime$(){ | 
|         if (Cools.isEmpty(this.createTime)){ | 
|             return ""; | 
|         } | 
|         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); | 
|     } | 
|   | 
|     public String getHostId$(){ | 
|         HostService service = SpringUtils.getBean(HostService.class); | 
|         Host host = service.getById(this.hostId); | 
|         if (!Cools.isEmpty(host)){ | 
|             return String.valueOf(host.getName()); | 
|         } | 
|         return null; | 
|     } | 
|   | 
|   | 
| } |