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
6b233fd3
Commit
6b233fd3
authored
Feb 19, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周转记录标题
parent
071a64c8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
37 deletions
+16
-37
GeneratePurchaseAdviseBackgroundService.cs
...PurchaseAdvise/GeneratePurchaseAdviseBackgroundService.cs
+2
-2
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+7
-7
dc_auto_purchase_advise.cs
AutoTurnOver.Models/dc_auto_purchase_advise.cs
+1
-0
PurchaseAdviseServices.cs
AutoTurnOver.Services/PurchaseAdviseServices.cs
+2
-2
SkuAutoTurnServices.cs
AutoTurnOver.Services/SkuAutoTurnServices.cs
+2
-2
PurchaseAdviseController.cs
AutoTurnOver/Controllers/PurchaseAdviseController.cs
+2
-24
No files found.
AutoGeneratePurchaseAdvise/GeneratePurchaseAdviseBackgroundService.cs
View file @
6b233fd3
...
...
@@ -77,7 +77,7 @@ namespace AutoGeneratePurchaseAdvise
if
(
now
.
Hour
==
08
&&
now
.
Minute
==
55
)
{
Console
.
WriteLine
(
$"开始 推送采购建议 任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
PurchaseAdviseServices
.
Generate
(
DateTime
.
Parse
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd 00:00:00"
)),
is_clear_data
:
true
);
PurchaseAdviseServices
.
Generate
(
$"早上的全量周转
{
DateTime
.
Now
.
ToString
(
"HH: mm"
)}
"
,
DateTime
.
Parse
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd 00:00:00"
)),
is_clear_data
:
true
);
Console
.
WriteLine
(
$"结束 推送采购建议 任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
...
...
@@ -128,7 +128,7 @@ namespace AutoGeneratePurchaseAdvise
if
(
now
.
Hour
==
15
&&
now
.
Minute
==
2
)
{
Console
.
WriteLine
(
$"开始 推送采购建议 任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
PurchaseAdviseServices
.
Generate
(
DateTime
.
Parse
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd 12:00:00"
)));
PurchaseAdviseServices
.
Generate
(
$"下午的补充周转
{
DateTime
.
Now
.
ToString
(
"HH: mm"
)}
"
,
DateTime
.
Parse
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd 12:00:00"
)));
Console
.
WriteLine
(
$"结束 推送采购建议 任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
...
...
AutoTurnOver.DB/purchase_advise.cs
View file @
6b233fd3
...
...
@@ -934,7 +934,7 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
if
(
mainID
<=
0
)
{
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
time
,
no
=
purchase_advise
.
GenerateOrderNo
(),
buy_sys_plan_no
=
"ImportJITShortageDetailed"
})
??
0
;
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
time
,
no
=
purchase_advise
.
GenerateOrderNo
(),
buy_sys_plan_no
=
"ImportJITShortageDetailed"
,
title
=
$" jit 缺货
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
})
??
0
;
}
var
datas
=
_connection
.
Query
<
dc_auto_purchase_advise_detailed
>(
@"select
...
...
@@ -1036,7 +1036,7 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
if
(
mainID
<=
0
)
{
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
time
,
no
=
purchase_advise
.
GenerateOrderNo
(),
buy_sys_plan_no
=
"ImportJITShortageDetailed1"
})
??
0
;
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
time
,
no
=
purchase_advise
.
GenerateOrderNo
(),
buy_sys_plan_no
=
"ImportJITShortageDetailed1"
,
title
=
$" jit 缺货
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
})
??
0
;
}
...
...
@@ -1103,7 +1103,7 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
if
(
mainID
<=
0
)
{
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
now
,
no
=
purchase_advise
.
GenerateOrderNo
(),
type
=
1
,
buy_sys_plan_no
=
"ImportFuZhuangShortageDetailed"
})
??
0
;
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
now
,
no
=
purchase_advise
.
GenerateOrderNo
(),
type
=
1
,
buy_sys_plan_no
=
"ImportFuZhuangShortageDetailed"
,
title
=
$" 无库仓缺货
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
})
??
0
;
}
var
datas
=
_connection
.
Query
<
dc_auto_purchase_advise_detailed
>(
@" select
t1.bailun_sku,
...
...
@@ -1166,7 +1166,7 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
if
(
mainID
<=
0
)
{
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
now
,
no
=
purchase_advise
.
GenerateOrderNo
(),
type
=
1
,
buy_sys_plan_no
=
"ImportYiWuShortageDetailed"
})
??
0
;
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
now
,
no
=
purchase_advise
.
GenerateOrderNo
(),
type
=
1
,
buy_sys_plan_no
=
"ImportYiWuShortageDetailed"
,
title
=
$" 义务仓缺货
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
})
??
0
;
}
var
datas
=
_connection
.
Query
<
dc_auto_purchase_advise_detailed
>(
@" select
t1.bailun_sku,
...
...
@@ -1230,7 +1230,7 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
if
(
mainID
<=
0
)
{
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
now
,
no
=
purchase_advise
.
GenerateOrderNo
(),
type
=
0
,
buy_sys_plan_no
=
"ImportDuLiShortageDetailed"
})
??
0
;
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
now
,
no
=
purchase_advise
.
GenerateOrderNo
(),
type
=
0
,
buy_sys_plan_no
=
"ImportDuLiShortageDetailed"
,
title
=
$"赵美聪独立站缺货
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
})
??
0
;
}
var
datas
=
_connection
.
Query
<
dc_auto_purchase_advise_detailed
>(
@" select
t1.bailun_sku,
...
...
@@ -1492,7 +1492,7 @@ t8.bailun_order_ids
var
last_date
=
_connection
.
QueryFirstOrDefault
<
DateTime
>(
" select create_time from dc_auto_purchase_advise where type=1 order by create_time desc limit 1 "
);
if
(
mainID
<=
0
)
{
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
DateTime
.
Now
,
no
=
purchase_advise
.
GenerateOrderNo
(),
type
=
1
,
buy_sys_plan_no
=
"ImportFuZhuangShortageIncreaseDetailed"
})
??
0
;
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
DateTime
.
Now
,
no
=
purchase_advise
.
GenerateOrderNo
(),
type
=
1
,
buy_sys_plan_no
=
"ImportFuZhuangShortageIncreaseDetailed"
,
title
=
$" 无库存缺货
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
})
??
0
;
}
var
datas
=
_connection
.
Query
<
dc_auto_purchase_advise_detailed
>(
@"select
t1.bailun_sku,
...
...
@@ -1556,7 +1556,7 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
if
(
mainID
<=
0
)
{
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
time
,
no
=
purchase_advise
.
GenerateOrderNo
(),
buy_sys_plan_no
=
"ImportShoujiShortageDetailed"
})
??
0
;
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
time
,
no
=
purchase_advise
.
GenerateOrderNo
(),
buy_sys_plan_no
=
"ImportShoujiShortageDetailed"
,
title
=
$" 手机缺货
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
})
??
0
;
}
var
datas
=
_connection
.
Query
<
dc_auto_purchase_advise_detailed
>(
@" select
t1.bailun_sku,
...
...
AutoTurnOver.Models/dc_auto_purchase_advise.cs
View file @
6b233fd3
...
...
@@ -26,6 +26,7 @@ namespace AutoTurnOver.Models
/// 采购建议单号
/// </summary>
public
string
buy_sys_plan_no
{
get
;
set
;
}
public
string
title
{
get
;
set
;
}
public
DateTime
?
push_time
{
get
;
set
;
}
...
...
AutoTurnOver.Services/PurchaseAdviseServices.cs
View file @
6b233fd3
...
...
@@ -17,7 +17,7 @@ namespace AutoTurnOver.Services
/// <summary>
/// 创建采购计划
/// </summary>
public
static
void
Generate
(
DateTime
date
,
bool
is_bak
=
true
,
bool
is_clear_data
=
false
)
public
static
void
Generate
(
string
title
,
DateTime
date
,
bool
is_bak
=
true
,
bool
is_clear_data
=
false
)
{
try
{
...
...
@@ -28,7 +28,7 @@ namespace AutoTurnOver.Services
purchase_advise
.
WaitReplaceLogisticsTask
();
// 创建一个采购计划
var
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
DateTime
.
Now
,
no
=
purchase_advise
.
GenerateOrderNo
()
,
buy_sys_plan_no
=
"Generate"
});
var
mainID
=
purchase_advise
.
Add
(
new
dc_auto_purchase_advise
{
create_time
=
DateTime
.
Now
,
no
=
purchase_advise
.
GenerateOrderNo
()
,
buy_sys_plan_no
=
"Generate"
,
title
=
title
});
if
(
mainID
==
null
)
throw
new
Exception
(
"创建采购建议失败"
);
purchase_advise
.
ImportDetailed
(
mainID
.
Value
,
date
,
is_clear_data
:
true
);
...
...
AutoTurnOver.Services/SkuAutoTurnServices.cs
View file @
6b233fd3
...
...
@@ -531,7 +531,7 @@ namespace AutoTurnOver.Services
bailun_sku_warehouse_codes
=
bailun_sku_warehouse_codes
},
commandTimeout
:
0
);
// 出周转建议
PurchaseAdviseServices
.
Generate
(
btime
,
is_bak
:
false
);
PurchaseAdviseServices
.
Generate
(
$"采购单更新,刷新周转
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
,
btime
,
is_bak
:
false
);
}
...
...
@@ -613,7 +613,7 @@ namespace AutoTurnOver.Services
bailun_sku_warehouse_codes
=
bailun_sku_warehouse_codes
},
commandTimeout
:
0
);
// 出周转建议
PurchaseAdviseServices
.
Generate
(
btime
,
is_bak
:
false
);
PurchaseAdviseServices
.
Generate
(
$"调拨单刷新
{
DateTime
.
Now
.
ToString
(
"HH:mm"
)}
"
,
btime
,
is_bak
:
false
);
}
...
...
AutoTurnOver/Controllers/PurchaseAdviseController.cs
View file @
6b233fd3
...
...
@@ -179,33 +179,11 @@ namespace AutoTurnOver.Controllers
/// <param name="id"></param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_aims"
,
"访问【百伦自动周转系统】->【自动下单管理】->【采购建议列表】->【推送采购系统】页面"
,
0
)]
public
JsonResult
PushBuySys
(
int
limit
,
int
offset
,
int
main_id
,
string
sort
,
string
sku
,
string
warehousecode
,
DateTime
?
end_date
,
DateTime
?
start_date
,
string
warehousetype
,
int
?
warehousearea
,
string
order
,
bool
?
ispush
=
null
,
int
?
type
=
null
,
string
supplier_name
=
null
,
string
purchase_user
=
null
,
string
product_inner_code
=
null
,
bool
?
is_multiple_warehouse
=
false
,
int
?
is_replace_logistics
=
null
,
decimal
?
quantity_final_advise_price_max
=
null
,
decimal
?
quantity_final_advise_price_min
=
null
,
int
?
purchase_type_jit
=
null
)
public
JsonResult
PushBuySys
([
FromQuery
]
dc_auto_purchase_advise_detailed_search_dto
m
)
{
try
{
var
m
=
new
dc_auto_purchase_advise_detailed_search_dto
{
main_id
=
main_id
,
sku
=
sku
,
warehouse_code
=
warehousecode
,
end_date
=
end_date
,
start_date
=
start_date
,
warehousearea
=
warehousearea
,
warehousetype
=
warehousetype
,
ispush
=
false
,
type
=
type
,
supplier_name
=
supplier_name
,
purchase_user
=
purchase_user
,
product_inner_code
=
product_inner_code
,
is_multiple_warehouse
=
is_multiple_warehouse
.
Value
,
quantity_final_advise_price_max
=
quantity_final_advise_price_max
,
quantity_final_advise_price_min
=
quantity_final_advise_price_min
,
purchase_type_jit
=
purchase_type_jit
,
is_replace_logistics
=
is_replace_logistics
};
m
.
ispush
=
false
;
var
total
=
0
;
var
list
=
PurchaseAdviseServices
.
DetailList
(
m
,
0
,
int
.
MaxValue
,
ref
total
);
...
...
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