Commit 71e4d546 by 陶然

优化

parent 055b9906
......@@ -83,7 +83,7 @@ namespace Kivii.Finances.Entities
[ApiMember(Description = "付方税号,收票方税号")]
[IgnoreUpdate]
[StringLength(100)]
[StringLength(100), Required]
public string PayerTaxNumber { get; set; }
[ApiMember(Description = "公司地址")]
......@@ -237,19 +237,7 @@ namespace Kivii.Finances.Entities
/// <summary>
/// 关联,与收款一一对应用
/// </summary>
Related,
/// <summary>
/// 现金,财务用
/// </summary>
Cash,
/// <summary>
/// Pos机,财务用
/// </summary>
Pos,
AliPay,
WeChat
Related
}
public enum InvoiceApplyStatus
......
......@@ -23,8 +23,7 @@ namespace Kivii.Finances.Entities
public Guid OffsetKvid { get; set; }
[ApiMember(Description = "业务Kvid,根据结算精细度,Settlement中的BizKvid可能会和SettlementDetail中的BizKvid一致," +
"查询时需要同时查询两表数据")]
[ApiMember(Description = "业务Kvid,根据结算精细度,Settlement中的BizKvid可能会和SettlementDetail中的BizKvid一致,查询时需要同时查询两表数据")]
[InternalSetter]
[DefaultEmptyGuid]
public Guid BizKvid { get; set; }
......
......@@ -84,10 +84,11 @@ namespace Kivii.Finances
payment.ThrowIfNull("要更新的付款记录不能为空!");
(payment.OffsetKvid != Guid.Empty).ThrowIfTrue("此到账已作废 无法重新计算开票金额");
(payment.RootKvid != payment.Kvid).ThrowIfTrue("不支持的类型");
(payment.Type != PaymentType.Bank).ThrowIfTrue("不支持的类型");
bool useTransaction = conn == null;//是否启用事务,如果外部未传入conn,启用内部事务
if (conn == null) conn = KiviiContext.GetOpenedDbConnection<Payment>();
var amountInvoiced = conn.Scalar<Payment, decimal>(o => Sql.Sum(o.AmountInvoice), p => p.ParentKvid == payment.Kvid && p.OffsetKvid == Guid.Empty);
var amountInvoiced = conn.Scalar<Payment, decimal>(o => Sql.Sum(o.AmountInvoice), p => p.Type == PaymentType.Split && p.ParentKvid == payment.Kvid && p.OffsetKvid == Guid.Empty);
IDbTransaction trans = null;//事务,如果外部来了Connection,不生成事务
if (useTransaction) trans = conn.OpenTransaction();
try
......@@ -120,8 +121,9 @@ namespace Kivii.Finances
(payment.Amount <= 0).ThrowIfTrue("付款记录发生金额不能少于0!");
(payment.AmountInvoice == 0).ThrowIfFalse("付款记录开票金额不为0!");
(payment.AmountUsed == 0).ThrowIfFalse("付款记录使用金额不为0!");
(payment.AmountSplited == 0).ThrowIfFalse("付款记录拆分不为0!");
(payment.Type != PaymentType.Cash && payment.Type != PaymentType.Pos && payment.Type != PaymentType.Bank).ThrowIfTrue("仅支持接受现金刷卡或者银行流水记录");
if (payment.Type == PaymentType.Bank) (payment.AmountSplited != 0).ThrowIfTrue("付款记录拆分不为0!");
else (payment.AmountSplited != payment.Amount).ThrowIfTrue("现金刷卡拆分金额错误!");
if (payment.ParentKvid != Guid.Empty) payment.ParentKvid = Guid.Empty;
if (payment.OffsetKvid != Guid.Empty) payment.OffsetKvid = Guid.Empty;
if (payment.Kvid == Guid.Empty) payment.Kvid = Guid.NewGuid();
......@@ -193,7 +195,7 @@ namespace Kivii.Finances
/// <param name="ownerKvid"></param>
/// <param name="ownerName"></param>
/// <returns></returns>
public static Payment BizSplit(this Payment payment, decimal amountSplit, Guid? ownerKvid = null, string ownerName = null)
public static Payment BizSplit(this Payment payment, decimal amountSplit, Guid? ownerKvid = null, string ownerName = null, IDbConnection conn = null)
{
payment.ThrowIfNull($"传入payment参数为空");
if (payment.Type != PaymentType.Bank) throw new Exception("非银行到账不可以认领!");
......@@ -201,7 +203,23 @@ namespace Kivii.Finances
(amountSplit <= 0).ThrowIfTrue("拆分认领金额不能为零或负值。");
if (payment.AmountSplited == payment.Amount) throw new Exception("无剩余收款可认领!");
if (payment.AmountSplited + amountSplit > payment.Amount) throw new Exception("认领金额超出范围!");
decimal amountInvoice = 0;
if (payment.AmountInvoice > 0)//如果要拆分的到账已经开过票 就要计算拆分项的开票金额
{
if (payment.AmountInvoice < payment.Amount)//到账的部分进行了开票 就需要计算拆分项的开票金额
{
if (conn == null) conn = KiviiContext.GetOpenedDbConnection<Payment>();
//查看已经拆分的项目分得的已经开票金额
var existSplits = conn.Select<Payment>(o => o.RootKvid == payment.RootKvid && o.Type == PaymentType.Split && o.OffsetKvid == Guid.Empty);
if (!existSplits.IsNullOrEmpty())
{
//剩余的开票金额
var remainAmountInvoice = payment.AmountInvoice - existSplits.Sum(o => o.AmountInvoice);
if (remainAmountInvoice > 0) amountInvoice = remainAmountInvoice > amountSplit ? amountSplit : remainAmountInvoice;
}
}
else amountInvoice = amountSplit;//否则直接记录拆分项完全开票
}
#region 新增拆分项目
var splitPayment = new Payment();
splitPayment.PopulateWith(payment);//先从父级中拷贝所有参数
......@@ -222,7 +240,7 @@ namespace Kivii.Finances
splitPayment.Amount = amountSplit;
splitPayment.AmountSplited = 0;
splitPayment.AmountUsed = 0;
splitPayment.AmountInvoice = payment.AmountInvoice > amountSplit ? amountSplit : payment.AmountInvoice;
splitPayment.AmountInvoice = amountInvoice;// payment.AmountInvoice > amountSplit ? amountSplit : payment.AmountInvoice;
splitPayment.Summary = string.Empty;
splitPayment.Remark = string.Empty;
splitPayment.OperateTime = payment.OperateTime;
......
......@@ -79,7 +79,10 @@
<Compile Include="Transforms\RestfulAccountDetail.cs" />
<Compile Include="Transforms\RestfulBill.cs" />
<Compile Include="Transforms\RestfulInvoice.Debit.cs" />
<Compile Include="Transforms\RestfulInvoice.Offset.Deficit.cs" />
<Compile Include="Transforms\RestfulInvoiceApply.Apply.cs" />
<Compile Include="Transforms\RestfulInvoiceApply.cs" />
<Compile Include="Transforms\RestfulInvoiceTitle.cs" />
<Compile Include="Transforms\RestfulPay.cs" />
<Compile Include="Transforms\RestfulPayment.Accept.cs" />
<Compile Include="Transforms\RestfulPayment.Account.cs" />
......
using Kivii.Finances.Entities;
using Kivii.Linq;
using Kivii.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kivii.Finances.Transforms
{
[Api(Description = "发票作废")]
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceOffset:RestfulExecution<Invoice>
{
public Guid Kvid { get; set; }
public string Remark { get; set; }
public override object OnExecution(IRequest req, IResponse res)
{
Kvid.ThrowIfEmpty("请传入要冲销的发票Kvid!");
var conn = KiviiContext.GetOpenedDbConnection<Invoice>();
var invoice = conn.SingleById<Invoice>(Kvid);
invoice.ThrowIfNull("未找到对应发票!");
invoice.BizKvid.ThrowIfNotEmpty("发票已关联业务! 请先解除关联!");
invoice.OffsetKvid.ThrowIfNotEmpty("发票已作废!");
var apply = conn.SingleById<InvoiceApply>(invoice.ApplyKvid);
return base.OnExecution(req, res);
}
}
[Api(Description = "作废撤回")]
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceOffsetCancel : RestfulExecution<Invoice>
{
}
[Api(Description = "发票红冲")]
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceDeficit : RestfulExecution<Invoice>
{
}
[Api(Description = "红冲撤回")]
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceDeficitCancel : RestfulExecution<Invoice>
{
}
}
......@@ -189,8 +189,7 @@ namespace Kivii.Finances.Transforms
{
#region apply驳回
//进入开票状态后不可驳回
if (apply.Status >= (int)InvoiceApplyStatus.FinancialExecute) continue;
//if (apply.Status < (int)ApplyStatus.ProcessAdoption) continue;
(apply.Status >= (int)InvoiceApplyStatus.FinancialExecute).ThrowIfTrue("撤销失败,当前申请已进入开票列队或已完成开票!");
apply.Status = (int)InvoiceApplyStatus.ApplyReject;
apply.AddOnlyProperties(o => o.Status);
apply.AmountUsed = 0;
......@@ -351,7 +350,7 @@ namespace Kivii.Finances.Transforms
if (Details.IsNullOrEmpty()) Details = new List<InvoiceApplyDetail>();
if (Detail != null) Details.Add(Detail);
if (Kvids == null || Kvids.Count <= 0) throw new Exception("请先选择申请条目!");
if (Item.OperateType != InvoiceApplyType.Payment && Item.OperateType != InvoiceApplyType.Pos && Item.OperateType != InvoiceApplyType.Cash && Item.OperateType != InvoiceApplyType.AliPay && Item.OperateType != InvoiceApplyType.WeChat) throw new Exception("合并开票只针对收款刷卡现金申请!");
if (Item.OperateType != InvoiceApplyType.Payment) throw new Exception("合并开票只针对收款刷卡现金申请!");
if (Details.Exists(o => o.GoodsFullName.IsNullOrEmpty())) throw new Exception("明细名称存在空值!");
if (Details.Exists(o => o.TaxRate < 0) || Details.Exists(o => o.TaxRate > 1)) throw new Exception("存在明细税率设置范围不在0-1之间!");
......@@ -370,7 +369,7 @@ namespace Kivii.Finances.Transforms
if (applys.Count < 2) throw new Exception("请选择两条以上的申请进行合并!");
//if (applys.Exists(o => o.Type != "VATS")) throw new Exception("普票暂时无法合并开票");
if (applys.Exists(o => o.PayerName != Item.PayerName)) throw new Exception("合并申请抬头不一致!");
if (!applys.Exists(o => Sql.In(o.OperateType, InvoiceApplyType.Payment, InvoiceApplyType.Pos, InvoiceApplyType.Cash, InvoiceApplyType.AliPay, InvoiceApplyType.WeChat))) throw new Exception("合并开票只针对收款刷卡现金申请!");
if (!applys.Exists(o => o.OperateType != InvoiceApplyType.Payment)) throw new Exception("合并开票只针对收款刷卡现金申请!");
if (applys.Exists(o => o.OperateType == InvoiceApplyType.Payment)) Item.OperateType = InvoiceApplyType.Payment;
var groups = applys.GroupBy(o => new { o.PayerName, o.PayerTaxNumber });
if (groups.Count() != 1) throw new Exception("合并申请抬头不一致!");
......
using Kivii.Finances.Entities;
using Kivii.Linq;
using Kivii.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kivii.Finances.Transforms
{
[Api(Description = "开票申请查询")]
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceApplyQueryEx:RestfulExecution<InvoiceApply>
{
#region QueryArgs
public virtual int? Skip { get; set; }
public virtual int? Take { get; set; }
public virtual string OrderBy { get; set; }
public string OrderByDesc { get; set; }
public virtual string Include { get; set; }
public virtual string Fields { get; set; }
public string QueryKeys { get; set; }
public string QueryValues { get; set; }
#endregion
public override object OnExecution(IRequest req, IResponse res)
{
var conn = KiviiContext.GetOpenedDbConnection<InvoiceApply>();
var dynamicParams = Request.GetRequestParams();
var autoQuery = Request.TryResolve<IAutoQueryDb>();
autoQuery.IncludeTotal = true;
var request = new RestfulQuery<InvoiceApply>();
request = request.PopulateWith(this);
var sqlExpress = autoQuery.CreateQuery(Request, conn, request, dynamicParams);
sqlExpress.Where(o => o.OffsetKvid == Guid.Empty && o.OperateType != InvoiceApplyType.Related);
var rtns = autoQuery.Execute(Request, conn, request, sqlExpress);
return rtns;
}
}
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceApplyQuery : RestfulQuery<InvoiceApply>
{ }
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceApplyRead : RestfulRead<InvoiceApply>
{ }
}
using Kivii.Finances.Entities;
using Kivii.Web;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kivii.Finances.Transforms
{
#region CRUDQ
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceTitleCreate : RestfulCreate<InvoiceTitle>
{
public override bool OnPreRestfulCreate(IRequest req, IResponse res, IDbConnection dbConnection, IRestfulCreateResponse<InvoiceTitle> rtns)
{
Item.CompanyName = Item.CompanyName.Replace("(", "(");
Item.CompanyName = Item.CompanyName.Replace(")", ")");
Item.CompanyName = Item.CompanyName.Replace(" ", "");
return base.OnPreRestfulCreate(req, res, dbConnection, rtns);
}
}
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceTitleUpdate : RestfulUpdate<InvoiceTitle>
{
public override bool OnPreRestfulUpdate(IRequest req, IResponse res, IDbConnection dbConnection, IRestfulUpdateResponse<InvoiceTitle> rtns)
{
if (!Item.CompanyName.IsNullOrEmpty())
{
Item.CompanyName = Item.CompanyName.Replace("(", "(");
Item.CompanyName = Item.CompanyName.Replace(")", ")");
Item.CompanyName = Item.CompanyName.Replace(" ", "");
Item.AddOnlyProperties(o => o.CompanyName);
}
return base.OnPreRestfulUpdate(req, res, dbConnection, rtns);
}
}
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceTitleRead : RestfulRead<InvoiceTitle>
{
}
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceTitleQuery : RestfulQuery<InvoiceTitle>
{
}
[RequiresAnyRole(SystemRoles.Everyone)]
public class InvoiceTitleDelete : RestfulDelete<InvoiceTitle>
{
}
#endregion
}
......@@ -64,9 +64,9 @@ namespace Kivii.Finances.Transforms
item.ParentKvid = Guid.Empty;
item.PayerAccountKvid = accountBalance.Kvid;
item.PayerAccountName = accountBalance.Name;
item.PayerAccountOwnerName = accountBalance.OwnerName;
item.PayerAccountSerialNumber = accountBalance.SerialNumber;
item.PayerAccountName = item.PayerAccountName.IsNullOrEmpty() ? accountBalance.Name : item.PayerAccountName;
item.PayerAccountOwnerName = item.PayerAccountOwnerName.IsNullOrEmpty() ? accountBalance.OwnerName : item.PayerAccountOwnerName;
item.PayerAccountSerialNumber = item.PayerAccountSerialNumber.IsNullOrEmpty() ? accountBalance.SerialNumber : item.PayerAccountSerialNumber;
item.PayeeAccountKvid = bankAccount.Kvid;
item.PayeeAccountName = bankAccount.Name;
......@@ -115,7 +115,7 @@ namespace Kivii.Finances.Transforms
if (item.Amount <= 0) continue;
var itemKvid = Guid.NewGuid();
item.AmountInvoice = 0;
item.AmountSplited = 0;
item.AmountSplited = item.Amount;
item.AmountUsed = 0;
item.OwnerKvid = ownerKvid;
......@@ -129,9 +129,9 @@ namespace Kivii.Finances.Transforms
item.ParentKvid = Guid.Empty;
item.PayerAccountKvid = cashAccount.Kvid;
item.PayerAccountName = cashAccount.Name;
item.PayerAccountOwnerName = cashAccount.OwnerName;
item.PayerAccountSerialNumber = cashAccount.SerialNumber;
item.PayerAccountName = item.PayerAccountName.IsNullOrEmpty() ? cashAccount.Name : item.PayerAccountName;
item.PayerAccountOwnerName = item.PayerAccountOwnerName.IsNullOrEmpty() ? cashAccount.OwnerName : item.PayerAccountOwnerName;
item.PayerAccountSerialNumber = item.PayerAccountSerialNumber.IsNullOrEmpty() ? cashAccount.SerialNumber : item.PayerAccountSerialNumber;
item.PayeeAccountKvid = accountBalance.Kvid;
item.PayeeAccountName = accountBalance.Name;
......@@ -155,7 +155,7 @@ namespace Kivii.Finances.Transforms
if (item.Amount <= 0) continue;
var itemKvid = Guid.NewGuid();
item.AmountInvoice = 0;
item.AmountSplited = 0;
item.AmountSplited = item.Amount;
item.AmountUsed = 0;
item.OwnerKvid = ownerKvid;
......@@ -169,9 +169,9 @@ namespace Kivii.Finances.Transforms
item.ParentKvid = Guid.Empty;
item.PayerAccountKvid = posAccount.Kvid;
item.PayerAccountName = posAccount.Name;
item.PayerAccountOwnerName = posAccount.OwnerName;
item.PayerAccountSerialNumber = posAccount.SerialNumber;
item.PayerAccountName = item.PayerAccountName.IsNullOrEmpty() ? posAccount.Name : item.PayerAccountName;
item.PayerAccountOwnerName = item.PayerAccountOwnerName.IsNullOrEmpty() ? posAccount.OwnerName : item.PayerAccountOwnerName;
item.PayerAccountSerialNumber = item.PayerAccountSerialNumber.IsNullOrEmpty() ? posAccount.SerialNumber : item.PayerAccountSerialNumber;
item.PayeeAccountKvid = accountBalance.Kvid;
item.PayeeAccountName = accountBalance.Name;
......
......@@ -30,7 +30,8 @@ namespace Kivii.Finances.Transforms
if (payments.Exists(o => o.Type != PaymentType.Bank && o.Type != PaymentType.Cash && o.Type != PaymentType.Pos && o.Type != PaymentType.AliPay && o.Type != PaymentType.WeChat)) throw new Exception("非可冲销收款类型!");
if (payments.Exists(o => o.BizKvid != Guid.Empty)) throw new Exception("收付款已关联业务!请先解除关联!");
if (payments.Exists(o => o.OffsetKvid != Guid.Empty)) throw new Exception("收付款已冲账");
(payments.Exists(o => o.AmountInvoice > 0 || o.AmountSplited > 0 || o.AmountUsed > 0)).ThrowIfTrue($"不可冲账,存在到账已开票:{payments.Sum(o => o.AmountInvoice)}元,已认领:{payments.Sum(o => o.AmountSplited)}元,已使用:{payments.Sum(o => o.AmountUsed)}元");
if (payments.Exists(o => o.Type != PaymentType.Cash && o.Type != PaymentType.Pos)) (payments.Exists(o => o.AmountInvoice > 0 || o.AmountSplited > 0 || o.AmountUsed > 0)).ThrowIfTrue($"不可冲账,存在到账已开票:{payments.Sum(o => o.AmountInvoice)}元,已认领:{payments.Sum(o => o.AmountSplited)}元,已使用:{payments.Sum(o => o.AmountUsed)}元");
else (payments.Exists(o => o.AmountInvoice > 0 || o.AmountUsed > 0)).ThrowIfTrue($"不可冲账,存在到账已开票:{payments.Sum(o => o.AmountInvoice)}元,已使用:{payments.Sum(o => o.AmountUsed)}元");
//查询当前项的拆分子项List
if (conn.Exists<Payment>(o => Sql.In(o.ParentKvid, payments.ConvertAll(p => p.Kvid)) && o.OffsetKvid == Guid.Empty)) throw new Exception("不可冲账,此到账存在未冲账子项!");
if (conn.Exists<InvoiceApply>(o => Sql.In(o.BizKvid, payments.ConvertAll(p => p.Kvid)) && o.OffsetKvid == Guid.Empty)) throw new Exception("申请开票中,不可冲账!");
......
......@@ -74,7 +74,7 @@ namespace Kivii.Finances.Transforms
if (payment.AmountSplited + Amount > payment.Amount) throw new Exception("认领金额超出范围!");
bank = payment;
split = bank.BizSplit(Amount, ownerKvid, ownerName);
split = bank.BizSplit(Amount, ownerKvid, ownerName, conn);
#region 记录日志
log = new EntityLog<Payment>();
......@@ -201,7 +201,7 @@ namespace Kivii.Finances.Transforms
{
var amount = payment.Amount - payment.AmountSplited;
if (amount <= 0) continue;
var splitPayment = payment.BizSplit(amount, ownerKvid, ownerName);
var splitPayment = payment.BizSplit(amount, ownerKvid, ownerName, conn);
splits.Add(splitPayment);
banks.Add(payment);
......
......@@ -15,7 +15,7 @@ namespace Kivii.Finances.Transforms
}
[Api(Description = "到账查询")]
[Api(Description = "到账查询Ex")]
[RequiresAnyRole(SystemRoles.Everyone)]
public class PaymentQueryEx : RestfulExecution<Payment>
{
......
......@@ -131,11 +131,30 @@ namespace Kivii.Finances.Transforms
{
public Guid Kvid { get; set; }
public bool IncludeDetail { get; set; }
public override object OnExecutionGeneric<G>(IRequest req, IResponse res)
{
var conn = KiviiContext.GetOpenedDbConnection<EntitySettlement<G>>();
var rtns = new RestfulReadResponse<EntitySettlement<G>>();
rtns.Result = conn.SingleById<EntitySettlement<G>>(Kvid);
rtns.Result = new EntitySettlement<G>();
if (typeof(G) != typeof(Settlement)) rtns.Result = conn.SingleById<EntitySettlement<G>>(Kvid);
else
{
var settlement = conn.SingleById<Settlement>(Kvid);
if (settlement != null) rtns.Result.PopulateWith(settlement);
}
if (IncludeDetail)
{
var details = conn.Select<EntitySettlementDetail<G>>(o => o.SettlementKvid == Kvid && o.OffsetKvid == Guid.Empty);
rtns.Result.Details = new List<SettlementDetail>();
foreach (var item in details)
{
var detail = new SettlementDetail();
detail.PopulateWith(item);
rtns.Result.Details.Add(detail);
}
}
return rtns;
}
}
......@@ -144,6 +163,63 @@ namespace Kivii.Finances.Transforms
[RequiresAnyRole(SystemRoles.Everyone)]
public class SettlementQuery : RestfulQuery<Settlement>
{
}
[Api(Description = "结算查询Ex")]
[RequiresAnyRole(SystemRoles.Everyone)]
public class SettlementQueryEx : RestfulExecution<Settlement>
{
#region QueryArgs
public virtual int? Skip { get; set; }
public virtual int? Take { get; set; }
public virtual string OrderBy { get; set; }
public string OrderByDesc { get; set; }
public virtual string Include { get; set; }
public virtual string Fields { get; set; }
public string QueryKeys { get; set; }
public string QueryValues { get; set; }
#endregion
public bool? IsPayed { get; set; }//是否已经收款
public bool? IsBilled { get; set; }//是否已经制作过账单
public override object OnExecution(IRequest req, IResponse res)
{
var conn = KiviiContext.GetOpenedDbConnection<Settlement>();
var dynamicParams = Request.GetRequestParams();
var autoQuery = Request.TryResolve<IAutoQueryDb>();
autoQuery.IncludeTotal = true;
var request = new RestfulQuery<Settlement>();
request = request.PopulateWith(this);
var sqlExpress = autoQuery.CreateQuery(Request, conn, request, dynamicParams);
if (IsPayed != null)
{
if (IsPayed.Value) sqlExpress.And(o => o.PayKvid != Guid.Empty);
else sqlExpress.And(o => o.PayKvid == Guid.Empty);
}
if (IsBilled != null)
{
var queryBillDetails = conn.From<BillDetail>();
queryBillDetails.Where(o => o.OffsetKvid == Guid.Empty);
queryBillDetails.Select(o => o.BizKvid);
if (IsBilled.Value) sqlExpress.And(o => Sql.In(o.Kvid, queryBillDetails));
else sqlExpress.And(o => !Sql.In(o.Kvid, queryBillDetails));
}
var rtns = autoQuery.Execute(Request, conn, request, sqlExpress);
return rtns;
}
}
[Api(Description = "结算删除")]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment