Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
be1b9fb3
提交
be1b9fb3
authored
9月 06, 2021
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(核查模块): 修复了省发起检查时省审核通过后 核查结果的显示问题
修复了省发起检查时省审核通过后 核查结果的显示问题
上级
2079bfca
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
40 行增加
和
22 行删除
+40
-22
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+40
-22
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
be1b9fb3
...
...
@@ -138,7 +138,7 @@ public class DeviceCheckController {
*/
@GetMapping
(
"/handleUsers/{id}"
)
@ApiOperation
(
value
=
"查询该detail经手的相关人员"
)
public
ResponseEntity
getDetailHanderUsers
(
@PathVariable
Integer
id
){
public
ResponseEntity
getDetailHanderUsers
(
@PathVariable
Integer
id
)
{
DeviceCheckDetail
detail
=
detailRepo
.
findById
(
id
).
orElseThrow
(()
->
new
ApiException
(
"没有找到id = "
+
id
+
"的detail自查单!"
));
Map
<
String
,
String
>
handUsers
=
new
HashMap
<>();
...
...
@@ -147,27 +147,27 @@ public class DeviceCheckController {
Integer
userBId
=
detail
.
getUserBId
();
Integer
userCId
=
detail
.
getUserCId
();
if
(
Objects
.
nonNull
(
startUserId
)
&&
startUserId
!=
0
)
{
if
(
Objects
.
nonNull
(
startUserId
)
&&
startUserId
!=
0
)
{
handUsers
.
put
(
"startUserId"
,
userService
.
findByUser
(
startUserId
).
getName
());
}
else
{
}
else
{
handUsers
.
put
(
"startUserId"
,
"NoBody"
);
}
if
(
Objects
.
nonNull
(
userAId
)
&&
userAId
!=
0
)
{
if
(
Objects
.
nonNull
(
userAId
)
&&
userAId
!=
0
)
{
handUsers
.
put
(
"userA"
,
userService
.
findByUser
(
userAId
).
getName
());
}
else
{
}
else
{
handUsers
.
put
(
"userA"
,
"NoBody"
);
}
if
(
Objects
.
nonNull
(
userBId
)
&&
userBId
!=
0
)
{
if
(
Objects
.
nonNull
(
userBId
)
&&
userBId
!=
0
)
{
handUsers
.
put
(
"userBId"
,
userService
.
findByUser
(
userBId
).
getName
());
}
else
{
}
else
{
handUsers
.
put
(
"userBId"
,
"NoBody"
);
}
if
(
Objects
.
nonNull
(
userCId
)
&&
userCId
!=
0
)
{
if
(
Objects
.
nonNull
(
userCId
)
&&
userCId
!=
0
)
{
handUsers
.
put
(
"userCId"
,
userService
.
findByUser
(
userCId
).
getName
());
}
else
{
}
else
{
handUsers
.
put
(
"userCId"
,
"NoBody"
);
}
...
...
@@ -220,7 +220,6 @@ public class DeviceCheckController {
}
@ApiOperation
(
value
=
"根据id查询核查详情数据"
,
notes
=
"可以通过这个接口查询核查详情数据"
)
@GetMapping
(
"/detail/{id}"
)
public
ResponseEntity
<
ResultObj
<
CheckDetailVo
>>
findDetail
(
@PathVariable
Integer
id
)
{
...
...
@@ -246,7 +245,8 @@ public class DeviceCheckController {
@ApiOperation
(
value
=
"根据id 刷新 核查详情数据"
,
notes
=
"可以通过这个接口 刷新 核查详情数据"
)
@GetMapping
(
"/detail/refresh/{id}"
)
public
ResponseEntity
<
ResultObj
<
CheckDetailVo
>>
refreshDetail
(
@PathVariable
Integer
id
)
{
DeviceCheckDetail
detail
=
detailRepo
.
findById
(
id
).
get
();
DeviceCheckDetail
detail
=
detailRepo
.
findById
(
id
)
.
orElseThrow
(()
->
new
ApiException
(
"没有找到指定的detail数据,你提供的是 id = "
+
id
));
String
checkUnit
=
detail
.
getCheckUnit
();
//查出所有装备 分为4类 A 所在是本单位 B 所属是本单位 其中
List
<
DeviceLibrary
>
allDevices
=
dcService
.
getAllDeviceLibraryList
();
...
...
@@ -377,7 +377,7 @@ public class DeviceCheckController {
.
collect
(
toList
());
totalList
.
addAll
(
casList
);
long
end1
=
System
.
currentTimeMillis
();
log
.
info
(
"[性能分析] task id = {} cost {} ms"
,
cct
.
getId
(),
end1
-
start1
);
log
.
info
(
"[性能分析] task id = {} cost {} ms"
,
cct
.
getId
(),
end1
-
start1
);
}
//
String
areaName
=
auService
.
findOne
(
AuExample
.
UnitId
,
child
.
getOwnUnit
()).
getName
();
...
...
@@ -685,7 +685,15 @@ public class DeviceCheckController {
if
(
startUnitId
!=
1
)
{
checkResult
=
"无"
;
}
else
{
checkResult
=
"等待省审核"
;
//根据detail userC为省且任务状态是完结状态时 变为无误 否则是等待省审核
Integer
detailId
=
task
.
getBillId
();
Integer
userCId
=
detailRepo
.
findById
(
detailId
).
get
().
getUserCId
();
if
(
task
.
getBillStatus
().
equals
(
END
.
id
)
&&
Objects
.
nonNull
(
userCId
)
&&
userIsProv
(
userCId
)){
checkResult
=
"无误"
;
}
else
{
checkResult
=
"等待省审核"
;
}
}
}
else
{
checkResult
=
"等待省审核"
;
...
...
@@ -698,14 +706,14 @@ public class DeviceCheckController {
redoTime
=
Integer
.
valueOf
(
remark
.
split
(
"-"
)[
1
]);
}
checkResult
=
redoTime
+
"次未通过"
;
}
else
if
(
comSituation
==
0
)
{
if
(
task
.
getBillStatus
().
equals
(
END
.
id
)){
}
else
if
(
comSituation
==
0
)
{
if
(
task
.
getBillStatus
().
equals
(
END
.
id
))
{
int
redoTime
=
1
;
if
(
Objects
.
nonNull
(
remark
)
&&
remark
.
contains
(
"ROLLBACK"
))
{
redoTime
=
Integer
.
valueOf
(
remark
.
split
(
"-"
)[
1
]);
}
checkResult
=
redoTime
+
"次未通过"
;
}
else
{
}
else
{
checkResult
=
"等待省审核"
;
}
}
else
{
...
...
@@ -718,6 +726,17 @@ public class DeviceCheckController {
return
led
;
}
/**
* 判断用户是否是省级用户
*
* @return
*/
private
boolean
userIsProv
(
Integer
userId
)
{
Integer
unitsId
=
userService
.
findById
(
userId
).
getUnitsId
();
Integer
level
=
unitsRepo
.
findById
(
unitsId
).
get
().
getLevel
();
return
level
==
1
;
}
/**
* @param periodId 1-月度 2-季度 3-年度
* @return
...
...
@@ -784,10 +803,9 @@ public class DeviceCheckController {
}
@ApiOperation
(
value
=
"根据地区ID获取下级的单位"
,
notes
=
"根据地区ID获取下级的单位"
)
@GetMapping
(
"/under/{areaId}"
)
public
ResponseEntity
getUnitsUnderAreaId
(
@PathVariable
Integer
areaId
,
@RequestParam
(
defaultValue
=
"true"
)
boolean
filter
)
{
public
ResponseEntity
getUnitsUnderAreaId
(
@PathVariable
Integer
areaId
,
@RequestParam
(
defaultValue
=
"true"
)
boolean
filter
)
{
//1.获取child AreaId List
List
<
Integer
>
areaIds
=
areaRepo
.
findAllByFatherId
(
areaId
).
stream
()
.
map
(
Area:
:
getId
)
...
...
@@ -797,7 +815,7 @@ public class DeviceCheckController {
List
<
Units
>
unitsList
=
unitsRepo
.
findAllByAreaIdIn
(
areaIds
);
// 根据filter 决定是否将没有数据的装备给过滤掉
if
(
filter
){
if
(
filter
)
{
unitsList
=
unitsList
.
stream
()
.
filter
(
unit
->
deviceRepo
.
findAllByOwnUnit
(
unit
.
getName
()).
size
()
!=
0
)
.
collect
(
toList
());
...
...
@@ -1383,7 +1401,7 @@ public class DeviceCheckController {
currentDetail
.
setCheckFiles
(
""
);
currentDetail
.
setCheckFileList
(
Lists
.
newArrayList
());
Integer
userId
=
authenticationUtils
.
getAuthentication
().
getCurrentUserInfo
().
getUserId
();
currentDetail
.
setUserCId
(
userId
);
currentDetail
.
setUserCId
(
0
);
currentDetail
=
detailRepo
.
save
(
currentDetail
);
//该detail对应的stat数据里相应的数据剔除(写一个通用的剔除方法), 否则在第二次审核通过的时候会重复计算一次数据
TaskBto
fatherTask
=
taskService
.
get
(
currentTask
.
getParentTaskId
());
...
...
@@ -1870,14 +1888,14 @@ public class DeviceCheckController {
continue
;
}
String
[]
device
=
s
.
split
(
"-"
);
if
(
device
.
length
<
2
||
StringUtils
.
isEmpty
(
device
[
0
]))
{
if
(
device
.
length
<
2
||
StringUtils
.
isEmpty
(
device
[
0
]))
{
continue
;
}
int
deviceId
=
Integer
.
parseInt
(
device
[
0
]);
int
proofResult
=
Integer
.
parseInt
(
device
[
1
]);
DeviceLibrary
checkDevice
=
deviceMap
.
get
(
deviceId
);
if
(
Objects
.
isNull
(
checkDevice
)){
if
(
Objects
.
isNull
(
checkDevice
))
{
continue
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论