package com.foreverwin.mesnac.integration.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author Leon.L
 * @since 2021-06-16
 */

@TableName("Z_INTEGRATION_LOG")
public class IntegrationLog extends Model<IntegrationLog> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
   @TableId(value = "HANDLE", type = IdType.INPUT)
   private String handle;
    /**
     * 站点
     */
   @TableField("SITE")
   private String site;
    /**
     * ITEM/物料，SHOP_ORDER/工单，ROUTER/工艺，BOM/物料清单，BJOB/报工
     */
   @TableField("INTEGRATION_TYPE")
   private String integrationType;
    /**
     * REQUEST/请求，RESPONSE/回传
     */
   @TableField("CATEGORY")
   private String category;
    /**
     * ERP/DNC/CAPP
     */
   @TableField("INTEGRATION_WAY")
   private String integrationWay;
    /**
     * 接口实现方法
     */
   @TableField("INTEGRATION_METHOD")
   private String integrationMethod;
    /**
     * 接口对应主表的handle
     */
   @TableField("HANDLE_OBJ")
   private String handleObj;
    /**
     * SFC主键
     */
   @TableField("SFC_BO")
   private String sfcBo;
    /**
     * 请求参数
     */
   @TableField("PARAM")
   private String param;
    /**
     * S/成功，E/失败
     */
   @TableField("STATUS")
   private String status;
    /**
     * 返回消息
     */
   @TableField("RESULT_MESSAGE")
   private String resultMessage;
    /**
     * 唯一编码
     */
   @TableField("TRANSACTION_ID")
   private String transactionId;
    /**
     * 请求时间
     */
   @TableField("REQUEST_DATE_TIME")
   private LocalDateTime requestDateTime;
    /**
     * 创建时间
     */
   @TableField("CREATED_DATE_TIME")
   private LocalDateTime createdDateTime;

   @TableField(exist = false)
   private LocalDateTime startDateTime;

   @TableField(exist = false)
   private LocalDateTime endDateTime;


   public String getHandle() {
      return handle;
   }

   public void setHandle(String handle) {
      this.handle = handle;
   }

   public String getSite() {
      return site;
   }

   public void setSite(String site) {
      this.site = site;
   }

   public String getIntegrationType() {
      return integrationType;
   }

   public void setIntegrationType(String integrationType) {
      this.integrationType = integrationType;
   }

   public String getCategory() {
      return category;
   }

   public void setCategory(String category) {
      this.category = category;
   }

   public String getIntegrationWay() {
      return integrationWay;
   }

   public void setIntegrationWay(String integrationWay) {
      this.integrationWay = integrationWay;
   }

   public String getIntegrationMethod() {
      return integrationMethod;
   }

   public void setIntegrationMethod(String integrationMethod) {
      this.integrationMethod = integrationMethod;
   }

   public String getHandleObj() {
      return handleObj;
   }

   public void setHandleObj(String handleObj) {
      this.handleObj = handleObj;
   }

   public String getSfcBo() {
      return sfcBo;
   }

   public void setSfcBo(String sfcBo) {
      this.sfcBo = sfcBo;
   }

   public String getParam() {
      return param;
   }

   public void setParam(String param) {
      this.param = param;
   }

   public String getStatus() {
      return status;
   }

   public void setStatus(String status) {
      this.status = status;
   }

   public String getResultMessage() {
      return resultMessage;
   }

   public void setResultMessage(String resultMessage) {
      this.resultMessage = resultMessage;
   }

   public String getTransactionId() {
      return transactionId;
   }

   public void setTransactionId(String transactionId) {
      this.transactionId = transactionId;
   }

   public LocalDateTime getRequestDateTime() {
      return requestDateTime;
   }

   public void setRequestDateTime(LocalDateTime requestDateTime) {
      this.requestDateTime = requestDateTime;
   }

   public LocalDateTime getCreatedDateTime() {
      return createdDateTime;
   }

   public void setCreatedDateTime(LocalDateTime createdDateTime) {
      this.createdDateTime = createdDateTime;
   }

   public LocalDateTime getStartDateTime() {
      return startDateTime;
   }

   public void setStartDateTime(LocalDateTime startDateTime) {
      this.startDateTime = startDateTime;
   }

   public LocalDateTime getEndDateTime() {
      return endDateTime;
   }

   public void setEndDateTime(LocalDateTime endDateTime) {
      this.endDateTime = endDateTime;
   }

   public static final String HANDLE = "HANDLE";

   public static final String SITE = "SITE";

   public static final String INTEGRATION_TYPE = "INTEGRATION_TYPE";

   public static final String CATEGORY = "CATEGORY";

   public static final String INTEGRATION_WAY = "INTEGRATION_WAY";

   public static final String INTEGRATION_METHOD = "INTEGRATION_METHOD";

   public static final String HANDLE_OBJ = "HANDLE_OBJ";

   public static final String SFC_BO = "SFC_BO";

   public static final String PARAM = "PARAM";

   public static final String STATUS = "STATUS";

   public static final String RESULT_MESSAGE = "RESULT_MESSAGE";

   public static final String TRANSACTION_ID = "TRANSACTION_ID";

   public static final String REQUEST_DATE_TIME = "REQUEST_DATE_TIME";

   public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";


   @Override
   protected Serializable pkVal() {
      return this.handle;
   }

   @Override
   public String toString() {
      return "IntegrationLog{" +
         "handle = " + handle +
         ", site = " + site +
         ", integrationType = " + integrationType +
         ", category = " + category +
         ", integrationWay = " + integrationWay +
         ", integrationMethod = " + integrationMethod +
         ", handleObj = " + handleObj +
         ", sfcBo = " + sfcBo +
         ", param = " + param +
         ", status = " + status +
         ", resultMessage = " + resultMessage +
         ", transactionId = " + transactionId +
         ", requestDateTime = " + requestDateTime +
         ", createdDateTime = " + createdDateTime +
         "}";
   }
}