Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_local_platform
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_local_platform
Commits
5a027edb
Commit
5a027edb
authored
Oct 07, 2023
by
赵剑炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改消息队列上报内容
parent
3d7bb1ad
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
195 行增加
和
12 行删除
+195
-12
APIs.csproj
WebApiNET6-master/APIs/APIs.csproj
+6
-1
BaseInfoController.cs
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
+73
-0
MapperProfile.cs
WebApiNET6-master/APIs/Profiles/MapperProfile.cs
+3
-0
Program.cs
WebApiNET6-master/APIs/Program.cs
+1
-1
FingerFaceReq.cs
WebApiNET6-master/APIs/Req/FingerFaceReq.cs
+14
-0
平台.ico
WebApiNET6-master/APIs/平台.ico
+0
-0
InfoListReq.cs
WebApiNET6-master/Models/ReqModel/InfoListReq.cs
+19
-0
Police.cs
WebApiNET6-master/Models/Table/Police.cs
+2
-0
IBaseRepository.cs
WebApiNET6-master/Repositories/IRepository/IBaseRepository.cs
+1
-0
IPoliceRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/IPoliceRepository.cs
+8
-1
BaseRepository.cs
WebApiNET6-master/Repositories/Repository/BaseRepository.cs
+10
-0
LogSummaryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
+3
-5
PoliceRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/PoliceRepository.cs
+29
-2
BaseService.cs
WebApiNET6-master/Services/BaseService.cs
+4
-0
IBaseService.cs
WebApiNET6-master/Services/Interface/IBaseService.cs
+1
-0
IPoliceService.cs
WebApiNET6-master/Services/Interface/IPoliceService.cs
+9
-1
PoliceService.cs
WebApiNET6-master/Services/PoliceService.cs
+12
-1
没有找到文件。
WebApiNET6-master/APIs/APIs.csproj
View file @
5a027edb
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>平台.ico</ApplicationIcon>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
...
@@ -11,13 +12,17 @@
...
@@ -11,13 +12,17 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Content Include="平台.ico" />
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="1
1.0.0
" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="1
2.0.1
" />
<PackageReference Include="FluentValidation.AspNetCore" Version="10.4.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="10.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.3" />
...
...
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
View file @
5a027edb
...
@@ -12,6 +12,7 @@ using Models.ToolsModel;
...
@@ -12,6 +12,7 @@ using Models.ToolsModel;
using
Newtonsoft.Json
;
using
Newtonsoft.Json
;
using
Services
;
using
Services
;
using
Services.Interface
;
using
Services.Interface
;
using
SqlSugar
;
using
static
Microsoft
.
AspNetCore
.
Razor
.
Language
.
TagHelperMetadata
;
using
static
Microsoft
.
AspNetCore
.
Razor
.
Language
.
TagHelperMetadata
;
namespace
APIs.Controllers
namespace
APIs.Controllers
...
@@ -35,7 +36,79 @@ namespace APIs.Controllers
...
@@ -35,7 +36,79 @@ namespace APIs.Controllers
Mapper
=
mapper
;
Mapper
=
mapper
;
}
}
/// <summary>
/// 新增基础信息
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[
HttpPost
]
public
virtual
async
Task
<
ApiResult
>
UploadInfo
([
FromBody
]
InfoListReq
req
)
{
try
{
string
idlist
=
string
.
Join
(
","
,
req
.
infoList
.
Select
(
d
=>
d
.
policeId
).
ToArray
());
var
list
=
idlist
.
Split
(
","
);
var
police
=
await
_policeService
.
Query
(
p
=>
list
.
Contains
(
p
.
id
));
if
(
police
!=
null
)
{
foreach
(
var
item
in
police
)
{
var
itemnew
=
req
.
infoList
.
Where
(
p
=>
p
.
policeId
.
Equals
(
item
.
id
)).
FirstOrDefault
();
if
(
itemnew
!=
null
)
{
item
.
fingerInfo
=
itemnew
.
fingerInfo
;
item
.
faceInfo
=
itemnew
.
faceInfo
;
}
}
int
result
=
_policeService
.
UpdateObjs
(
police
);
if
(
result
>
0
)
{
var
src
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
data
=
police
};
return
src
;
}
else
{
var
src
=
new
ApiResult
{
code
=
ResultCode
.
POLICE_ERROR
.
Code
,
msg
=
ResultCode
.
POLICE_ERROR
.
Msg
,
data
=
""
};
return
src
;
}
}
else
{
var
src
=
new
ApiResult
{
code
=
ResultCode
.
POLICE_ERROR
.
Code
,
msg
=
ResultCode
.
POLICE_ERROR
.
Msg
,
data
=
""
};
return
src
;
}
}
catch
(
Exception
ex
)
{
var
error
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ex
.
Message
,
};
return
error
;
}
}
/// <summary>
/// <summary>
/// 查询人员信息
/// 查询人员信息
...
...
WebApiNET6-master/APIs/Profiles/MapperProfile.cs
View file @
5a027edb
using
APIs.Dto
;
using
APIs.Dto
;
using
APIs.Req
;
using
AutoMapper
;
using
AutoMapper
;
using
Common.Utility.Model
;
using
Common.Utility.Model
;
using
Models.SqlModel
;
using
Models.SqlModel
;
...
@@ -16,5 +17,6 @@ public class MapperProfile : Profile
...
@@ -16,5 +17,6 @@ public class MapperProfile : Profile
CreateMap
<
RecordsReq
,
LogSummary
>();
CreateMap
<
RecordsReq
,
LogSummary
>();
CreateMap
<
LogDetail
,
EquipmentList
>();
CreateMap
<
LogDetail
,
EquipmentList
>();
CreateMap
<
EquipmentList
,
LogDetail
>();
CreateMap
<
EquipmentList
,
LogDetail
>();
}
}
}
}
\ No newline at end of file
WebApiNET6-master/APIs/Program.cs
View file @
5a027edb
...
@@ -33,7 +33,7 @@ public class Program
...
@@ -33,7 +33,7 @@ public class Program
var
logger
=
NLogBuilder
.
ConfigureNLog
(
"nlog.config"
).
GetCurrentClassLogger
();
var
logger
=
NLogBuilder
.
ConfigureNLog
(
"nlog.config"
).
GetCurrentClassLogger
();
try
try
{
{
Console
.
WriteLine
(
$"[
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm"
)}
]"
+
"--------------
init main
--------------"
);
Console
.
WriteLine
(
$"[
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm"
)}
]"
+
"--------------
程序初始化中
--------------"
);
Console
.
WriteLine
(
"程序启动成功"
);
Console
.
WriteLine
(
"程序启动成功"
);
CreateHostBuilder
(
args
).
Build
().
Run
();
CreateHostBuilder
(
args
).
Build
().
Run
();
...
...
WebApiNET6-master/APIs/Req/FingerFaceReq.cs
0 → 100644
View file @
5a027edb
namespace
APIs.Req
{
public
class
InfoListReq
{
public
List
<
FingerFace
>
infoList
{
get
;
set
;
}
}
public
class
FingerFace
{
public
String
policeId
{
get
;
set
;
}
public
String
faceInfo
{
get
;
set
;
}
public
String
fingerInfo
{
get
;
set
;
}
}
}
WebApiNET6-master/APIs/平台.ico
0 → 100644
View file @
5a027edb
File added
WebApiNET6-master/Models/ReqModel/InfoListReq.cs
0 → 100644
View file @
5a027edb
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Models.ReqModel
{
public
class
InfoList
{
public
List
<
FingerFace
>
infoList
{
get
;
set
;
}
}
public
class
FingerFace
{
public
String
id
{
get
;
set
;
}
public
String
faceInfo
{
get
;
set
;
}
public
String
fingerInfo
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/Police.cs
View file @
5a027edb
...
@@ -25,5 +25,7 @@ namespace Models.Table
...
@@ -25,5 +25,7 @@ namespace Models.Table
[
SugarColumn
(
ColumnName
=
"id_card"
)]
[
SugarColumn
(
ColumnName
=
"id_card"
)]
public
String
?
idCard
{
get
;
set
;
}
public
String
?
idCard
{
get
;
set
;
}
public
String
?
sex
{
get
;
set
;
}
public
String
?
sex
{
get
;
set
;
}
public
String
?
faceInfo
{
get
;
set
;
}
public
String
?
fingerInfo
{
get
;
set
;
}
}
}
}
}
WebApiNET6-master/Repositories/IRepository/IBaseRepository.cs
View file @
5a027edb
...
@@ -13,6 +13,7 @@ namespace Repositories.IRepository
...
@@ -13,6 +13,7 @@ namespace Repositories.IRepository
Task
<
int
>
Add
(
TEntity
entity
);
Task
<
int
>
Add
(
TEntity
entity
);
Task
<
int
>
Add
(
List
<
TEntity
>
listEntity
);
Task
<
int
>
Add
(
List
<
TEntity
>
listEntity
);
Task
<
bool
>
Update
(
TEntity
entity
);
Task
<
bool
>
Update
(
TEntity
entity
);
int
UpdateObjs
(
List
<
TEntity
>
entity
);
Task
<
bool
>
DeleteByIds
(
int
[]
ids
);
Task
<
bool
>
DeleteByIds
(
int
[]
ids
);
Task
<
bool
>
DeleteById
(
object
id
);
Task
<
bool
>
DeleteById
(
object
id
);
...
...
WebApiNET6-master/Repositories/IRepository/IBussiness/IPoliceRepository.cs
View file @
5a027edb
using
Models.SqlModel
;
using
Models.ReqModel
;
using
Models.SqlModel
;
using
Models.Table
;
using
Models.Table
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -10,5 +11,11 @@ namespace Repositories.IRepository.IBussiness
...
@@ -10,5 +11,11 @@ namespace Repositories.IRepository.IBussiness
{
{
public
interface
IPoliceRepository
:
IBaseRepository
<
Police
>
public
interface
IPoliceRepository
:
IBaseRepository
<
Police
>
{
{
/// <summary>
///
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
int
UpdateInfos
(
InfoList
req
);
}
}
}
}
WebApiNET6-master/Repositories/Repository/BaseRepository.cs
View file @
5a027edb
...
@@ -38,6 +38,9 @@ namespace Repositories.Repository
...
@@ -38,6 +38,9 @@ namespace Repositories.Repository
return
await
context
.
Updateable
(
entity
).
ExecuteCommandHasChangeAsync
();
return
await
context
.
Updateable
(
entity
).
ExecuteCommandHasChangeAsync
();
}
}
}
}
public
async
Task
<
bool
>
DeleteByIds
(
int
[]
ids
)
public
async
Task
<
bool
>
DeleteByIds
(
int
[]
ids
)
{
{
using
(
var
context
=
_db
.
GetDbClient
())
using
(
var
context
=
_db
.
GetDbClient
())
...
@@ -151,5 +154,12 @@ namespace Repositories.Repository
...
@@ -151,5 +154,12 @@ namespace Repositories.Repository
}
}
int
IBaseRepository
<
TEntity
>.
UpdateObjs
(
List
<
TEntity
>
entity
)
{
using
(
var
context
=
_db
.
GetDbClient
())
{
return
context
.
Updateable
(
entity
).
ExecuteCommand
();
}
}
}
}
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
View file @
5a027edb
...
@@ -29,18 +29,16 @@ namespace Repositories.Repository.Bussiness
...
@@ -29,18 +29,16 @@ namespace Repositories.Repository.Bussiness
//var invs = await context.Queryable<Inventory>().Where(x =>
//var invs = await context.Queryable<Inventory>().Where(x =>
//model.DetailList.Select(x => x.epc).Contains(x.epc)).ToListAsync();
//model.DetailList.Select(x => x.epc).Contains(x.epc)).ToListAsync();
context
.
BeginTran
();
context
.
BeginTran
();
await
context
.
Updateable
(
cars
).
WhereColumns
(
it
=>
new
{
it
.
id
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommandAsync
();
//实体有多少列更新多少列
context
.
Updateable
(
cars
).
WhereColumns
(
it
=>
new
{
it
.
id
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommand
();
//实体有多少列更新多少列
var
result
=
await
context
.
Updateable
(
inv
).
WhereColumns
(
it
=>
new
{
it
.
epc
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommandAsync
();
//实体有多少列更新多少列
var
result
=
context
.
Updateable
(
inv
).
WhereColumns
(
it
=>
new
{
it
.
epc
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommand
();
//实体有多少列更新多少列
var
logSum
=
await
context
.
InsertNav
(
model
)
var
logSum
=
context
.
InsertNav
(
model
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
ExecuteCommandAsync
();
.
ExecuteCommandAsync
();
context
.
CommitTran
();
context
.
CommitTran
();
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
context
.
RollbackTran
();
return
false
;
throw
e
;
throw
e
;
}
}
}
}
...
...
WebApiNET6-master/Repositories/Repository/Bussiness/PoliceRepository.cs
View file @
5a027edb
using
Models.SqlModel
;
using
Models.ReqModel
;
using
Models.SqlModel
;
using
Models.Table
;
using
Models.Table
;
using
Repositories.IRepository.IBussiness
;
using
Repositories.IRepository.IBussiness
;
using
Repositories.IRepository.IUnitOfWork
;
using
Repositories.IRepository.IUnitOfWork
;
...
@@ -12,10 +13,36 @@ using System.Threading.Tasks;
...
@@ -12,10 +13,36 @@ using System.Threading.Tasks;
namespace
Repositories.Repository.Bussiness
namespace
Repositories.Repository.Bussiness
{
{
public
class
PoliceRepository
:
BaseRepository
<
Police
>,
IPoliceRepository
public
class
PoliceRepository
:
BaseRepository
<
Police
>,
IPoliceRepository
{
{
protected
readonly
ILocalSugarUnitOfWork
_suger
;
public
PoliceRepository
(
ILocalSugarUnitOfWork
sugarUnitOfWork
)
:
base
(
sugarUnitOfWork
)
public
PoliceRepository
(
ILocalSugarUnitOfWork
sugarUnitOfWork
)
:
base
(
sugarUnitOfWork
)
{
{
_suger
=
sugarUnitOfWork
;
}
public
int
UpdateInfos
(
InfoList
req
)
{
return
0
;
//using (var context = _suger.GetDbClient())
//{
// try
// {
// context.BeginTran();
// var result = context.Updateable(req.infoList).WhereColumns(it => new { it.policeId }).UpdateColumns(it => new { it.faceInfo, it.fingerInfo }).ExecuteCommandAsync();//实体有多少列更新多少列
// context.CommitTran();
// }
// catch (Exception e)
// {
// context.RollbackTran();
// return 0;
// throw e;
// }
//}
//return true;
}
}
}
}
}
}
WebApiNET6-master/Services/BaseService.cs
View file @
5a027edb
...
@@ -48,6 +48,10 @@ namespace Services
...
@@ -48,6 +48,10 @@ namespace Services
{
{
return
await
BaseDal
.
Update
(
entity
);
return
await
BaseDal
.
Update
(
entity
);
}
}
public
int
UpdateObjs
(
List
<
TEntity
>
entity
)
{
return
BaseDal
.
UpdateObjs
(
entity
);
}
public
async
Task
<
bool
>
DeleteById
(
object
id
)
public
async
Task
<
bool
>
DeleteById
(
object
id
)
{
{
return
await
BaseDal
.
DeleteById
(
id
);
return
await
BaseDal
.
DeleteById
(
id
);
...
...
WebApiNET6-master/Services/Interface/IBaseService.cs
View file @
5a027edb
...
@@ -15,6 +15,7 @@ namespace Services.Interface
...
@@ -15,6 +15,7 @@ namespace Services.Interface
Task
<
int
>
Add
(
TEntity
entity
);
Task
<
int
>
Add
(
TEntity
entity
);
Task
<
int
>
Add
(
List
<
TEntity
>
listEntity
);
Task
<
int
>
Add
(
List
<
TEntity
>
listEntity
);
Task
<
bool
>
Update
(
TEntity
entity
);
Task
<
bool
>
Update
(
TEntity
entity
);
int
UpdateObjs
(
List
<
TEntity
>
entity
);
Task
<
bool
>
DeleteByIds
(
int
[]
ids
);
Task
<
bool
>
DeleteByIds
(
int
[]
ids
);
Task
<
bool
>
DeleteById
(
object
id
);
Task
<
bool
>
DeleteById
(
object
id
);
...
...
WebApiNET6-master/Services/Interface/IPoliceService.cs
View file @
5a027edb
using
Models.SqlModel
;
using
Common.Utility.Model
;
using
Models.ReqModel
;
using
Models.SqlModel
;
using
Models.Table
;
using
Models.Table
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -10,6 +12,12 @@ namespace Services.Interface
...
@@ -10,6 +12,12 @@ namespace Services.Interface
{
{
public
interface
IPoliceService
:
IBaseServices
<
Police
>
public
interface
IPoliceService
:
IBaseServices
<
Police
>
{
{
/// <summary>
/// 修改基础信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
int
UpdateInfo
(
InfoList
model
);
}
}
}
}
WebApiNET6-master/Services/PoliceService.cs
View file @
5a027edb
using
Models.SqlModel
;
using
AutoMapper
;
using
Common.Utility.Model
;
using
Models.ReqModel
;
using
Models.SqlModel
;
using
Models.Table
;
using
Models.Table
;
using
Repositories.IRepository.IBussiness
;
using
Repositories.IRepository.IBussiness
;
using
Repositories.Repository.Bussiness
;
using
Services.Interface
;
using
Services.Interface
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -19,5 +23,12 @@ namespace Services
...
@@ -19,5 +23,12 @@ namespace Services
_policeRepository
=
policeRepository
;
_policeRepository
=
policeRepository
;
}
}
public
int
UpdateInfo
(
InfoList
model
)
{
throw
new
NotImplementedException
();
}
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论