/*
 * 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

        *

  Stock

        **/
        public class TStock{
        
            /**
            *



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

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

 库存主体id

            **/
            public String ownerId ;
            public String getOwnerId(){ return this.ownerId; }
            public void setOwnerId(String ownerId){ this.ownerId = ownerId; }

            public String ownerId(){ return this.ownerId; }
            public TStock ownerId(String ownerId){ this.ownerId = ownerId; return this; }
          
            /**
            *

 库存主体类型,1:门店(store);2:仓库(warehouse)

            **/
            public com.today.api.stock.enums.StockOwnerTypeEnum ownerType ;
            public com.today.api.stock.enums.StockOwnerTypeEnum getOwnerType(){ return this.ownerType; }
            public void setOwnerType(com.today.api.stock.enums.StockOwnerTypeEnum ownerType){ this.ownerType = ownerType; }

            public com.today.api.stock.enums.StockOwnerTypeEnum ownerType(){ return this.ownerType; }
            public TStock ownerType(com.today.api.stock.enums.StockOwnerTypeEnum ownerType){ this.ownerType = ownerType; return this; }
          
            /**
            *

 货号

            **/
            public String skuNo ;
            public String getSkuNo(){ return this.skuNo; }
            public void setSkuNo(String skuNo){ this.skuNo = skuNo; }

            public String skuNo(){ return this.skuNo; }
            public TStock skuNo(String skuNo){ this.skuNo = skuNo; return this; }
          
            /**
            *

 库存主体名称

            **/
            public String ownerName ;
            public String getOwnerName(){ return this.ownerName; }
            public void setOwnerName(String ownerName){ this.ownerName = ownerName; }

            public String ownerName(){ return this.ownerName; }
            public TStock ownerName(String ownerName){ this.ownerName = ownerName; return this; }
          
            /**
            *



            **/
            public String skuName ;
            public String getSkuName(){ return this.skuName; }
            public void setSkuName(String skuName){ this.skuName = skuName; }

            public String skuName(){ return this.skuName; }
            public TStock skuName(String skuName){ this.skuName = skuName; return this; }
          
            /**
            *

 库存数
 @datatype(name="bigdecimal")

            **/
            public Optional<java.math.BigDecimal> stockNum = Optional.empty();
            public Optional<java.math.BigDecimal> getStockNum(){ return this.stockNum; }
            public void setStockNum(Optional<java.math.BigDecimal> stockNum){ this.stockNum = stockNum; }

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

 ff商品库存

            **/
            public Optional<Double> ffStockWeight = Optional.empty();
            public Optional<Double> getFfStockWeight(){ return this.ffStockWeight; }
            public void setFfStockWeight(Optional<Double> ffStockWeight){ this.ffStockWeight = ffStockWeight; }

            public Optional<Double> ffStockWeight(){ return this.ffStockWeight; }
            public TStock ffStockWeight(Optional<Double> ffStockWeight){ this.ffStockWeight = ffStockWeight; return this; }
          
            /**
            *

 FF商品计量单位

            **/
            public Optional<String> useUnit = Optional.empty();
            public Optional<String> getUseUnit(){ return this.useUnit; }
            public void setUseUnit(Optional<String> useUnit){ this.useUnit = useUnit; }

            public Optional<String> useUnit(){ return this.useUnit; }
            public TStock useUnit(Optional<String> useUnit){ this.useUnit = useUnit; return this; }
          
            /**
            *



            **/
            public Optional<Long> lastBalanceStock = Optional.empty();
            public Optional<Long> getLastBalanceStock(){ return this.lastBalanceStock; }
            public void setLastBalanceStock(Optional<Long> lastBalanceStock){ this.lastBalanceStock = lastBalanceStock; }

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

 上一次的ff商品库存

            **/
            public Optional<Double> lastBalanceFfStock = Optional.empty();
            public Optional<Double> getLastBalanceFfStock(){ return this.lastBalanceFfStock; }
            public void setLastBalanceFfStock(Optional<Double> lastBalanceFfStock){ this.lastBalanceFfStock = lastBalanceFfStock; }

            public Optional<Double> lastBalanceFfStock(){ return this.lastBalanceFfStock; }
            public TStock lastBalanceFfStock(Optional<Double> lastBalanceFfStock){ this.lastBalanceFfStock = lastBalanceFfStock; return this; }
          
            /**
            *

 财务库存

            **/
            public Optional<Long> financeStock = Optional.empty();
            public Optional<Long> getFinanceStock(){ return this.financeStock; }
            public void setFinanceStock(Optional<Long> financeStock){ this.financeStock = financeStock; }

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

 财务FF商品库存

            **/
            public Optional<Double> financeFfStock = Optional.empty();
            public Optional<Double> getFinanceFfStock(){ return this.financeFfStock; }
            public void setFinanceFfStock(Optional<Double> financeFfStock){ this.financeFfStock = financeFfStock; }

            public Optional<Double> financeFfStock(){ return this.financeFfStock; }
            public TStock financeFfStock(Optional<Double> financeFfStock){ this.financeFfStock = financeFfStock; return this; }
          
            /**
            *

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

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

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



            **/
            public long createdAt ;
            public long getCreatedAt(){ return this.createdAt; }
            public void setCreatedAt(long createdAt){ this.createdAt = createdAt; }

            public long createdAt(){ return this.createdAt; }
            public TStock createdAt(long createdAt){ this.createdAt = createdAt; return this; }
          
            /**
            *



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

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



            **/
            public Optional<Integer> updatedBy = Optional.empty();
            public Optional<Integer> getUpdatedBy(){ return this.updatedBy; }
            public void setUpdatedBy(Optional<Integer> updatedBy){ this.updatedBy = updatedBy; }

            public Optional<Integer> updatedBy(){ return this.updatedBy; }
            public TStock updatedBy(Optional<Integer> updatedBy){ this.updatedBy = updatedBy; return this; }
          
            /**
            *



            **/
            public Optional<Long> updatedAt = Optional.empty();
            public Optional<Long> getUpdatedAt(){ return this.updatedAt; }
            public void setUpdatedAt(Optional<Long> updatedAt){ this.updatedAt = updatedAt; }

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

 售价(含税)

            **/
            public Optional<Double> sellingPrice = Optional.empty();
            public Optional<Double> getSellingPrice(){ return this.sellingPrice; }
            public void setSellingPrice(Optional<Double> sellingPrice){ this.sellingPrice = sellingPrice; }

            public Optional<Double> sellingPrice(){ return this.sellingPrice; }
            public TStock sellingPrice(Optional<Double> sellingPrice){ this.sellingPrice = sellingPrice; return this; }
          
            /**
            *

 供应商进价(未税)

            **/
            public Optional<Double> buyingPrice = Optional.empty();
            public Optional<Double> getBuyingPrice(){ return this.buyingPrice; }
            public void setBuyingPrice(Optional<Double> buyingPrice){ this.buyingPrice = buyingPrice; }

            public Optional<Double> buyingPrice(){ return this.buyingPrice; }
            public TStock buyingPrice(Optional<Double> buyingPrice){ this.buyingPrice = buyingPrice; return this; }
          
            /**
            *

 物流销价(不含税)

            **/
            public Optional<Double> logisticsPrice = Optional.empty();
            public Optional<Double> getLogisticsPrice(){ return this.logisticsPrice; }
            public void setLogisticsPrice(Optional<Double> logisticsPrice){ this.logisticsPrice = logisticsPrice; }

            public Optional<Double> logisticsPrice(){ return this.logisticsPrice; }
            public TStock logisticsPrice(Optional<Double> logisticsPrice){ this.logisticsPrice = logisticsPrice; return this; }
          
            /**
            *

 物流销项税率

            **/
            public Optional<Double> logisticsOutputTax = Optional.empty();
            public Optional<Double> getLogisticsOutputTax(){ return this.logisticsOutputTax; }
            public void setLogisticsOutputTax(Optional<Double> logisticsOutputTax){ this.logisticsOutputTax = logisticsOutputTax; }

            public Optional<Double> logisticsOutputTax(){ return this.logisticsOutputTax; }
            public TStock logisticsOutputTax(Optional<Double> logisticsOutputTax){ this.logisticsOutputTax = logisticsOutputTax; return this; }
          
            /**
            *

 物流销价总金额
 @datatype(name="bigdecimal")

            **/
            public Optional<java.math.BigDecimal> logisticsPriceAmount = Optional.empty();
            public Optional<java.math.BigDecimal> getLogisticsPriceAmount(){ return this.logisticsPriceAmount; }
            public void setLogisticsPriceAmount(Optional<java.math.BigDecimal> logisticsPriceAmount){ this.logisticsPriceAmount = logisticsPriceAmount; }

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

 门店售价总金额
 @datatype(name="bigdecimal")

            **/
            public Optional<java.math.BigDecimal> storeSellingPriceAmount = Optional.empty();
            public Optional<java.math.BigDecimal> getStoreSellingPriceAmount(){ return this.storeSellingPriceAmount; }
            public void setStoreSellingPriceAmount(Optional<java.math.BigDecimal> storeSellingPriceAmount){ this.storeSellingPriceAmount = storeSellingPriceAmount; }

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

 kafka_id
 @datatype(name="bigint")

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

            public Optional<String> kafkaId(){ return this.kafkaId; }
            public TStock kafkaId(Optional<String> kafkaId){ this.kafkaId = kafkaId; return this; }
          

        public static byte[] getBytesFromBean(TStock 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.TStockSerializer().write(bean, protocol);
          transport.flush();
          return transport.getByteBuf();
        }

        public static TStock 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.TStockSerializer().read(protocol);
        }

        public String toString(){
          StringBuilder stringBuilder = new StringBuilder("{");
            stringBuilder.append("\"").append("id").append("\":").append(this.id).append(",");
    stringBuilder.append("\"").append("ownerId").append("\":\"").append(this.ownerId).append("\",");
    stringBuilder.append("\"").append("ownerType").append("\":").append(this.ownerType).append(",");
    stringBuilder.append("\"").append("skuNo").append("\":\"").append(this.skuNo).append("\",");
    stringBuilder.append("\"").append("ownerName").append("\":\"").append(this.ownerName).append("\",");
    stringBuilder.append("\"").append("skuName").append("\":\"").append(this.skuName).append("\",");
    stringBuilder.append("\"").append("stockNum").append("\":").append(this.stockNum.isPresent()?this.stockNum.get():null).append(",");
    stringBuilder.append("\"").append("ffStockWeight").append("\":").append(this.ffStockWeight.isPresent()?this.ffStockWeight.get():null).append(",");
    stringBuilder.append("\"").append("useUnit").append("\":\"").append(this.useUnit.isPresent()?this.useUnit.get():null).append("\",");
    stringBuilder.append("\"").append("lastBalanceStock").append("\":").append(this.lastBalanceStock.isPresent()?this.lastBalanceStock.get():null).append(",");
    stringBuilder.append("\"").append("lastBalanceFfStock").append("\":").append(this.lastBalanceFfStock.isPresent()?this.lastBalanceFfStock.get():null).append(",");
    stringBuilder.append("\"").append("financeStock").append("\":").append(this.financeStock.isPresent()?this.financeStock.get():null).append(",");
    stringBuilder.append("\"").append("financeFfStock").append("\":").append(this.financeFfStock.isPresent()?this.financeFfStock.get():null).append(",");
    stringBuilder.append("\"").append("isDeleted").append("\":").append(this.isDeleted.isPresent()?this.isDeleted.get():null).append(",");
    stringBuilder.append("\"").append("createdAt").append("\":").append(this.createdAt).append(",");
    stringBuilder.append("\"").append("createdBy").append("\":").append(this.createdBy).append(",");
    stringBuilder.append("\"").append("updatedBy").append("\":").append(this.updatedBy.isPresent()?this.updatedBy.get():null).append(",");
    stringBuilder.append("\"").append("updatedAt").append("\":").append(this.updatedAt.isPresent()?this.updatedAt.get():null).append(",");
    stringBuilder.append("\"").append("sellingPrice").append("\":").append(this.sellingPrice.isPresent()?this.sellingPrice.get():null).append(",");
    stringBuilder.append("\"").append("buyingPrice").append("\":").append(this.buyingPrice.isPresent()?this.buyingPrice.get():null).append(",");
    stringBuilder.append("\"").append("logisticsPrice").append("\":").append(this.logisticsPrice.isPresent()?this.logisticsPrice.get():null).append(",");
    stringBuilder.append("\"").append("logisticsOutputTax").append("\":").append(this.logisticsOutputTax.isPresent()?this.logisticsOutputTax.get():null).append(",");
    stringBuilder.append("\"").append("logisticsPriceAmount").append("\":").append(this.logisticsPriceAmount.isPresent()?this.logisticsPriceAmount.get():null).append(",");
    stringBuilder.append("\"").append("storeSellingPriceAmount").append("\":").append(this.storeSellingPriceAmount.isPresent()?this.storeSellingPriceAmount.get():null).append(",");
    stringBuilder.append("\"").append("kafkaId").append("\":\"").append(this.kafkaId.isPresent()?this.kafkaId.get():null).append("\",");
    
            stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
            stringBuilder.append("}");

          return stringBuilder.toString();
        }
      }
      