package com.zy.asrs.entity; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; import com.core.common.Cools; import com.core.common.SpringUtils; import com.zy.system.entity.User; import com.zy.system.service.UserService; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.Date; @Data @TableName("man_monthly_settle") public class MonthlySettle implements Serializable { private static final long serialVersionUID = 1L; /** * ID */ @ApiModelProperty(value = "ID") @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 月结编号 */ @ApiModelProperty(value = "月结编号") @TableField("settle_no") private String settleNo; /** * 起始日期 */ @ApiModelProperty(value = "起始日期") @TableField("start_date") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date startDate; /** * 结束日期 */ @ApiModelProperty(value = "结束日期") @TableField("end_date") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date endDate; /** * 状态 0:待月结 1:已月结 */ @ApiModelProperty(value = "状态 0:待月结 1:已月结") private Integer status; /** * 总入库数量 */ @ApiModelProperty(value = "总入库数量") @TableField("total_in_qty") private BigDecimal totalInQty; /** * 总出库数量 */ @ApiModelProperty(value = "总出库数量") @TableField("total_out_qty") private BigDecimal totalOutQty; /** * 物料种类数 */ @ApiModelProperty(value = "物料种类数") @TableField("total_materials") private Integer totalMaterials; /** * 备注 */ @ApiModelProperty(value = "备注") private String memo; /** * 创建人员 */ @ApiModelProperty(value = "创建人员") @TableField("create_by") private Long createBy; /** * 创建时间 */ @ApiModelProperty(value = "创建时间") @TableField("create_time") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** * 修改人员 */ @ApiModelProperty(value = "修改人员") @TableField("update_by") private Long updateBy; /** * 修改时间 */ @ApiModelProperty(value = "修改时间") @TableField("update_time") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** * 删除标记 0:未删除 1:已删除 */ @ApiModelProperty(value = "删除标记 0:未删除 1:已删除") @TableField("is_deleted") private Integer isDeleted; public String getStatus$() { if (null == this.status) { return null; } switch (this.status) { case 0: return "待月结"; case 1: return "已月结"; default: return String.valueOf(this.status); } } public String getStartDate$() { if (Cools.isEmpty(this.startDate)) { return ""; } return new SimpleDateFormat("yyyy-MM-dd").format(this.startDate); } public String getEndDate$() { if (Cools.isEmpty(this.endDate)) { return ""; } return new SimpleDateFormat("yyyy-MM-dd").format(this.endDate); } public String getCreateBy$() { UserService service = SpringUtils.getBean(UserService.class); User user = service.selectById(this.createBy); if (!Cools.isEmpty(user)) { return String.valueOf(user.getUsername()); } return null; } public String getCreateTime$() { if (Cools.isEmpty(this.createTime)) { return ""; } return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); } public String getUpdateBy$() { UserService service = SpringUtils.getBean(UserService.class); User user = service.selectById(this.updateBy); if (!Cools.isEmpty(user)) { return String.valueOf(user.getUsername()); } return null; } public String getUpdateTime$() { if (Cools.isEmpty(this.updateTime)) { return ""; } return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); } }