313 lines
12 KiB
C#
Raw Normal View History

2025-04-24 18:31: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>
/// OrderItem
/// </summary>
[DataContract]
public partial class OrderItem : IEquatable<OrderItem>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="OrderItem" /> class.
/// </summary>
/// <param name="code">编码.</param>
/// <param name="name">产品名.</param>
/// <param name="unitPrice">单价,折后价.</param>
/// <param name="oriUnitPrice">吊牌单价.</param>
/// <param name="origAmount">吊牌总价.</param>
/// <param name="totalAmount">小计,小计价格应该要准确。折扣总价。.</param>
/// <param name="qty">数量.</param>
/// <param name="isGift">1:是赠品 0:不是赠品.</param>
/// <param name="isService">是不是服务 0:不是 1是.</param>
/// <param name="remark">备注.</param>
/// <param name="needReCal">是否需要重新计算价格,类似自用品是不需要的.</param>
/// <param name="listOrderItem">明细.</param>
public OrderItem(string code = default(string), string name = default(string), double? unitPrice = default(double?), double? oriUnitPrice = default(double?), double? origAmount = default(double?), double? totalAmount = default(double?), double? qty = default(double?), int? isGift = default(int?), int? isService = default(int?), string remark = default(string), bool? needReCal = default(bool?), List<OrderItem> listOrderItem = default(List<OrderItem>))
{
this.Code = code;
this.Name = name;
this.UnitPrice = unitPrice;
this.OriUnitPrice = oriUnitPrice;
this.OrigAmount = origAmount;
this.TotalAmount = totalAmount;
this.Qty = qty;
this.IsGift = isGift;
this.IsService = isService;
this.Remark = remark;
this.NeedReCal = needReCal;
this.ListOrderItem = listOrderItem;
}
/// <summary>
/// 编码
/// </summary>
/// <value>编码</value>
[DataMember(Name="code", EmitDefaultValue=false)]
public string Code { get; set; }
/// <summary>
/// 产品名
/// </summary>
/// <value>产品名</value>
[DataMember(Name="name", EmitDefaultValue=false)]
public string Name { get; set; }
/// <summary>
/// 单价,折后价
/// </summary>
/// <value>单价,折后价</value>
[DataMember(Name="unitPrice", EmitDefaultValue=false)]
public double? UnitPrice { get; set; }
/// <summary>
/// 吊牌单价
/// </summary>
/// <value>吊牌单价</value>
[DataMember(Name="oriUnitPrice", EmitDefaultValue=false)]
public double? OriUnitPrice { get; set; }
/// <summary>
/// 吊牌总价
/// </summary>
/// <value>吊牌总价</value>
[DataMember(Name="origAmount", EmitDefaultValue=false)]
public double? OrigAmount { get; set; }
/// <summary>
/// 小计,小计价格应该要准确。折扣总价。
/// </summary>
/// <value>小计,小计价格应该要准确。折扣总价。</value>
[DataMember(Name="totalAmount", EmitDefaultValue=false)]
public double? TotalAmount { get; set; }
/// <summary>
/// 数量
/// </summary>
/// <value>数量</value>
[DataMember(Name="qty", EmitDefaultValue=false)]
public double? Qty { get; set; }
/// <summary>
/// 1:是赠品 0:不是赠品
/// </summary>
/// <value>1:是赠品 0:不是赠品</value>
[DataMember(Name="isGift", EmitDefaultValue=false)]
public int? IsGift { get; set; }
/// <summary>
/// 是不是服务 0:不是 1
/// </summary>
/// <value>是不是服务 0:不是 1是</value>
[DataMember(Name="isService", EmitDefaultValue=false)]
public int? IsService { get; set; }
/// <summary>
/// 备注
/// </summary>
/// <value>备注</value>
[DataMember(Name="remark", EmitDefaultValue=false)]
public string Remark { get; set; }
/// <summary>
/// 是否需要重新计算价格,类似自用品是不需要的
/// </summary>
/// <value>是否需要重新计算价格,类似自用品是不需要的</value>
[DataMember(Name="needReCal", EmitDefaultValue=false)]
public bool? NeedReCal { get; set; }
/// <summary>
/// 明细
/// </summary>
/// <value>明细</value>
[DataMember(Name="listOrderItem", EmitDefaultValue=false)]
public List<OrderItem> ListOrderItem { 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 OrderItem {\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" UnitPrice: ").Append(UnitPrice).Append("\n");
sb.Append(" OriUnitPrice: ").Append(OriUnitPrice).Append("\n");
sb.Append(" OrigAmount: ").Append(OrigAmount).Append("\n");
sb.Append(" TotalAmount: ").Append(TotalAmount).Append("\n");
sb.Append(" Qty: ").Append(Qty).Append("\n");
sb.Append(" IsGift: ").Append(IsGift).Append("\n");
sb.Append(" IsService: ").Append(IsService).Append("\n");
sb.Append(" Remark: ").Append(Remark).Append("\n");
sb.Append(" NeedReCal: ").Append(NeedReCal).Append("\n");
sb.Append(" ListOrderItem: ").Append(ListOrderItem).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 OrderItem);
}
/// <summary>
/// Returns true if OrderItem instances are equal
/// </summary>
/// <param name="input">Instance of OrderItem to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(OrderItem input)
{
if (input == null)
return false;
return
(
this.Code == input.Code ||
(this.Code != null &&
this.Code.Equals(input.Code))
) &&
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
) &&
(
this.UnitPrice == input.UnitPrice ||
(this.UnitPrice != null &&
this.UnitPrice.Equals(input.UnitPrice))
) &&
(
this.OriUnitPrice == input.OriUnitPrice ||
(this.OriUnitPrice != null &&
this.OriUnitPrice.Equals(input.OriUnitPrice))
) &&
(
this.OrigAmount == input.OrigAmount ||
(this.OrigAmount != null &&
this.OrigAmount.Equals(input.OrigAmount))
) &&
(
this.TotalAmount == input.TotalAmount ||
(this.TotalAmount != null &&
this.TotalAmount.Equals(input.TotalAmount))
) &&
(
this.Qty == input.Qty ||
(this.Qty != null &&
this.Qty.Equals(input.Qty))
) &&
(
this.IsGift == input.IsGift ||
(this.IsGift != null &&
this.IsGift.Equals(input.IsGift))
) &&
(
this.IsService == input.IsService ||
(this.IsService != null &&
this.IsService.Equals(input.IsService))
) &&
(
this.Remark == input.Remark ||
(this.Remark != null &&
this.Remark.Equals(input.Remark))
) &&
(
this.NeedReCal == input.NeedReCal ||
(this.NeedReCal != null &&
this.NeedReCal.Equals(input.NeedReCal))
) &&
(
this.ListOrderItem == input.ListOrderItem ||
this.ListOrderItem != null &&
this.ListOrderItem.SequenceEqual(input.ListOrderItem)
);
}
/// <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.Name != null)
hashCode = hashCode * 59 + this.Name.GetHashCode();
if (this.UnitPrice != null)
hashCode = hashCode * 59 + this.UnitPrice.GetHashCode();
if (this.OriUnitPrice != null)
hashCode = hashCode * 59 + this.OriUnitPrice.GetHashCode();
if (this.OrigAmount != null)
hashCode = hashCode * 59 + this.OrigAmount.GetHashCode();
if (this.TotalAmount != null)
hashCode = hashCode * 59 + this.TotalAmount.GetHashCode();
if (this.Qty != null)
hashCode = hashCode * 59 + this.Qty.GetHashCode();
if (this.IsGift != null)
hashCode = hashCode * 59 + this.IsGift.GetHashCode();
if (this.IsService != null)
hashCode = hashCode * 59 + this.IsService.GetHashCode();
if (this.Remark != null)
hashCode = hashCode * 59 + this.Remark.GetHashCode();
if (this.NeedReCal != null)
hashCode = hashCode * 59 + this.NeedReCal.GetHashCode();
if (this.ListOrderItem != null)
hashCode = hashCode * 59 + this.ListOrderItem.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;
}
}
}