177 lines
6.0 KiB
C#
Raw Permalink Normal View History

2025-04-21 14:10:27 +08:00
/*
* API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: Admin
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter;
namespace IO.Swagger.Model
{
/// <summary>
/// StockDetail
/// </summary>
[DataContract]
public partial class StockDetail : IEquatable<StockDetail>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="StockDetail" /> class.
/// </summary>
/// <param name="code">物料编码.</param>
/// <param name="shouldQty">应该数量,如果只有一个数量,则和实际数量传同一个值.</param>
/// <param name="qty">实际数量.</param>
/// <param name="unitPrice">单价.</param>
public StockDetail(string code = default(string), double? shouldQty = default(double?), double? qty = default(double?), double? unitPrice = default(double?))
{
this.Code = code;
this.ShouldQty = shouldQty;
this.Qty = qty;
this.UnitPrice = unitPrice;
}
/// <summary>
/// 物料编码
/// </summary>
/// <value>物料编码</value>
[DataMember(Name="code", EmitDefaultValue=false)]
public string Code { get; set; }
/// <summary>
/// 应该数量,如果只有一个数量,则和实际数量传同一个值
/// </summary>
/// <value>应该数量,如果只有一个数量,则和实际数量传同一个值</value>
[DataMember(Name="shouldQty", EmitDefaultValue=false)]
public double? ShouldQty { get; set; }
/// <summary>
/// 实际数量
/// </summary>
/// <value>实际数量</value>
[DataMember(Name="qty", EmitDefaultValue=false)]
public double? Qty { get; set; }
/// <summary>
/// 单价
/// </summary>
/// <value>单价</value>
[DataMember(Name="unitPrice", EmitDefaultValue=false)]
public double? UnitPrice { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class StockDetail {\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" ShouldQty: ").Append(ShouldQty).Append("\n");
sb.Append(" Qty: ").Append(Qty).Append("\n");
sb.Append(" UnitPrice: ").Append(UnitPrice).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as StockDetail);
}
/// <summary>
/// Returns true if StockDetail instances are equal
/// </summary>
/// <param name="input">Instance of StockDetail to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(StockDetail input)
{
if (input == null)
return false;
return
(
this.Code == input.Code ||
(this.Code != null &&
this.Code.Equals(input.Code))
) &&
(
this.ShouldQty == input.ShouldQty ||
(this.ShouldQty != null &&
this.ShouldQty.Equals(input.ShouldQty))
) &&
(
this.Qty == input.Qty ||
(this.Qty != null &&
this.Qty.Equals(input.Qty))
) &&
(
this.UnitPrice == input.UnitPrice ||
(this.UnitPrice != null &&
this.UnitPrice.Equals(input.UnitPrice))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Code != null)
hashCode = hashCode * 59 + this.Code.GetHashCode();
if (this.ShouldQty != null)
hashCode = hashCode * 59 + this.ShouldQty.GetHashCode();
if (this.Qty != null)
hashCode = hashCode * 59 + this.Qty.GetHashCode();
if (this.UnitPrice != null)
hashCode = hashCode * 59 + this.UnitPrice.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}