Commit fe91dc52 by guanzhenshan
parents e9f914ee 2d82b1b1
...@@ -4,4 +4,10 @@ ...@@ -4,4 +4,10 @@
<TargetFramework>netcoreapp2.1</TargetFramework> <TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
<PackageReference Include="NPOI" Version="2.4.1" />
<PackageReference Include="StackExchange.Redis" Version="2.1.28" />
</ItemGroup>
</Project> </Project>
using Newtonsoft.Json;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Common
{
public class RedisHelper
{
public static string RedisServiceAddr = "localhost:6379";
public static ConnectionMultiplexer Redis { get; set; }
static RedisHelper()
{
Redis = ConnectionMultiplexer.Connect(RedisServiceAddr);
}
/// <summary>
/// 获取缓存
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string GetString(string key)
{
using (var conn = ConnectionMultiplexer.Connect(RedisServiceAddr))
{
var db = conn.GetDatabase();
return db.StringGet(key);
}
}
/// <summary>
/// 获取缓存(序列化)
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <returns></returns>
public static List<T> GetList<T>(string key)
{
using (var conn = ConnectionMultiplexer.Connect(RedisServiceAddr))
{
var db = conn.GetDatabase();
var value = db.StringGet(key);
return value.HasValue ? JsonConvert.DeserializeObject<List<T>>(value) : new List<T>();
}
}
/// <summary>
/// 添加
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <param name="value"></param>
/// <returns></returns>
public static bool Add<T>(string key, T value)
{
using (var conn = ConnectionMultiplexer.Connect(RedisServiceAddr))
{
var db = conn.GetDatabase();
return db.StringSet(key, JsonConvert.SerializeObject(value));
}
}
/// <summary>
/// 添加(带过期时间)
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <param name="value"></param>
/// <param name="expire"></param>
/// <returns></returns>
public static bool Add<T>(string key, T value, TimeSpan expire)
{
using (var conn = ConnectionMultiplexer.Connect(RedisServiceAddr))
{
var db = conn.GetDatabase();
return db.StringSet(key, JsonConvert.SerializeObject(value), expire);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Voucher
{
public class QueryDtos
{
public string Site { get; set; }
public string TitleName { get; set; }
public decimal Amount { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Voucher
{
/// <summary>
/// 各站点对应的表头标题。用于转换数据
/// </summary>
public class SiteTitleEntity
{
public string type { get; set; }
public string product_sales { get; set; }
public string shipping_credits { get; set; }
public string gift_wrap_credits { get; set; }
public string selling_fees { get; set; }
public string promotional_rebates { get; set; }
public string other_transaction_fees { get; set; }
public string fulfillment { get; set; }
/// <summary>
/// UK站点
/// </summary>
public string fulfilment { get; set; }
public string fba_fees { get; set; }
public string other { get; set; }
public string total { get; set; }
public string description { get; set; }
public string product_sales_tax { get; set; }
public string postage_credits { get; set; }
public string shipping_credits_tax { get; set; }
public string giftwrap_credits_tax { get; set; }
public string Typ { get; set; }
public string Umsätze { get; set; }
public string Produktumsatzsteuer { get; set; }
public string Gutschrift_für_Versandkosten { get; set; }
public string Steuer_auf_Versandgutschrift { get; set; }
public string Gutschrift_für_Geschenkverpackung { get; set; }
public string Steuer_auf_Geschenkverpackungsgutschriften { get; set; }
public string Rabatte_aus_Werbeaktionen { get; set; }
public string Steuer_auf_Aktionsrabatte { get; set; }
public string Verkaufsgebühren { get; set; }
public string Gebühren_zu_Versand_durch_Amazon { get; set; }
public string Andere_Transaktionsgebühren { get; set; }
public string Andere { get; set; }
public string Gesamt { get; set; }
public string Versand { get; set; }
public string promotional_rebates_tax { get; set; }
public string ventes_de_produits { get; set; }
public string Taxes_sur_la_vente_des_produits { get; set; }
public string crédits_d_expédition { get; set; }
public string taxe_sur_les_crédits_d_expédition { get; set; }
public string crédits_sur_l_emballage_cadeau { get; set; }
public string Taxes_sur_les_crédits_cadeaux { get; set; }
public string Rabais_promotionnels { get; set; }
public string Taxes_sur_les_remises_promotionnelles { get; set; }
public string frais_de_vente { get; set; }
public string traitement { get; set; }
public string Frais_Expédié_par_Amazon { get; set; }
public string autres_frais_de_transaction { get; set; }
public string autre { get; set; }
public string Vendite { get; set; }
public string totale { get; set; }
public string imposta_sulle_vendite_dei_prodotti { get; set; }
public string Accrediti_per_le_spedizioni { get; set; }
public string imposta_accrediti_per_le_spedizioni { get; set; }
public string Accrediti_per_confezioni_regalo { get; set; }
public string imposta_sui_crediti_confezione_regalo { get; set; }
public string Sconti_promozionali { get; set; }
public string imposta_sugli_sconti_promozionali { get; set; }
public string Commissioni_di_vendita { get; set; }
public string Costi_del_servizio_Logistica_di_Amazon { get; set; }
public string Altri_costi_relativi_alle_transazioni { get; set; }
public string Altro { get; set; }
public string Tipo { get; set; }
public string Gestione { get; set; }
public string ventas_de_productos { get; set; }
public string abonos_de_envío { get; set; }
public string impuestos_por_abonos_de_envío { get; set; }
public string abonos_de_envoltorio_para_regalo { get; set; }
public string devoluciones_promocionales { get; set; }
public string tarifas_de_venta { get; set; }
public string tarifas_de_Logística_de_Amazon { get; set; }
public string tarifas_de_otras_transacciones { get; set; }
public string otro { get; set; }
public string gestión_logística { get; set; }
public string tipo { get; set; }
public string totaal { get; set; }
public string verkoop_van_producten { get; set; }
public string Verzendtegoeden { get; set; }
public string promotiekortingen { get; set; }
public string verkoopkosten { get; set; }
public string fba_vergoedingen { get; set; }
public string overige_transactiekosten { get; set; }
public string overige { get; set; }
public string totalt { get; set; }
public string försäljning_av_produkter { get; set; }
public string fraktkrediter { get; set; }
public string krediter_för_presentinslagning { get; set; }
public string kampanjrabatter { get; set; }
public string försäljningsavgifter { get; set; }
public string fba_avgifter { get; set; }
public string övriga_transaktionsavgifter { get; set; }
public string Övrigt { get; set; }
public string leverans { get; set; }
public string 合計 { get; set; }
public string 商品売上 { get; set; }
public string 商品の売上税 { get; set; }
public string 配送料 { get; set; }
public string 配送料の税金 { get; set; }
public string ギフト包装手数料 { get; set; }
public string 手数料 { get; set; }
public string FBA_手数料 { get; set; }
public string トランザクションに関するその他の手数料 { get; set; }
public string その他 { get; set; }
public string フルフィルメント { get; set; }
public string トランザクションの種類 { get; set; }
public string tarifas_fba { get; set; }
public string cumplimiento { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Voucher
{
public class VoucherData
{
/// <summary>
/// FBA
/// </summary>
public decimal yongjinAmazon { get; set; } = 0;
/// <summary>
/// Seller
/// </summary>
public decimal yongjinToTal { get; set; } = 0;
/// <summary>
/// 广告费
/// </summary>
public decimal guanggaoTotal { get; set; } = 0;
/// <summary>
/// 仓储费
/// </summary>
public decimal fbacangchu { get; set; } = 0;
/// <summary>
/// 物流费(销售费用-fba物流费-尾程)
/// </summary>
public decimal TailCourseFba { get; set; } = 0;
/// <summary>
/// 货运费(销售费用-fba物流费-头程)
/// </summary>
public decimal FirstJourneyFba { get; set; } = 0;
/// <summary>
/// 销售费用
/// </summary>
public decimal salseFee { get; set; } = 0;
/// <summary>
/// 应收
/// </summary>
public decimal yingyewaiAdju { get; set; } = 0;
/// <summary>
/// 主营
/// </summary>
public decimal yingyewaiTotal { get; set; } = 0;
public string Market { get; set; }
public decimal yongjinSeller { get; set; } = 0;
public decimal yongjinSeller2 { get; set; } = 0;
public decimal yongjinSeller3 { get; set; } = 0;
public decimal yongjinSeller4 { get; set; } = 0;
public decimal yongjinSeller5 { get; set; } = 0;
public decimal guanggaoDeal { get; set; } = 0;
public decimal guanggaoService { get; set; } = 0;
public decimal guanggaoService_Sub { get; set; } = 0;
public decimal yingyewaiRefund { get; set; } = 0;
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Voucher
{
public class VoucherTemplateEntity
{
public string 凭证ID { get; set; }
public string 会计年 { get; set; }
public string 会计期间 { get; set; }
public string 制单日期 { get; set; }
public string 凭证类别 { get; set; }
public string 凭证号 { get; set; }
public string 制单人 { get; set; }
public string 所附单据数 { get; set; }
public string 备注1 { get; set; }
public string 备注2 { get; set; }
public string 科目编码 { get; set; }
public string 摘要 { get; set; }
public string 取值列 { get; set; }
public string 站点 { get; set; }
public string 原币金额借方金额取数来源 { get; set; }
public string 结算方式编码 { get; set; }
public string 票据号 { get; set; }
public string 票据日期 { get; set; }
public string 币种名称 { get; set; }
public string 汇率 { get; set; }
public string 单价 { get; set; }
public string 借方数量 { get; set; }
public string 贷方数量 { get; set; }
public string 原币借方 { get; set; }
public string 原币贷方 { get; set; }
public string 借方金额 { get; set; }
public string 贷方金额 { get; set; }
public string 部门编码 { get; set; }
public string 职员编码 { get; set; }
public string 客户编码 { get; set; }
public string 供应商编码 { get; set; }
public string 项目大类编码 { get; set; }
public string 项目编码 { get; set; }
public string 业务员 { get; set; }
public string 自定义项1 { get; set; }
public string 自定义项2 { get; set; }
public string 自定义项3 { get; set; }
public string 自定义项4 { get; set; }
public string 自定义项5 { get; set; }
public string 自定义项6 { get; set; }
public string 自定义项7 { get; set; }
public string 自定义项8 { get; set; }
public string 自定义项9 { get; set; }
public string 自定义项10 { get; set; }
public string 自定义项11 { get; set; }
public string 自定义项12 { get; set; }
public string 自定义项13 { get; set; }
public string 自定义项14 { get; set; }
public string 自定义项15 { get; set; }
public string 自定义项16 { get; set; }
public string 现金流量项目 { get; set; }
public string 现金流量借方金额 { get; set; }
public string 现金流量贷方金额 { get; set; }
}
}
using Bailun.DC.Common;
using Bailun.DC.Services;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
{
[Area("DataWareHouse")]
public class VoucherController : Base.BaseController
{
public IActionResult Index()
{
return View();
}
#region 导出凭证
/// <summary>
/// 获取凭证信息
/// </summary>
/// <returns></returns>
public ActionResult GetVoucherList(DateTime month,string platform)
{
var data = new VoucherService().GetVoucherListNew(month, platform);
var columns = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(data.FirstOrDefault())).Select(x => x.Key).ToList();
columns.Remove("取值列");
columns.Remove("站点");
var table = new DataTable();
foreach (var item in columns)
{
table.Columns.Add(item);
}
foreach (var dataItem in data)
{
var row = table.NewRow();
var dataObj = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(dataItem));
var index = 0;
foreach (var dicItem in dataObj)
{
if (columns.Contains(dicItem.Key))
{
row[dicItem.Key] = dicItem.Value;
}
index++;
}
table.Rows.Add(row);
}
var filepath = Directory.GetCurrentDirectory() + "\\Files\\Report\\" + DateTime.Now.ToString("yyyyMMdd") + "\\";
var filename = $"亚马逊{month.Month}月凭证" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
ExcelHelper.DataTableToExcel(table, filepath + filename, true);
var stream = System.IO.File.OpenRead(filepath + filename);//excel表转换成流
return File(stream, "application/vnd.android.package-archive", Path.GetFileName(filepath + filename));//进行浏览器下载
}
#endregion
}
}
@{ @{
ViewData["Title"] = "平台账单流水"; ViewData["Title"] = "平台账单流水";
Layout = "~/Pages/Shared/_MainLayout.cshtml"; Layout = "~/Pages/Shared/_MainLayout.cshtml";
ViewBag.Nav = new string[] { "销售平台流水", (ViewBag.platform==""?"其他": ViewBag.platform) +"账单流水" }; ViewBag.Nav = new string[] { "销售平台流水", (ViewBag.platform == "" ? "其他" : ViewBag.platform) + "账单流水" };
} }
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<button type="button" style="margin-left:10px" class="btn btn-warning" onclick="downloadTemplate()">模版下载</button> <button type="button" style="margin-left:10px" class="btn btn-warning" onclick="downloadTemplate()">模版下载</button>
<button id="btn_Upload" type="button" style="" class="btn btn-warning">导入流水</button> <button id="btn_Upload" type="button" style="" class="btn btn-warning">导入流水</button>
@*<button id="btn_Upload_Merge" type="button" style="" class="btn btn-warning">导入站点合并流水</button>*@ @*<button id="btn_Upload_Merge" type="button" style="" class="btn btn-warning">导入站点合并流水</button>*@
<button id="btn_Export_Voucher" type="button" style="" onclick="Export_Voucher()" class="btn btn-warning">导出凭证</button>
</div> </div>
</div> </div>
</form> </form>
...@@ -96,6 +97,7 @@ ...@@ -96,6 +97,7 @@
.webuploader-container { .webuploader-container {
background-color: cornflowerblue !important; background-color: cornflowerblue !important;
} }
.mules { .mules {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
...@@ -109,7 +111,7 @@ ...@@ -109,7 +111,7 @@
} }
.pagination ul li{float:left;width:20px;} .pagination ul li{float:left;width:20px;}
*/ */
.pagination { .pagination {
margin: 20px 0; margin: 20px 0;
} }
...@@ -126,7 +128,7 @@ ...@@ -126,7 +128,7 @@
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
padding-left:0px; padding-left: 0px;
} }
.pagination ul > li { .pagination ul > li {
...@@ -194,13 +196,13 @@ ...@@ -194,13 +196,13 @@
.pagination-right { .pagination-right {
text-align: right; text-align: right;
} }
</style> </style>
} }
@section scripts{ @section scripts{
<script src="~/js/jspagination/bootstrap-paginator.js"></script> <script src="~/js/jspagination/bootstrap-paginator.js"></script>
<script src="~/js/webuploader-0.1.5/webuploader.min.js"></script> <script src="~/js/webuploader-0.1.5/webuploader.min.js"></script>
<script src="~/js/Layer-2.1/extend/layer.ext.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var tb; var tb;
var current_page = 1; var current_page = 1;
...@@ -245,6 +247,7 @@ ...@@ -245,6 +247,7 @@
} }
});*@ });*@
}) })
function list() { function list() {
...@@ -428,6 +431,27 @@ ...@@ -428,6 +431,27 @@
window.open('@Url.Content("~/DataWareHouse/PlatformOrder/ExportOrderBillings")' + '?platform=' + platform+'&website=' + website + '&start=' + start + '&end=' + end + '&orderno=' + orderno); window.open('@Url.Content("~/DataWareHouse/PlatformOrder/ExportOrderBillings")' + '?platform=' + platform+'&website=' + website + '&start=' + start + '&end=' + end + '&orderno=' + orderno);
} }
function Export_Voucher() {
var time = new Date();
var mon = time.getMonth();
var month = null;
if (mon < 10) {
month = time.getFullYear() + '-0' + time.getMonth();
} else {
month = time.getFullYear() + '-' + time.getMonth();
}
var centents = '<input type="month" class="layui-layer-input" value="' + month + '" placeholder="月份">';
layer.prompt({
title: '请选择月份(必选项)',
content: centents,
formType: 3
}, function (enddate, index) {
window.open('@Url.Content("~/DataWareHouse/Voucher/GetVoucherList")'+'?month='+enddate+'&platform=亚马逊');
layer.close(index);
})
};
function downloadTemplate() { function downloadTemplate() {
if (websitecount > 0 && website=='') { if (websitecount > 0 && website=='') {
alert('请选择站点,再下载导入模版。'); alert('请选择站点,再下载导入模版。');
......
var baseUrl = 'http://data.bailuntec.com'; //'http://localhost:59628/';// var baseUrl = 'http://localhost:50077/';
var globalOrderSort=''; var globalOrderSort='';
var globalOrderType = ''; var globalOrderType = '';
var global_userid; var global_userid;
......
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