| package com.zy.crm.manager.entity; | 
|   | 
| import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; | 
| import com.baomidou.mybatisplus.enums.IdType; | 
| import com.baomidou.mybatisplus.annotations.TableField; | 
| import java.text.SimpleDateFormat; | 
| import java.util.Date; | 
|   | 
| import com.core.common.SpringUtils; | 
| import com.zy.crm.system.entity.User; | 
| import com.zy.crm.system.service.UserService; | 
| import org.springframework.format.annotation.DateTimeFormat; | 
|   | 
| import io.swagger.annotations.ApiModelProperty; | 
| import lombok.Data; | 
| import com.baomidou.mybatisplus.annotations.TableName; | 
| import java.io.Serializable; | 
|   | 
| @Data | 
| @TableName("man_pri") | 
| public class Pri implements Serializable { | 
|   | 
|     private static final long serialVersionUID = 1L; | 
|   | 
|     /** | 
|      * ID | 
|      */ | 
|     @ApiModelProperty(value= "ID") | 
|     @TableId(value = "id", type = IdType.AUTO) | 
|     private Long id; | 
|   | 
|     /** | 
|      * 模板excel的sheet数据 | 
|      */ | 
|     @ApiModelProperty(value= "模板excel的sheet数据") | 
|     @TableField("sheet_data") | 
|     private String sheetData; | 
|   | 
|     /** | 
|      * 模板excel标题 | 
|      */ | 
|     @ApiModelProperty(value= "模板excel标题") | 
|     private String title; | 
|   | 
|     @ApiModelProperty(value= "文件保存地址") | 
|     private String filepath; | 
|   | 
|     @ApiModelProperty(value= "创建人员用户id") | 
|     @TableField("user_id") | 
|     private Long userId; | 
|   | 
|     @ApiModelProperty(value= "状态{0:禁止,1:正常}") | 
|     @TableField("status") | 
|     private Integer status; | 
|   | 
|     /** | 
|      * 创建时间 | 
|      */ | 
|     @ApiModelProperty(value= "创建时间") | 
|     @TableField("create_time") | 
|     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 
|     private Date createTime; | 
|   | 
|     @ApiModelProperty(value= "更新时间") | 
|     @TableField("update_time") | 
|     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 
|     private Date updateTime; | 
|   | 
|     public Pri() {} | 
|   | 
|     public Pri(String sheetData,String title,Date createTime,String filepath) { | 
|         this.sheetData = sheetData; | 
|         this.title = title; | 
|         this.createTime = createTime; | 
|         this.filepath = filepath; | 
|     } | 
|   | 
| //    Pri pri = new Pri( | 
| //            null,    // 模板excel的sheet数据[非空] | 
| //            null,    // 模板excel标题[非空] | 
| //            null    // 创建时间 | 
| //    ); | 
|   | 
|     public String getCreateTime$(){ | 
|         if (Cools.isEmpty(this.createTime)){ | 
|             return ""; | 
|         } | 
|         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); | 
|     } | 
|   | 
|     public String getUser$() { | 
|         UserService userService = SpringUtils.getBean(UserService.class); | 
|         User user = userService.selectById(this.userId); | 
|         if (!Cools.isEmpty(user)){ | 
|             return String.valueOf(user.getNickname()); | 
|         } | 
|         return null; | 
|     } | 
|   | 
|     public String getStatus$() { | 
|         if (null == this.status){ return null; } | 
|         switch (this.status){ | 
|             case 1: | 
|                 return "正常"; | 
|             case 0: | 
|                 return "禁用"; | 
|             default: | 
|                 return String.valueOf(this.status); | 
|         } | 
|     } | 
|   | 
|     public String getUpdateTime$(){ | 
|         if (Cools.isEmpty(this.updateTime)){ | 
|             return ""; | 
|         } | 
|         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); | 
|     } | 
|   | 
| } |