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
d5579168
Commit
d5579168
authored
Aug 15, 2019
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周转表的分类修改为百伦新分类
库存新增百伦分类的筛选
parent
5757e9ea
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
199 additions
and
19 deletions
+199
-19
daily.cs
AutoTurnOver.DB/daily.cs
+8
-2
dc_auto_turnover.cs
AutoTurnOver.DB/dc_auto_turnover.cs
+2
-3
bailun_category_new_dto.cs
AutoTurnOver.Models/ApiDto/bailun_category_new_dto.cs
+19
-0
saas_api_result.cs
AutoTurnOver.Models/ApiDto/saas_api_result.cs
+14
-0
dc_auto_turnover.cs
AutoTurnOver.Models/dc_auto_turnover.cs
+1
-1
ApiServices.cs
AutoTurnOver.Services/ApiServices.cs
+106
-0
DailyServices.cs
AutoTurnOver.Services/DailyServices.cs
+9
-3
ReportServices.cs
AutoTurnOver.Services/ReportServices.cs
+1
-1
SkuAutoTurnServices.cs
AutoTurnOver.Services/SkuAutoTurnServices.cs
+1
-1
CommonController.cs
AutoTurnOver/Controllers/CommonController.cs
+28
-1
DailyController.cs
AutoTurnOver/Controllers/DailyController.cs
+4
-4
appsettings.Development.json
AutoTurnOver/appsettings.Development.json
+2
-1
appsettings.Production.json
AutoTurnOver/appsettings.Production.json
+2
-1
appsettings.json
AutoTurnOver/appsettings.json
+2
-1
No files found.
AutoTurnOver.DB/daily.cs
View file @
d5579168
...
...
@@ -2,7 +2,8 @@
using
Dapper
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
using
AutoTurnOver.Models.ApiDto
;
namespace
AutoTurnOver.DB
{
...
...
@@ -199,7 +200,7 @@ WHERE
/// <param name="sku">sku</param>
/// <param name="warehouse_code">仓库编码</param>
/// <returns></returns>
public
static
List
<
dc_base_stock_dto
>
RealtimeList
(
string
sku
,
string
bailun_sku
,
string
warehouse_code
,
string
product_inner_code
,
string
sku_title_cn
,
string
supplier_name
,
int
offset
,
int
limit
,
ref
int
total
,
string
warehousetype
,
int
?
warehousearea
,
bool
isSum
=
false
,
string
order
=
null
,
string
sort
=
null
,
int
?
has_tort
=
null
)
public
static
List
<
dc_base_stock_dto
>
RealtimeList
(
string
sku
,
string
bailun_sku
,
string
warehouse_code
,
string
product_inner_code
,
string
sku_title_cn
,
string
supplier_name
,
int
offset
,
int
limit
,
ref
int
total
,
string
warehousetype
,
int
?
warehousearea
,
bool
isSum
=
false
,
string
order
=
null
,
string
sort
=
null
,
int
?
has_tort
=
null
,
List
<
bailun_category_new_dto
>
categoryModels
=
null
)
{
var
sql
=
""
;
if
(
isSum
)
...
...
@@ -290,6 +291,11 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
DynamicParameters
parameters
=
new
DynamicParameters
();
parameters
.
Add
(
"time"
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd 00:00:00"
));
if
(
categoryModels
!=
null
&&
categoryModels
.
Count
>=
1
)
{
sql
+=
" and t3.category_simple_id in ( "
+
string
.
Join
(
","
,
categoryModels
.
Select
(
s
=>
s
.
id
).
Distinct
())
+
")"
;
countSql
+=
" and t3.category_simple_id in ( "
+
string
.
Join
(
","
,
categoryModels
.
Select
(
s
=>
s
.
id
).
Distinct
())
+
")"
;
}
if
(
has_tort
!=
null
)
{
...
...
AutoTurnOver.DB/dc_auto_turnover.cs
View file @
d5579168
...
...
@@ -104,9 +104,8 @@ from dc_auto_turnover as dat
if
(
m
.
categoryModels
!=
null
)
{
sql
+=
" and dat.bailun_category_id in ( "
+
string
.
Join
(
","
,
m
.
categoryModels
.
Select
(
s
=>
s
.
C_ID
).
Distinct
())
+
")"
;
sqlCount
+=
" and dat.bailun_category_id in ( "
+
string
.
Join
(
","
,
m
.
categoryModels
.
Select
(
s
=>
s
.
C_ID
).
Distinct
())
+
")"
;
sql
+=
" and dat.category_simple_id in ( "
+
string
.
Join
(
","
,
m
.
categoryModels
.
Select
(
s
=>
s
.
id
).
Distinct
())
+
")"
;
sqlCount
+=
" and dat.category_simple_id in ( "
+
string
.
Join
(
","
,
m
.
categoryModels
.
Select
(
s
=>
s
.
id
).
Distinct
())
+
")"
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
m
.
buyer_name
))
{
...
...
AutoTurnOver.Models/ApiDto/bailun_category_new_dto.cs
0 → 100644
View file @
d5579168
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
AutoTurnOver.Models.ApiDto
{
public
class
bailun_category_new_dto
{
public
int
parentId
{
get
;
set
;
}
public
string
name
{
get
;
set
;
}
public
string
fullName
{
get
;
set
;
}
public
int
level
{
get
;
set
;
}
public
int
id
{
get
;
set
;
}
}
}
AutoTurnOver.Models/ApiDto/saas_api_result.cs
0 → 100644
View file @
d5579168
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
AutoTurnOver.Models.ApiDto
{
public
class
saas_api_result
<
T
>
{
public
T
result
{
get
;
set
;
}
public
int
statusCode
{
get
;
set
;
}
public
string
message
{
get
;
set
;
}
}
}
AutoTurnOver.Models/dc_auto_turnover.cs
View file @
d5579168
...
...
@@ -330,7 +330,7 @@ namespace AutoTurnOver.Models
/// </summary>
public
string
categoryIds
{
get
;
set
;
}
public
List
<
CategoryD
to
>
categoryModels
{
get
;
set
;
}
public
List
<
bailun_category_new_d
to
>
categoryModels
{
get
;
set
;
}
}
public
class
dc_auto_turnover_Extend
:
dc_auto_turnover
...
...
AutoTurnOver.Services/ApiServices.cs
View file @
d5579168
...
...
@@ -587,5 +587,111 @@ namespace AutoTurnOver.Services
}
/// <summary>
/// 获取一二级新百伦分类
/// </summary>
/// <returns></returns>
public
static
List
<
bailun_category_new_dto
>
GetNewCategoryAll
()
{
return
GetNewCategoryList
(
0
);
}
/// <summary>
/// 根据基本查询分类
/// </summary>
/// <param name="level"></param>
/// <returns></returns>
public
static
List
<
bailun_category_new_dto
>
GetNewCategoryList
(
int
level
=
1
)
{
string
url
=
ConfigHelper
.
GetValue
(
"SkuSys_CategoryList"
);
string
resultStr
=
HttpHelper
.
Request
(
url
+
$"?level=
{
level
}
"
,
RequestType
.
GET
,
timeout
:
1000
*
60
*
60
*
24
);
var
result
=
resultStr
.
ToObj
<
saas_api_result
<
List
<
bailun_category_new_dto
>>>();
if
(
result
==
null
)
{
throw
new
Exception
(
"skums 系统 新百伦分类接口异常: 未获取到新百伦分类数据"
);
}
if
(
result
.
statusCode
!=
200
)
{
throw
new
Exception
(
"wms系统 新百伦分类接口 异常: "
+
result
.
message
);
}
return
result
.
result
;
}
/// <summary>
/// 根据ID查询分类
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
static
bailun_category_new_dto
GetNewCategoryById
(
int
id
)
{
var
all
=
GetNewCategoryAll
();
return
all
.
SingleOrDefault
(
s
=>
s
.
id
==
id
);
}
/// <summary>
/// 获取顶层分类
/// </summary>
/// <param name="category_id"></param>
/// <returns></returns>
public
static
bailun_category_new_dto
GetTopNewCategory
(
List
<
bailun_category_new_dto
>
datas
,
int
category_id
)
{
if
(
datas
==
null
)
datas
=
GetNewCategoryAll
();
var
c_data
=
datas
.
SingleOrDefault
(
s
=>
s
.
id
==
category_id
);
if
(
c_data
==
null
)
throw
new
Exception
(
$" 分类id
{
category_id
}
不存在 "
);
if
(
c_data
.
parentId
==
0
)
return
c_data
;
return
GetTopNewCategory
(
datas
,
c_data
.
parentId
);
}
/// <summary>
/// 查询相关的子节点
/// </summary>
/// <param name="all"></param>
/// <param name="id"></param>
/// <returns></returns>
public
static
List
<
bailun_category_new_dto
>
GetNewClientNodesByIds
(
List
<
int
>
ids
)
{
if
(
ids
==
null
||
ids
.
Count
<=
0
)
{
return
new
List
<
bailun_category_new_dto
>();
}
List
<
bailun_category_new_dto
>
datas
=
new
List
<
bailun_category_new_dto
>();
var
all
=
GetNewCategoryList
(
0
);
foreach
(
var
item
in
ids
)
{
datas
.
AddRange
(
GetNewClientNodesById
(
all
,
item
));
}
return
datas
;
}
/// <summary>
/// 查询相关的子节点
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public
static
List
<
bailun_category_new_dto
>
GetNewClientNodesById
(
List
<
bailun_category_new_dto
>
all
,
int
id
)
{
// 查询所有数据
if
(
all
==
null
)
{
all
=
GetNewCategoryList
(
0
);
}
List
<
bailun_category_new_dto
>
clients
=
all
.
Where
(
s
=>
s
.
id
==
id
).
ToList
();
var
cNodes
=
all
.
Where
(
s
=>
s
.
parentId
==
id
).
ToList
();
if
(
cNodes
!=
null
||
cNodes
.
Count
>=
1
)
{
foreach
(
var
item
in
cNodes
)
{
clients
.
AddRange
(
GetNewClientNodesById
(
all
,
item
.
id
));
}
}
return
clients
;
}
}
}
AutoTurnOver.Services/DailyServices.cs
View file @
d5579168
using
AutoTurnOver.Models
;
using
AutoTurnOver.Models.ApiDto
;
using
AutoTurnOver.Utility
;
using
System
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.IO
;
using
System.
Text
;
using
System.
Linq
;
namespace
AutoTurnOver.Services
{
...
...
@@ -38,9 +39,14 @@ namespace AutoTurnOver.Services
}
public
List
<
dc_base_stock_dto
>
RealtimeList
(
string
sku
,
string
bailun_sku
,
string
warehouse_code
,
string
product_inner_code
,
string
sku_title_cn
,
string
supplier_name
,
int
offset
,
int
limit
,
ref
int
total
,
string
warehousetype
,
int
?
warehousearea
,
bool
isSum
=
false
,
string
order
=
null
,
string
sort
=
null
,
int
?
has_tort
=
null
)
public
List
<
dc_base_stock_dto
>
RealtimeList
(
string
sku
,
string
bailun_sku
,
string
warehouse_code
,
string
product_inner_code
,
string
sku_title_cn
,
string
supplier_name
,
int
offset
,
int
limit
,
ref
int
total
,
string
warehousetype
,
int
?
warehousearea
,
bool
isSum
=
false
,
string
order
=
null
,
string
sort
=
null
,
int
?
has_tort
=
null
,
string
categoryIds
=
null
)
{
return
DB
.
daily
.
RealtimeList
(
sku
,
bailun_sku
,
warehouse_code
,
product_inner_code
,
sku_title_cn
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
isSum
,
order
,
sort
,
has_tort
:
has_tort
);
List
<
bailun_category_new_dto
>
categoryModels
=
null
;
if
(!
string
.
IsNullOrWhiteSpace
(
categoryIds
))
{
categoryModels
=
ApiServices
.
GetNewClientNodesByIds
(
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
}
return
DB
.
daily
.
RealtimeList
(
sku
,
bailun_sku
,
warehouse_code
,
product_inner_code
,
sku_title_cn
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
isSum
,
order
,
sort
,
has_tort
:
has_tort
,
categoryModels
:
categoryModels
);
}
...
...
AutoTurnOver.Services/ReportServices.cs
View file @
d5579168
...
...
@@ -449,7 +449,7 @@ namespace AutoTurnOver.Services
public
void
ShortagePush
(
bool
is_all
=
false
)
{
var
datas
=
report
.
ShortagePush
(
is_all
);
var
err_datas
=
ApiServices
.
ShortagePush
(
datas
);
var
err_datas
=
ApiServices
.
ShortagePush
(
datas
);
// 记录推送状态
report
.
AddShortagePush
(
datas
.
Where
(
s
=>
!
err_datas
.
Any
(
e
=>
e
.
warehouseCode
==
s
.
warehouse_code
&&
s
.
bailun_sku
==
e
.
sku
)));
...
...
AutoTurnOver.Services/SkuAutoTurnServices.cs
View file @
d5579168
...
...
@@ -28,7 +28,7 @@ namespace AutoTurnOver.Services
{
if
(!
string
.
IsNullOrWhiteSpace
(
m
.
categoryIds
))
{
m
.
categoryModels
=
ApiServices
.
GetClientNodesByIds
(
m
.
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
m
.
categoryModels
=
ApiServices
.
Get
New
ClientNodesByIds
(
m
.
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
}
return
DB
.
dc_auto_turnover
.
List
(
m
,
offset
,
limit
,
ref
total
,
order
,
sort
,
isSum
);
}
...
...
AutoTurnOver/Controllers/CommonController.cs
View file @
d5579168
...
...
@@ -170,7 +170,33 @@ namespace AutoTurnOver.Controllers
}
}
public
JsonResult
GetNewCategoryAll
()
{
try
{
var
datas
=
ApiServices
.
GetNewCategoryAll
().
Select
(
s
=>
new
{
id
=
s
.
id
,
pId
=
s
.
parentId
,
name
=
s
.
name
,
open
=
false
});
return
new
JsonResult
(
new
{
data
=
datas
,
success
=
true
});
}
catch
(
Exception
ex
)
{
return
new
JsonResult
(
new
{
message
=
ex
.
Message
,
success
=
false
});
}
}
}
}
\ No newline at end of file
AutoTurnOver/Controllers/DailyController.cs
View file @
d5579168
...
...
@@ -62,12 +62,12 @@ namespace AutoTurnOver.Controllers
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <returns></returns>
public
JsonResult
RealtimeList
(
string
sku
,
string
bailun_sku
,
string
warehousecode
,
string
product_inner_code
,
string
sku_title_cn
,
string
supplier_name
,
int
offset
,
int
limit
,
string
order
,
string
sort
,
string
warehousetype
,
int
?
warehousearea
,
int
?
has_tort
=
null
)
public
JsonResult
RealtimeList
(
string
sku
,
string
bailun_sku
,
string
warehousecode
,
string
product_inner_code
,
string
sku_title_cn
,
string
supplier_name
,
int
offset
,
int
limit
,
string
order
,
string
sort
,
string
warehousetype
,
int
?
warehousearea
,
int
?
has_tort
=
null
,
string
categoryIds
=
null
)
{
var
services
=
new
DailyServices
();
var
total
=
0
;
var
list
=
services
.
RealtimeList
(
sku
,
bailun_sku
,
warehousecode
,
product_inner_code
,
sku_title_cn
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
order
:
order
,
sort
:
sort
,
has_tort
:
has_tort
);
var
list
=
services
.
RealtimeList
(
sku
,
bailun_sku
,
warehousecode
,
product_inner_code
,
sku_title_cn
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
order
:
order
,
sort
:
sort
,
has_tort
:
has_tort
,
categoryIds
:
categoryIds
);
return
new
JsonResult
(
new
{
...
...
@@ -76,12 +76,12 @@ namespace AutoTurnOver.Controllers
});
}
public
JsonResult
RealtimeListSumFooter
(
string
sku
,
string
bailun_sku
,
string
warehousecode
,
string
product_inner_code
,
string
sku_title_cn
,
string
supplier_name
,
int
offset
,
int
limit
,
string
order
,
string
sort
,
string
warehousetype
,
int
?
warehousearea
,
int
?
has_tort
=
null
)
public
JsonResult
RealtimeListSumFooter
(
string
sku
,
string
bailun_sku
,
string
warehousecode
,
string
product_inner_code
,
string
sku_title_cn
,
string
supplier_name
,
int
offset
,
int
limit
,
string
order
,
string
sort
,
string
warehousetype
,
int
?
warehousearea
,
int
?
has_tort
=
null
,
string
categoryIds
=
null
)
{
var
services
=
new
DailyServices
();
var
total
=
0
;
var
list
=
services
.
RealtimeList
(
sku
,
bailun_sku
,
warehousecode
,
product_inner_code
,
sku_title_cn
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
true
,
has_tort
:
has_tort
);
var
list
=
services
.
RealtimeList
(
sku
,
bailun_sku
,
warehousecode
,
product_inner_code
,
sku_title_cn
,
supplier_name
,
offset
,
limit
,
ref
total
,
warehousetype
,
warehousearea
,
true
,
has_tort
:
has_tort
,
categoryIds
:
categoryIds
);
return
new
JsonResult
(
list
==
null
||
list
.
Count
<=
0
?
new
dc_base_stock_dto
()
:
list
[
0
]);
}
...
...
AutoTurnOver/appsettings.Development.json
View file @
d5579168
...
...
@@ -34,5 +34,6 @@
"CdnUrl"
:
"http://imgcache.bailuntec.com"
},
"QiYeJiQiRen"
:
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=5fa4c1d5-ce65-4e8a-9ae9-a0d689a13b65"
,
"GetSchedulings"
:
"http://www.bailuntec.com/Api/Cq/GetSchedulings?userID=2409"
"GetSchedulings"
:
"http://www.bailuntec.com/Api/Cq/GetSchedulings?userID=2409"
,
"SkuSys_CategoryList"
:
"http://api.skums.bailuntec.com/api/category/simplecategory/categoriessimplebylevel"
}
AutoTurnOver/appsettings.Production.json
View file @
d5579168
...
...
@@ -34,5 +34,6 @@
"CdnUrl"
:
"http://imgcache.bailuntec.com"
},
"QiYeJiQiRen"
:
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=5fa4c1d5-ce65-4e8a-9ae9-a0d689a13b65"
,
"GetSchedulings"
:
"http://www.bailuntec.com/Api/Cq/GetSchedulings?userID=2409"
"GetSchedulings"
:
"http://www.bailuntec.com/Api/Cq/GetSchedulings?userID=2409"
,
"SkuSys_CategoryList"
:
"http://api.skums.bailuntec.com/api/category/simplecategory/categoriessimplebylevel"
}
AutoTurnOver/appsettings.json
View file @
d5579168
...
...
@@ -34,5 +34,6 @@
"CdnUrl"
:
"http://imgcache.bailuntec.com"
},
"QiYeJiQiRen"
:
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=5fa4c1d5-ce65-4e8a-9ae9-a0d689a13b65"
,
"GetSchedulings"
:
"http://www.bailuntec.com/Api/Cq/GetSchedulings?userID=2409"
"GetSchedulings"
:
"http://www.bailuntec.com/Api/Cq/GetSchedulings?userID=2409"
,
"SkuSys_CategoryList"
:
"http://api.skums.bailuntec.com/api/category/simplecategory/categoriessimplebylevel"
}
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