diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj
index a4fc1e064..f3a86053b 100644
--- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj
+++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj
@@ -97,6 +97,11 @@
+
+
+
+
+
diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs
index 935d8b7ed..4f256644a 100644
--- a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs
+++ b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs
@@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
+ UCustom025.Init();
UnitTestConfigQuery.Init();
UnitSub.Init();
UnitUpdateNavN3.Init();
diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillDtl.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillDtl.cs
new file mode 100644
index 000000000..77ba7ccc3
--- /dev/null
+++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillDtl.cs
@@ -0,0 +1,565 @@
+
+using SqlSugar;
+
+namespace IWMS.Bill.Models
+{
+ ///
+ /// 单据明细
+ ///
+ [SugarTable("IMS_BILL_DTL")]
+ public class ImsBillDtl
+ {
+ ///
+ /// 主表ID
+ ///
+ [SugarColumn(ColumnName = "MST_ID")]
+ public decimal MstId { get; set; }
+
+ ///
+ /// 来源主表ID
+ ///
+ [SugarColumn(ColumnName = "ORIG_MST_ID")]
+ public decimal OrigMstId { get; set; }
+
+ ///
+ /// 行号
+ ///
+ [SugarColumn(ColumnName = "LINE_NO")]
+ public decimal? LineNo { get; set; }
+
+ ///
+ /// 备注
+ ///
+ [SugarColumn(ColumnName = "DESCRIPTION")]
+ public string Description { get; set; }
+
+ ///
+ /// 项目文本
+ ///
+ [SugarColumn(ColumnName = "ITEM_TEXT")]
+ public string ItemText { get; set; }
+
+ ///
+ /// 料号ID
+ ///
+ [SugarColumn(ColumnName = "PART_ID")]
+ public decimal? PartId { get; set; }
+
+ ///
+ /// 成品号
+ ///
+ [SugarColumn(ColumnName = "PID")]
+ public string Pid { get; set; }
+
+ ///
+ /// 机芯
+ ///
+ [SugarColumn(ColumnName = "CORE")]
+ public string Core { get; set; }
+
+ ///
+ /// 发出库别
+ ///
+ [SugarColumn(ColumnName = "FROM_SIC_ID")]
+ public decimal? FromSicId { get; set; }
+
+ ///
+ /// 发出储位
+ ///
+ [SugarColumn(ColumnName = "FROM_LOC_ID")]
+ public decimal? FromLocId { get; set; }
+
+ ///
+ /// 发出工厂
+ ///
+ [SugarColumn(ColumnName = "FROM_BU_ID")]
+ public decimal? FromBuId { get; set; }
+
+ ///
+ /// 接收工厂
+ ///
+ [SugarColumn(ColumnName = "TO_BU_ID")]
+ public decimal? ToBuId { get; set; }
+
+ ///
+ /// 接收仓库
+ ///
+ [SugarColumn(ColumnName = "TO_SIC_ID")]
+ public decimal? ToSicId { get; set; }
+
+ ///
+ /// 接收储位
+ ///
+ [SugarColumn(ColumnName = "TO_LOC_ID")]
+ public decimal? ToLocId { get; set; }
+
+ ///
+ /// 转换后料号
+ ///
+ [SugarColumn(ColumnName = "TO_PART_ID")]
+ public decimal? ToPartId { get; set; }
+
+ ///
+ /// 总箱数
+ ///
+ [SugarColumn(ColumnName = "TOTAL_BOX")]
+ public decimal? TotalBox { get; set; }
+
+ ///
+ /// 最小包装
+ ///
+ [SugarColumn(ColumnName = "MPQ")]
+ public decimal? Mpq { get; set; }
+
+ ///
+ /// 开单量
+ ///
+ [SugarColumn(ColumnName = "QTY")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 实际收发量
+ ///
+ [SugarColumn(ColumnName = "ACTUAL_QTY")]
+ public decimal ActualQty { get; set; }
+
+ ///
+ /// 状态
+ ///
+ [SugarColumn(ColumnName = "STATUS", IsOnlyIgnoreInsert = true)]
+ public string Status { get; set; }
+
+ ///
+ /// 进向交货单
+ ///
+ [SugarColumn(ColumnName = "INNER_DN_NO")]
+ public string InnerDnNo { get; set; }
+
+ ///
+ /// 账册序号
+ ///
+ [SugarColumn(ColumnName = "BOOK_NO")]
+ public string BookNo { get; set; }
+
+ ///
+ /// 备案申请号
+ ///
+ [SugarColumn(ColumnName = "APP_NO")]
+ public string AppNo { get; set; }
+
+ ///
+ /// 采购单
+ ///
+ [SugarColumn(ColumnName = "PO_NO")]
+ public string PoNo { get; set; }
+
+ ///
+ /// 采购单行号
+ ///
+ [SugarColumn(ColumnName = "PO_LINE")]
+ public string PoLine { get; set; }
+
+ ///
+ /// 贸易类型
+ ///
+ [SugarColumn(ColumnName = "ZTYPE")]
+ public string Ztype { get; set; }
+
+ ///
+ /// 采购单位
+ ///
+ [SugarColumn(ColumnName = "PO_UNIT")]
+ public string PoUnit { get; set; }
+
+ ///
+ /// 库存单位
+ ///
+ [SugarColumn(ColumnName = "BASE_UNIT")]
+ public string BaseUnit { get; set; }
+
+ ///
+ /// 单价
+ ///
+ [SugarColumn(ColumnName = "UNIT_PRICE")]
+ public decimal UnitPrice { get; set; }
+
+ ///
+ /// 币别
+ ///
+ [SugarColumn(ColumnName = "CURRENCY")]
+ public string Currency { get; set; }
+
+ ///
+ /// 工单号
+ ///
+ [SugarColumn(ColumnName = "MO")]
+ public string Mo { get; set; }
+
+ ///
+ /// 工单行号
+ ///
+ [SugarColumn(ColumnName = "MO_LINE")]
+ public string MoLine { get; set; }
+
+ ///
+ /// 出通单号
+ ///
+ [SugarColumn(ColumnName = "DN_NO")]
+ public string DnNo { get; set; }
+
+ ///
+ /// 出通单行号
+ ///
+ [SugarColumn(ColumnName = "DN_LINE")]
+ public string DnLine { get; set; }
+
+ ///
+ /// 销单号
+ ///
+ [SugarColumn(ColumnName = "SO")]
+ public string So { get; set; }
+
+ ///
+ /// 销单行号
+ ///
+ [SugarColumn(ColumnName = "SO_LINE")]
+ public string SoLine { get; set; }
+
+ ///
+ /// 销售国
+ ///
+ [SugarColumn(ColumnName = "SO_CONTRY")]
+ public string SoContry { get; set; }
+
+ ///
+ /// 预留单号
+ ///
+ [SugarColumn(ColumnName = "RSV_NO")]
+ public string RsvNo { get; set; }
+
+ ///
+ /// 预留单行号
+ ///
+ [SugarColumn(ColumnName = "RSV_LINE")]
+ public string RsvLine { get; set; }
+
+ ///
+ /// 装箱单号
+ ///
+ [SugarColumn(ColumnName = "PK_NO")]
+ public string PkNo { get; set; }
+
+ ///
+ /// 装箱单项次
+ ///
+ [SugarColumn(ColumnName = "PK_LINE")]
+ public string PkLine { get; set; }
+
+ ///
+ /// 凭证号
+ ///
+ [SugarColumn(ColumnName = "EVIDENCE")]
+ public string Evidence { get; set; }
+
+ ///
+ /// 凭证行
+ ///
+ [SugarColumn(ColumnName = "EVIDENCE_LINE")]
+ public string EvidenceLine { get; set; }
+
+ ///
+ /// 凭证年份
+ ///
+ [SugarColumn(ColumnName = "EVIDENCE_YEAR")]
+ public string EvidenceYear { get; set; }
+
+ ///
+ /// 科目
+ ///
+ [SugarColumn(ColumnName = "ACCOUNT")]
+ public string Account { get; set; }
+
+ ///
+ /// 成本中心
+ ///
+ [SugarColumn(ColumnName = "COST_CENTER")]
+ public string CostCenter { get; set; }
+
+ ///
+ /// 反冲标识
+ ///
+ [SugarColumn(ColumnName = "BACK_FLUSH")]
+ public string BackFlush { get; set; }
+
+ ///
+ /// 配送目的地
+ ///
+ [SugarColumn(ColumnName = "DESTINATION")]
+ public string Destination { get; set; }
+
+ ///
+ /// 移动原因
+ ///
+ [SugarColumn(ColumnName = "MOVE_REASON")]
+ public string MoveReason { get; set; }
+
+ ///
+ /// 卸货点
+ ///
+ [SugarColumn(ColumnName = "UNLOADING_POINT")]
+ public string UnloadingPoint { get; set; }
+
+ ///
+ /// 加工方式
+ ///
+ [SugarColumn(ColumnName = "PROCESS_WAY")]
+ public string ProcessWay { get; set; }
+
+ ///
+ /// 串号
+ ///
+ [SugarColumn(ColumnName = "ARTNO")]
+ public string Artno { get; set; }
+
+ ///
+ /// 报关单号
+ ///
+ [SugarColumn(ColumnName = "ENTRYID")]
+ public string Entryid { get; set; }
+
+ ///
+ /// 报关单行号
+ ///
+ [SugarColumn(ColumnName = "GNO")]
+ public string Gno { get; set; }
+
+ ///
+ /// 供应商发票号
+ ///
+ [SugarColumn(ColumnName = "VD_INV_NO")]
+ public string VdInvNo { get; set; }
+
+ ///
+ /// 香港发票号
+ ///
+ [SugarColumn(ColumnName = "HK_INV_NO")]
+ public string HkInvNo { get; set; }
+
+ ///
+ /// 供应商编号
+ ///
+ [SugarColumn(ColumnName = "VENDOR_CODE")]
+ public string VendorCode { get; set; }
+
+ ///
+ /// 航班号
+ ///
+ [SugarColumn(ColumnName = "FLIGHT_NO")]
+ public string FlightNo { get; set; }
+
+ ///
+ /// 运输方式
+ ///
+ [SugarColumn(ColumnName = "SHIP_WAY")]
+ public string ShipWay { get; set; }
+
+ ///
+ /// 货柜号
+ ///
+ [SugarColumn(ColumnName = "CONTAINER")]
+ public string Container { get; set; }
+
+ ///
+ /// 柜型
+ ///
+ [SugarColumn(ColumnName = "CONTAINER_TYPE")]
+ public string ContainerType { get; set; }
+
+ ///
+ /// 货柜尺寸
+ ///
+ [SugarColumn(ColumnName = "CONTAINER_SIZE")]
+ public string ContainerSize { get; set; }
+
+ ///
+ /// 封条号
+ ///
+ [SugarColumn(ColumnName = "SEAL_NO")]
+ public string SealNo { get; set; }
+
+ ///
+ /// 厂封
+ ///
+ [SugarColumn(ColumnName = "F_SEAL_NO")]
+ public string FSealNo { get; set; }
+
+ ///
+ /// 套件值
+ ///
+ [SugarColumn(ColumnName = "GROUP_KEY")]
+ public string GroupKey { get; set; }
+
+ ///
+ /// 急料标记
+ ///
+ [SugarColumn(ColumnName = "URGENT_FLAG")]
+ public string UrgentFlag { get; set; }
+
+ ///
+ /// 试产标记
+ ///
+ [SugarColumn(ColumnName = "TRIAL_FLAG")]
+ public string TrialFlag { get; set; }
+
+ ///
+ /// 开始处理人
+ ///
+ [SugarColumn(ColumnName = "START_BY")]
+ public string StartBy { get; set; }
+
+ ///
+ /// 开始处理时间
+ ///
+ [SugarColumn(ColumnName = "START_DATE")]
+ public System.DateTime? StartDate { get; set; }
+
+ ///
+ /// 结单人员
+ ///
+ [SugarColumn(ColumnName = "CLOSED_BY")]
+ public string ClosedBy { get; set; }
+
+ ///
+ /// 结单时间
+ ///
+ [SugarColumn(ColumnName = "CLOSED_DATE")]
+ public System.DateTime? ClosedDate { get; set; }
+
+ ///
+ /// 过账时间
+ ///
+ [SugarColumn(ColumnName = "BOOK_DATE")]
+ public System.DateTime? BookDate { get; set; }
+
+ ///
+ /// 扩展1
+ ///
+ [SugarColumn(ColumnName = "ATT1")]
+ public string Att1 { get; set; }
+
+ ///
+ /// 扩展2
+ ///
+ [SugarColumn(ColumnName = "ATT2")]
+ public string Att2 { get; set; }
+
+ ///
+ /// 扩展3
+ ///
+ [SugarColumn(ColumnName = "ATT3")]
+ public string Att3 { get; set; }
+
+ ///
+ /// 扩展4
+ ///
+ [SugarColumn(ColumnName = "ATT4")]
+ public string Att4 { get; set; }
+
+ ///
+ /// 扩展5
+ ///
+ [SugarColumn(ColumnName = "ATT5")]
+ public string Att5 { get; set; }
+
+ ///
+ /// 扩展6
+ ///
+ [SugarColumn(ColumnName = "ATT6")]
+ public string Att6 { get; set; }
+
+ ///
+ /// 扩展7
+ ///
+ [SugarColumn(ColumnName = "ATT7")]
+ public string Att7 { get; set; }
+
+ ///
+ /// 扩展8
+ ///
+ [SugarColumn(ColumnName = "ATT8")]
+ public string Att8 { get; set; }
+
+ ///
+ /// 扩展9
+ ///
+ [SugarColumn(ColumnName = "ATT9")]
+ public string Att9 { get; set; }
+
+ ///
+ /// 扩展10
+ ///
+ [SugarColumn(ColumnName = "ATT10")]
+ public string Att10 { get; set; }
+
+ ///
+ /// 备用数值1
+ ///
+ [SugarColumn(ColumnName = "NUM1")]
+ public decimal? Num1 { get; set; }
+
+ ///
+ /// 备用数值2
+ ///
+ [SugarColumn(ColumnName = "NUM2")]
+ public decimal? Num2 { get; set; }
+
+ ///
+ /// 备用数值3
+ ///
+ [SugarColumn(ColumnName = "NUM3")]
+ public decimal? Num3 { get; set; }
+
+ ///
+ /// 备用数值4
+ ///
+ [SugarColumn(ColumnName = "NUM4")]
+ public decimal? Num4 { get; set; }
+
+ ///
+ /// 备用数值5
+ ///
+ [SugarColumn(ColumnName = "NUM5")]
+ public decimal? Num5 { get; set; }
+
+ ///
+ /// 备用日期1
+ ///
+ [SugarColumn(ColumnName = "DT1")]
+ public System.DateTime? Dt1 { get; set; }
+
+ ///
+ /// 备用日期2
+ ///
+ [SugarColumn(ColumnName = "DT2")]
+ public System.DateTime? Dt2 { get; set; }
+
+ ///
+ /// 备用日期3
+ ///
+ [SugarColumn(ColumnName = "DT3")]
+ public System.DateTime? Dt3 { get; set; }
+
+ ///
+ /// 备用日期4
+ ///
+ [SugarColumn(ColumnName = "DT4")]
+ public System.DateTime? Dt4 { get; set; }
+
+ ///
+ /// 备用日期5
+ ///
+ [SugarColumn(ColumnName = "DT5")]
+ public System.DateTime? Dt5 { get; set; }
+ public decimal Id { get; internal set; }
+ }
+}
diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillDtlStk.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillDtlStk.cs
new file mode 100644
index 000000000..717ca5a55
--- /dev/null
+++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillDtlStk.cs
@@ -0,0 +1,77 @@
+using SqlSugar;
+
+namespace IWMS.Bill.Models
+{
+ ///
+ /// 单据条码关联表
+ ///
+ [SugarTable("IMS_BILL_DTL_STK")]
+ public class ImsBillDtlStk
+ {
+ ///
+ /// 主键
+ ///
+ [SugarColumn(IsPrimaryKey = true, ColumnName = "ID")]
+ public decimal Id { get; set; }
+
+ ///
+ /// 租户ID
+ ///
+ [SugarColumn(ColumnName = "TENANT_ID")]
+ public decimal TenantId { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName = "CREATED_TIME", IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)]
+ public System.DateTime CreatedTime { get; set; }
+
+ ///
+ /// 创建人
+ ///
+ [SugarColumn(ColumnName = "CREATED_BY", IsOnlyIgnoreUpdate = true)]
+ public string CreatedBy { get; set; }
+
+ ///
+ /// 更新时间
+ ///
+ [SugarColumn(ColumnName = "UPDATED_TIME", IsOnlyIgnoreInsert = true)]
+ public System.DateTime? UpdatedTime { get; set; }
+
+ ///
+ /// 最后更新人
+ ///
+ [SugarColumn(ColumnName = "UPDATED_BY", IsOnlyIgnoreInsert = true)]
+ public string UpdatedBy { get; set; }
+
+ ///
+ /// 删除标记
+ ///
+ [SugarColumn(ColumnName = "DELETED", IsOnlyIgnoreInsert = true)]
+ public string Deleted { get; set; }
+
+ ///
+ /// 单据明细表ID
+ ///
+ [SugarColumn(ColumnName = "DTL_ID")]
+ public decimal DtlId { get; set; }
+
+ ///
+ /// 单据库存表ID
+ ///
+ [SugarColumn(ColumnName = "STK_ID")]
+ public decimal StkId { get; set; }
+
+ ///
+ /// 充单量
+ ///
+ [SugarColumn(ColumnName = "QTY")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 序号
+ ///
+ [SugarColumn(IsIgnore = true)]
+ public decimal RowIndex { get; set; }
+ }
+}
diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillMst.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillMst.cs
new file mode 100644
index 000000000..a5b507c54
--- /dev/null
+++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillMst.cs
@@ -0,0 +1,410 @@
+
+using SqlSugar;
+
+namespace IWMS.Bill.Models
+{
+ ///
+ /// 单据主表
+ ///
+ [SugarTable("IMS_BILL_MST")]
+ public class ImsBillMst
+ {
+ ///
+ /// 单据编号
+ ///
+ [SugarColumn(ColumnName = "CODE")]
+ public string Code { get; set; }
+
+ ///
+ /// 合并到的单据
+ ///
+ [SugarColumn(ColumnName = "COMBINED_TO")]
+ public string CombinedTo { get; set; }
+
+ ///
+ /// 说明
+ ///
+ [SugarColumn(ColumnName = "DESCRIPTION")]
+ public string Description { get; set; }
+
+ ///
+ /// 抬头文本
+ ///
+ [SugarColumn(ColumnName = "HEADER_TEXT")]
+ public string HeaderText { get; set; }
+
+ ///
+ /// 状态
+ ///
+ [SugarColumn(ColumnName = "STATUS")]
+ public string Status { get; set; }
+
+ ///
+ /// 单据来源渠道(1:WMS 2: ERP 3:SRM)
+ ///
+ [SugarColumn(ColumnName = "CHANNEL")]
+ public decimal Channel { get; set; }
+
+ ///
+ /// 目的地
+ ///
+ [SugarColumn(ColumnName = "DESTINATION")]
+ public string Destination { get; set; }
+
+ ///
+ /// 单据类型
+ ///
+ [SugarColumn(ColumnName = "BILL_TYPE_ID")]
+ public decimal BillTypeId { get; set; }
+
+ ///
+ /// 公司
+ ///
+ [SugarColumn(ColumnName = "COMPANY_ID")]
+ public decimal CompanyId { get; set; }
+
+ ///
+ /// 供应商
+ ///
+ [SugarColumn(ColumnName = "VENDOR_ID")]
+ public decimal VendorId { get; set; }
+
+ ///
+ /// 客户
+ ///
+ [SugarColumn(ColumnName = "CUSTOMER_ID")]
+ public decimal CustomerId { get; set; }
+
+ ///
+ /// 发票号
+ ///
+ [SugarColumn(ColumnName = "INVOICE_NO")]
+ public string InvoiceNo { get; set; }
+
+ ///
+ /// 装箱单
+ ///
+ [SugarColumn(ColumnName = "PK_NO")]
+ public string PkNo { get; set; }
+
+ ///
+ /// 装箱单类型
+ ///
+ [SugarColumn(ColumnName = "PK_TYPE")]
+ public string PkType { get; set; }
+
+ ///
+ /// 保税类型
+ ///
+ [SugarColumn(ColumnName = "BONDED_TYPE")]
+ public string BondedType { get; set; }
+
+ ///
+ /// 车间
+ ///
+ [SugarColumn(ColumnName = "FACTORY")]
+ public string Factory { get; set; }
+
+ ///
+ /// 默认发产区域清单
+ ///
+ [SugarColumn(ColumnName = "COMMIT_LOCATORS")]
+ public string CommitLocators { get; set; }
+
+ ///
+ /// ERP交易路线
+ ///
+ [SugarColumn(ColumnName = "ERP_BILL_TYPE")]
+ public string ErpBillType { get; set; }
+
+ ///
+ /// ERP交易名称
+ ///
+ [SugarColumn(ColumnName = "ERP_BILL_NAME")]
+ public string ErpBillName { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ [SugarColumn(ColumnName = "WORK_CENTER")]
+ public string WorkCenter { get; set; }
+
+ ///
+ /// 部门
+ ///
+ [SugarColumn(ColumnName = "DEPARTMENT")]
+ public string Department { get; set; }
+
+ ///
+ /// 到货日期
+ ///
+ [SugarColumn(ColumnName = "ETA_DATE")]
+ public System.DateTime? EtaDate { get; set; }
+
+ ///
+ /// 司机
+ ///
+ [SugarColumn(ColumnName = "DRIVER_NAME")]
+ public string DriverName { get; set; }
+
+ ///
+ /// 司机手机号
+ ///
+ [SugarColumn(ColumnName = "DRIVER_MOBILE")]
+ public string DriverMobile { get; set; }
+
+ ///
+ /// 车牌号
+ ///
+ [SugarColumn(ColumnName = "CAR_NO")]
+ public string CarNo { get; set; }
+
+ ///
+ /// 码头号
+ ///
+ [SugarColumn(ColumnName = "WHARF")]
+ public string Wharf { get; set; }
+
+ ///
+ /// 送货方式
+ ///
+ [SugarColumn(ColumnName = "DLV_TYPE")]
+ public string DlvType { get; set; }
+
+ ///
+ /// 报缺时间
+ ///
+ [SugarColumn(ColumnName = "SHORTAGE_TIME")]
+ public System.DateTime? ShortageTime { get; set; }
+
+ ///
+ /// 车型
+ ///
+ [SugarColumn(ColumnName = "VEHICLE_TYPE")]
+ public string VehicleType { get; set; }
+
+ ///
+ /// 箱数
+ ///
+ [SugarColumn(ColumnName = "BOX_COUNT")]
+ public decimal BoxCount { get; set; }
+
+ ///
+ /// 打印次数
+ ///
+ [SugarColumn(ColumnName = "PRINT_COUNT")]
+ public decimal PrintCount { get; set; }
+
+ ///
+ /// 打印时间
+ ///
+ [SugarColumn(ColumnName = "PRINT_DATE")]
+ public System.DateTime? PrintDate { get; set; }
+
+ ///
+ /// 打印人
+ ///
+ [SugarColumn(ColumnName = "PRINT_BY")]
+ public string PrintBy { get; set; }
+
+ ///
+ /// 提单号
+ ///
+ [SugarColumn(ColumnName = "BILL_OF_LOAD")]
+ public string BillOfLoad { get; set; }
+
+ ///
+ /// 出货通知单
+ ///
+ [SugarColumn(ColumnName = "SHIPPING_ORDER")]
+ public string ShippingOrder { get; set; }
+
+ ///
+ /// 出货日期
+ ///
+ [SugarColumn(ColumnName = "SHIPPING_DATE")]
+ public System.DateTime? ShippingDate { get; set; }
+
+ ///
+ /// 进厂时间
+ ///
+ [SugarColumn(ColumnName = "IN_DOOR_DATE")]
+ public System.DateTime? InDoorDate { get; set; }
+
+ ///
+ /// 出厂时间
+ ///
+ [SugarColumn(ColumnName = "OUT_DOOR_DATE")]
+ public System.DateTime? OutDoorDate { get; set; }
+
+ ///
+ /// 核准状态
+ ///
+ [SugarColumn(ColumnName = "SIGN_STATUS")]
+ public string SignStatus { get; set; }
+
+ ///
+ /// 核准时间
+ ///
+ [SugarColumn(ColumnName = "SIGN_DATE")]
+ public System.DateTime? SignDate { get; set; }
+
+ ///
+ /// 核准人
+ ///
+ [SugarColumn(ColumnName = "SIGN_BY")]
+ public string SignBy { get; set; }
+
+ ///
+ /// 核准说明
+ ///
+ [SugarColumn(ColumnName = "SIGN_REMARK")]
+ public string SignRemark { get; set; }
+
+ ///
+ /// 开始处理人
+ ///
+ [SugarColumn(ColumnName = "START_BY")]
+ public string StartBy { get; set; }
+
+ ///
+ /// 开始处理时间
+ ///
+ [SugarColumn(ColumnName = "START_DATE")]
+ public System.DateTime? StartDate { get; set; }
+
+ ///
+ /// 结单人员
+ ///
+ [SugarColumn(ColumnName = "CLOSED_BY")]
+ public string ClosedBy { get; set; }
+
+ ///
+ /// 结单时间
+ ///
+ [SugarColumn(ColumnName = "CLOSED_DATE")]
+ public System.DateTime? ClosedDate { get; set; }
+
+ ///
+ /// 扩展1
+ ///
+ [SugarColumn(ColumnName = "ATT1")]
+ public string Att1 { get; set; }
+
+ ///
+ /// 扩展2
+ ///
+ [SugarColumn(ColumnName = "ATT2")]
+ public string Att2 { get; set; }
+
+ ///
+ /// 扩展3
+ ///
+ [SugarColumn(ColumnName = "ATT3")]
+ public string Att3 { get; set; }
+
+ ///
+ /// 扩展4
+ ///
+ [SugarColumn(ColumnName = "ATT4")]
+ public string Att4 { get; set; }
+
+ ///
+ /// 扩展5
+ ///
+ [SugarColumn(ColumnName = "ATT5")]
+ public string Att5 { get; set; }
+
+ ///
+ /// 扩展6
+ ///
+ [SugarColumn(ColumnName = "ATT6")]
+ public string Att6 { get; set; }
+
+ ///
+ /// 扩展7
+ ///
+ [SugarColumn(ColumnName = "ATT7")]
+ public string Att7 { get; set; }
+
+ ///
+ /// 扩展8
+ ///
+ [SugarColumn(ColumnName = "ATT8")]
+ public string Att8 { get; set; }
+
+ ///
+ /// 扩展9
+ ///
+ [SugarColumn(ColumnName = "ATT9")]
+ public string Att9 { get; set; }
+
+ ///
+ /// 扩展10
+ ///
+ [SugarColumn(ColumnName = "ATT10")]
+ public string Att10 { get; set; }
+
+ ///
+ /// 备用数值1
+ ///
+ [SugarColumn(ColumnName = "NUM1")]
+ public decimal Num1 { get; set; }
+
+ ///
+ /// 备用数值2
+ ///
+ [SugarColumn(ColumnName = "NUM2")]
+ public decimal Num2 { get; set; }
+
+ ///
+ /// 备用数值3
+ ///
+ [SugarColumn(ColumnName = "NUM3")]
+ public decimal Num3 { get; set; }
+
+ ///
+ /// 备用数值4
+ ///
+ [SugarColumn(ColumnName = "NUM4")]
+ public decimal Num4 { get; set; }
+
+ ///
+ /// 备用数值5
+ ///
+ [SugarColumn(ColumnName = "NUM5")]
+ public decimal Num5 { get; set; }
+
+ ///
+ /// 备用日期1
+ ///
+ [SugarColumn(ColumnName = "DT1")]
+ public System.DateTime? Dt1 { get; set; }
+
+ ///
+ /// 备用日期2
+ ///
+ [SugarColumn(ColumnName = "DT2")]
+ public System.DateTime? Dt2 { get; set; }
+
+ ///
+ /// 备用日期3
+ ///
+ [SugarColumn(ColumnName = "DT3")]
+ public System.DateTime? Dt3 { get; set; }
+
+ ///
+ /// 备用日期4
+ ///
+ [SugarColumn(ColumnName = "DT4")]
+ public System.DateTime? Dt4 { get; set; }
+
+ ///
+ /// 备用日期5
+ ///
+ [SugarColumn(ColumnName = "DT5")]
+ public System.DateTime? Dt5 { get; set; }
+ public string Deleted { get; internal set; }
+ public decimal Id { get; internal set; }
+ }
+}
diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillStk.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillStk.cs
new file mode 100644
index 000000000..024921b3b
--- /dev/null
+++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/ImsBillStk.cs
@@ -0,0 +1,413 @@
+using SqlSugar;
+
+namespace IWMS.Bill.Models
+{
+ ///
+ /// 单据条码记录表
+ ///
+ [SugarTable("IMS_BILL_STK")]
+ public class ImsBillStk
+ {
+ ///
+ /// 主键
+ ///
+ [SugarColumn(IsPrimaryKey = true, ColumnName = "ID")]
+ public decimal Id { get; set; }
+
+ ///
+ /// 单据ID
+ ///
+ [SugarColumn(ColumnName = "MST_ID")]
+ public decimal MstId { get; set; }
+
+ ///
+ /// 租户ID
+ ///
+ [SugarColumn(ColumnName = "TENANT_ID")]
+ public decimal TenantId { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName = "CREATED_TIME", IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)]
+ public System.DateTime CreatedTime { get; set; }
+
+ ///
+ /// 创建人
+ ///
+ [SugarColumn(ColumnName = "CREATED_BY", IsOnlyIgnoreUpdate = true)]
+ public string CreatedBy { get; set; }
+
+ ///
+ /// 更新时间
+ ///
+ [SugarColumn(ColumnName = "UPDATED_TIME", IsOnlyIgnoreInsert = true)]
+ public System.DateTime? UpdatedTime { get; set; }
+
+ ///
+ /// 最后更新人
+ ///
+ [SugarColumn(ColumnName = "UPDATED_BY", IsOnlyIgnoreInsert = true)]
+ public string UpdatedBy { get; set; }
+
+ ///
+ /// 删除标记
+ ///
+ [SugarColumn(ColumnName = "DELETED", IsOnlyIgnoreInsert = true)]
+ public string Deleted { get; set; }
+
+ ///
+ /// 预估量
+ ///
+ [SugarColumn(ColumnName = "QTY")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 实际量
+ ///
+ [SugarColumn(ColumnName = "ACTUAL_QTY")]
+ public decimal ActualQty { get; set; }
+
+ ///
+ /// 库存ID
+ ///
+ [SugarColumn(ColumnName = "STOCK_ID")]
+ public decimal StockId { get; set; }
+
+ ///
+ /// 条码
+ ///
+ [SugarColumn(ColumnName = "BCD")]
+ public decimal Bcd { get; set; }
+
+ ///
+ /// 原条码
+ ///
+ [SugarColumn(ColumnName = "SOURCE_BCD")]
+ public decimal SourceBcd { get; set; }
+
+ ///
+ /// 打印标记
+ ///
+ [SugarColumn(ColumnName = "PRINT_FLAG")]
+ public string PrintFlag { get; set; }
+
+ ///
+ /// 打印次数
+ ///
+ [SugarColumn(ColumnName = "PRINT_COUNT")]
+ public decimal PrintCount { get; set; }
+
+ ///
+ /// 打印时间
+ ///
+ [SugarColumn(ColumnName = "PRINT_DATE")]
+ public System.DateTime? PrintDate { get; set; }
+
+ ///
+ /// 打印人员
+ ///
+ [SugarColumn(ColumnName = "PRINT_BY")]
+ public string PrintBy { get; set; }
+
+ ///
+ /// 需求号
+ ///
+ [SugarColumn(ColumnName = "REQ_CODE")]
+ public string ReqCode { get; set; }
+
+ ///
+ /// 源库别
+ ///
+ [SugarColumn(ColumnName = "SRC_SIC_ID")]
+ public decimal SrcSicId { get; set; }
+
+ ///
+ /// 目的库别
+ ///
+ [SugarColumn(ColumnName = "DST_SIC_ID")]
+ public decimal DstSicId { get; set; }
+
+ ///
+ /// 源储位
+ ///
+ [SugarColumn(ColumnName = "FROM_LOC_ID")]
+ public decimal FromLocId { get; set; }
+
+ ///
+ /// 目的储位
+ ///
+ [SugarColumn(ColumnName = "TO_LOC_ID")]
+ public decimal ToLocId { get; set; }
+
+ ///
+ /// 栈板码
+ ///
+ [SugarColumn(ColumnName = "PALLET")]
+ public string Pallet { get; set; }
+
+ ///
+ /// 外箱码
+ ///
+ [SugarColumn(ColumnName = "CARTON")]
+ public string Carton { get; set; }
+
+ ///
+ /// 第一层内箱码
+ ///
+ [SugarColumn(ColumnName = "BOX_L1")]
+ public string BoxL1 { get; set; }
+
+ ///
+ /// 第二层内箱码
+ ///
+ [SugarColumn(ColumnName = "BOX_L2")]
+ public string BoxL2 { get; set; }
+
+ ///
+ /// 第三层内箱码
+ ///
+ [SugarColumn(ColumnName = "BOX_L3")]
+ public string BoxL3 { get; set; }
+
+ ///
+ /// 第四层内箱码
+ ///
+ [SugarColumn(ColumnName = "BOX_L4")]
+ public string BoxL4 { get; set; }
+
+ ///
+ /// BIN值
+ ///
+ [SugarColumn(ColumnName = "BIN")]
+ public string Bin { get; set; }
+
+ ///
+ /// 状态
+ ///
+ [SugarColumn(ColumnName = "STATUS")]
+ public string Status { get; set; }
+
+ ///
+ /// 备注
+ ///
+ [SugarColumn(ColumnName = "REMARK")]
+ public string Remark { get; set; }
+
+ ///
+ /// 捡料标记
+ ///
+ [SugarColumn(ColumnName = "PICKED_FLAG")]
+ public string PickedFlag { get; set; }
+
+ ///
+ /// 捡料时间
+ ///
+ [SugarColumn(ColumnName = "PICKED_DATE")]
+ public System.DateTime PickedDate { get; set; }
+
+ ///
+ /// 捡料人
+ ///
+ [SugarColumn(ColumnName = "PICKED_USER")]
+ public string PickedUser { get; set; }
+
+ ///
+ /// 捡料备注信息
+ ///
+ [SugarColumn(ColumnName = "PICKED_REMARK")]
+ public string PickedRemark { get; set; }
+
+ ///
+ /// 交接确认标记
+ ///
+ [SugarColumn(ColumnName = "TSF_CFM_FLAG")]
+ public string TsfCfmFlag { get; set; }
+
+ ///
+ /// 交接确认时间
+ ///
+ [SugarColumn(ColumnName = "TSF_CFM_DATE")]
+ public System.DateTime TsfCfmDate { get; set; }
+
+ ///
+ /// 交接确认人
+ ///
+ [SugarColumn(ColumnName = "TSF_CFM_USER")]
+ public string TsfCfmUser { get; set; }
+
+ ///
+ /// 交接确认数量
+ ///
+ [SugarColumn(ColumnName = "TSF_CFM_QTY")]
+ public decimal TsfCfmQty { get; set; }
+
+ ///
+ /// 交接确认备注信息
+ ///
+ [SugarColumn(ColumnName = "TSF_CFM_REMARK")]
+ public string TsfCfmRemark { get; set; }
+
+ ///
+ /// 出货扫描标记
+ ///
+ [SugarColumn(ColumnName = "SHIP_MKR_FLAG")]
+ public string ShipMkrFlag { get; set; }
+
+ ///
+ /// 出货扫描时间
+ ///
+ [SugarColumn(ColumnName = "SHIP_MKR_DATE")]
+ public System.DateTime ShipMkrDate { get; set; }
+
+ ///
+ /// 出货扫描人员
+ ///
+ [SugarColumn(ColumnName = "SHIP_MKR_USER")]
+ public string ShipMkrUser { get; set; }
+
+ ///
+ /// 出货扫描数量
+ ///
+ [SugarColumn(ColumnName = "SHIP_MKR_QTY")]
+ public decimal ShipMkrQty { get; set; }
+
+ ///
+ /// 出货扫描备注信息
+ ///
+ [SugarColumn(ColumnName = "SHIP_MKR")]
+ public string ShipMkr { get; set; }
+
+ ///
+ /// OOBA标记
+ ///
+ [SugarColumn(ColumnName = "OOBA_FLAG")]
+ public string OobaFlag { get; set; }
+
+ ///
+ /// OOBA时间
+ ///
+ [SugarColumn(ColumnName = "OOBA_DATE")]
+ public System.DateTime OobaDate { get; set; }
+
+ ///
+ /// OOBA人员
+ ///
+ [SugarColumn(ColumnName = "OOBA_USER")]
+ public string OobaUser { get; set; }
+
+ ///
+ /// OOBA数量
+ ///
+ [SugarColumn(ColumnName = "OOBA_QTY")]
+ public decimal OobaQty { get; set; }
+
+ ///
+ /// OOBA备注信息
+ ///
+ [SugarColumn(ColumnName = "OOBA_REMARK")]
+ public string OobaRemark { get; set; }
+
+ ///
+ /// 关闭人员
+ ///
+ [SugarColumn(ColumnName = "CLOSED_BY")]
+ public string ClosedBy { get; set; }
+
+ ///
+ /// 关闭时间
+ ///
+ [SugarColumn(ColumnName = "CLOSED_DATE")]
+ public System.DateTime ClosedDate { get; set; }
+
+ ///
+ /// 扩展1
+ ///
+ [SugarColumn(ColumnName = "ATT1")]
+ public string Att1 { get; set; }
+
+ ///
+ /// 扩展2
+ ///
+ [SugarColumn(ColumnName = "ATT2")]
+ public string Att2 { get; set; }
+
+ ///
+ /// 扩展3
+ ///
+ [SugarColumn(ColumnName = "ATT3")]
+ public string Att3 { get; set; }
+
+ ///
+ /// 扩展4
+ ///
+ [SugarColumn(ColumnName = "ATT4")]
+ public string Att4 { get; set; }
+
+ ///
+ /// 扩展5
+ ///
+ [SugarColumn(ColumnName = "ATT5")]
+ public string Att5 { get; set; }
+
+ ///
+ /// 备用数值1
+ ///
+ [SugarColumn(ColumnName = "NUM1")]
+ public decimal Num1 { get; set; }
+
+ ///
+ /// 备用数值2
+ ///
+ [SugarColumn(ColumnName = "NUM2")]
+ public decimal Num2 { get; set; }
+
+ ///
+ /// 备用数值3
+ ///
+ [SugarColumn(ColumnName = "NUM3")]
+ public decimal Num3 { get; set; }
+
+ ///
+ /// 备用数值4
+ ///
+ [SugarColumn(ColumnName = "NUM4")]
+ public decimal Num4 { get; set; }
+
+ ///
+ /// 备用数值5
+ ///
+ [SugarColumn(ColumnName = "NUM5")]
+ public decimal Num5 { get; set; }
+
+ ///
+ /// 备用日期1
+ ///
+ [SugarColumn(ColumnName = "DT1")]
+ public System.DateTime Dt1 { get; set; }
+
+ ///
+ /// 备用日期2
+ ///
+ [SugarColumn(ColumnName = "DT2")]
+ public System.DateTime Dt2 { get; set; }
+
+ ///
+ /// 备用日期3
+ ///
+ [SugarColumn(ColumnName = "DT3")]
+ public System.DateTime Dt3 { get; set; }
+
+ ///
+ /// 备用日期4
+ ///
+ [SugarColumn(ColumnName = "DT4")]
+ public System.DateTime Dt4 { get; set; }
+
+ ///
+ /// 备用日期5
+ ///
+ [SugarColumn(ColumnName = "DT5")]
+ public System.DateTime Dt5 { get; set; }
+ }
+}
diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom025.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom025.cs
new file mode 100644
index 000000000..c2e495111
--- /dev/null
+++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom025.cs
@@ -0,0 +1,33 @@
+using IWMS.Bill.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SqlSugar;
+namespace OrmTest
+{
+ public class UCustom025
+ {
+ public static void Init()
+ {
+ var db = NewUnitTest.Db;
+ var cnt = db.Queryable((m, d) => m.Id == d.MstId)
+ .Where((m, d) => m.Deleted == "N" && m.Code == "")
+ .Select((m, d) => new
+ {
+ TT_REQ_QTY = d.Qty,
+ KIT_QTY = SqlFunc.IsNull(SqlFunc.Subqueryable().InnerJoin((ds, sk) => ds.StkId == sk.Id)
+ .Where((ds, sk) => ds.DtlId == d.Id && ds.Deleted == "N" && sk.Deleted == "N")
+ .Select((ds, sk) => SqlFunc.AggregateSum(sk.ActualQty)), 0),
+ })
+ .MergeTable()
+ .Where(t => t.TT_REQ_QTY > t.KIT_QTY)
+ .ToSql().Key;
+ if (!cnt.Contains("SUM([sk].[ACTUAL_QTY])"))
+ {
+ throw new Exception("unit error");
+ }
+ }
+ }
+}