Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-center-auto
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
data-center-auto
Commits
0dad9369
Commit
0dad9369
authored
Jul 31, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
dba00e9e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
135 additions
and
17 deletions
+135
-17
ApiUtility.cs
AutoTurnOver.DB/ApiUtility.cs
+29
-1
daily.cs
AutoTurnOver.DB/daily.cs
+0
-0
report.cs
AutoTurnOver.DB/report.cs
+5
-0
api_pps_sku_status_response_dto.cs
...TurnOver.Models/ApiDto/api_pps_sku_status_response_dto.cs
+39
-0
AverageTargetBackgrounService.cs
...r.Purchase.AverageTarget/AverageTargetBackgrounService.cs
+8
-1
Program.cs
AutoTurnOver.Purchase.AverageTarget/Program.cs
+6
-2
appsettings.dev.json
AutoTurnOver.Purchase.AverageTarget/appsettings.dev.json
+2
-1
appsettings.json
AutoTurnOver.Purchase.AverageTarget/appsettings.json
+2
-1
appsettings.prod.json
AutoTurnOver.Purchase.AverageTarget/appsettings.prod.json
+3
-1
CommonServices.cs
AutoTurnOver.Services/CommonServices.cs
+5
-0
CommonController.cs
AutoTurnOver/Controllers/CommonController.cs
+6
-0
DailyController.cs
AutoTurnOver/Controllers/DailyController.cs
+22
-6
Program.cs
ResetOutofstock/Program.cs
+1
-1
appsettings.dev.json
ResetOutofstock/appsettings.dev.json
+2
-1
appsettings.json
ResetOutofstock/appsettings.json
+2
-1
appsettings.prod.json
ResetOutofstock/appsettings.prod.json
+3
-1
No files found.
AutoTurnOver.DB/ApiUtility.cs
View file @
0dad9369
...
...
@@ -74,7 +74,35 @@ namespace AutoTurnOver.DB
}
public
static
List
<
LmsShipLogisticsDto
>
RealTimeShipLogisticsCompanyList
()
{
return
RealTimeShipLogisticsList
().
GroupBy
(
s
=>
new
{
s
.
Company_Code
}).
Select
(
s
=>
new
LmsShipLogisticsDto
{
Company_Code
=
s
.
Key
.
Company_Code
,
Company_Name
=
s
.
Max
(
v
=>
v
.
Company_Name
)}).
ToList
();
return
RealTimeShipLogisticsList
().
GroupBy
(
s
=>
new
{
s
.
Company_Code
}).
Select
(
s
=>
new
LmsShipLogisticsDto
{
Company_Code
=
s
.
Key
.
Company_Code
,
Company_Name
=
s
.
Max
(
v
=>
v
.
Company_Name
)
}).
ToList
();
}
/// <summary>
/// 抓取sku 刊登状态
/// </summary>
/// <returns></returns>
public
static
List
<
api_pps_sku_status_response_dto
.
sku_dto
>
GetPPSSkuStatus
(
api_pps_sku_status_request_dto
data
)
{
try
{
//查询采购建议明细
string
url
=
ConfigHelper
.
GetValue
(
"PPSSkuStatus"
);
string
resultStr
=
HttpHelper
.
Request
(
url
,
RequestType
.
POST
,
data
.
ToJson
(),
"application/json"
,
timeout
:
1000
*
60
*
60
*
24
);
var
result
=
resultStr
.
ToObj
<
api_pps_sku_status_response_dto
>();
if
(
result
==
null
)
{
return
new
List
<
api_pps_sku_status_response_dto
.
sku_dto
>()
{
};
}
else
{
return
result
.
result
;
}
}
catch
(
Exception
ex
)
{
throw
new
Exception
(
"pps sku 刊登状态接口异常: "
+
ex
.
Message
);
throw
new
Exception
(
"pps sku 刊登状态接口异常: "
+
ex
.
StackTrace
);
}
}
}
}
AutoTurnOver.DB/daily.cs
View file @
0dad9369
This diff is collapsed.
Click to expand it.
AutoTurnOver.DB/report.cs
View file @
0dad9369
...
...
@@ -2581,6 +2581,11 @@ where 1=1
public
static
List
<
platform_type_website_dto
>
PlatformtypeWebsiteList
(
string
platform_type
)
{
return
_connection
.
Query
<
platform_type_website_dto
>(
" select DISTINCT platform_type,website from dc_base_oms_order "
).
AsList
();
}
public
static
List
<
string
>
BrandList
()
{
return
_connection
.
Query
<
string
>(
" SELECT DISTINCT brand FROM `dc_base_sku` "
).
AsList
();
}
}
}
...
...
AutoTurnOver.Models/ApiDto/api_pps_sku_status_response_dto.cs
0 → 100644
View file @
0dad9369
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
AutoTurnOver.Models.ApiDto
{
/// <summary>
/// sku 刊登状态
/// </summary>
public
class
api_pps_sku_status_response_dto
{
public
List
<
sku_dto
>
result
{
get
;
set
;
}
public
class
sku_dto
{
public
string
sku
{
get
;
set
;
}
/// <summary>
/// 平台
/// </summary>
public
string
platformDesc
{
get
;
set
;
}
/// <summary>
/// 站点
/// </summary>
public
string
site
{
get
;
set
;
}
/// <summary>
/// 状态 【上架 下架】
/// </summary>
public
string
statusDesc
{
get
;
set
;
}
}
}
public
class
api_pps_sku_status_request_dto
{
public
List
<
string
>
sku
{
get
;
set
;
}
}
}
AutoTurnOver.Purchase.AverageTarget/AverageTargetBackgrounService.cs
View file @
0dad9369
using
AutoTurnOver.Services
;
using
AutoTurnOver.DB
;
using
AutoTurnOver.Services
;
using
Microsoft.Extensions.Hosting
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -24,6 +25,12 @@ namespace AutoTurnOver.Purchase.AverageTarget
{
var
now
=
DateTime
.
Now
;
// 判断是不是指定的时间
if
(
now
.
Hour
==
23
&&
now
.
Minute
==
58
)
{
Console
.
WriteLine
(
$"开始同步sku刊登状态,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
daily
.
SynchroPPSSkuStatus
();
Console
.
WriteLine
(
$"结束同步sku刊登状态,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
23
&&
now
.
Minute
==
59
)
{
Console
.
WriteLine
(
$"开始采购平均值统计任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
...
...
AutoTurnOver.Purchase.AverageTarget/Program.cs
View file @
0dad9369
using
AutoTurnOver.Services
;
using
AutoTurnOver.DB
;
using
AutoTurnOver.Services
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Hosting
;
using
System
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
AutoTurnOver.Purchase.AverageTarget
...
...
@@ -20,7 +22,9 @@ namespace AutoTurnOver.Purchase.AverageTarget
{
Console
.
WriteLine
(
"采购平均值计算任务启动..."
);
// 创建采购计划
PurchaseAverageTargetServices
.
Calculation
();
Console
.
WriteLine
(
$"开始同步sku刊登状态,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
daily
.
SynchroPPSSkuStatus
();
Console
.
WriteLine
(
$"结束同步sku刊登状态,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
{
...
...
AutoTurnOver.Purchase.AverageTarget/appsettings.dev.json
View file @
0dad9369
{
"ConnectionStrings"
:
{
"Default"
:
"server=gz-cdb-kp7s5i79.sql.tencentcdb.com;port=61691;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
}
},
"PPSSkuStatus"
:
"http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
AutoTurnOver.Purchase.AverageTarget/appsettings.json
View file @
0dad9369
{
"ConnectionStrings"
:
{
"Default"
:
"server=10.0.8.15;port=3306;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
}
},
"PPSSkuStatus"
:
"http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
AutoTurnOver.Purchase.AverageTarget/appsettings.prod.json
View file @
0dad9369
{
"ConnectionStrings"
:
{
"Default"
:
"server=10.0.8.15;port=3306;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
}
},
"PPSSkuStatus"
:
"http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
\ No newline at end of file
AutoTurnOver.Services/CommonServices.cs
View file @
0dad9369
...
...
@@ -32,6 +32,11 @@ namespace AutoTurnOver.Services
public
List
<
purchase_user_dto
>
SearchPurchaseUser
(
string
name
)
{
return
DB
.
common
.
SearchPurchaseUser
(
name
);
}
public
List
<
string
>
BrandList
()
{
return
report
.
BrandList
();
}
...
...
AutoTurnOver/Controllers/CommonController.cs
View file @
0dad9369
...
...
@@ -175,6 +175,12 @@ namespace AutoTurnOver.Controllers
var
datas
=
ApiServices
.
PlatformtypeWebsiteList
(
platform_type
);
return
new
JsonResult
(
datas
);
}
public
JsonResult
BrandList
()
{
var
datas
=
new
CommonServices
().
BrandList
();
return
new
JsonResult
(
datas
);
}
/// <summary>
/// crm 自定义出信模板
...
...
AutoTurnOver/Controllers/DailyController.cs
View file @
0dad9369
...
...
@@ -62,14 +62,14 @@ namespace AutoTurnOver.Controllers
/// <returns></returns>
[
UseAction
]
public
JsonResult
RealtimeList
(
int
?
monitor_status
,
int
?
searchType
,
string
key_words
,
string
warehousecode
,
string
buyer_name
,
string
supplier_name
,
int
offset
,
int
limit
,
string
order
,
string
sort
,
string
warehousetype
,
int
?
warehousearea
,
int
?
has_tort
=
null
,
string
categoryIds
=
null
,
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
)
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
)
{
try
{
var
services
=
new
DailyServices
();
var
total
=
0
;
var
list
=
services
.
RealtimeList
(
monitor_status
,
searchType
,
key_words
,
warehousecode
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
order
:
order
,
sort
:
sort
,
has_tort
:
has_tort
,
categoryIds
:
categoryIds
,
buyer_name
:
buyer_name
,
start_date
:
start_date
,
end_date
:
end_date
,
f_start_date
:
f_start_date
,
f_end_date
:
f_end_date
,
product_type
:
product_type
);
var
list
=
services
.
RealtimeList
(
monitor_status
,
searchType
,
key_words
,
warehousecode
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
order
:
order
,
sort
:
sort
,
has_tort
:
has_tort
,
categoryIds
:
categoryIds
,
buyer_name
:
buyer_name
,
start_date
:
start_date
,
end_date
:
end_date
,
f_start_date
:
f_start_date
,
f_end_date
:
f_end_date
,
product_type
:
product_type
);
return
new
JsonResult
(
new
{
...
...
@@ -89,7 +89,7 @@ namespace AutoTurnOver.Controllers
}
public
JsonResult
RealtimeListSumFooter
(
int
?
monitor_status
,
int
?
searchType
,
string
key_words
,
string
warehousecode
,
string
buyer_name
,
string
supplier_name
,
int
offset
,
int
limit
,
string
order
,
string
sort
,
string
warehousetype
,
int
?
warehousearea
,
int
?
has_tort
=
null
,
string
categoryIds
=
null
,
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
)
DateTime
?
start_date
=
null
,
DateTime
?
end_date
=
null
,
DateTime
?
f_start_date
=
null
,
DateTime
?
f_end_date
=
null
,
int
?
product_type
=
null
)
{
var
services
=
new
DailyServices
();
...
...
@@ -114,7 +114,7 @@ namespace AutoTurnOver.Controllers
{
var
services
=
new
DailyServices
();
var
total
=
0
;
var
list
=
services
.
ShortagePushList
(
platform
,
bailun_sku
,
offset
,
limit
,
ref
total
,
start_date
,
end_date
,
warehousecode
,
warehousetype
,
warehousearea
);
var
list
=
services
.
ShortagePushList
(
platform
,
bailun_sku
,
offset
,
limit
,
ref
total
,
start_date
,
end_date
,
warehousecode
,
warehousetype
,
warehousearea
);
return
new
JsonResult
(
new
{
rows
=
list
,
...
...
@@ -228,12 +228,28 @@ namespace AutoTurnOver.Controllers
}
public
JsonResult
GetListingStatusPage
(
int
offset
,
int
limit
,
string
order
,
string
sort
,
DateTime
?
end_date
,
DateTime
?
start_date
,
string
brand
,
int
?
has_tort
,
int
?
listing_status
,
int
?
warehousearea
,
int
?
source
,
string
warehousetype
,
string
warehouse_cod
e
)
DateTime
?
end_date
,
DateTime
?
start_date
,
string
brand
,
int
?
has_tort
,
int
?
listing_status
,
int
?
warehousearea
,
int
?
source
,
string
warehousetype
,
string
warehouse_code
,
int
?
product_typ
e
)
{
try
{
var
services
=
new
StockMonitorService
();
var
page_data
=
services
.
GetListingStatusPage
(
new
listing_status_view_search_dto
{
warehouse_code
=
warehouse_code
,
warehousetype
=
warehousetype
,
source
=
source
,
warehousearea
=
warehousearea
,
listing_status
=
listing_status
,
brand
=
brand
,
has_tort
=
has_tort
,
page
=
offset
+
1
,
rows
=
limit
,
sidx
=
sort
,
sord
=
order
,
start_date
=
start_date
,
end_date
=
end_date
});
var
page_data
=
services
.
GetListingStatusPage
(
new
listing_status_view_search_dto
{
product_type
=
product_type
,
source
=
source
,
warehouse_code
=
warehouse_code
,
warehousetype
=
warehousetype
,
warehousearea
=
warehousearea
,
listing_status
=
listing_status
,
brand
=
brand
,
has_tort
=
has_tort
,
page
=
offset
+
1
,
rows
=
limit
,
sidx
=
sort
,
sord
=
order
,
start_date
=
start_date
,
end_date
=
end_date
});
return
new
JsonResult
(
new
{
...
...
ResetOutofstock/Program.cs
View file @
0dad9369
...
...
@@ -23,7 +23,7 @@ namespace ResetOutofstock
// throw;
//}
report
.
ResetCashFlowData
();
//
report.ResetCashFlowData();
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
...
...
ResetOutofstock/appsettings.dev.json
View file @
0dad9369
...
...
@@ -10,5 +10,6 @@
"Defaultdatabase"
:
"0"
},
"WipStockUrl"
:
"http://mjzz.bailuntec.com/api/FullStockPageList"
,
"Lms_GetLogistics"
:
"http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics"
:
"http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
,
"PPSSkuStatus"
:
"http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
ResetOutofstock/appsettings.json
View file @
0dad9369
...
...
@@ -11,5 +11,6 @@
},
"PPS_ShortagePush"
:
"http://bltpro.bailuntec.com/api/EbayTask/PushSkuEditQtyTask"
,
"WipStockUrl"
:
"http://mjzz.bailuntec.com/api/FullStockPageList"
,
"Lms_GetLogistics"
:
"http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics"
:
"http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
,
"PPSSkuStatus"
:
"http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
ResetOutofstock/appsettings.prod.json
View file @
0dad9369
...
...
@@ -10,5 +10,6 @@
"Defaultdatabase"
:
0
},
"WipStockUrl"
:
"http://mjzz.bailuntec.com/api/FullStockPageList"
,
"Lms_GetLogistics"
:
"http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics"
:
"http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
,
"PPSSkuStatus"
:
"http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
\ No newline at end of file
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