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
cc8a85f4
Commit
cc8a85f4
authored
Jul 17, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善预测销量配置
parent
641beeb1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
+49
-2
dc_auto_sales_forecast_config.cs
AutoTurnOver.Models/dc_auto_sales_forecast_config.cs
+1
-0
ConfigServices.cs
AutoTurnOver.Services/ConfigServices.cs
+46
-0
ConfigController.cs
AutoTurnOver/Controllers/ConfigController.cs
+2
-2
No files found.
AutoTurnOver.Models/dc_auto_sales_forecast_config.cs
View file @
cc8a85f4
...
@@ -44,6 +44,7 @@ namespace AutoTurnOver.Models
...
@@ -44,6 +44,7 @@ namespace AutoTurnOver.Models
public
class
dc_auto_sales_forecast_stage_config
public
class
dc_auto_sales_forecast_stage_config
{
{
public
int
id
{
get
;
set
;
}
public
int
config_id
{
get
;
set
;
}
public
int
config_id
{
get
;
set
;
}
public
int
index
{
get
;
set
;
}
public
int
index
{
get
;
set
;
}
/// <summary>
/// <summary>
...
...
AutoTurnOver.Services/ConfigServices.cs
View file @
cc8a85f4
...
@@ -755,6 +755,52 @@ namespace AutoTurnOver.Services
...
@@ -755,6 +755,52 @@ namespace AutoTurnOver.Services
public
void
SaveSalesForecastConfig
(
Models
.
dc_auto_sales_forecast_config_dto
m
,
string
username
)
public
void
SaveSalesForecastConfig
(
Models
.
dc_auto_sales_forecast_config_dto
m
,
string
username
)
{
{
if
(
m
.
screen_type
<=
0
)
{
throw
new
Exception
(
"筛选类型必选"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
m
.
warehouse_area_id
)||
string
.
IsNullOrWhiteSpace
(
m
.
warehouse_code
)||
string
.
IsNullOrWhiteSpace
(
m
.
warehouse_type
))
{
throw
new
Exception
(
"仓库类型、国家、仓库 中,至少选择一种"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
m
.
title
))
{
throw
new
Exception
(
"规则标题必填"
);
}
foreach
(
var
item
in
m
.
stages
)
{
if
(
item
.
index
==
1
||
(
m
.
screen_type
==
1
&&
(
item
.
duration_upper_limit
>
0
||
item
.
duration_lower_limit
>
0
))
||
(
m
.
screen_type
==
2
&&
(
item
.
sales_upper_limit
>
0
||
item
.
sales_lower_limit
>
0
))
)
{
if
(
item
.
one_ratio
+
item
.
two_ratio
+
item
.
three_ratio
!=
1
)
{
throw
new
Exception
(
$" 第
{
item
.
index
}
阶段的 三个时间段范围比例相加不等 1 "
);
}
}
else
{
if
(
item
.
index
==
1
)
{
throw
new
Exception
(
$"第1阶段的
{(
m
.
screen_type
==
1
?
"入库时长"
:
"销量范围"
)}
必填"
);
}
}
if
(
item
.
one_n2
+
item
.
one_n4
+
item
.
one_n6
!=
1
)
{
throw
new
Exception
(
$" 第
{
item
.
index
}
阶段的 底 1 个时间段范围 的 3个加权值相加不等与1 "
);
}
if
(
item
.
two_n2
+
item
.
two_n4
+
item
.
two_n6
!=
1
)
{
throw
new
Exception
(
$" 第
{
item
.
index
}
阶段的 底 2 个时间段范围 的 3个加权值相加不等与1 "
);
}
if
(
item
.
three_n2
+
item
.
three_n4
+
item
.
three_n6
!=
1
)
{
throw
new
Exception
(
$" 第
{
item
.
index
}
阶段的 底 3 个时间段范围 的 3个加权值相加不等与1 "
);
}
}
DB
.
db_config
.
SaveSalesForecastConfig
(
m
,
username
);
DB
.
db_config
.
SaveSalesForecastConfig
(
m
,
username
);
}
}
...
...
AutoTurnOver/Controllers/ConfigController.cs
View file @
cc8a85f4
...
@@ -765,11 +765,11 @@ namespace AutoTurnOver.Controllers
...
@@ -765,11 +765,11 @@ namespace AutoTurnOver.Controllers
try
try
{
{
new
Services
.
ConfigServices
().
SaveSalesForecastConfig
(
m
,
""
);
new
Services
.
ConfigServices
().
SaveSalesForecastConfig
(
m
,
""
);
return
new
JsonResult
(
""
);
return
Json
(
new
{
success
=
true
}
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
return
new
JsonResult
(
ex
.
Message
);
return
Json
(
new
{
success
=
false
,
message
=
ex
.
Message
}
);
}
}
}
}
...
...
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