| | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.zy.common.utils.Synchro; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.beans.BeanInfo; |
| | | import java.beans.Introspector; |
| | | import java.beans.PropertyDescriptor; |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | @ApiModelProperty(value= "商品名称") |
| | | private String maktx; |
| | | |
| | | @ApiModelProperty(value= "批号") |
| | | @ApiModelProperty(value= "序列码") |
| | | private String batch; |
| | | |
| | | @ApiModelProperty(value= "单据编号") |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "是否冻结") |
| | | private Integer frozen; |
| | | |
| | | /** |
| | | * 物料类型{1:单品,2:高频,3:混放} |
| | | */ |
| | | @ApiModelProperty(value= "物料类型") |
| | | @TableField("mat_type") |
| | | private Integer matType; |
| | | |
| | | @ApiModelProperty(value= "客户信息ID") |
| | | private Long owner; |
| | | |
| | | @ApiModelProperty(value= "物料类型") |
| | | @TableField("mat_type_In") |
| | | private Integer matTypeIn; |
| | | |
| | | public String getBeBatch$(){ |
| | | if (null == this.beBatch){ return null; } |
| | | switch (this.beBatch){ |
| | |
| | | return String.valueOf(this.beBatch); |
| | | } |
| | | } |
| | | |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | | LocOwner locOwner = service.selectById(this.owner); |
| | | if (!Cools.isEmpty(locOwner)){ |
| | | return String.valueOf(locOwner.getOwner()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public String getSource$(){ |
| | | if (null == this.source){ return null; } |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public void sync(Object dest) { |
| | | try { |
| | | BeanInfo sourceBean = Introspector.getBeanInfo(this.getClass(),Object.class); |
| | | PropertyDescriptor[] sourceProperty = sourceBean.getPropertyDescriptors(); |
| | | BeanInfo destBean = Introspector.getBeanInfo(dest.getClass(),Object.class); |
| | | PropertyDescriptor[] destProperty = destBean.getPropertyDescriptors(); |
| | | for (PropertyDescriptor propertyDescriptor : sourceProperty) { |
| | | for (PropertyDescriptor descriptor : destProperty) { |
| | | if (propertyDescriptor.getName().equals(descriptor.getName()) && propertyDescriptor.getPropertyType() == descriptor.getPropertyType()) { |
| | | descriptor.getWriteMethod().invoke(dest, propertyDescriptor.getReadMethod().invoke(this)); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | throw new CoolException("属性复制失败:" + e.getMessage()); |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | public String getMatType$() { |
| | | if (this.matType == null) { |
| | | return ""; |
| | | } |
| | | switch (this.matType) { |
| | | case 1: |
| | | return "单品"; |
| | | case 2: |
| | | return "高频"; |
| | | case 3: |
| | | return "混放"; |
| | | default: |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public String getMatTypeIn$() { |
| | | if (this.matTypeIn == null) { |
| | | return "默认"; |
| | | } |
| | | switch (this.matTypeIn) { |
| | | case 1: |
| | | return "单品"; |
| | | case 2: |
| | | return "高频"; |
| | | case 3: |
| | | return "混放"; |
| | | default: |
| | | return "默认"; |
| | | } |
| | | } |
| | | } |