客户对账合计数据

usertest
cjy 4 months ago
parent 7bba5e9683
commit e7a8c80470

@ -57,9 +57,9 @@ public class CheckBillController : ApiController
/// <returns></returns>
[HttpPost]
[Route("GetCheckBillList")]
public DataResult<List<CheckBillSumRes>> GetCheckBillList([FromBody] PageRequest request)
public async Task<DataResult<CheckBillListRes>> GetCheckBillList([FromBody] PageRequest request)
{
var res = _invokeService.GetCheckBillList(request);
var res = await _invokeService.GetCheckBillList(request);
return res;
}
/// <summary>
@ -93,9 +93,9 @@ public class CheckBillController : ApiController
/// <returns></returns>
[HttpPost]
[Route("GetCheckBillBusinessList")]
public DataResult<List<VW_CheckBill_Business>> GetCheckBillBusinessList([FromBody] PageRequest request)
public async Task<DataResult<CheckBillBusinessRes>> GetCheckBillBusinessList([FromBody] PageRequest request)
{
var res = _invokeService.GetCheckBillBusinessList(request);
var res = await _invokeService.GetCheckBillBusinessList(request);
return res;
}

@ -0,0 +1,30 @@
using DS.WMS.Core.Check.View;
using DS.WMS.Core.Op.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Check.Dtos
{
/// <summary>
/// 客户对账业务明细
/// </summary>
public class CheckBillBusinessRes
{
/// <summary>
/// 列表数据
/// </summary>
public List<VW_CheckBill_Business> List { get; set; }
/// <summary>
/// 合计数
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// 合计信息
/// </summary>
public CheckBillTotalRes DataTotal { get; set; }
}
}

@ -1,4 +1,5 @@
using SqlSugar;
using DS.WMS.Core.Op.Dtos;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@ -50,37 +51,88 @@ namespace DS.WMS.Core.Check.Dtos
/// <summary>
/// RMB应收
/// </summary>
public decimal? RMBDR { get; set; } = 0;
public decimal RMBDR { get; set; } = 0;
/// <summary>
/// RMB应付
/// </summary>
public decimal? RMBCR { get; set; } = 0;
public decimal RMBCR { get; set; } = 0;
/// <summary>
/// USD应收
/// </summary>
public decimal? USDDR { get; set; } = 0;
public decimal USDDR { get; set; } = 0;
/// <summary>
/// USD应付
/// </summary>
public decimal? USDCR { get; set; } = 0;
public decimal USDCR { get; set; } = 0;
/// <summary>
/// RMB未收
/// </summary>
public decimal? BALRMBDR { get; set; } = 0;
public decimal BALRMBDR { get; set; } = 0;
/// <summary>
/// RMB未付
/// </summary>
public decimal? BALRMBCR { get; set; } = 0;
public decimal BALRMBCR { get; set; } = 0;
/// <summary>
/// USD未收
/// </summary>
public decimal? BALUSDDR { get; set; } = 0;
public decimal BALUSDDR { get; set; } = 0;
/// <summary>
/// USD未付
/// </summary>
public decimal? BALUSDCR { get; set; } = 0;
public decimal BALUSDCR { get; set; } = 0;
/// <summary>
/// 其他应收
/// </summary>
public decimal OtherDR { get; set; }
/// <summary>
/// 其他应付
/// </summary>
public decimal OtherCR { get; set; }
/// <summary>
/// 其他未收
/// </summary>
public decimal BALOtherDR { get; set; }
/// <summary>
/// 其他未付
/// </summary>
public decimal BALOtherCR { get; set; }
/// <summary>
/// TTL应收
/// </summary>
public decimal TTLDR { get; set; }
/// <summary>
/// TTL应付
/// </summary>
public decimal TTLCR { get; set; }
/// <summary>
/// TTL未收
/// </summary>
public decimal BALTTLDR { get; set; }
/// <summary>
/// TTL未付
/// </summary>
public decimal BALTTLCR { get; set; }
/// <summary>
/// 开票RMB应收
/// </summary>
public decimal OrderInvoiceRMBDR { get; set; }
/// <summary>
/// 开票USD应收
/// </summary>
public decimal OrderInvoiceUSDDR { get; set; }
/// <summary>
/// 订单金额RMB应付
/// </summary>
public decimal OrderAmountRMBCR { get; set; }
/// <summary>
/// 订单金额USD应付
/// </summary>
public decimal OrderAmountUSDCR { get; set; }
/// <summary>
/// 对账时间
/// </summary>
@ -96,10 +148,31 @@ namespace DS.WMS.Core.Check.Dtos
/// 对账人
/// </summary>
public string CreateByName { get; set; }
public string CreateUserName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
}
/// <summary>
/// 客户对账列表返回
/// </summary>
public class CheckBillListRes
{
/// <summary>
/// 列表数据
/// </summary>
public List<CheckBillSumRes> List { get; set; }
/// <summary>
/// 合计数
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// 合计信息
/// </summary>
public CheckBillTotalRes DataTotal { get; set; }
}
}

@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Check.Dtos
{
/// <summary>
/// 客户对账列表合计
/// </summary>
public class CheckBillTotalRes
{
/// <summary>
/// RMB应收
/// </summary>
public decimal RMBDR { get; set; }
/// <summary>
/// RMB应付
/// </summary>
public decimal RMBCR { get; set; }
/// <summary>
/// USD应收
/// </summary>
public decimal USDDR { get; set; }
/// <summary>
/// USD应付
/// </summary>
public decimal USDCR { get; set; }
/// <summary>
/// RMB未收
/// </summary>
public decimal BALRMBDR { get; set; }
/// <summary>
/// RMB未付
/// </summary>
public decimal BALRMBCR { get; set; }
/// <summary>
/// USD未收
/// </summary>
public decimal BALUSDDR { get; set; }
/// <summary>
/// USD未付
/// </summary>
public decimal BALUSDCR { get; set; }
/// <summary>
/// 其他应收
/// </summary>
public decimal OtherDR { get; set; }
/// <summary>
/// 其他应付
/// </summary>
public decimal OtherCR { get; set; }
/// <summary>
/// 其他未收
/// </summary>
public decimal BALOtherDR { get; set; }
/// <summary>
/// 其他未付
/// </summary>
public decimal BALOtherCR { get; set; }
/// <summary>
/// TTL应收
/// </summary>
public decimal TTLDR { get; set; }
/// <summary>
/// TTL应付
/// </summary>
public decimal TTLCR { get; set; }
/// <summary>
/// TTL未收
/// </summary>
public decimal BALTTLDR { get; set; }
/// <summary>
/// TTL未付
/// </summary>
public decimal BALTTLCR { get; set; }
/// <summary>
/// 开票RMB应收
/// </summary>
public decimal OrderInvoiceRMBDR { get; set; }
/// <summary>
/// 开票USD应收
/// </summary>
public decimal OrderInvoiceUSDDR { get; set; }
/// <summary>
/// 订单金额RMB应付
/// </summary>
public decimal OrderAmountRMBCR { get; set; }
/// <summary>
/// 订单金额USD应付
/// </summary>
public decimal OrderAmountUSDCR { get; set; }
}
}

@ -17,7 +17,7 @@ namespace DS.WMS.Core.Check.Interface
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public DataResult<List<CheckBillSumRes>> GetCheckBillList(PageRequest request);
public Task<DataResult<CheckBillListRes>> GetCheckBillList(PageRequest request);
/// <summary>
@ -31,7 +31,7 @@ namespace DS.WMS.Core.Check.Interface
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public DataResult<List<VW_CheckBill_Business>> GetCheckBillBusinessList(PageRequest request);
public Task<DataResult<CheckBillBusinessRes>> GetCheckBillBusinessList(PageRequest request);
/// <summary>
/// 客户对账明细对应费用列表
/// </summary>

@ -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;
@ -86,16 +87,13 @@ namespace DS.WMS.Core.Check.Method
.Where(whereList).Select<CheckBillFeeRecordRes>()
.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>

Loading…
Cancel
Save