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
d3ac2e29
Commit
d3ac2e29
authored
Jan 03, 2019
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化采购建议表字段,新增周转计算公式的记录
parent
51d128ba
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
13 deletions
+51
-13
db_config.cs
AutoTurnOver.DB/db_config.cs
+3
-3
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+10
-2
dc_auto_purchase_advise.cs
AutoTurnOver.Models/dc_auto_purchase_advise.cs
+30
-0
ReportServices.cs
AutoTurnOver.Services/ReportServices.cs
+7
-7
FolderProfile.pubxml
AutoTurnOver/Properties/PublishProfiles/FolderProfile.pubxml
+1
-1
No files found.
AutoTurnOver.DB/db_config.cs
View file @
d3ac2e29
...
@@ -24,7 +24,7 @@ namespace AutoTurnOver.DB
...
@@ -24,7 +24,7 @@ namespace AutoTurnOver.DB
try
try
{
{
var
sql
=
@"select * from dc_auto_config_safe_inventory as dacp "
;
var
sql
=
@"select * from dc_auto_config_safe_inventory as dacp
where 1=1
"
;
if
(
m
.
IsEffective
==
true
)
if
(
m
.
IsEffective
==
true
)
{
{
...
@@ -149,7 +149,7 @@ namespace AutoTurnOver.DB
...
@@ -149,7 +149,7 @@ namespace AutoTurnOver.DB
try
try
{
{
var
sql
=
@"select * from dc_auto_config_sales_upper_limit as dacp "
;
var
sql
=
@"select * from dc_auto_config_sales_upper_limit as dacp
where 1=1
"
;
if
(
m
.
IsEffective
==
true
)
if
(
m
.
IsEffective
==
true
)
{
{
...
@@ -172,7 +172,7 @@ namespace AutoTurnOver.DB
...
@@ -172,7 +172,7 @@ namespace AutoTurnOver.DB
return
obj
.
AsList
();
return
obj
.
AsList
();
}
}
catch
(
Exception
)
catch
(
Exception
ex
)
{
{
return
list
;
return
list
;
}
}
...
...
AutoTurnOver.DB/purchase_advise.cs
View file @
d3ac2e29
...
@@ -35,15 +35,23 @@ namespace AutoTurnOver.DB
...
@@ -35,15 +35,23 @@ namespace AutoTurnOver.DB
public
static
void
ImportDetailed
(
int
mainID
)
public
static
void
ImportDetailed
(
int
mainID
)
{
{
_connection
.
Execute
(
@"
_connection
.
Execute
(
@"
INSERT into dc_auto_purchase_advise_detailed(`bailun_sku`,`warehouse_code`,`quantity_init_advise`,`quantity_actual`,`main_id`)
INSERT into dc_auto_purchase_advise_detailed(`bailun_sku`,`warehouse_code`,`quantity_init_advise`,`quantity_actual`,`main_id`,
`forecast_formula`,`fit_forecast_formula`,`turnover_days`,`supplier_delivery`,`inspection_delivery`,`transfer_delivery`)
(
(
select
select
t1.bailun_sku,
t1.bailun_sku,
t1.warehouse_code,
t1.warehouse_code,
t1.quantity_final_advise as 'quantity_init_advise',
t1.quantity_final_advise as 'quantity_init_advise',
0 as 'quantity_actual',
0 as 'quantity_actual',
@main_id as 'main_id'
@main_id as 'main_id',
t2.forecast_formula as 'forecast_formula',
t2.fit_forecast_formula as 'fit_forecast_formula',
t1.turnover_days,
t1.supplier_delivery,
t1.inspection_delivery,
t1.transfer_delivery
from dc_auto_turnover as t1
from dc_auto_turnover as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
where t1.quantity_init_advise>0
where t1.quantity_init_advise>0
)
)
"
,
new
{
main_id
=
mainID
});
"
,
new
{
main_id
=
mainID
});
...
...
AutoTurnOver.Models/dc_auto_purchase_advise.cs
View file @
d3ac2e29
...
@@ -58,6 +58,36 @@ namespace AutoTurnOver.Models
...
@@ -58,6 +58,36 @@ namespace AutoTurnOver.Models
/// 主表ID
/// 主表ID
/// </summary>
/// </summary>
public
int
main_id
{
get
;
set
;
}
public
int
main_id
{
get
;
set
;
}
/// <summary>
/// 销量趋势预测公式y = kx + b
/// </summary>
public
string
forecast_formula
{
get
;
set
;
}
/// <summary>
/// 销量预测公式
/// </summary>
public
string
fit_forecast_formula
{
get
;
set
;
}
/// <summary>
/// 周转天数
/// </summary>
public
int
turnover_days
{
get
;
set
;
}
/// <summary>
/// 供应商交期
/// </summary>
public
int
supplier_delivery
{
get
;
set
;
}
/// <summary>
/// 质检天数
/// </summary>
public
int
inspection_delivery
{
get
;
set
;
}
/// <summary>
/// 调拨天数
/// </summary>
public
int
transfer_delivery
{
get
;
set
;
}
}
}
public
class
dc_auto_purchase_advise_detailed_dto
:
dc_auto_purchase_advise_detailed
public
class
dc_auto_purchase_advise_detailed_dto
:
dc_auto_purchase_advise_detailed
...
...
AutoTurnOver.Services/ReportServices.cs
View file @
d3ac2e29
...
@@ -41,12 +41,12 @@ namespace AutoTurnOver.Services
...
@@ -41,12 +41,12 @@ namespace AutoTurnOver.Services
var
shortsupply
=
DB
.
dc_auto_turnover
.
GetAutoShortSupplyBySkuWH
(
sku
,
warehousecode
);
var
shortsupply
=
DB
.
dc_auto_turnover
.
GetAutoShortSupplyBySkuWH
(
sku
,
warehousecode
);
list
.
Add
(
sales
!=
null
?
sales
.
sales_details
:
"[]"
);
list
.
Add
(
sales
!=
null
?
sales
.
sales_details
.
ToObj
<
List
<
decimal
>>().
Select
(
s
=>(
int
)
s
).
ToJson
()
:
"[]"
);
//list.Add(buyputin != null ? buyputin.details : "[]");
//list.Add(buyputin != null ? buyputin.details : "[]");
//list.Add(allotputin != null ? allotputin.details : "[]");
//list.Add(allotputin != null ? allotputin.details : "[]");
list
.
Add
(
sales
!=
null
?
sales
.
inbound_details
:
"[]"
);
list
.
Add
(
sales
!=
null
?
sales
.
inbound_details
.
ToObj
<
List
<
decimal
>>().
Select
(
s
=>
(
int
)
s
).
ToJson
()
:
"[]"
);
list
.
Add
(
sales
!=
null
?
sales
.
inventory_details
:
"[]"
);
list
.
Add
(
sales
!=
null
?
sales
.
inventory_details
.
ToObj
<
List
<
decimal
>>().
Select
(
s
=>
(
int
)
s
).
ToJson
()
:
"[]"
);
list
.
Add
(
sales
!=
null
?
sales
.
short_supply_details
:
"[]"
);
list
.
Add
(
sales
!=
null
?
sales
.
short_supply_details
.
ToObj
<
List
<
decimal
>>().
Select
(
s
=>
(
int
)
s
).
ToJson
()
:
"[]"
);
// 计算涉及的总天数
// 计算涉及的总天数
int
count
=
list
.
Max
(
s
=>
s
.
Split
(
','
).
Length
);
int
count
=
list
.
Max
(
s
=>
s
.
Split
(
','
).
Length
);
...
@@ -109,9 +109,9 @@ namespace AutoTurnOver.Services
...
@@ -109,9 +109,9 @@ namespace AutoTurnOver.Services
}
}
}
}
list
.
Add
(
tempStrList
!=
null
?
tempStrList
.
ToJson
()
:
"[]"
);
list
.
Add
(
tempStrList
!=
null
?
tempStrList
.
ToJson
()
:
"[]"
);
list
.
Add
(
tempCorrectionStrList
!=
null
?
tempCorrectionStrList
.
ToJson
()
:
"[]"
);
list
.
Add
(
tempCorrectionStrList
!=
null
?
tempCorrectionStrList
.
Select
(
s
=>(
int
)
s
).
ToJson
()
:
"[]"
);
list
.
Add
(
tempAdviseStrList
!=
null
?
tempAdviseStrList
.
ToJson
()
:
"[]"
);
list
.
Add
(
tempAdviseStrList
!=
null
?
tempAdviseStrList
.
Select
(
s
=>
(
int
)
s
).
ToJson
()
:
"[]"
);
list
.
Add
(
tempActualStrList
!=
null
?
tempActualStrList
.
ToJson
()
:
"[]"
);
list
.
Add
(
tempActualStrList
!=
null
?
tempActualStrList
.
Select
(
s
=>
(
int
)
s
).
ToJson
()
:
"[]"
);
////添加预测销量
////添加预测销量
//list.Add(new mforecast {
//list.Add(new mforecast {
...
...
AutoTurnOver/Properties/PublishProfiles/FolderProfile.pubxml
View file @
d3ac2e29
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<WebPublishMethod>
FileSystem
</WebPublishMethod>
<WebPublishMethod>
FileSystem
</WebPublishMethod>
<PublishProvider>
FileSystem
</PublishProvider>
<PublishProvider>
FileSystem
</PublishProvider>
<LastUsedBuildConfiguration>
Release
</LastUsedBuildConfiguration>
<LastUsedBuildConfiguration>
Release
</LastUsedBuildConfiguration>
<LastUsedBuildConfiguration>
Debug
</LastUsedBuildConfiguration>
<LastUsedBuildConfiguration>
Release
</LastUsedBuildConfiguration>
<LastUsedPlatform>
Any CPU
</LastUsedPlatform>
<LastUsedPlatform>
Any CPU
</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish
/>
<SiteUrlToLaunchAfterPublish
/>
<LaunchSiteAfterPublish>
True
</LaunchSiteAfterPublish>
<LaunchSiteAfterPublish>
True
</LaunchSiteAfterPublish>
...
...
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