Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
JunmpPoliceStation
概览
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
zxw
JunmpPoliceStation
Commits
c734d17c
Commit
c734d17c
authored
Dec 29, 2022
by
zxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单警柜切换模式
物资详情换orgid 第三方停启用状态 第三方批量完成打印单 统计导出调整
parent
4366ac90
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
135 行增加
和
23 行删除
+135
-23
CabinetController.cs
JunmpPoliceStation/Controllers/CabinetController.cs
+10
-2
InventoryController.cs
JunmpPoliceStation/Controllers/InventoryController.cs
+11
-4
OrganizationController.cs
JunmpPoliceStation/Controllers/OrganizationController.cs
+43
-16
PrintController.cs
JunmpPoliceStation/Controllers/PrintController.cs
+71
-1
TjController.cs
JunmpPoliceStation/Controllers/TjController.cs
+0
-0
没有找到文件。
JunmpPoliceStation/Controllers/CabinetController.cs
View file @
c734d17c
...
...
@@ -274,7 +274,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[
HttpPost
(
"ChangeCabinetType"
)]
[
NoSign
]
public
async
Task
<
HttpResponseMessage
>
ChangeCabinetType
([
FromBody
]
JObject
jdata
)
{
return
await
Task
.
Run
(()
=>
...
...
@@ -317,12 +317,20 @@ namespace JunmpPoliceStation.Controllers
var
innerInv
=
updateInv
.
Where
(
x
=>
x
.
CurrentState
==
3
).
ToList
();
if
(
innerInv
.
Count
>
0
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
CABINET_INVENTORY_EXIST
);
//return JsonManager.SimpleStatusResponse(ResultCode.CABINET_INVENTORY_EXIST);
//清除物资绑定
foreach
(
var
inventory
in
innerInv
)
{
inventory
.
CabinetId
=
null
;
inventory
.
CurrentState
=
8
;
updateInvs
.
Add
(
inventory
);
}
}
var
outInv
=
updateInv
.
Where
(
x
=>
x
.
CurrentState
==
7
).
ToList
();
foreach
(
var
Inv
in
outInv
)
{
Inv
.
CabinetId
=
null
;
Inv
.
CurrentState
=
8
;
updateInvs
.
Add
(
Inv
);
}
}
...
...
JunmpPoliceStation/Controllers/InventoryController.cs
View file @
c734d17c
...
...
@@ -9222,11 +9222,11 @@ namespace JunmpPoliceStation.Controllers
{
if
(
entity
.
level
==
"本级"
)
{
expression
=
t
=>
t
.
WarehouseCodeNavigation
.
Orgization
Id
.
Equals
(
OrgId
);
expression
=
t
=>
t
.
Org
Id
.
Equals
(
OrgId
);
}
else
{
expression
=
t
=>
dataList
.
Select
(
c
=>
c
.
Id
).
Contains
(
t
.
WarehouseCodeNavigation
.
Orgization
Id
);
expression
=
t
=>
dataList
.
Select
(
c
=>
c
.
Id
).
Contains
(
t
.
Org
Id
);
}
}
else
...
...
@@ -9289,11 +9289,18 @@ namespace JunmpPoliceStation.Controllers
expression
=
LambdaExtensions
.
AndAlso
(
expression
,
t
=>
t
.
CurrentState
!=
6
&&
t
.
IsFixed
==
true
);
break
;
}
case
"单警柜装备"
:
case
"单警柜中"
:
{
expression
=
LambdaExtensions
.
AndAlso
(
expression
,
t
=>
t
.
CurrentState
==
3
||
t
.
CurrentState
==
7
);
break
;
}
case
"仓库装备"
:
{
//(不包括单警柜的装备)
expression
=
LambdaExtensions
.
AndAlso
(
expression
,
t
=>
t
.
CurrentState
!=
3
&&
t
.
CurrentState
!=
7
);
break
;
}
default
:
break
;
}
...
...
@@ -9399,8 +9406,8 @@ namespace JunmpPoliceStation.Controllers
equipment
.
EquipmentCode
,
warehouseName
=
equipment
.
WarehouseCodeNavigation
?.
Name
,
equipment
.
WarehouseCode
,
equipment
.
WarehouseCodeNavigation
?.
Orgization
?.
Name
,
equipment
.
WarehouseCodeNavigation
?.
Orgization
Id
,
equipment
.
Org
?.
Name
,
equipment
.
Org
Id
,
supplierName
=
equipment
.
SupplierCodeNavigation
?.
Name
,
equipment
.
SupplierCode
,
cabinetID
=
equipment
.
Cabinet
?.
Id
,
...
...
JunmpPoliceStation/Controllers/OrganizationController.cs
View file @
c734d17c
...
...
@@ -16,6 +16,9 @@ using System.Linq.Expressions;
using
System.Net.Http
;
using
System.Threading.Tasks
;
using
JmpCommon.Tools
;
using
System.Configuration
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.DependencyInjection
;
namespace
JunmpPoliceStation.Controllers
{
...
...
@@ -243,28 +246,45 @@ namespace JunmpPoliceStation.Controllers
string
id
=
entity
.
id
;
string
state
=
entity
.
state
;
var
OrgInfo
=
_unitOfWork
.
OrganizationRepository
.
Get
(
p
=>
p
.
Id
.
Equals
(
id
));
if
(
OrgInfo
!=
null
)
using
(
var
scope
=
_unitOfWork
.
BeginTransaction
())
{
OrgInfo
.
State
=
short
.
Parse
(
state
);
bool
result
=
_unitOfWork
.
OrganizationRepository
.
Update
(
OrgInfo
,
true
);
if
(
result
)
try
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_SUCCESS
);
var
OrgInfo
=
_unitOfWork
.
OrganizationRepository
.
Get
(
p
=>
p
.
Id
.
Equals
(
id
));
if
(
OrgInfo
!=
null
)
{
OrgInfo
.
State
=
short
.
Parse
(
state
);
bool
result
=
_unitOfWork
.
OrganizationRepository
.
Update
(
OrgInfo
,
true
);
if
(
result
)
{
//更新第三方停启用状态
using
(
var
dbContext
=
new
ApiSysDbContext
())
{
dbContext
.
Database
.
ExecuteSqlRaw
(
"update api_org set state={0} WHERE id={1}"
,
OrgInfo
.
State
,
OrgInfo
.
Id
);
}
scope
.
Commit
();
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_SUCCESS
);
}
else
{
scope
.
Rollback
();
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
}
else
{
scope
.
Rollback
();
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
ORGANIZATION_ERROR
);
}
}
else
catch
(
Exception
e
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
scope
.
Rollback
();
throw
;
}
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
ORGANIZATION_ERROR
);
}
}
else
{
...
...
@@ -1453,6 +1473,13 @@ namespace JunmpPoliceStation.Controllers
#
endregion
}
public
class
ApiSysDbContext
:
DbContext
{
protected
override
void
OnConfiguring
(
DbContextOptionsBuilder
optionsBuilder
)
{
var
configuration
=
Startup
.
ServiceLocator
.
Instance
.
GetService
<
IConfiguration
>();
optionsBuilder
.
UseSqlServer
(
configuration
.
GetConnectionString
(
"ApiSysConnection"
));
}
}
}
JunmpPoliceStation/Controllers/PrintController.cs
View file @
c734d17c
...
...
@@ -21,6 +21,7 @@ using JunmpPoliceStation.Extensions;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.Extensions.Logging
;
using
MySqlX.XDevAPI.Common
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
Rextec.SOA.Infrastructure
;
...
...
@@ -744,6 +745,75 @@ namespace JunmpPoliceStation.Controllers
}
/// <summary>
/// 批量更新EPC打印状态(第三方使用)
/// </summary>
/// <param name="jdata"></param>
/// <returns></returns>
/// <remarks>
/// /// ## 例子
///
/// {
/// "idList":["111","222"],
/// }
/// </remarks>
[
HttpPost
(
"UpdateRangeEpcStateDevelop"
)]
[
ServiceFilter
(
typeof
(
ActionLimitAttribute
))]
//[NoSign]
public
async
Task
<
HttpResponseMessage
>
UpdateRangeEpcStateDevelop
([
FromBody
]
JObject
jdata
)
{
return
await
Task
.
Run
(()
=>
{
try
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
if
(!
entity
.
idList
is
IEnumerable
)
{
return
JsonManager
.
SimpleCustResponse
(
$"idList is require"
);
}
var
list
=
new
List
<
string
>();
foreach
(
var
id
in
entity
.
idList
)
{
list
.
Add
(
id
.
ToString
());
}
var
epcs
=
_unitOfWork
.
DbContext
.
CommonJpPurchaseEpcs
.
Where
(
t
=>
list
.
Contains
(
t
.
Id
)
&&
(
t
.
CurrentState
==
0
||
t
.
CurrentState
==
1
)
//允许重复执行打印绑定操作
)
.
ToList
();
if
(
epcs
.
Count
>
0
)
{
foreach
(
var
epc
in
epcs
)
{
epc
.
CurrentState
=
1
;
}
}
bool
result
=
_unitOfWork
.
PurchaseEpcsRepository
.
Update
(
epcs
);
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_SUCCESS
);
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
});
}
/// <summary>
/// 获取装备号型、供应商
/// </summary>
/// <param name="jdata"></param>
...
...
@@ -3793,7 +3863,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[
HttpPost
(
"EditInventory"
)]
[
SwaggerIgnore
]
//
[SwaggerIgnore]
public
async
Task
<
HttpResponseMessage
>
EditInventory
([
FromBody
]
JObject
jdata
)
{
return
await
Task
.
Run
(()
=>
...
...
JunmpPoliceStation/Controllers/TjController.cs
View file @
c734d17c
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论