Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
2da12384
Commit
2da12384
authored
Sep 03, 2021
by
zhoujinhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
存货计价导出
parent
3ec2cfa2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
172 additions
and
42 deletions
+172
-42
GetMonthStockWeightingOutputDto.cs
...n.DC.Models/Dtos/Stock/GetMonthStockWeightingOutputDto.cs
+19
-1
GetMonthStockWeightingSummaryDto.cs
....DC.Models/Dtos/Stock/GetMonthStockWeightingSummaryDto.cs
+28
-0
dc_base_wms_stock_flow.cs
Bailun.DC.Models/Stock/dc_base_wms_stock_flow.cs
+30
-24
InventoryServices.cs
Bailun.DC.Services/InventoryServices.cs
+31
-0
FinanceService.cs
Bailun.DC.Services/WebApiService/FinanceService.cs
+0
-0
FinanceController.cs
Bailun.DC.WebApi/Controllers/FinanceController.cs
+57
-17
Bailun.DC.sln
Bailun.DC.sln
+7
-0
No files found.
Bailun.DC.Models/Dtos/Stock/GetMonthStockWeightingOutputDto.cs
View file @
2da12384
namespace
Bailun.DC.Models.Dtos.Stock
using
System.Collections.Generic
;
using
System.Data
;
namespace
Bailun.DC.Models.Dtos.Stock
{
/// <summary>
/// 获取存货计价数据返回参数信息
...
...
@@ -11,9 +14,24 @@
public
dynamic
Data
{
get
;
set
;
}
/// <summary>
/// Excel导出用
/// </summary>
public
DataTable
DataTable
{
get
;
set
;
}
/// <summary>
/// 前端Vue表头
/// </summary>
public
string
ColumnText
{
get
;
set
;
}
public
int
Total
{
get
;
set
;
}
/// <summary>
/// 导出标题
/// </summary>
public
List
<
string
>
ExportCNTitle
{
get
;
set
;
}
/// <summary>
/// 导出数据列名称
/// </summary>
public
List
<
string
>
ExportDataTitle
{
get
;
set
;
}
}
}
Bailun.DC.Models/Dtos/Stock/GetMonthStockWeightingSummaryDto.cs
0 → 100644
View file @
2da12384
namespace
Bailun.DC.Models.Dtos.Stock
{
/// <summary>
/// 存货统计
/// </summary>
public
class
GetMonthStockWeightingSummaryDto
{
/// <summary>
/// sku
/// </summary>
public
string
bailun_sku
{
get
;
set
;
}
/// <summary>
/// 总金额
/// </summary>
public
decimal
total_price
{
get
;
set
;
}
/// <summary>
/// 总数量
/// </summary>
public
int
total_count
{
get
;
set
;
}
/// <summary>
/// 月末库存
/// </summary>
public
int
on_hand_stock
{
get
;
set
;
}
}
}
Bailun.DC.Models/Stock/dc_base_wms_stock_flow.cs
View file @
2da12384
...
...
@@ -9,6 +9,36 @@ namespace Bailun.DC.Models.Stock
/// </summary>
public
class
dc_base_wms_stock_flow
{
public
dc_base_wms_stock_flow
()
{
}
/// <summary>
///
/// </summary>
/// <param name="productStockFlow"></param>
public
dc_base_wms_stock_flow
(
ProductStockFlowApiResponseDto
productStockFlow
)
{
sys_serial_number
=
productStockFlow
.
SysSerialNumber
;
bailun_sku
=
productStockFlow
.
Sku
;
change_quantity
=
productStockFlow
.
ChangeQuantity
;
warehouse_code
=
productStockFlow
.
WarehouseCode
;
warehouse_name
=
productStockFlow
.
WarehouseName
;
third_sys_order_no
=
productStockFlow
.
ThirdSysOrderNo
;
third_sys_order_type
=
productStockFlow
.
ThirdSysOrderType
;
system_source
=
productStockFlow
.
SystemSource
;
target_ware_no
=
productStockFlow
.
TargetWareNo
;
target_ware_name
=
productStockFlow
.
TargetWareName
;
availabel_stock
=
productStockFlow
.
AvailabelStock
;
on_hand_stock
=
productStockFlow
.
OnHandStock
;
in_bound_stock
=
productStockFlow
.
InboundStock
;
order_creation_time
=
productStockFlow
.
OrderCreationTime
;
create_user_name
=
productStockFlow
.
CreateUserName
;
wms_creation_time
=
productStockFlow
.
CreationTime
;
create_time
=
DateTime
.
Now
;
}
/// <summary>
/// id
/// </summary>
...
...
@@ -99,30 +129,6 @@ namespace Bailun.DC.Models.Stock
/// </summary>
public
DateTime
create_time
{
get
;
set
;
}
/// <summary>
///
/// </summary>
/// <param name="productStockFlow"></param>
public
void
WmsRepsonseToModel
(
ProductStockFlowApiResponseDto
productStockFlow
)
{
sys_serial_number
=
productStockFlow
.
SysSerialNumber
;
bailun_sku
=
productStockFlow
.
Sku
;
change_quantity
=
productStockFlow
.
ChangeQuantity
;
warehouse_code
=
productStockFlow
.
WarehouseCode
;
warehouse_name
=
productStockFlow
.
WarehouseName
;
third_sys_order_no
=
productStockFlow
.
ThirdSysOrderNo
;
third_sys_order_type
=
productStockFlow
.
ThirdSysOrderType
;
system_source
=
productStockFlow
.
SystemSource
;
target_ware_no
=
productStockFlow
.
TargetWareNo
;
target_ware_name
=
productStockFlow
.
TargetWareName
;
availabel_stock
=
productStockFlow
.
AvailabelStock
;
on_hand_stock
=
productStockFlow
.
OnHandStock
;
in_bound_stock
=
productStockFlow
.
InboundStock
;
order_creation_time
=
productStockFlow
.
OrderCreationTime
;
create_user_name
=
productStockFlow
.
CreateUserName
;
wms_creation_time
=
productStockFlow
.
CreationTime
;
create_time
=
DateTime
.
Now
;
}
}
/// <summary>
...
...
Bailun.DC.Services/InventoryServices.cs
View file @
2da12384
...
...
@@ -9,6 +9,7 @@ using Bailun.DC.Models.Stock;
using
MySql.Data
;
using
System.Data
;
using
Bailun.DC.Models.Warehouse
;
using
Bailun.DC.Models.Dtos.Stock
;
namespace
Bailun.DC.Services
{
...
...
@@ -1313,6 +1314,36 @@ namespace Bailun.DC.Services
}
#
endregion
#
region
WMS
库存流水
/// <summary>
/// 写入WMS库存流水记录
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
InsertWmsStockFlow
(
dc_base_wms_stock_flow
model
)
{
var
sql
=
@"
INSERT INTO `dc_base_wms_stock_flow` (`sys_serial_number`, `bailun_sku`, `change_quantity`,
`warehouse_code`, `warehouse_name`, `third_sys_order_no`, `third_sys_order_type`, `system_source`,
`target_ware_no`, `target_ware_name`, `availabel_stock`, `on_hand_stock`, `in_bound_stock`,
`order_creation_time`, `create_user_name`, `wms_creation_time`, `create_time`)
VALUES (@sys_serial_number, @bailun_sku, @change_quantity,
@warehouse_code, @warehouse_name, @third_sys_order_no, @third_sys_order_type, @system_source,
@target_ware_no, @target_ware_name, @availabel_stock, @on_hand_stock, @in_bound_stock,
@order_creation_time, @create_user_name, @wms_creation_time, @create_time);
"
;
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
count
=
cn
.
Execute
(
sql
,
model
);
return
count
>
0
;
}
}
#
endregion
}
}
Bailun.DC.Services/WebApiService/FinanceService.cs
View file @
2da12384
This diff is collapsed.
Click to expand it.
Bailun.DC.WebApi/Controllers/FinanceController.cs
View file @
2da12384
...
...
@@ -11,9 +11,13 @@ using Bailun.ServiceFabric.Core.Extension;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Dynamic
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Reflection
;
using
System.Text
;
...
...
@@ -175,8 +179,8 @@ namespace Bailun.DC.WebApi.Controllers
foreach
(
var
item
in
displayNameList
)
{
if
(
item
.
KeyName
==
"id"
||
item
.
KeyName
==
"month"
)
continue
;
var
isFirst
=
firstList
.
Count
(
x
=>
x
.
ParentName
.
ToString
()
==
item
.
KeyName
)
>
0
?
1
:
0
;
jsonStr
.
Append
(
"{\"ItemName\":\""
+
item
.
KeyName
+
"\",\"Item\":\""
+
item
.
DisplayName
+
"\",\"IsFirst\":"
+
isFirst
+
",\"FirstId\":\""
+
(
int
)
item
.
ParentName
+
"\","
);
var
isFirst
=
firstList
.
Count
(
x
=>
x
.
ParentName
.
ToString
()
==
item
.
KeyName
)
>
0
?
1
:
0
;
jsonStr
.
Append
(
"{\"ItemName\":\""
+
item
.
KeyName
+
"\",\"Item\":\""
+
item
.
DisplayName
+
"\",\"IsFirst\":"
+
isFirst
+
",\"FirstId\":\""
+
(
int
)
item
.
ParentName
+
"\","
);
excelItemStr
=
item
.
DisplayName
+
"|"
;
foreach
(
var
subItem
in
dataList
)
{
...
...
@@ -337,10 +341,10 @@ namespace Bailun.DC.WebApi.Controllers
/// <param name="financecategory"></param>
/// <returns></returns>
[
HttpGet
(
"getPlatformTypeMonthlyStatistics"
)]
public
CommonApiResponseDto
<
List
<
PlatformTypeMonthlyStatisticsDto
>>
GetPlatformTypeMonthlyStatistics
(
string
month
,
string
financecategory
,
string
isCost
)
public
CommonApiResponseDto
<
List
<
PlatformTypeMonthlyStatisticsDto
>>
GetPlatformTypeMonthlyStatistics
(
string
month
,
string
financecategory
,
string
isCost
)
{
var
result
=
new
CommonApiResponseDto
<
List
<
PlatformTypeMonthlyStatisticsDto
>>
{
Data
=
new
List
<
PlatformTypeMonthlyStatisticsDto
>()};
result
.
Data
=
new
FinanceService
().
GetMonthSalesProfiOrderSummary
(
month
,
financecategory
,
isCost
);
var
result
=
new
CommonApiResponseDto
<
List
<
PlatformTypeMonthlyStatisticsDto
>>
{
Data
=
new
List
<
PlatformTypeMonthlyStatisticsDto
>()
};
result
.
Data
=
new
FinanceService
().
GetMonthSalesProfiOrderSummary
(
month
,
financecategory
,
isCost
);
return
result
;
}
...
...
@@ -350,7 +354,7 @@ namespace Bailun.DC.WebApi.Controllers
/// <param name="input"></param>
/// <returns></returns>
[
HttpPost
(
"getMonthProfitOrderDetailPage"
)]
public
CommonApiResponseDto
<
MonthProfitOrderDetailPageOutputDto
>
GetMonthProfitOrderDetailPage
([
FromBody
]
MonthProfitOrderDetailPageInputDto
input
)
public
CommonApiResponseDto
<
MonthProfitOrderDetailPageOutputDto
>
GetMonthProfitOrderDetailPage
([
FromBody
]
MonthProfitOrderDetailPageInputDto
input
)
{
return
new
FinanceService
().
GetMonthProfitOrderDetailPage
(
input
);
}
...
...
@@ -428,7 +432,7 @@ namespace Bailun.DC.WebApi.Controllers
/// <param name="feeName"></param>
/// <returns></returns>
[
HttpGet
(
"getMonthProfitFeeManagementCostDetail"
)]
public
CommonApiResponseDto
<
List
<
FinanceDetailsDto
>>
GetMonthProfitFeeManagementCostDetail
(
string
month
,
string
feeName
)
public
CommonApiResponseDto
<
List
<
FinanceDetailsDto
>>
GetMonthProfitFeeManagementCostDetail
(
string
month
,
string
feeName
)
=>
new
FinanceService
().
GetMonthProfitFeeManagementCostDetail
(
month
,
feeName
);
/// <summary>
/// 月销售利润平台费用明细
...
...
@@ -458,7 +462,7 @@ namespace Bailun.DC.WebApi.Controllers
[
HttpPost
(
"exportMonthProfitFeePlatformFeeDetail"
)]
public
ActionResult
ExportMonthProfitFeePlatformFeeDetail
(
GetMonthProfitPlatformDetailInput
input
)
{
var
dataList
=
new
FinanceService
().
ExportMonthProfitFeePlatformFeeDetail
(
input
);
var
dataList
=
new
FinanceService
().
ExportMonthProfitFeePlatformFeeDetail
(
input
);
var
colNames
=
new
List
<
string
>
{
"平台"
,
"站点"
,
"账单时间"
,
"单号"
,
"币种"
,
"原币金额"
,
"汇率"
,
"RMB金额"
,
"费用字段说明"
,
"财务分类归集说明"
,
"数据中心费用类型"
,
"会计科目编码"
,
"项目编码"
};
var
list
=
new
List
<
string
>();
...
...
@@ -536,8 +540,8 @@ namespace Bailun.DC.WebApi.Controllers
[
HttpPost
(
"exportMonthSalesProfitDetail"
)]
public
ActionResult
ExportMonthSalesProfitDetail
(
MonthProfitOrderDetailPageInputDto
input
)
{
var
dataList
=
new
FinanceService
().
GetMonthSalesProfitDetail
(
input
,
false
);
var
colNames
=
new
List
<
string
>
{
"财务分类"
,
"平台类型"
,
"订单号"
,
"SKU"
,
"销售利润"
,
"发货量"
,
"发货时间"
,
"创建时间"
};
var
dataList
=
new
FinanceService
().
GetMonthSalesProfitDetail
(
input
,
false
);
var
colNames
=
new
List
<
string
>
{
"财务分类"
,
"平台类型"
,
"订单号"
,
"SKU"
,
"销售利润"
,
"发货量"
,
"发货时间"
,
"创建时间"
};
var
list
=
new
List
<
string
>();
foreach
(
var
item
in
dataList
.
Data
.
Data
)
{
...
...
@@ -554,15 +558,15 @@ namespace Bailun.DC.WebApi.Controllers
ms
.
Position
=
0
;
return
File
(
ms
,
"text/csv"
,
$"
{
input
.
Month
}
_月销售费用合计》费用利润表明细.csv"
);
}
/// <summary>
/// 同步月利润销售报告
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
/// <summary>
/// 同步月利润销售报告
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
[
HttpGet
(
"syncMonthSalesProfit"
)]
public
bool
SyncMonthSalesProfit
(
string
time
)
{
return
new
FinanceService
().
SyncMonthSalesProfit
(
time
);
return
new
FinanceService
().
SyncMonthSalesProfit
(
time
);
//var sql = "select * from dc_month_sales_profit_orderdetail limit 1";
//var data = Dapper.SimpleCRUD.Query<dc_month_sales_profit_orderdetail>(sql, null, Common.GlobalConfig.ConnectionString).FirstOrDefault();
//return data;
...
...
@@ -574,7 +578,7 @@ namespace Bailun.DC.WebApi.Controllers
/// <returns></returns>
[
HttpGet
(
"syncMonthSalesProfiOrderDetail"
)]
public
bool
SyncMonthSalesProfiOrderDetail
(
string
date
)
=>
new
FinanceService
().
SyncMonthSalesProfiOrderDetail
(
date
);
=>
new
FinanceService
().
SyncMonthSalesProfiOrderDetail
(
date
);
#
endregion
#
region
会计科目
...
...
@@ -628,6 +632,42 @@ namespace Bailun.DC.WebApi.Controllers
{
return
new
FinanceService
().
GetMonthStockWeightingList
(
bailunSku
,
month
,
page
,
limit
);
}
/// <summary>
/// 导出明细
/// </summary>
/// <param name="bailunSku"></param>
/// <param name="month"></param>
/// <returns></returns>
[
HttpPost
(
"exportMonthStockWeighting"
)]
public
ActionResult
ExportMonthStockWeighting
(
string
bailunSku
,
string
month
)
{
var
response
=
new
FinanceService
().
GetMonthStockWeightingList
(
bailunSku
,
month
,
0
,
0
);
var
list
=
new
List
<
string
>();
for
(
int
i
=
0
;
i
<
response
.
Data
.
DataTable
.
Rows
.
Count
;
i
++)
{
StringBuilder
dataStr
=
new
StringBuilder
();
foreach
(
var
title
in
response
.
Data
.
ExportDataTitle
)
{
string
value
=
response
.
Data
.
DataTable
.
Rows
[
i
][
title
].
ToString
();
dataStr
.
Append
(
value
+
"|"
);
}
var
dataStrValue
=
dataStr
.
ToString
().
TrimEnd
(
'|'
);
list
.
Add
(
dataStrValue
);
}
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
ToCSV
(
list
,
response
.
Data
.
ExportCNTitle
,
guid
,
filepath
);
var
ms
=
new
System
.
IO
.
MemoryStream
();
using
(
var
f
=
new
System
.
IO
.
FileStream
(
filepath
+
guid
+
".csv"
,
System
.
IO
.
FileMode
.
Open
))
{
f
.
CopyTo
(
ms
);
}
ms
.
Position
=
0
;
return
File
(
ms
,
"text/csv"
,
"存货计价.csv"
);
}
#
endregion
}
}
Bailun.DC.sln
View file @
2da12384
...
...
@@ -93,6 +93,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bailun.DC.SyncMonthSalesPro
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bailun.DC.ExportTask", "Bailun.DC.ExportTask\Bailun.DC.ExportTask.csproj", "{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bailun.DC.SyncMonthStockWeighting", "..\Bailun.DC.SyncMonthStockWeighting\Bailun.DC.SyncMonthStockWeighting.csproj", "{ED1647F9-6EA3-41A8-805F-DC46B8AD8835}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -275,6 +277,10 @@ Global
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94}.Release|Any CPU.Build.0 = Release|Any CPU
{ED1647F9-6EA3-41A8-805F-DC46B8AD8835}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED1647F9-6EA3-41A8-805F-DC46B8AD8835}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED1647F9-6EA3-41A8-805F-DC46B8AD8835}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED1647F9-6EA3-41A8-805F-DC46B8AD8835}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
@@ -317,6 +323,7 @@ Global
{B0E4B05A-2330-46E1-8CF7-C6D69DBB7850} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{DEAD70F9-01C4-4178-AB0B-1C4874AA7A61} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{C4C4990D-14DC-4B76-A7EB-6F3FC5BE8B94} = {AE2CE86A-8538-4142-920F-684DCF47C064}
{ED1647F9-6EA3-41A8-805F-DC46B8AD8835} = {AE2CE86A-8538-4142-920F-684DCF47C064}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6E53AF28-A282-4FB0-A769-EAEA9769C02A}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment