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
8291a44f
Commit
8291a44f
authored
Jun 14, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加Ebay 订单流水,增加itemid搜索
parent
3af74199
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
382 additions
and
32 deletions
+382
-32
HttpHelper.cs
Bailun.DC.Common/HttpHelper.cs
+9
-1
dc_base_oms_order.cs
Bailun.DC.Models/Orders/dc_base_oms_order.cs
+4
-1
OrdersServices.cs
Bailun.DC.Services/OrdersServices.cs
+40
-5
OrdersController.cs
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
+99
-3
ListEbayOrder.cshtml
...un.DC.Web/Areas/Reports/Views/Orders/ListEbayOrder.cshtml
+187
-0
Bailun.DC.Web.csproj
Bailun.DC.Web/Bailun.DC.Web.csproj
+1
-0
HomeController.cs
Bailun.DC.Web/Controllers/HomeController.cs
+35
-0
Index.cshtml
Bailun.DC.Web/Pages/Index.cshtml
+0
-0
_MainLayout.cshtml
Bailun.DC.Web/Pages/Shared/_MainLayout.cshtml
+1
-1
_MainLayout2.cshtml
Bailun.DC.Web/Pages/Shared/_MainLayout2.cshtml
+1
-1
Main.cshtml
Bailun.DC.Web/Views/Home/Main.cshtml
+0
-0
common.js
Bailun.DC.Web/wwwroot/js/common.js
+5
-20
No files found.
Bailun.DC.Common/HttpHelper.cs
View file @
8291a44f
...
...
@@ -45,13 +45,21 @@ namespace Bailun.DC.Common
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public
static
string
Request
(
string
url
,
RequestType
type
=
RequestType
.
GET
,
string
data
=
null
,
string
host
=
null
)
public
static
string
Request
(
string
url
,
string
[]
header_name
=
null
,
string
[]
header_value
=
null
,
RequestType
type
=
RequestType
.
GET
,
string
data
=
null
,
string
host
=
null
)
{
HttpWebRequest
httpRequest
=
(
HttpWebRequest
)
HttpWebRequest
.
Create
(
url
);
//建立HttpWebRequest對象
httpRequest
.
Timeout
=
600000
;
//定義服務器超時時間
httpRequest
.
UserAgent
=
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36"
;
httpRequest
.
Accept
=
"*"
;
if
(
header_name
!=
null
&&
header_value
!=
null
&&
header_name
.
Length
>
0
&&
header_value
.
Length
>
0
)
{
for
(
var
i
=
0
;
i
<
header_name
.
Length
;
i
++)
{
httpRequest
.
Headers
.
Add
(
header_name
[
i
],
header_value
[
i
]);
}
}
if
(!
string
.
IsNullOrEmpty
(
host
))
{
SetHeaderValue
(
httpRequest
.
Headers
,
"Host"
,
host
);
...
...
Bailun.DC.Models/Orders/dc_base_oms_order.cs
View file @
8291a44f
...
...
@@ -423,6 +423,9 @@ namespace Bailun.DC.Models.Orders
/// </summary>
public
decimal
cost_logistics
{
get
;
set
;
}
/// <summary>
/// OMS算出的利润
/// </summary>
public
decimal
profit_oms
{
get
;
set
;
}
}
}
Bailun.DC.Services/OrdersServices.cs
View file @
8291a44f
...
...
@@ -460,10 +460,10 @@ namespace Bailun.DC.Services
/// <param name="sku">sku编码</param>
/// <param name="total">符合条件的记录数</param>
/// <returns></returns>
public
List
<
Models
.
Orders
.
dc_base_oms_order
>
ListOrders
(
BtTableParameter
parameter
,
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
sku
,
int
?
companyid
,
ref
int
total
)
public
List
<
Models
.
Orders
.
dc_base_oms_order
>
ListOrders
(
BtTableParameter
parameter
,
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
sku
,
int
?
companyid
,
ref
int
total
,
string
itemid
=
null
)
{
var
sqlparam
=
new
DynamicParameters
();
var
sql
=
"select t1.origin_order_id,t1.
platform_type,t1.website,t1.seller_account,t1.platform_order_type,t1.bailun_order_status,t1.bailun_payment_status,t1.bailun_shipping_status,t1.order_currency,(t1.amount_total*t1.seller_order_exchange_rate) amount_total,(t1.amount_shipping*t1.seller_order_exchange_rate) amount_shipping,(t1.amount_product*t1.seller_order_exchange_rate) amount_product,(t1.amount_adjustment*t1.seller_order_exchange_rate) amount_adjustment,(t1.cost_promotion*t1.seller_order_exchange_rate) cost_promotion,((if(t1.platform_type='Ebay',t1.seller_other_exchange_rate,t1.seller_order_exchange_rate))*t1.cost_platform_fee) cost_platform_fee,t1.cost_product,t1.cost_first,t1.cost_package,(t1.cost_fba_fee*t1.seller_order_exchange_rate) cost_fba_fee,t1.cost_total,(t1.profit_total) profit_total,t1.profit_rate,t1.create_time,t1.order_update_time
from dc_base_oms_order t1"
;
var
sql
=
"select t1.origin_order_id,t1.
bailun_order_id,t1.platform_type,t1.website,t1.seller_account,t1.platform_order_type,t1.bailun_order_status,t1.bailun_payment_status,t1.bailun_shipping_status,t1.order_currency,(t1.amount_total*t1.seller_order_exchange_rate) amount_total,(t1.amount_shipping*t1.seller_order_exchange_rate) amount_shipping,(t1.amount_product*t1.seller_order_exchange_rate) amount_product,(t1.amount_adjustment*t1.seller_order_exchange_rate) amount_adjustment,(t1.cost_promotion*t1.seller_order_exchange_rate) cost_promotion,((if(t1.platform_type='Ebay',t1.seller_other_exchange_rate,t1.seller_order_exchange_rate))*t1.cost_platform_fee) cost_platform_fee,t1.cost_product,t1.cost_first,t1.cost_package,(t1.cost_fba_fee*t1.seller_order_exchange_rate) cost_fba_fee,t1.cost_total,(t1.profit_total) profit_total,t1.profit_rate,t1.create_time,t1.order_update_time,t1.profit_oms
from dc_base_oms_order t1"
;
var
strwhere
=
" where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 "
;
...
...
@@ -510,6 +510,12 @@ namespace Bailun.DC.Services
sqlparam
.
Add
(
"bailun_sku"
,
sku
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
itemid
))
{
sql
+=
" join dc_base_oms_platform_sku t3 on t1.bailun_order_id=t3.bailun_order_id and t3.item_id=@itemid"
;
sqlparam
.
Add
(
"itemid"
,
itemid
);
}
if
(
start
.
HasValue
)
{
strwhere
+=
" and t1.paid_time>=@paid_time_start"
;
...
...
@@ -564,10 +570,10 @@ namespace Bailun.DC.Services
/// <param name="orderno">平台单号</param>
/// <param name="sku">sku编码</param>
/// <returns></returns>
public
Models
.
Orders
.
dc_base_oms_order
ListOrdersCount
(
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
sku
,
int
?
companyid
)
public
Models
.
Orders
.
dc_base_oms_order
ListOrdersCount
(
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
sku
,
int
?
companyid
,
string
itemid
=
null
)
{
var
sqlparam
=
new
DynamicParameters
();
var
sql
=
"select sum(t1.amount_total*
seller_order_exchange_rate) amount_total,sum(t1.amount_shipping*seller_order_exchange_rate) amount_shipping,sum(t1.amount_product*seller_order_exchange_rate) amount_product,sum(t1.amount_adjustment*seller_order_exchange_rate) amount_adjustment,sum(t1.cost_promotion*seller_order_exchange_rate) cost_promotion,sum((if(t1.platform_type='FBA',t1.seller_other_exchange_rate,t1.seller_order_exchange_rate))*t1.cost_platform_fee) cost_platform_fee,sum(t1.cost_product) cost_product,sum(t1.cost_first) cost_first,sum(t1.cost_package) cost_package,sum(t1.cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(t1.cost_total) cost_total,sum(t1.profit_total) profit_total
from dc_base_oms_order t1"
;
var
sql
=
"select sum(t1.amount_total*
t1.seller_order_exchange_rate) amount_total,sum(t1.amount_shipping*t1.seller_order_exchange_rate) amount_shipping,sum(t1.amount_product*t1.seller_order_exchange_rate) amount_product,sum(t1.amount_adjustment*t1.seller_order_exchange_rate) amount_adjustment,sum(t1.cost_promotion*t1.seller_order_exchange_rate) cost_promotion,sum((if(t1.platform_type='FBA',t1.seller_other_exchange_rate,t1.seller_order_exchange_rate))*t1.cost_platform_fee) cost_platform_fee,sum(t1.cost_product) cost_product,sum(t1.cost_first) cost_first,sum(t1.cost_package) cost_package,sum(t1.cost_fba_fee*t1.seller_order_exchange_rate) cost_fba_fee,sum(t1.cost_total) cost_total,sum(t1.profit_total) profit_total,sum(t1.profit_oms) profit_oms
from dc_base_oms_order t1"
;
var
strwhere
=
" where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 "
;
...
...
@@ -614,6 +620,12 @@ namespace Bailun.DC.Services
sqlparam
.
Add
(
"bailun_sku"
,
sku
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
itemid
))
{
sql
+=
" join dc_base_oms_platform_sku t3 on t1.bailun_order_id=t3.bailun_order_id and t3.item_id=@itemid"
;
sqlparam
.
Add
(
"itemid"
,
itemid
);
}
if
(
start
.
HasValue
)
{
strwhere
+=
" and t1.paid_time>=@paid_time_start"
;
...
...
@@ -2265,7 +2277,30 @@ namespace Bailun.DC.Services
return
cn
.
Query
<
Models
.
Ebay
.
dc_ebay_report_uk_config
>(
"select * from dc_ebay_report_uk_config where type>0"
).
AsList
();
}
}
/// <summary>
/// 获取Ebay订单的Itemid
/// </summary>
/// <param name="orderid">订单号列表</param>
/// <returns></returns>
public
List
<
dc_base_oms_platform_sku
>
GetOrderItemId
(
List
<
string
>
orderid
)
{
var
sql
=
"select bailun_order_id,GROUP_CONCAT(item_id) as item_id from dc_base_oms_platform_sku where bailun_order_id in ('"
+
string
.
Join
(
"','"
,
orderid
)+
"') group by bailun_order_id;"
;
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
list
=
new
List
<
Tuple
<
string
,
string
>>();
var
obj
=
cn
.
Query
<
dc_base_oms_platform_sku
>(
sql
);
return
obj
.
ToList
();
}
}
#
endregion
#
region
退款单
...
...
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
View file @
8291a44f
...
...
@@ -598,8 +598,16 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
[
HttpPost
]
public
JsonResult
PlatformProfitCountJson
(
string
platform
,
DateTime
?
start
,
DateTime
?
end
,
DateTime
?
shipstart
,
DateTime
?
shipend
,
string
currency
)
{
var
companyid
=
HttpContextHelper
.
Current
?.
User
?.
GetCompanyId
().
ToInt32
();
var
companyid
=
0
;
var
cookie
=
HttpContext
.
Request
.
Cookies
[
"token"
];
var
user
=
Common
.
HttpHelper
.
NetHelper
.
Request
(
"http://sso.bailuntec.com/GetUserResource"
,
new
string
[]
{
"Authorization"
},
new
string
[]
{
(
cookie
!=
null
?
cookie
:
""
)
});
var
json
=
Newtonsoft
.
Json
.
Linq
.
JObject
.
Parse
(
user
);
if
(
json
[
"statusCode"
].
ToStr
()
==
"200"
&&
json
[
"result"
][
"success"
].
ToString
().
ToLower
()
==
"true"
)
{
int
.
TryParse
(
json
[
"result"
][
"Company"
][
"Id"
].
ToString
(),
out
companyid
);
}
var
result
=
new
List
<
Models
.
Orders
.
dc_base_oms_sku
>();
if
(
shipstart
.
HasValue
||
shipend
.
HasValue
)
...
...
@@ -661,7 +669,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}).
ToList
();
var
objEbay
=
list
.
Where
(
a
=>
a
.
platform_type
==
"Ebay"
).
FirstOrDefault
();
if
(
objEbay
!=
null
)
if
(
objEbay
!=
null
&&
list
.
Count
>
3
)
{
list
.
Remove
(
objEbay
);
list
.
Insert
(
3
,
objEbay
);
...
...
@@ -1254,6 +1262,94 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
});
}
/// <summary>
/// Ebay订单流水,按itemid进行搜索
/// </summary>
/// <returns></returns>
public
ActionResult
ListEbayOrder
()
{
return
View
();
}
/// <summary>
/// Ebay订单流水数据
/// </summary>
/// <param name="parameter">分页信息</param>
/// <param name="account">帐号</param>
/// <param name="website">站点</param>
/// <param name="start">付款开始时间</param>
/// <param name="end">付款结束时间</param>
/// <param name="orderno">平台订单号</param>
/// <param name="sku">sku编码</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
public
string
ListEbayOrderJson
(
BtTableParameter
parameter
,
string
account
,
string
website
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
sku
,
string
itemid
)
{
var
companyid
=
HttpContextHelper
.
Current
?.
User
?.
GetCompanyId
().
ToInt32
();
var
total
=
0
;
var
service
=
new
Services
.
OrdersServices
();
var
obj
=
service
.
ListOrders
(
parameter
,
"Ebay"
,
website
,
account
,
start
,
end
,
orderno
,
sku
,
companyid
,
ref
total
,
itemid
);
var
objItemid
=
service
.
GetOrderItemId
(
obj
.
Select
(
a
=>
a
.
bailun_order_id
).
ToList
());
var
countM
=
service
.
ListOrdersCount
(
"Ebay"
,
website
,
account
,
start
,
end
,
orderno
,
sku
,
companyid
,
itemid
);
countM
.
amount_adjustment
=
Math
.
Round
(
countM
.
amount_adjustment
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
amount_gift_wrap
=
Math
.
Round
(
countM
.
amount_gift_wrap
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
amount_product
=
Math
.
Round
(
countM
.
amount_product
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
amount_refund
=
Math
.
Round
(
countM
.
amount_refund
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
amount_shipping
=
Math
.
Round
(
countM
.
amount_shipping
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
amount_tax
=
Math
.
Round
(
countM
.
amount_tax
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
amount_total
=
Math
.
Round
(
countM
.
amount_total
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_estimate_logistics
=
Math
.
Round
(
countM
.
cost_estimate_logistics
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_fba_fee
=
Math
.
Round
(
countM
.
cost_fba_fee
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_first
=
Math
.
Round
(
countM
.
cost_first
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_package
=
Math
.
Round
(
countM
.
cost_package
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_paypal_fee
=
Math
.
Round
(
countM
.
cost_paypal_fee
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_platform_fee
=
Math
.
Round
(
countM
.
cost_platform_fee
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_product
=
Math
.
Round
(
countM
.
cost_product
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_promotion
=
Math
.
Round
(
countM
.
cost_promotion
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_refund_commisson
=
Math
.
Round
(
countM
.
cost_refund_commisson
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_shipping
=
Math
.
Round
(
countM
.
cost_shipping
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
cost_total
=
Math
.
Round
(
countM
.
cost_total
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
profit_total
=
Math
.
Round
(
countM
.
profit_total
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
profit_oms
=
Math
.
Round
(
countM
.
profit_oms
,
2
,
MidpointRounding
.
AwayFromZero
);
countM
.
website
=
"总计:"
;
var
list
=
obj
.
Select
(
p
=>
new
{
p
.
origin_order_id
,
p
.
platform_type
,
p
.
website
,
p
.
seller_account
,
p
.
platform_order_type
,
p
.
bailun_order_status
,
p
.
bailun_payment_status
,
p
.
bailun_shipping_status
,
p
.
order_currency
,
amount_total
=
p
.
amount_total
>
0
?
p
.
amount_total
.
ToString
(
"N2"
)
:
"0"
,
amount_shipping
=
p
.
amount_shipping
>
0
?
p
.
amount_shipping
.
ToString
(
"N2"
)
:
"0"
,
amount_product
=
p
.
amount_product
>
0
?
p
.
amount_product
.
ToString
(
"N2"
)
:
"0"
,
amount_adjustment
=
p
.
amount_adjustment
>
0
?
p
.
amount_adjustment
.
ToString
(
"N2"
)
:
"0"
,
cost_promotion
=
p
.
cost_promotion
>
0
?
p
.
cost_promotion
.
ToString
(
"N2"
)
:
"0"
,
cost_platform_fee
=
p
.
cost_platform_fee
>
0
?
p
.
cost_platform_fee
.
ToString
(
"N2"
)
:
"0"
,
cost_product
=
p
.
cost_product
>
0
?
p
.
cost_product
.
ToString
(
"N2"
)
:
"0"
,
cost_first
=
p
.
cost_first
>
0
?
p
.
cost_first
.
ToString
(
"N2"
)
:
"0"
,
cost_package
=
p
.
cost_package
>
0
?
p
.
cost_package
.
ToString
(
"N2"
)
:
"0"
,
cost_fba_fee
=
p
.
cost_fba_fee
>
0
?
p
.
cost_fba_fee
.
ToString
(
"N2"
)
:
"0"
,
cost_total
=
p
.
cost_total
>
0
?
p
.
cost_total
.
ToString
(
"N2"
)
:
"0"
,
profit_total
=
p
.
profit_total
>
0
?
p
.
profit_total
.
ToString
(
"N2"
)
:
"0"
,
create_time
=
p
.
create_time
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
order_update_time
=
p
.
order_update_time
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
p
.
salecount
,
profit_rate
=
((
p
.
profit_oms
/
p
.
amount_total
)
*
100
).
ToString
(
"N2"
),
item_id
=
objItemid
.
Where
(
a
=>
a
.
bailun_order_id
==
p
.
bailun_order_id
).
FirstOrDefault
()?.
item_id
,
profit_oms
=
p
.
profit_oms
.
ToString
(
"N2"
)
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
,
count_row
=
countM
});
}
#
endregion
#
region
订单退款明细
...
...
Bailun.DC.Web/Areas/Reports/Views/Orders/ListEbayOrder.cshtml
0 → 100644
View file @
8291a44f
@{
ViewData["Title"] = "Ebay所有订单流水";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
ViewBag.Nav = new string[] { "统计", "Ebay", "所有订单流水" };
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
<input id="platform" name="platform" type="hidden" value="@ViewBag.platform" />
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>站点:</label>
<select id="website" name="website" class="form-control">
<option value="">选择站点</option>
</select>
</div>
<div class="form-group">
<label>销售帐号:</label>
<select id="account" name="account" class="form-control" style="width:160px;">
<option value="">选择帐号</option>
</select>
</div>
<div class="form-group">
<label>付款时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"))" />
<span>至</span>
<input id="end" name="end" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" />
</div>
<div class="form-group">
<label> </label>
<input id="itemid" name="itemid" class="form-control" style="width:130px;" placeholder="itemid" />
</div>
<div class="form-group">
<label> </label>
<input id="orderno" name="orderno" class="form-control" style="width:130px;" placeholder="平台订单号" />
</div>
<div class="form-group">
<label> </label>
<input id="sku" name="sku" class="form-control" style="width:130px;" placeholder="sku编码" />
</div>
<div class="form-group">
<label> </label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</button>
</div>
</div>
</form>
</div>
<div class="ibox-content m-b-sm border-bottom">
<table id="roletable" style="table-layout:fixed;"></table>
</div>
</div>
</div>
@section css{
<link href="~/css/bootstrap-table-fixed-columns.css" rel="stylesheet" />
<style>
.mules {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
}
@section scripts{
<script src="~/js/bootstrap-table-fixed-columns.js" type="text/javascript"></script>
<script type="text/javascript">
var tb;
$(document).ready(function () {
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
var height = document.body.clientHeight;
$("#roletable").attr("data-height", (height - 170));
list();
listAccount();
listWebsite();
})
function list() {
var columns = [
{
field: 'origin_order_id', title: '平台订单号', width: '220', sortable: true, formatter: function (idx, data) {
return '<div class="mules" title="' + data.origin_order_id + '">' + data.origin_order_id + '</div>';
}
},
{
field: 'item_id', title: 'itemid', width: '200', sortable: true, formatter: function (idx, data) {
return '<div class="mules" title="' + data.item_id + '">' + data.item_id + '</div>';
}
},
{ field: 'website', title: '平台站点', width: '90', sortable: true, iscount: true },
{
field: 'seller_account', title: '卖家帐号', width: '160', sortable: true, formatter: function (idx, data) {
return '<div class="mules" title="' + data.seller_account + '">' + data.seller_account+'</div>';
}
},
{ field: 'bailun_order_status', title: '订单状态', width: '100', sortable: true },
{ field: 'bailun_payment_status', title: '付款状态', width: '100', sortable: true },
{ field: 'bailun_shipping_status', title: '发货状态', width: '110', sortable: true },
{ field: 'order_currency', title: '币种', width: '80', sortable: true },
{ field: 'amount_total', title: '订单总金额', width: '120', sortable: true, iscount: true },
{ field: 'amount_shipping', title: '运费', width: '80', sortable: true, iscount: true },
{ field: 'amount_product', title: '商品金额', width: '100', sortable: true, iscount: true },
{ field: 'amount_adjustment', title: '调整金额', width: '100', sortable: true, iscount: true },
{ field: 'cost_promotion', title: '促销费', width: '90', sortable: true, iscount: true },
{ field: 'cost_platform_fee', title: '平台费', width: '90', sortable: true, iscount: true },
{ field: 'cost_product', title: '产品成本', width: '100', sortable: true, iscount: true },
{ field: 'cost_first', title: '头程费', width: '90', sortable: true, iscount: true },
{ field: 'cost_package', title: '包装费', width: '90', sortable: true, iscount: true },
{ field: 'cost_total', title: '总支出', width: '90', sortable: true, iscount: true },
{ field: 'salecount', title: '销售数量', width: '100', sortable: false, iscount: true },
{ field: 'profit_oms', title: '利润', width: '100', sortable: true, iscount: true },
//{ field: 'profit_rate', title: '利润率', width: '100', sortable: true },
{ field: 'create_time', title: '创建时间', width: '140', sortable: true },
{ field: 'order_update_time', title: '更新时间', width: '140', sortable: true }
];
var url = '@Url.Content("~/Reports/Orders/ListEbayOrderJson")' + '?' + $("#toolbar").serialize();
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
showfooter: true, loadsuccess: function (d) {
//替换汇总行的相关列值
var tr = $('.fixed-table-footer').find('tr');
for (var c in columns) {
var key = columns[c].field;
if (columns[c].iscount) {
for (var v in d.count_row) {
if (key == v) {
tr.find('td').eq(c).children('div').first().html(d.count_row[v]);
break;
}
}
}
}
}
}, {
fixedcol: true,
fixedcolnum:1
});
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function listAccount() {
$.submit({
url: '@Url.Content("~/Reports/Orders/ListAccount")',
type:'POST',
paramData: 'platform=@(ViewBag.platform)',
func: function (result) {
if (result != null && result != undefined) {
$('#account').html('<option value="">选择帐号</option>');
for (var i = 0; i < result.length; i++) {
$('#account').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
}
}
})
}
function listWebsite() {
$.submit({
url: '@Url.Content("~/Reports/Orders/ListWebSite")',
type:'POST',
paramData: 'platform=@(ViewBag.platform)',
func: function (result) {
if (result != null && result != undefined) {
$('#website').html('<option value="">选择站点</option>');
for (var i = 0; i < result.length; i++) {
$('#website').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
}
}
})
}
</script>
}
Bailun.DC.Web/Bailun.DC.Web.csproj
View file @
8291a44f
...
...
@@ -22,6 +22,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Bailun.DC.Common\Bailun.DC.Common.csproj" />
<ProjectReference Include="..\Bailun.DC.Models\Bailun.DC.Models.csproj" />
<ProjectReference Include="..\Bailun.DC.Services\Bailun.DC.Services.csproj" />
</ItemGroup>
...
...
Bailun.DC.Web/Controllers/HomeController.cs
View file @
8291a44f
...
...
@@ -17,6 +17,41 @@ namespace Bailun.DC.Web.Controllers
return
View
();
}
public
ActionResult
Main
()
{
var
companyid
=
-
1
;
var
departmentname
=
""
;
var
username
=
""
;
var
isAllCompany
=
0
;
//var user = Common.HttpHelper.NetHelper.Request("http://sso.bailuntec.com/GetUserResource");
var
cookie
=
HttpContext
.
Request
.
Cookies
[
"token"
];
var
user
=
Common
.
HttpHelper
.
NetHelper
.
Request
(
"http://sso.bailuntec.com/GetUserResource"
,
new
string
[]
{
"Authorization"
},
new
string
[]
{
(
cookie
!=
null
?
cookie
:
""
)});
var
json
=
Newtonsoft
.
Json
.
Linq
.
JObject
.
Parse
(
user
);
if
(
json
[
"statusCode"
].
ToStr
()
==
"200"
&&
json
[
"result"
][
"success"
].
ToString
().
ToLower
()
==
"true"
)
{
username
=
json
[
"result"
][
"Account"
].
ToString
();
isAllCompany
=
json
[
"result"
][
"AllCompany"
].
ToStr
().
ToLower
()
==
"false"
?
0
:
1
;
int
.
TryParse
(
json
[
"result"
][
"Company"
][
"Id"
].
ToString
(),
out
companyid
);
if
(
json
[
"result"
][
"Department"
].
ToString
()
!=
"null"
)
{
departmentname
=
json
[
"result"
][
"Department"
][
"Name"
].
ToStr
();
}
}
else
{
//HttpContext.Response.Cookies["token"].Expires.AddDays(-1);
}
ViewBag
.
companyid
=
companyid
;
ViewBag
.
allcompany
=
isAllCompany
;
ViewBag
.
username
=
username
;
ViewBag
.
departmentname
=
departmentname
;
return
View
();
}
[
HttpPost
]
public
JsonResult
ListWarehouseType
()
{
...
...
Bailun.DC.Web/Pages/Index.cshtml
View file @
8291a44f
This diff is collapsed.
Click to expand it.
Bailun.DC.Web/Pages/Shared/_MainLayout.cshtml
View file @
8291a44f
...
...
@@ -85,7 +85,7 @@
<script
src=
"/css/bootstrap-select-1.12.4/js/bootstrap-select.js"
></script>
<script
src=
"~/js/jquery.cookie.js"
type=
"text/javascript"
></script>
<!--常用js方法-->
<script
src=
"/js/common.js?=201906
06
001"
></script>
<script
src=
"/js/common.js?=201906
13
001"
></script>
@RenderSection("scripts", required: false)
<script
type=
"text/javascript"
>
...
...
Bailun.DC.Web/Pages/Shared/_MainLayout2.cshtml
View file @
8291a44f
...
...
@@ -106,7 +106,7 @@
<!--下拉选择搜索控件-->
<script
src=
"/css/bootstrap-select-1.12.4/js/bootstrap-select.js"
></script>
<!--常用js方法-->
<script
src=
"/css/js/common.js?=201906
06
001"
></script>
<script
src=
"/css/js/common.js?=201906
13
001"
></script>
@RenderSection("scripts", required: false)
<script
type=
"text/javascript"
>
...
...
Bailun.DC.Web/Views/Home/Main.cshtml
0 → 100644
View file @
8291a44f
This diff is collapsed.
Click to expand it.
Bailun.DC.Web/wwwroot/js/common.js
View file @
8291a44f
...
...
@@ -314,29 +314,14 @@ function login() {
else
{
token
=
$
.
cookie
(
'token'
);
if
(
token
==
undefined
)
{
if
(
token
==
''
||
token
==
undefined
||
token
==
null
)
{
window
.
location
=
"http://sso.bailuntec.com/?returnUrl="
+
baseUrl
;
return
false
;
}
}
}
$
.
submit
({
type
:
'POST'
,
url
:
baseUrl
+
'Home/GetUserInfo'
,
paramData
:
''
,
func
:
function
(
result
)
{
if
(
result
.
success
)
{
userid
=
result
.
userid
;
username
=
result
.
username
;
jobs
=
result
.
jobs
;
$
(
'#user-job'
).
html
(
jobs
);
$
(
'#user-name'
).
html
(
username
);
}
else
{
window
.
location
=
"http://sso.bailuntec.com/?returnUrl="
+
baseUrl
;
}
}
})
function
logout
()
{
$
.
removeCookie
(
'token'
);
window
.
location
=
"http://sso.bailuntec.com/?returnUrl="
+
baseUrl
;
}
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