using FreeSql.DatabaseModel;using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;
using Common.Extensions;
namespace Common.DJYModel
{
///
///
///
[JsonObject(MemberSerialization.OptIn), Table(Name = "Cust_Fee", DisableSyncStructure = true)]
public partial class CustFee {
[JsonProperty, Column(DbType = "varchar(50)", IsPrimary = true, IsNullable = false)]
public string GID { get; set; } = Guid.NewGuid().ToString().ToUpper();
[JsonProperty, Column(DbType = "varchar(5000)")]
public string BEIZHU { get; set; }
[JsonProperty, Column(DbType = "varchar(5000)")]
public string BEIZHU2 { get; set; }
///
/// 一般是业务Gid
///
[JsonProperty, Column(DbType = "varchar(50)")]
public string BSNO { get; set; }
///
///业务订单编号
///
[JsonProperty, Column(DbType = "varchar(30)")]
public string MBLNO { get; set; }
[JsonProperty, Column(DbType = "varchar(20)")]
public string BSSTATUS { get; set; }
///
/// 业务类型
///
[JsonProperty]
public int? BSTYPE { get; set; }
[JsonProperty, Column(DbType = "varchar(50)")]
public string CANGKU { get; set; }
[JsonProperty, Column(DbType = "varchar(30)")]
public string CARRIER { get; set; }
[JsonProperty, Column(DbType = "numeric(18,4)")]
public decimal? CBM { get; set; }
///
/// 录入人公司ID
///
[JsonProperty, Column(DbType = "varchar(50)")]
public string COMID { get; set; }
///
/// 录入人公司
///
[JsonProperty, Column(DbType = "varchar(50)")]
public string COMNAME { get; set; }
[JsonProperty, Column(InsertValueSql = "getdate()")]
public DateTime? CREATETIME { get; set; }
[JsonProperty, Column(DbType = "varchar(2000)")]
public string DESCRIPTION { get; set; }
[JsonProperty, Column(DbType = "varchar(100)")]
public string DESTINATION { get; set; }
[JsonProperty]
public DateTime? ETD { get; set; }
[JsonProperty, Column(DbType = "varchar(30)")]
public string FORWARDER { get; set; }
[JsonProperty, Column(DbType = "varchar(30)")]
public string HBLNO { get; set; }
[JsonProperty, Column(DbType = "numeric(18,4)")]
public decimal? KGS { get; set; }
[JsonProperty, Column(DbType = "varchar(20)")]
public string KINDPKGS { get; set; }
///
/// 录入人
///
[JsonProperty, Column(DbType = "varchar(50)")]
public string LURUREN { get; set; }
///
/// 录入人ID
///
[JsonProperty, Column(DbType = "varchar(50)")]
public string LURURENID { get; set; }
[JsonProperty, Column(DbType = "varchar(600)")]
public string MARKS { get; set; }
[JsonProperty, Column(DbType = "numeric(18,4)")]
public decimal? PKGS { get; set; }
[JsonProperty, Column(DbType = "varchar(100)")]
public string PORTDISCHARGE { get; set; }
[JsonProperty, Column(DbType = "decimal(19,2)")]
public decimal? PRICE { get; set; }
///
/// 发送公司
///
[JsonProperty, Column(DbType = "varchar(50)")]
public string SENDCOM { get; set; }
[JsonProperty]
public DateTime? SENDTIME { get; set; }
[JsonProperty]
public int? SENDTYPE { get; set; }
///
/// 发送人名
///
[JsonProperty, Column(DbType = "varchar(50)")]
public string SENDUSER { get; set; }
///
/// 发送人ID
///
[JsonProperty, Column(DbType = "varchar(50)")]
public string SENDUSERID { get; set; }
[JsonProperty, Column(DbType = "varchar(60)")]
public string VESSEL { get; set; }
[JsonProperty, Column(DbType = "varchar(30)")]
public string VOYNO { get; set; }
///
///箱量 根据 CtnrInfo计算
///
public int CtnrCount { get; set; }
///
///箱型箱量明细 尺寸*数量 多个逗号间隔
///
public string CtnrInfo { get; set; }
///
/// 是否可以信用支付 1 可以 0不允许 1的时候钱包金额不足可以负数
///
[Column(IsIgnore =true)]
public int IsCredit { get; set; } = 0;
///
/// 根据CtnrInfo计算箱量
///
///
public int GetCtnrcount() {
var val = 0;
if (CtnrInfo.IsNotNull()) {
var list = CtnrInfo.Split(',').ToList();
list.ForEach(item =>
{
var it = item.Split('*');
if (it.Length == 2) {
if (it[1].Isint()) {
val += it[1].ToInt();
}
}
});
}
return val;
}
}
}