/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.today.api.stock.vo;

        import java.util.Optional;
        import com.github.dapeng.org.apache.thrift.TException;
        import com.github.dapeng.org.apache.thrift.protocol.TCompactProtocol;
        import com.github.dapeng.util.TCommonTransport;

        /**
         * Autogenerated by Dapeng-Code-Generator (2.1.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING

        *

  StockJournal2

        **/
        public class TStockJournal2{
        
            /**
            *



            **/
            public long id ;
            public long getId(){ return this.id; }
            public void setId(long id){ this.id = id; }

            public long id(){ return this.id; }
            public TStockJournal2 id(long id){ this.id = id; return this; }
          
            /**
            *

 关联结果表stockid

            **/
            public long stockId ;
            public long getStockId(){ return this.stockId; }
            public void setStockId(long stockId){ this.stockId = stockId; }

            public long stockId(){ return this.stockId; }
            public TStockJournal2 stockId(long stockId){ this.stockId = stockId; return this; }
          
            /**
            *

 来源类型,0:初始化导入(init);1:门店订单(store_order);2:收货(receive);3:店铺转入(transfer_in);4:店铺转出(transfer_out);5:门店报废(store_scrap);6:退货仓库(return);7:仓库入库(warehouse_in);8:仓库出库(warehouse_out);9:仓库报废(warehouse_scrap);10:营业盘点(inventory);11:财务修正(finance);12:门店销售退货(sale_return);13:总部修正门店收货(fix_store_receive);14:总部修正门店退货(fix_store_refund);15:门店撤销报废(store_scrap_revoked);16:外卖销售(app_sale);17:外卖退货(app_return);18:退货供应商(return_supplier);19:转店盘点(inventory);20:闭店盘点(inventory)

            **/
            public com.today.api.stock.enums.StockJournalSourceTypeEnum sourceType ;
            public com.today.api.stock.enums.StockJournalSourceTypeEnum getSourceType(){ return this.sourceType; }
            public void setSourceType(com.today.api.stock.enums.StockJournalSourceTypeEnum sourceType){ this.sourceType = sourceType; }

            public com.today.api.stock.enums.StockJournalSourceTypeEnum sourceType(){ return this.sourceType; }
            public TStockJournal2 sourceType(com.today.api.stock.enums.StockJournalSourceTypeEnum sourceType){ this.sourceType = sourceType; return this; }
          
            /**
            *

 来源id如订单id

            **/
            public long sourceId ;
            public long getSourceId(){ return this.sourceId; }
            public void setSourceId(long sourceId){ this.sourceId = sourceId; }

            public long sourceId(){ return this.sourceId; }
            public TStockJournal2 sourceId(long sourceId){ this.sourceId = sourceId; return this; }
          
            /**
            *

 来源时间

            **/
            public Optional<Long> sourceTime = Optional.empty();
            public Optional<Long> getSourceTime(){ return this.sourceTime; }
            public void setSourceTime(Optional<Long> sourceTime){ this.sourceTime = sourceTime; }

            public Optional<Long> sourceTime(){ return this.sourceTime; }
            public TStockJournal2 sourceTime(Optional<Long> sourceTime){ this.sourceTime = sourceTime; return this; }
          
            /**
            *

 流水库存变化数
 @datatype(name="bigdecimal")

            **/
            public Optional<java.math.BigDecimal> stockAmount = Optional.empty();
            public Optional<java.math.BigDecimal> getStockAmount(){ return this.stockAmount; }
            public void setStockAmount(Optional<java.math.BigDecimal> stockAmount){ this.stockAmount = stockAmount; }

            public Optional<java.math.BigDecimal> stockAmount(){ return this.stockAmount; }
            public TStockJournal2 stockAmount(Optional<java.math.BigDecimal> stockAmount){ this.stockAmount = stockAmount; return this; }
          
            /**
            *

 变化操作之后的库存结果集
 @datatype(name="bigdecimal")

            **/
            public Optional<java.math.BigDecimal> afterStockNum = Optional.empty();
            public Optional<java.math.BigDecimal> getAfterStockNum(){ return this.afterStockNum; }
            public void setAfterStockNum(Optional<java.math.BigDecimal> afterStockNum){ this.afterStockNum = afterStockNum; }

            public Optional<java.math.BigDecimal> afterStockNum(){ return this.afterStockNum; }
            public TStockJournal2 afterStockNum(Optional<java.math.BigDecimal> afterStockNum){ this.afterStockNum = afterStockNum; return this; }
          
            /**
            *

 操作类型,1:门店或者仓库自然操作(normal);2:财务操作(finance)

            **/
            public Optional<com.today.api.stock.enums.StockJournalHandleTypeEnum> handleType = Optional.empty();
            public Optional<com.today.api.stock.enums.StockJournalHandleTypeEnum> getHandleType(){ return this.handleType; }
            public void setHandleType(Optional<com.today.api.stock.enums.StockJournalHandleTypeEnum> handleType){ this.handleType = handleType; }

            public Optional<com.today.api.stock.enums.StockJournalHandleTypeEnum> handleType(){ return this.handleType; }
            public TStockJournal2 handleType(Optional<com.today.api.stock.enums.StockJournalHandleTypeEnum> handleType){ this.handleType = handleType; return this; }
          
            /**
            *

 逻辑删除,1:正常(normal);2:删除(deleted)

            **/
            public Optional<com.today.api.stock.enums.StockJournalIsDeletedEnum> isDeleted = Optional.empty();
            public Optional<com.today.api.stock.enums.StockJournalIsDeletedEnum> getIsDeleted(){ return this.isDeleted; }
            public void setIsDeleted(Optional<com.today.api.stock.enums.StockJournalIsDeletedEnum> isDeleted){ this.isDeleted = isDeleted; }

            public Optional<com.today.api.stock.enums.StockJournalIsDeletedEnum> isDeleted(){ return this.isDeleted; }
            public TStockJournal2 isDeleted(Optional<com.today.api.stock.enums.StockJournalIsDeletedEnum> isDeleted){ this.isDeleted = isDeleted; return this; }
          
            /**
            *

 kafka消息ID全局唯一

            **/
            public Optional<Long> kafkaId = Optional.empty();
            public Optional<Long> getKafkaId(){ return this.kafkaId; }
            public void setKafkaId(Optional<Long> kafkaId){ this.kafkaId = kafkaId; }

            public Optional<Long> kafkaId(){ return this.kafkaId; }
            public TStockJournal2 kafkaId(Optional<Long> kafkaId){ this.kafkaId = kafkaId; return this; }
          
            /**
            *

 创建时间

            **/
            public Optional<Long> createdAt = Optional.empty();
            public Optional<Long> getCreatedAt(){ return this.createdAt; }
            public void setCreatedAt(Optional<Long> createdAt){ this.createdAt = createdAt; }

            public Optional<Long> createdAt(){ return this.createdAt; }
            public TStockJournal2 createdAt(Optional<Long> createdAt){ this.createdAt = createdAt; return this; }
          
            /**
            *

 特指后台创建人(公司员工 id)

            **/
            public int createdBy ;
            public int getCreatedBy(){ return this.createdBy; }
            public void setCreatedBy(int createdBy){ this.createdBy = createdBy; }

            public int createdBy(){ return this.createdBy; }
            public TStockJournal2 createdBy(int createdBy){ this.createdBy = createdBy; return this; }
          
            /**
            *

 更新时间

            **/
            public long updatedAt ;
            public long getUpdatedAt(){ return this.updatedAt; }
            public void setUpdatedAt(long updatedAt){ this.updatedAt = updatedAt; }

            public long updatedAt(){ return this.updatedAt; }
            public TStockJournal2 updatedAt(long updatedAt){ this.updatedAt = updatedAt; return this; }
          
            /**
            *

 特指后台更新人(公司员工 id)

            **/
            public int updatedBy ;
            public int getUpdatedBy(){ return this.updatedBy; }
            public void setUpdatedBy(int updatedBy){ this.updatedBy = updatedBy; }

            public int updatedBy(){ return this.updatedBy; }
            public TStockJournal2 updatedBy(int updatedBy){ this.updatedBy = updatedBy; return this; }
          
            /**
            *

 备注

            **/
            public String remark ;
            public String getRemark(){ return this.remark; }
            public void setRemark(String remark){ this.remark = remark; }

            public String remark(){ return this.remark; }
            public TStockJournal2 remark(String remark){ this.remark = remark; return this; }
          

        public static byte[] getBytesFromBean(TStockJournal2 bean) throws TException {
          byte[] bytes = new byte[]{};
          TCommonTransport transport = new TCommonTransport(bytes, TCommonTransport.Type.Write);
          TCompactProtocol protocol = new TCompactProtocol(transport);

          new com.today.api.stock.vo.serializer.TStockJournal2Serializer().write(bean, protocol);
          transport.flush();
          return transport.getByteBuf();
        }

        public static TStockJournal2 getBeanFromBytes(byte[] bytes) throws TException {
          TCommonTransport transport = new TCommonTransport(bytes, TCommonTransport.Type.Read);
          TCompactProtocol protocol = new TCompactProtocol(transport);
          return new com.today.api.stock.vo.serializer.TStockJournal2Serializer().read(protocol);
        }

        public String toString(){
          StringBuilder stringBuilder = new StringBuilder("{");
            stringBuilder.append("\"").append("id").append("\":").append(this.id).append(",");
    stringBuilder.append("\"").append("stockId").append("\":").append(this.stockId).append(",");
    stringBuilder.append("\"").append("sourceType").append("\":").append(this.sourceType).append(",");
    stringBuilder.append("\"").append("sourceId").append("\":").append(this.sourceId).append(",");
    stringBuilder.append("\"").append("sourceTime").append("\":").append(this.sourceTime.isPresent()?this.sourceTime.get():null).append(",");
    stringBuilder.append("\"").append("stockAmount").append("\":").append(this.stockAmount.isPresent()?this.stockAmount.get():null).append(",");
    stringBuilder.append("\"").append("afterStockNum").append("\":").append(this.afterStockNum.isPresent()?this.afterStockNum.get():null).append(",");
    stringBuilder.append("\"").append("handleType").append("\":").append(this.handleType.isPresent()?this.handleType.get():null).append(",");
    stringBuilder.append("\"").append("isDeleted").append("\":").append(this.isDeleted.isPresent()?this.isDeleted.get():null).append(",");
    stringBuilder.append("\"").append("kafkaId").append("\":").append(this.kafkaId.isPresent()?this.kafkaId.get():null).append(",");
    stringBuilder.append("\"").append("createdAt").append("\":").append(this.createdAt.isPresent()?this.createdAt.get():null).append(",");
    stringBuilder.append("\"").append("createdBy").append("\":").append(this.createdBy).append(",");
    stringBuilder.append("\"").append("updatedAt").append("\":").append(this.updatedAt).append(",");
    stringBuilder.append("\"").append("updatedBy").append("\":").append(this.updatedBy).append(",");
    stringBuilder.append("\"").append("remark").append("\":\"").append(this.remark).append("\",");
    
            stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
            stringBuilder.append("}");

          return stringBuilder.toString();
        }
      }
      