|
|
|
@ -18,6 +18,7 @@ using DS.WMS.Core.Op.View;
|
|
|
|
|
using DS.WMS.Core.Sys.Entity;
|
|
|
|
|
using DS.WMS.Core.Sys.Interface;
|
|
|
|
|
using DS.WMS.Core.Sys.Method;
|
|
|
|
|
using LanguageExt.Common;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using SqlSugar;
|
|
|
|
@ -87,15 +88,12 @@ namespace DS.WMS.Core.Check.Method
|
|
|
|
|
.ToQueryPage(request.PageCondition);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 客户对账列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<CheckBillSumRes>> GetCheckBillList(PageRequest request)
|
|
|
|
|
public async Task<DataResult<CheckBillListRes>> GetCheckBillList(PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var users = db.Queryable<SysUser>().Select(x => new { x.Id, x.UserName }).ToList();
|
|
|
|
@ -116,10 +114,10 @@ namespace DS.WMS.Core.Check.Method
|
|
|
|
|
queryData = queryData.Where(x => checkIds.Contains(x.Id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var data = queryData.Mapper(it =>
|
|
|
|
|
var result = queryData.Mapper(it =>
|
|
|
|
|
{
|
|
|
|
|
var checkBillDetails = tenantDb.Queryable<VW_CheckBill_Business>().Where(x => x.CheckId == it.Id).ToList();
|
|
|
|
|
it.CreateByName = users.Find(x => x.Id == it.CreateBy).UserName;
|
|
|
|
|
//it.CreateByName = users.Find(x => x.Id == it.CreateBy).UserName;
|
|
|
|
|
it.RMBDR = checkBillDetails.Sum(x => x.RMBDR);
|
|
|
|
|
it.RMBCR = checkBillDetails.Sum(x => x.RMBCR);
|
|
|
|
|
it.USDDR = checkBillDetails.Sum(x => x.USDDR);
|
|
|
|
@ -128,10 +126,52 @@ namespace DS.WMS.Core.Check.Method
|
|
|
|
|
it.BALRMBCR = checkBillDetails.Sum(x => x.BALRMBCR);
|
|
|
|
|
it.BALUSDDR = checkBillDetails.Sum(x => x.BALUSDDR);
|
|
|
|
|
it.BALUSDCR = checkBillDetails.Sum(x => x.BALUSDCR);
|
|
|
|
|
it.OtherDR = checkBillDetails.Sum(x => x.OtherDR);
|
|
|
|
|
it.OtherCR = checkBillDetails.Sum(x => x.OtherCR);
|
|
|
|
|
it.BALOtherDR = checkBillDetails.Sum(x => x.BALOtherDR);
|
|
|
|
|
it.TTLDR = checkBillDetails.Sum(x => x.TTLDR);
|
|
|
|
|
it.TTLCR = checkBillDetails.Sum(x => x.TTLCR);
|
|
|
|
|
it.BALTTLDR = checkBillDetails.Sum(x => x.BALTTLDR);
|
|
|
|
|
it.BALTTLCR = checkBillDetails.Sum(x => x.BALTTLCR);
|
|
|
|
|
it.OrderInvoiceRMBDR = checkBillDetails.Sum(x => x.OrderInvoiceRMBDR);
|
|
|
|
|
it.OrderInvoiceUSDDR = checkBillDetails.Sum(x => x.OrderInvoiceUSDDR);
|
|
|
|
|
it.OrderAmountRMBCR = checkBillDetails.Sum(x => x.OrderAmountRMBCR);
|
|
|
|
|
it.OrderAmountUSDCR = checkBillDetails.Sum(x => x.OrderAmountUSDCR);
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
.ToQueryPage(request.PageCondition);
|
|
|
|
|
return data;
|
|
|
|
|
);
|
|
|
|
|
var list = result.ToList();
|
|
|
|
|
var data = await result.ToQueryPageAsync(request.PageCondition);
|
|
|
|
|
var totalData = new CheckBillTotalRes()
|
|
|
|
|
{
|
|
|
|
|
RMBDR = list.Sum(x => x.RMBDR),
|
|
|
|
|
RMBCR = list.Sum(x => x.RMBCR),
|
|
|
|
|
USDDR = list.Sum(x => x.USDDR),
|
|
|
|
|
USDCR = list.Sum(x => x.USDCR),
|
|
|
|
|
BALRMBDR = list.Sum(x => x.BALRMBDR),
|
|
|
|
|
BALRMBCR = list.Sum(x => x.BALRMBCR),
|
|
|
|
|
BALUSDDR = list.Sum(x => x.BALUSDDR),
|
|
|
|
|
BALUSDCR = list.Sum(x => x.BALUSDCR),
|
|
|
|
|
OtherDR = list.Sum(x => x.OtherDR),
|
|
|
|
|
OtherCR = list.Sum(x => x.OtherCR),
|
|
|
|
|
BALOtherDR = list.Sum(x => x.BALOtherDR),
|
|
|
|
|
TTLDR = list.Sum(x => x.TTLDR),
|
|
|
|
|
TTLCR = list.Sum(x => x.TTLCR),
|
|
|
|
|
BALTTLDR = list.Sum(x => x.BALTTLDR),
|
|
|
|
|
BALTTLCR = list.Sum(x => x.BALTTLCR),
|
|
|
|
|
OrderInvoiceRMBDR = list.Sum(x => x.OrderInvoiceRMBDR),
|
|
|
|
|
OrderInvoiceUSDDR = list.Sum(x => x.OrderInvoiceUSDDR),
|
|
|
|
|
OrderAmountRMBCR = list.Sum(x => x.OrderAmountRMBCR),
|
|
|
|
|
OrderAmountUSDCR = list.Sum(x => x.OrderAmountUSDCR),
|
|
|
|
|
};
|
|
|
|
|
var res = new CheckBillListRes()
|
|
|
|
|
{
|
|
|
|
|
List = data.Data,
|
|
|
|
|
TotalCount = list.Count(),
|
|
|
|
|
DataTotal = totalData
|
|
|
|
|
};
|
|
|
|
|
return await Task.FromResult(DataResult<CheckBillListRes>.Success(res, MultiLanguageConst.DataQuerySuccess));
|
|
|
|
|
//.ToQueryPage(request.PageCondition);
|
|
|
|
|
//return data;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 详情
|
|
|
|
@ -153,16 +193,45 @@ namespace DS.WMS.Core.Check.Method
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<List<VW_CheckBill_Business>> GetCheckBillBusinessList(PageRequest request)
|
|
|
|
|
public async Task<DataResult<CheckBillBusinessRes>> GetCheckBillBusinessList(PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
//序列化查询条件
|
|
|
|
|
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
|
|
|
|
|
var data = tenantDb.Queryable<VW_CheckBill_Business>()
|
|
|
|
|
.Where(whereList)
|
|
|
|
|
.ToQueryPage(request.PageCondition);
|
|
|
|
|
return data;
|
|
|
|
|
var result = tenantDb.Queryable<VW_CheckBill_Business>()
|
|
|
|
|
.Where(whereList);
|
|
|
|
|
var list = result.ToList();
|
|
|
|
|
var data = await result.ToQueryPageAsync(request.PageCondition);
|
|
|
|
|
var totalData = new CheckBillTotalRes()
|
|
|
|
|
{
|
|
|
|
|
RMBDR = list.Sum(x => x.RMBDR),
|
|
|
|
|
RMBCR = list.Sum(x => x.RMBCR),
|
|
|
|
|
USDDR = list.Sum(x => x.USDDR),
|
|
|
|
|
USDCR = list.Sum(x => x.USDCR),
|
|
|
|
|
BALRMBDR = list.Sum(x => x.BALRMBDR),
|
|
|
|
|
BALRMBCR = list.Sum(x => x.BALRMBCR),
|
|
|
|
|
BALUSDDR = list.Sum(x => x.BALUSDDR),
|
|
|
|
|
BALUSDCR = list.Sum(x => x.BALUSDCR),
|
|
|
|
|
OtherDR = list.Sum(x => x.OtherDR),
|
|
|
|
|
OtherCR = list.Sum(x => x.OtherCR),
|
|
|
|
|
BALOtherDR = list.Sum(x => x.BALOtherDR),
|
|
|
|
|
TTLDR = list.Sum(x => x.TTLDR),
|
|
|
|
|
TTLCR = list.Sum(x => x.TTLCR),
|
|
|
|
|
BALTTLDR = list.Sum(x => x.BALTTLDR),
|
|
|
|
|
BALTTLCR = list.Sum(x => x.BALTTLCR),
|
|
|
|
|
OrderInvoiceRMBDR = list.Sum(x => x.OrderInvoiceRMBDR),
|
|
|
|
|
OrderInvoiceUSDDR = list.Sum(x => x.OrderInvoiceUSDDR),
|
|
|
|
|
OrderAmountRMBCR = list.Sum(x => x.OrderAmountRMBCR),
|
|
|
|
|
OrderAmountUSDCR = list.Sum(x => x.OrderAmountUSDCR),
|
|
|
|
|
};
|
|
|
|
|
var res = new CheckBillBusinessRes()
|
|
|
|
|
{
|
|
|
|
|
List = data.Data,
|
|
|
|
|
TotalCount = list.Count(),
|
|
|
|
|
DataTotal = totalData
|
|
|
|
|
};
|
|
|
|
|
return await Task.FromResult(DataResult<CheckBillBusinessRes>.Success(res, MultiLanguageConst.DataQuerySuccess));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|