|  |  | 
 |  |  | package com.vincent.rsf.server.manager.entity; | 
 |  |  |  | 
 |  |  | import java.text.SimpleDateFormat; | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.*; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import com.vincent.rsf.server.system.constant.DictTypeCode; | 
 |  |  | import com.vincent.rsf.server.system.entity.DictData; | 
 |  |  | import com.vincent.rsf.server.system.service.DictDataService; | 
 |  |  | import lombok.experimental.Accessors; | 
 |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
 |  |  | import com.baomidou.mybatisplus.annotation.TableLogic; | 
 |  |  | 
 |  |  | @Accessors(chain = true) | 
 |  |  | @TableName("man_stock") | 
 |  |  | public class Stock implements Serializable { | 
 |  |  |  | 
 |  |  |     private static final long serialVersionUID = 1L; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |     private Long id; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ASN单据, 带出PO单 | 
 |  |  |      * 编号 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "ASN单据, 带出PO单") | 
 |  |  |     private Long asnId; | 
 |  |  |     @ApiModelProperty("订单编码") | 
 |  |  |     private String asnCode; | 
 |  |  |     @ApiModelProperty(value= "编号") | 
 |  |  |     private String code; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ERP凭证 | 
 |  |  |      * 源单据编码 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "plat凭证") | 
 |  |  |     private String platToken; | 
 |  |  |     @ApiModelProperty(value= "源单据编码") | 
 |  |  |     private String sourceCode; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * plat单号 | 
 |  |  |      * 源单据ID | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "plat单号") | 
 |  |  |     private String platOrderNo; | 
 |  |  |     @ApiModelProperty(value= "源单据ID") | 
 |  |  |     private Long sourceId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * plat库存地址 | 
 |  |  |      * 单据类型 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "plat库存地址") | 
 |  |  |     private String platStkAdr; | 
 |  |  |     @ApiModelProperty(value= "单据类型") | 
 |  |  |     private String type; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 合同标识 | 
 |  |  |      * 业务类型 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "合同标识") | 
 |  |  |     private String contractId; | 
 |  |  |     @ApiModelProperty(value= "业务类型") | 
 |  |  |     private Short wkType; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 锁定原因 | 
 |  |  |      * 库存数量 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "锁定原因") | 
 |  |  |     private String lockReason; | 
 |  |  |     @ApiModelProperty(value= "库存数量") | 
 |  |  |     private Double anfme; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 锁定状态 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "锁定状态") | 
 |  |  |     private Short lockStatus; | 
 |  |  |     @ApiModelProperty(value= "条形码") | 
 |  |  |     private String barcode; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 锁定人 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "锁定人") | 
 |  |  |     private String locker; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 锁定时间 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "锁定时间") | 
 |  |  |     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private Date lockedTime; | 
 |  |  |     @ApiModelProperty("库位") | 
 |  |  |     private String locCode; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 状态 1: 正常  0: 冻结   | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "添加时间") | 
 |  |  |     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") | 
 |  |  |     private Date createTime; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "修改时间") | 
 |  |  |     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") | 
 |  |  |     private Date updateTime; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |  | 
 |  |  |     public Stock() {} | 
 |  |  |  | 
 |  |  |     public Stock(String asnOrder,String platToken,String platOrder,String platStkAdr,String contractId,String lockReason,Short lockStatus,String locker,Date lockedTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { | 
 |  |  |         this.platOrderNo = asnOrder; | 
 |  |  |         this.platToken = platToken; | 
 |  |  |         this.platOrderNo = platOrder; | 
 |  |  |         this.platStkAdr = platStkAdr; | 
 |  |  |         this.contractId = contractId; | 
 |  |  |         this.lockReason = lockReason; | 
 |  |  |         this.lockStatus = lockStatus; | 
 |  |  |         this.locker = locker; | 
 |  |  |         this.lockedTime = lockedTime; | 
 |  |  |     public Stock(String code,String sourceCode,Long sourceId,String type,Short wkType,Double anfme,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { | 
 |  |  |         this.code = code; | 
 |  |  |         this.sourceCode = sourceCode; | 
 |  |  |         this.sourceId = sourceId; | 
 |  |  |         this.type = type; | 
 |  |  |         this.wkType = wkType; | 
 |  |  |         this.anfme = anfme; | 
 |  |  |         this.status = status; | 
 |  |  |         this.deleted = deleted; | 
 |  |  |         this.tenantId = tenantId; | 
 |  |  | 
 |  |  |         this.memo = memo; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | //    Stock stock = new Stock( | 
 |  |  | //            null,    // ASN单据, 带出PO单[非空] | 
 |  |  | //            null,    // ERP凭证 | 
 |  |  | //            null,    // ERP单号 | 
 |  |  | //            null,    // ERP库存地址 | 
 |  |  | //            null,    // 合同标识 | 
 |  |  | //            null,    // 锁定原因 | 
 |  |  | //            null,    // 锁定状态[非空] | 
 |  |  | //            null,    // 锁定人 | 
 |  |  | //            null,    // 锁定时间 | 
 |  |  | //            null,    // 状态[非空] | 
 |  |  | //            null,    // 是否删除[非空] | 
 |  |  | //            null,    // 租户 | 
 |  |  | //            null,    // 添加人员 | 
 |  |  | //            null,    // 添加时间[非空] | 
 |  |  | //            null,    // 修改人员 | 
 |  |  | //            null,    // 修改时间[非空] | 
 |  |  | //            null    // 备注 | 
 |  |  | //    ); | 
 |  |  |  | 
 |  |  |     public String getLockedTime$(){ | 
 |  |  |         if (Cools.isEmpty(this.lockedTime)){ | 
 |  |  | //    public String getLockedTime$(){ | 
 |  |  | //        if (Cools.isEmpty(this.lockedTime)){ | 
 |  |  | //            return ""; | 
 |  |  | //        } | 
 |  |  | //        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.lockedTime); | 
 |  |  | //    } | 
 |  |  |  | 
 |  |  |     public String getType$(){ | 
 |  |  |         if (Cools.isEmpty(this.type)){ | 
 |  |  |             return ""; | 
 |  |  |         } | 
 |  |  |         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.lockedTime); | 
 |  |  |         DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); | 
 |  |  |         DictData dictData = dictDataService.getOne(new LambdaQueryWrapper<DictData>().eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_ORDER_TYPE).eq(DictData::getValue, this.type)); | 
 |  |  |         if (Objects.isNull(dictData)) { | 
 |  |  |             return null; | 
 |  |  |         } | 
 |  |  |         return dictData.getLabel(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getWkType$(){ | 
 |  |  |         if (Cools.isEmpty(this.wkType)){ | 
 |  |  |             return ""; | 
 |  |  |         } | 
 |  |  |         DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); | 
 |  |  |         DictData dictData = dictDataService.getOne(new LambdaQueryWrapper<DictData>().eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_BUSINESS_TYPE).eq(DictData::getValue, this.wkType)); | 
 |  |  |         if (Objects.isNull(dictData)) { | 
 |  |  |             return null; | 
 |  |  |         } | 
 |  |  |         return dictData.getLabel(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getStatus$(){ | 
 |  |  | 
 |  |  |             return ""; | 
 |  |  |         } | 
 |  |  |         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public Boolean getStatusBool(){ | 
 |  |  |         if (null == this.status){ return null; } | 
 |  |  |         switch (this.status){ | 
 |  |  |             case 1: | 
 |  |  |                 return true; | 
 |  |  |             case 0: | 
 |  |  |                 return false; | 
 |  |  |             default: | 
 |  |  |                 return null; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |