Commit f84a7e29 authored by 吴春's avatar 吴春

提交代码

parent 8f82e169
...@@ -78,6 +78,8 @@ namespace Mall.Model.Entity.User ...@@ -78,6 +78,8 @@ namespace Mall.Model.Entity.User
get; get;
set; set;
} }
/// <summary> /// <summary>
/// 退款费用 /// 退款费用
/// </summary> /// </summary>
...@@ -98,6 +100,16 @@ namespace Mall.Model.Entity.User ...@@ -98,6 +100,16 @@ namespace Mall.Model.Entity.User
/// 运杂费用id /// 运杂费用id
/// </summary> /// </summary>
public int? ExpensesCostTypeId { get; set; } public int? ExpensesCostTypeId { get; set; }
/// <summary>
/// 保险成本费用
/// </summary>
public int? InsuranceCostTypeId
{
get;
set;
}
/// <summary> /// <summary>
/// RemitCostTypeId /// RemitCostTypeId
/// </summary> /// </summary>
......
...@@ -113,5 +113,9 @@ namespace Mall.Model.Entity.Finance ...@@ -113,5 +113,9 @@ namespace Mall.Model.Entity.Finance
set; set;
} }
/// <summary>
/// 保险成本价格
/// </summary>
public decimal? InsuranceCostMoney { get; set; }
} }
} }
...@@ -216,6 +216,11 @@ namespace Mall.Model.Entity.Product ...@@ -216,6 +216,11 @@ namespace Mall.Model.Entity.Product
/// </summary> /// </summary>
public int FreightFinanceId { get; set; } public int FreightFinanceId { get; set; }
/// <summary>
/// 保险成本单据id
/// </summary>
public int InsuranceFinanceId { get; set; }
/// <summary> /// <summary>
/// 积分赠送 /// 积分赠送
/// </summary> /// </summary>
......
...@@ -159,7 +159,7 @@ namespace Mall.Model.Extend.Product ...@@ -159,7 +159,7 @@ namespace Mall.Model.Extend.Product
/// <summary> /// <summary>
/// 1-商品,2-运费 /// 1-商品,2-运费,3-保险
/// </summary> /// </summary>
public int FinanceType { get; set; } public int FinanceType { get; set; }
#endregion #endregion
...@@ -192,10 +192,16 @@ namespace Mall.Model.Extend.Product ...@@ -192,10 +192,16 @@ namespace Mall.Model.Extend.Product
/// <summary> /// <summary>
/// 是否查询所有,0-全部,1-成本,2-运费 /// 是否查询所有,0-全部,1-成本,2-运费,3-保险成本
/// </summary> /// </summary>
public int IsSelectAll { get; set; } public int IsSelectAll { get; set; }
/// <summary>
/// 订单分类 0正常订单 1司导订单
/// </summary>
public int OrderClassify { get; set; }
/// <summary> /// <summary>
/// 规格key(出库的规格),没有修改为 /// 规格key(出库的规格),没有修改为
/// </summary> /// </summary>
......
...@@ -196,6 +196,10 @@ where {where} order by o.CreateDate desc"; ...@@ -196,6 +196,10 @@ where {where} order by o.CreateDate desc";
{ {
where += $@" and o.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}"; where += $@" and o.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}";
} }
if (dmodel.OrderClassify > -1)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderClassify)}={dmodel.OrderClassify}";
}
if (dmodel.OrderType > 0) if (dmodel.OrderType > 0)
{ {
......
...@@ -298,9 +298,6 @@ namespace Mall.WebApi.Controllers.User ...@@ -298,9 +298,6 @@ namespace Mall.WebApi.Controllers.User
{ {
if (orderGoodsItem.CostMoney > 0 && orderGoodsItem.CostFinanceId <= 0) if (orderGoodsItem.CostMoney > 0 && orderGoodsItem.CostFinanceId <= 0)
{ {
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 1;
var newOrderGoods = new RB_Goods_OrderDetail_Extend var newOrderGoods = new RB_Goods_OrderDetail_Extend
{ {
FinanceType = 1, FinanceType = 1,
...@@ -311,7 +308,8 @@ namespace Mall.WebApi.Controllers.User ...@@ -311,7 +308,8 @@ namespace Mall.WebApi.Controllers.User
OrderNo = orderGoodsItem.OrderNo, OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id, Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney, CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
}; };
OrderDetailPaid += ((orderGoodsItem.CostMoney ?? 0) * (orderGoodsItem.Number ?? 0)); OrderDetailPaid += ((orderGoodsItem.CostMoney ?? 0) * (orderGoodsItem.Number ?? 0));
result.Add(newOrderGoods); result.Add(newOrderGoods);
...@@ -319,11 +317,9 @@ namespace Mall.WebApi.Controllers.User ...@@ -319,11 +317,9 @@ namespace Mall.WebApi.Controllers.User
} }
if (demodel.IsSelectAll == 0 || demodel.IsSelectAll == 2) if (demodel.IsSelectAll == 0 || demodel.IsSelectAll == 2)
{ {
if (orderGoodsItem.FreightCostMoney.HasValue && orderGoodsItem.FreightCostMoney.Value > 0 && orderGoodsItem.FreightFinanceId <= 0) if (orderGoodsItem.FreightCostMoney.HasValue && orderGoodsItem.FreightCostMoney.Value > 0 && orderGoodsItem.FreightFinanceId <= 0)
{ {
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 2;
var newOrderGoods = new RB_Goods_OrderDetail_Extend var newOrderGoods = new RB_Goods_OrderDetail_Extend
{ {
FinanceType = 2, FinanceType = 2,
...@@ -334,12 +330,38 @@ namespace Mall.WebApi.Controllers.User ...@@ -334,12 +330,38 @@ namespace Mall.WebApi.Controllers.User
OrderNo = orderGoodsItem.OrderNo, OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id, Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney, CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
}; };
OrderDetailPaid += (orderGoodsItem.FreightCostMoney ?? 0); OrderDetailPaid += (orderGoodsItem.FreightCostMoney ?? 0);
result.Add(newOrderGoods); result.Add(newOrderGoods);
} }
} }
if (demodel.IsSelectAll == 0 || demodel.IsSelectAll == 3)
{
if (orderGoodsItem.InsuranceCostMoney.HasValue && orderGoodsItem.InsuranceCostMoney.Value > 0 && orderGoodsItem.InsuranceFinanceId <= 0)
{
var newOrderGoods = new RB_Goods_OrderDetail_Extend
{
FinanceType = 3,
Final_Price = orderGoodsItem.Final_Price,
Number = 1,
FreightMoney = orderGoodsItem.FreightMoney,
GoodsName = orderGoodsItem.GoodsName,
OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
};
OrderDetailPaid += ((orderGoodsItem.InsuranceCostMoney ?? 0) * (orderGoodsItem.Number ?? 0));
result.Add(newOrderGoods);
}
}
RB_Finance_RecordDetail_Extend financeRecordDetail = new RB_Finance_RecordDetail_Extend RB_Finance_RecordDetail_Extend financeRecordDetail = new RB_Finance_RecordDetail_Extend
{ {
...@@ -358,6 +380,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -358,6 +380,7 @@ namespace Mall.WebApi.Controllers.User
Unit_Price = orderGoodsItem.CostMoney, Unit_Price = orderGoodsItem.CostMoney,
Number = orderGoodsItem.Number, Number = orderGoodsItem.Number,
OrderDetailPaid = OrderDetailPaid, OrderDetailPaid = OrderDetailPaid,
InsuranceCostMoney = ((orderGoodsItem.InsuranceCostMoney ?? 0) * (orderGoodsItem.Number ?? 0)),
}; };
record.RecordDetailList.Add(financeRecordDetail); record.RecordDetailList.Add(financeRecordDetail);
...@@ -370,17 +393,25 @@ namespace Mall.WebApi.Controllers.User ...@@ -370,17 +393,25 @@ namespace Mall.WebApi.Controllers.User
ECList = ECList.Distinct().ToList(); ECList = ECList.Distinct().ToList();
var detailList = result.Select(x => new var detailList = result.Select(x => new
{ {
CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : financeConfigurineModel.ExpensesCostTypeId, CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : (x.FinanceType == 2 ? financeConfigurineModel.ExpensesCostTypeId : financeConfigurineModel.InsuranceCostTypeId),
Number = x.FinanceType == 1 ? x.Number : 1, // CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : financeConfigurineModel.ExpensesCostTypeId,
OriginalMoney = x.FinanceType == 1 ? ((x.CostMoney ?? 0) * (x.Number ?? 0)) : x.FreightCostMoney, Number = (x.FinanceType == 1 || x.FinanceType == 3) ? x.Number : 1,
UnitPrice = x.FinanceType == 1 ? ((x.CostMoney ?? 0)) : x.FreightCostMoney, OriginalMoney = x.FinanceType == 1 ? ((x.CostMoney ?? 0) * (x.Number ?? 0)) : (x.FinanceType == 2 ? x.FreightCostMoney : ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0))),
UnitPrice = x.FinanceType == 1 ? ((x.CostMoney ?? 0)) : (x.FinanceType == 2 ? x.FreightCostMoney : (x.InsuranceCostMoney ?? 0)),
Remark = x.GoodsName + x.Specification + x.OrderNo Remark = x.GoodsName + x.Specification + x.OrderNo
}); });
decimal totalMonry = 0; decimal totalMonry = 0;
if (demodel.IsSelectAll == 0) if (demodel.IsSelectAll == 0)
{ {
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 2).Sum(x => x.FreightCostMoney ?? 0)); if (demodel.OrderClassify == 0)
{
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 2).Sum(x => x.FreightCostMoney ?? 0));
}
else
{
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 3).Sum(x => ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0))));
}
} }
else if (demodel.IsSelectAll == 1) else if (demodel.IsSelectAll == 1)
{ {
...@@ -390,10 +421,14 @@ namespace Mall.WebApi.Controllers.User ...@@ -390,10 +421,14 @@ namespace Mall.WebApi.Controllers.User
{ {
totalMonry = result.Where(x => x.FinanceType == 2).Sum(x => (x.FreightCostMoney ?? 0)); totalMonry = result.Where(x => x.FinanceType == 2).Sum(x => (x.FreightCostMoney ?? 0));
} }
else if (demodel.IsSelectAll == 3)
{
totalMonry = result.Where(x => x.FinanceType == 2).Sum(x => ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0)));
}
var financeObj = new var financeObj = new
{ {
CreateBy = demodel.FinanceCreateBy == 0 ? Config.ExpendDirector : demodel.FinanceCreateBy.ToString(), CreateBy = demodel.FinanceCreateBy == 0 ? Config.ExpendDirector : demodel.FinanceCreateBy.ToString(),
IsPublic = demodel.IsPublic,// supplierModel.ClientBankAccount.AccountType, //financeConfigurineModel.AccountType, IsPublic = demodel.IsPublic,
ClientType = supplierModel.ClientBankAccount.Type, ClientType = supplierModel.ClientBankAccount.Type,
ClientID = supplierModel.BankAccountId, ClientID = supplierModel.BankAccountId,
CurrencyId = financeConfigurineModel.CurrencyId, CurrencyId = financeConfigurineModel.CurrencyId,
......
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