Commit c64260ec authored by 吴春's avatar 吴春

提交代码

parent d9fab6af
using Mall.Common;
using DapperExtensions.Lambda;
using Mall.Common;
using Mall.Common.Enum.Goods;
using Mall.Common.Enum.User;
using Mall.Common.Plugin;
......@@ -180,8 +181,6 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
newOrderGoods.FinanceType = 2;
result.Add(newOrderGoods);
}
RB_Finance_RecordDetail financeRecordDetail = new RB_Finance_RecordDetail
{
......@@ -204,14 +203,25 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
}
}
if (result!=null&& result.Any())
if (result != null && result.Any())
{
decimal OriginalFee = 0;
var goodsDetailGroupList = goodsDetailList.GroupBy(x => x.OrderId);
foreach (var goodsDetailGroupItem in goodsDetailGroupList)
{
OriginalFee += goodsDetailList.Where(x => x.OrderId == goodsDetailGroupItem.Key).Sum(x => (x.FreightMoney ?? 0) + (x.Final_Price ?? 0)) * (Convert.ToDecimal(Config.SettlementRate) / 100);
}
var detailList = result.Select(x => new
{
CostTypeId = x.FinanceType == 1 ? item.IncomeCostTypeId : item.FreightCostTypeId,
Number = x.FinanceType == 1 ? x.Number : 1,
OriginalMoney = x.FinanceType == 1 ? x.Unit_Price : x.FreightMoney,
UnitPrice = x.FinanceType == 1 ? (((x.Final_Price ?? 0) - (x.FreightMoney ?? 0)) / (x.Number ?? 0)) : x.FreightMoney,
OriginalMoney = x.FinanceType == 1 ? (x.Final_Price ?? 0) : (x.FreightMoney ?? 0),
// OriginalMoney = x.FinanceType == 1 ? ((x.Unit_Price ?? 0) * (x.Number ?? 0)) : x.FreightMoney,
UnitPrice = x.FinanceType == 1 ? ((x.Final_Price ?? 0) / (x.Number ?? 0)) : x.FreightMoney,
// UnitPrice = x.FinanceType == 1 ? (((x.Final_Price ?? 0) - (x.FreightMoney ?? 0)) / (x.Number ?? 0)) : x.FreightMoney,
Remark = x.GoodsName + x.OrderNo
});
var financeObj = new
......@@ -220,7 +230,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
item.IsPublic,
BType = item.AccountType,
AccountId = item.AccountId,
WBMoney = result.Sum(x => x.Final_Price ?? 0),
WBMoney = result.Sum(x => x.FinanceType == 1 ? (x.Final_Price ?? 0) : (x.FreightMoney ?? 0)),
RB_Branch_Id = Config.RB_Branch_Id,
RemitterName = item.RemitterName,
TradeDate = System.DateTime.Now.ToString("yyyy-MM-dd"),
......@@ -229,7 +239,6 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
OrderSource = 16,
Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据",
detailList,
};
string sign = EncryptionHelper.AesEncrypt(JsonHelper.Serialize(financeObj), Config.FinanceKey);
var resultInfo = new
......@@ -584,7 +593,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
//判断是否到了时间
}
else {
else
{
//直接结算佣金
}
}
......
......@@ -33,6 +33,7 @@
"RebornDMC": "reborn_dmc",
"IncomeFinanceApi": "http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallIn",
"PaymentFinanceApi": "http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallOut",
"SettlementRate": "0.60",
//"FinanceKey": "FinanceMallInsertToERPViitto2020",
"FinanceKey": "FinanceMallInsertToERPViitto2020",
"RedisSetting": {
......
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