Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
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
DataCenter_Core2.1_20190520
Commits
12fc559f
Commit
12fc559f
authored
Dec 21, 2020
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加物流供应商往来统计配置;更改操作日志记录地址
parent
312db406
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
497 additions
and
4 deletions
+497
-4
dc_logistics_supplier_config.cs
Bailun.DC.Models/dc_logistics_supplier_config.cs
+32
-0
LogisticsServices.cs
Bailun.DC.Services/LogisticsServices.cs
+133
-0
SupplierTrancationReport.cshtml
...s/Reports/Views/Logistics/SupplierTrancationReport.cshtml
+4
-2
HomeController.cs
Bailun.DC.Web/Areas/Supplier/Controllers/HomeController.cs
+104
-0
AddLogisticsSupplierConfig.cshtml
...eas/Supplier/Views/Home/AddLogisticsSupplierConfig.cshtml
+59
-0
ListLogisticsSupplierConfig.cshtml
...as/Supplier/Views/Home/ListLogisticsSupplierConfig.cshtml
+150
-0
Bailun.DC.Web.csproj
Bailun.DC.Web/Bailun.DC.Web.csproj
+14
-1
appsettings.json
Bailun.DC.Web/appsettings.json
+1
-1
No files found.
Bailun.DC.Models/dc_logistics_supplier_config.cs
0 → 100644
View file @
12fc559f
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models
{
/// <summary>
/// 物流供应商往来供应商配置
/// </summary>
public
class
dc_logistics_supplier_config
{
public
int
id
{
get
;
set
;
}
public
string
suppliername
{
get
;
set
;
}
public
string
parentsuppliername
{
get
;
set
;
}
/// <summary>
/// 类型,1:需合并的,2:需删除不统计的
/// </summary>
public
int
type
{
get
;
set
;
}
public
DateTime
lastupdatetime
{
get
;
set
;
}
public
int
lastupdateuserid
{
get
;
set
;
}
public
string
lastupdateusername
{
get
;
set
;
}
public
int
delstatus
{
get
;
set
;
}
}
}
Bailun.DC.Services/LogisticsServices.cs
View file @
12fc559f
...
...
@@ -286,5 +286,138 @@ namespace Bailun.DC.Services
}
}
/// <summary>
/// 获取物流供应商往来统计的配置
/// </summary>
/// <param name="parameter"></param>
/// <param name="supplier"></param>
/// <param name="type">类型,1:需合并的,2:需删除不统计的</param>
/// <param name="total"></param>
/// <returns></returns>
public
List
<
dc_logistics_supplier_config
>
ListLogisticsSupplierConfig
(
BtTableParameter
parameter
,
string
supplier
,
int
type
,
ref
int
total
)
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_read
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
sql
=
$"select * from dc_logistics_supplier_config where delstatus=0 and type=
{
type
}
"
;
if
(!
string
.
IsNullOrEmpty
(
supplier
))
{
sql
+=
$" and (suppliername like '%
{
supplier
}
%' or parentsuppliername like '%
{
supplier
}
%') "
;
}
sql
+=
" order by lastupdatetime desc"
;
var
list
=
cn
.
Page
<
dc_logistics_supplier_config
>(
parameter
.
pageIndex
,
parameter
.
limit
,
sql
,
ref
total
).
ToList
();
return
list
;
}
}
/// <summary>
/// 设置物流供应商的往来配置
/// </summary>
/// <param name="supplier">供应商名称</param>
/// <param name="parentsupplier">父级供应商(type=1必须传值)</param>
/// <param name="type">类型,1:需合并的,2:需删除不统计的</param>
/// <param name="uid">当前用户id</param>
/// <param name="username">当前用户名称</param>
/// <returns></returns>
public
string
SaveLogisticsSupplierConfig
(
string
supplier
,
string
parentsupplier
,
int
type
,
int
uid
,
string
username
)
{
try
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
sql
=
$@"select * from dc_logistics_supplier_config where type=
{
type
}
and suppliername='
{
supplier
}
' and parentsuppliername='
{
parentsupplier
}
'"
;
var
obj
=
cn
.
QueryFirstOrDefault
<
dc_logistics_supplier_config
>(
sql
);
if
(
obj
==
null
)
{
obj
=
new
dc_logistics_supplier_config
{
lastupdatetime
=
DateTime
.
Now
,
};
}
obj
.
lastupdateuserid
=
uid
;
obj
.
lastupdateusername
=
username
;
obj
.
suppliername
=
supplier
;
obj
.
parentsuppliername
=
parentsupplier
;
obj
.
lastupdatetime
=
DateTime
.
Now
;
obj
.
lastupdateuserid
=
uid
;
obj
.
lastupdateusername
=
username
;
obj
.
type
=
type
;
obj
.
delstatus
=
0
;
if
(
obj
.
id
>
0
)
{
cn
.
Update
<
dc_logistics_supplier_config
>(
obj
);
}
else
{
cn
.
Insert
<
dc_logistics_supplier_config
>(
obj
);
}
return
""
;
}
}
catch
(
Exception
ex
)
{
return
ex
.
Message
;
}
}
/// <summary>
/// 删除供应商配置
/// </summary>
/// <param name="id"></param>
/// <param name="uid"></param>
/// <param name="username"></param>
/// <returns></returns>
public
string
DelLogisticsSupplierConfig
(
int
id
,
int
uid
,
string
username
)
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
QueryFirstOrDefault
<
dc_logistics_supplier_config
>(
"select * from dc_logistics_supplier_config where id="
+
id
);
if
(
obj
==
null
)
{
return
"找不到该配置"
;
}
else
{
obj
.
delstatus
=
1
;
obj
.
lastupdatetime
=
DateTime
.
Now
;
obj
.
lastupdateuserid
=
uid
;
obj
.
lastupdateusername
=
username
;
cn
.
Update
<
dc_logistics_supplier_config
>(
obj
);
}
return
""
;
}
}
}
}
Bailun.DC.Web/Areas/Reports/Views/Logistics/SupplierTrancationReport.cshtml
View file @
12fc559f
...
...
@@ -24,7 +24,7 @@
<div class="form-group">
<label> </label>
<button type="button" class="btn btn-success" onclick="list();">搜索</button>
@*<button type="button" class="btn btn-primary" onclick="exportFile();">导出</button>*@
<button type="button" class="btn btn-primary" onclick="showConfig();">往来统计配置</button>
</div>
</div>
</form>
...
...
@@ -186,7 +186,9 @@
window.open('@Url.Content("~/Reports/Finance/ExportFirstSupplierPay?start=")' + start + '&end=' + end, '_blank');
}
function showConfig() {
layer_show('物流供应商往来统计配置', '@Url.Content("~/Supplier/Home/ListLogisticsSupplierConfig")', '95%', '95%');
}
</script>
}
...
...
Bailun.DC.Web/Areas/Supplier/Controllers/HomeController.cs
0 → 100644
View file @
12fc559f
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Bailun.ServiceFabric.Authorize
;
using
Bailun.ServiceFabric.Core.Extension.HttpContext
;
using
Microsoft.AspNetCore.Mvc
;
using
Bailun.ServiceFabric.Core.Extension
;
using
Bailun.DC.Models
;
using
Newtonsoft.Json
;
namespace
Bailun.DC.Web.Areas.Supplier.Controllers
{
[
Area
(
"Supplier"
)]
public
class
HomeController
:
Base
.
BaseController
{
public
IActionResult
Index
()
{
return
View
();
}
public
IActionResult
ListLogisticsSupplierConfig
()
{
return
View
();
}
/// <summary>
///
/// </summary>
/// <param name="parameter"></param>
/// <param name="supplier"></param>
/// <param name="type">类型,1:需合并的,2:需删除不统计的</param>
/// <returns></returns>
public
string
ListLogisticsSupplierConfigJson
(
BtTableParameter
parameter
,
string
supplier
,
int
type
)
{
var
total
=
0
;
var
obj
=
new
Services
.
LogisticsServices
().
ListLogisticsSupplierConfig
(
parameter
,
supplier
,
type
,
ref
total
);
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
suppliername
,
a
.
parentsuppliername
,
lastupdatetime
=
a
.
lastupdatetime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
a
.
lastupdateusername
,
type
=
a
.
type
==
1
?
"需合并"
:
"需删除"
,
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
,
});
}
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
public
JsonResult
DelLogisticsSupplierConfig
(
int
id
)
{
var
user
=
HttpContextHelper
.
Current
?.
User
;
var
result
=
new
Services
.
LogisticsServices
().
DelLogisticsSupplierConfig
(
id
,
(
user
!=
null
?
user
.
GetUid
()
:
0
),
(
user
!=
null
?
user
.
GetUserName
()
:
""
));
return
Json
(
new
{
success
=
string
.
IsNullOrEmpty
(
result
),
msg
=
result
});
}
public
IActionResult
SetLogisticsSupplierConfig
()
{
return
View
();
}
public
ActionResult
AddLogisticsSupplierConfig
()
{
return
View
();
}
/// <summary>
/// 更新物流供应商往来的统计配置
/// </summary>
/// <param name="supplier">供应商名称</param>
/// <param name="supplierparent">父级供应商名称</param>
/// <param name="type">类型,1:需合并的,2:需删除不统计的</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
public
JsonResult
SetLogisticsSupplierConfigJson
(
string
suppliername
,
string
supplierparent
,
int
type
)
{
var
user
=
HttpContextHelper
.
Current
?.
User
;
var
result
=
new
Services
.
LogisticsServices
().
SaveLogisticsSupplierConfig
(
suppliername
,
supplierparent
,
type
,
(
user
!=
null
?
user
.
GetUid
()
:
0
),
(
user
!=
null
?
user
.
GetUserName
()
:
""
));
return
Json
(
new
{
success
=
string
.
IsNullOrEmpty
(
result
),
msg
=
result
});
}
}
}
Bailun.DC.Web/Areas/Supplier/Views/Home/AddLogisticsSupplierConfig.cshtml
0 → 100644
View file @
12fc559f
@{
ViewData["Title"] = "新增物流供应商往来统计配置";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>供应商名称:</label>
<input id="suppliername" name="suppliername" class="form-control" style="width:180px" />
</div>
<div class="form-group" style="margin-left:10px;">
<label>合并后的供应商:</label>
<input id="supplierparent" name="supplierparent" class="form-control" style="width:180px" />
</div>
<div class="form-group">
<a href="javascript:;" class="btn btn-sm btn-primary" onclick="Save()">提交</a>
</div>
</div>
</form>
</div>
</div>
</div>
@section scripts{
<script type="text/javascript">
function Save() {
var name = $('#suppliername').val();
var parent = $('#supplierparent').val();
if (name == '' || parent == '') {
alert('供应商名称、合并后的供应商都不能为空');
return;
}
$.submit({
url: '@Url.Content("~/Supplier/Home/SetLogisticsSupplierConfigJson")',
paramData: 'suppliername=' + name + '&supplierparent=' + parent+'&type=1',
type:'POST',
func: function (result) {
if (result.success) {
layer.msg('提交成功');
}
else {
layer.msg(result.msg);
}
}
})
}
</script>
}
\ No newline at end of file
Bailun.DC.Web/Areas/Supplier/Views/Home/ListLogisticsSupplierConfig.cshtml
0 → 100644
View file @
12fc559f
@{
ViewData["Title"] = "配置物流供应商往来统计配置";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>类型:</label>
<select id="type" name="type" class="form-control" style="width:150px">
<option value="1">需要合并的</option>
<option value="2">需删除不显示的</option>
</select>
</div>
<div class="form-group">
<label>供应商名称:</label>
<input type="text" class="form-control" id="supplier" name="supplier" style="width:180px;" placeholder="请输入供应商名称" />
</div>
<div class="form-group">
<button type="button" class="btn btn-primary" onclick="init();"><i class="fa fa-search"></i> 查询</button>
<button type="button" class="btn btn-success" onclick="addparent();">新增合并供应商</button>
<button type="button" class="btn btn-warning" onclick="adddelete();">新增需删除供应商</button>
</div>
</div>
</form>
</div>
<div class="ibox-content m-b-sm border-bottom">
<table id="roletable" style="table-layout:fixed;"></table>
</div>
</div>
</div>
@section scripts{
<script src="~/css/Layer-2.1/extend/layer.ext.js"></script>
<script type="text/javascript">
var tb;
$(document).ready(function () {
init();
})
function init() {
var columns = [
{ field: 'suppliername', title: '供应商名称', width: '180' },
{ field: 'parentsuppliername', title: '合并后的供应商名称', width: '180' },
{ field: 'type', title: '类型', width: '100'},
{ field: 'lastupdatetime', title: '更新时间', width: '130' },
{ field: 'lastupdateusername', title: '更新人名称', width: '130' },
{
field: '', title: '操作', width: '100', formatter: function (v, rows) {
return '<a href="javascript:;" class="btn btn-sm btn-danger" onclick="del('+rows.id+')">删除</a>';
}
}
];
var url = '@Url.Content("~/Supplier/Home/ListLogisticsSupplierConfigJson")' + '?' + $("#toolbar").serialize();
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "",);
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function addparent() {
layer_show('新增合并的供应商配置', '@Url.Content("~/Supplier/Home/AddLogisticsSupplierConfig")', '90%', '90%');
}
function Save() {
var name = $('#suppliername').val();
var parent = $('#supplierparent').val();
if (name == '' || parent == '') {
alert('供应商名称、合并后的供应商都不能为空');
return;
}
$.submit({
url: '@Url.Content("~/Supplier/Home/SetLogisticsSupplierConfigJson")',
paramData: 'suppliername=' + name + '&supplierparent=' + parent+'&type=1',
type:'POST',
func: function (result) {
if (result.success) {
layer.msg('提交成功');
}
else {
layer.msg(result.msg);
}
}
})
}
function adddelete() {
layer.prompt({ title: '新增需删除的供应商' }, function (value, index, elem) {
if (value == '') {
alert('请输入供应商名称');
return;
}
$.submit({
url: '@Url.Content("~/Supplier/Home/SetLogisticsSupplierConfigJson")',
paramData: 'suppliername=' + value + '&supplierparent=&type=2',
type:'POST',
func: function (result) {
if (result.success) {
layer.msg('提交成功');
layer.close(index);
}
else {
layer.msg(result.msg);
}
}
})
});
}
function del(id) {
$.submit({
url: '@Url.Content("~/Supplier/Home/DelLogisticsSupplierConfig")',
paramData: 'id=' + id,
type:'POST',
func: function (result) {
if (result.success) {
layer.msg('提交成功');
init();
}
else {
layer.msg(result.msg);
}
}
})
}
</script>
}
Bailun.DC.Web/Bailun.DC.Web.csproj
View file @
12fc559f
...
...
@@ -16,8 +16,19 @@
<ItemGroup>
<PackageReference Include="Bailun.ServiceFabric.Authorize" Version="1.0.3" />
<PackageReference Include="Bailun.ServiceFabric.Core" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.10" />
<PackageReference Include="NPOI" Version="2.4.1" />
</ItemGroup>
...
...
@@ -34,6 +45,8 @@
<Folder Include="Areas\Logistics\Models\" />
<Folder Include="Areas\Reports\Data\" />
<Folder Include="Areas\Reports\Models\" />
<Folder Include="Areas\Supplier\Data\" />
<Folder Include="Areas\Supplier\Models\" />
<Folder Include="Areas\Users\Data\" />
<Folder Include="Areas\Users\Models\" />
<Folder Include="Views\Api\" />
...
...
Bailun.DC.Web/appsettings.json
View file @
12fc559f
...
...
@@ -17,7 +17,7 @@
"AuthType"
:
""
//Ƿdebugģʽ
},
"BrowseLogSetting"
:
{
"Url"
:
"http://
saas.admin.bailuntec.com/Api/Ssoadmin
/operationloginfo/addoperationloginfo"
,
"Url"
:
"http://
10.0.0.11
/operationloginfo/addoperationloginfo"
,
"CanLog"
:
"yes"
}
}
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