Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
c0dc335d
提交
c0dc335d
authored
9月 17, 2021
作者:
zjm
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'bug' 到 'master'
fix(核查模块): 增加关于省本级与省直属的特殊接口的处理问题 查看合并请求
!50
上级
fe30d6e5
43473246
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
98 行增加
和
19 行删除
+98
-19
CheckType.java
...va/com/tykj/dev/device/confirmcheck/common/CheckType.java
+2
-2
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+96
-17
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/common/CheckType.java
浏览文件 @
c0dc335d
...
@@ -14,11 +14,11 @@ import lombok.Getter;
...
@@ -14,11 +14,11 @@ import lombok.Getter;
public
enum
CheckType
{
public
enum
CheckType
{
/**
/**
*
自动
核查
* 核查
*/
*/
CT_CHECK
(
0
,
"核查"
),
CT_CHECK
(
0
,
"核查"
),
/**
/**
*
手动核
查
*
检
查
*/
*/
CT_EXAM
(
1
,
"检查"
);
CT_EXAM
(
1
,
"检查"
);
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
c0dc335d
...
@@ -37,6 +37,7 @@ import com.tykj.dev.device.user.subject.entity.bto.AreaUnit;
...
@@ -37,6 +37,7 @@ import com.tykj.dev.device.user.subject.entity.bto.AreaUnit;
import
com.tykj.dev.device.user.subject.service.AuService
;
import
com.tykj.dev.device.user.subject.service.AuService
;
import
com.tykj.dev.device.user.subject.service.UserService
;
import
com.tykj.dev.device.user.subject.service.UserService
;
import
com.tykj.dev.device.user.util.AuthenticationUtils
;
import
com.tykj.dev.device.user.util.AuthenticationUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.ResultObj
;
import
com.tykj.dev.misc.base.ResultObj
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.exception.ApiException
;
...
@@ -117,6 +118,10 @@ public class DeviceCheckController {
...
@@ -117,6 +118,10 @@ public class DeviceCheckController {
@Autowired
@Autowired
private
SelfCheckController
selfCheckController
;
private
SelfCheckController
selfCheckController
;
final
String
CHECK_RESULT_WAIT
=
"等待省查阅"
;
final
String
CHECK_RESULT_DONE
=
"已查阅"
;
@GetMapping
(
"/area/{fatherId}"
)
@GetMapping
(
"/area/{fatherId}"
)
@ApiOperation
(
value
=
"查询指定区域下的所有区域信息"
)
@ApiOperation
(
value
=
"查询指定区域下的所有区域信息"
)
public
ResponseEntity
<
ResultObj
<
List
<
Area
>>>
findAreaUnderId
(
@PathVariable
Integer
fatherId
)
{
public
ResponseEntity
<
ResultObj
<
List
<
Area
>>>
findAreaUnderId
(
@PathVariable
Integer
fatherId
)
{
...
@@ -242,6 +247,44 @@ public class DeviceCheckController {
...
@@ -242,6 +247,44 @@ public class DeviceCheckController {
return
ResponseEntity
.
ok
(
new
ResultObj
<>(
detailVoList
));
return
ResponseEntity
.
ok
(
new
ResultObj
<>(
detailVoList
));
}
}
private
int
specialDetailId
=
0
;
private
List
<
String
>
specialUnits
=
new
ArrayList
<>();
@GetMapping
(
"/detail/refresh/remove/{checkId}/{detailId}"
)
public
ResponseEntity
<
String
>
removeUnitTask
(
@PathVariable
Integer
checkId
,
@PathVariable
Integer
detailId
){
log
.
info
(
"[核查模块] 移除billId = {} 中 detailId = {}的数据 "
,
checkId
,
detailId
);
DeviceCheckDetail
detail
=
detailRepo
.
findById
(
detailId
).
get
();
DeviceCheckStat
dcs
=
statRepo
.
findById
(
checkId
).
get
();
removeDetailFromDcs
(
detail
,
dcs
);
log
.
info
(
"[核查模块] 从stat id = {} 中删除detail id = {}的数据"
,
checkId
,
detailId
);
// 删除task
Task
task
=
taskRepo
.
findByBillIdAndBusinessType
(
detailId
,
CONFIRM_CHECK_DETAIL
.
id
).
get
();
taskRepo
.
deleteById
(
task
.
getId
());
log
.
info
(
"[核查模块] 删除task id = {} 的任务"
,
task
.
getId
());
return
ResponseEntity
.
ok
(
"成功删除数据"
);
}
@GetMapping
(
"/detail/refresh/active/{id}"
)
public
ResponseEntity
<
String
>
activeSpecialData
(
@PathVariable
Integer
id
,
@RequestParam
String
unitName1
,
@RequestParam
(
defaultValue
=
""
)
String
unitName2
){
log
.
info
(
"[核查模块] 特殊数据处理,设置specialDetailId = {},specialUnits = {} {} "
,
id
,
unitName1
,
unitName2
);
specialDetailId
=
id
;
specialUnits
.
add
(
unitName1
);
if
(!
StringUtils
.
isEmpty
(
unitName2
)){
specialUnits
.
add
(
unitName2
);
}
return
ResponseEntity
.
ok
(
"设置特殊数据处理成功"
);
}
@GetMapping
(
"/detail/refresh/reset"
)
public
ResponseEntity
<
String
>
resetSpecialData
(){
log
.
info
(
"[核查模块] 重置特殊数据! "
);
specialDetailId
=
0
;
specialUnits
=
new
ArrayList
<>();
return
ResponseEntity
.
ok
(
"设置特殊数据处理成功"
);
}
@ApiOperation
(
value
=
"根据id 刷新 核查详情数据"
,
notes
=
"可以通过这个接口 刷新 核查详情数据"
)
@ApiOperation
(
value
=
"根据id 刷新 核查详情数据"
,
notes
=
"可以通过这个接口 刷新 核查详情数据"
)
@GetMapping
(
"/detail/refresh/{id}"
)
@GetMapping
(
"/detail/refresh/{id}"
)
public
ResponseEntity
<
ResultObj
<
CheckDetailVo
>>
refreshDetail
(
@PathVariable
Integer
id
)
{
public
ResponseEntity
<
ResultObj
<
CheckDetailVo
>>
refreshDetail
(
@PathVariable
Integer
id
)
{
...
@@ -250,6 +293,41 @@ public class DeviceCheckController {
...
@@ -250,6 +293,41 @@ public class DeviceCheckController {
String
checkUnit
=
detail
.
getCheckUnit
();
String
checkUnit
=
detail
.
getCheckUnit
();
//查出所有装备 分为4类 A 所在是本单位 B 所属是本单位 其中
//查出所有装备 分为4类 A 所在是本单位 B 所属是本单位 其中
List
<
DeviceLibrary
>
allDevices
=
dcService
.
getAllDeviceLibraryList
();
List
<
DeviceLibrary
>
allDevices
=
dcService
.
getAllDeviceLibraryList
();
Map
<
Boolean
,
List
<
DeviceLibrary
>>
devLib
=
getDevLibMap
(
checkUnit
,
allDevices
);
// 更新detail
List
<
DeviceLibrary
>
devInLib
=
devLib
.
get
(
true
);
List
<
DeviceLibrary
>
devNotInLib
=
devLib
.
get
(
false
);
// 特殊单位处理 if DetailId = x , 则补充添加 name=[],[]单位的装备进来
if
(
specialDetailId
!=
0
&&
specialUnits
.
size
()
!=
0
&&
id
==
specialDetailId
){
String
unitsString
=
specialUnits
.
stream
().
collect
(
joining
(
","
,
"["
,
"]"
));
log
.
info
(
"[核查模块] 特殊数据处理,要补充特殊数据的省本级detail Id ={},要补充的单位名 = {}"
,
id
,
unitsString
);
for
(
String
specialUnit
:
specialUnits
)
{
log
.
info
(
"[核查模块] 正在补充 {} 的数据"
,
specialUnit
);
Map
<
Boolean
,
List
<
DeviceLibrary
>>
specialLib
=
getDevLibMap
(
specialUnit
,
allDevices
);
devInLib
.
addAll
(
specialLib
.
get
(
true
));
devNotInLib
.
addAll
(
specialLib
.
get
(
false
));
}
}
detail
.
updateDevice
(
devInLib
,
devNotInLib
);
detail
=
detailRepo
.
save
(
detail
);
CheckDetailVo
cdVo
=
transUtil
.
CheckDetailDo2Vo
(
detail
);
return
ResponseEntity
.
ok
(
new
ResultObj
<>(
cdVo
));
}
/**
* 获得指定单位的在库装备与非在库装备
* @param checkUnit 单位名
* @param allDevices 装备列表
* @return true -> 在库装备,false -> 非在库装备
*/
@NotNull
private
Map
<
Boolean
,
List
<
DeviceLibrary
>>
getDevLibMap
(
String
checkUnit
,
List
<
DeviceLibrary
>
allDevices
)
{
//在库 = A and B & not B 去除掉ls = 10 的装备 把ls = 11 的装备加入到非在库
//在库 = A and B & not B 去除掉ls = 10 的装备 把ls = 11 的装备加入到非在库
Map
<
Boolean
,
List
<
DeviceLibrary
>>
locationMap
=
allDevices
.
stream
()
Map
<
Boolean
,
List
<
DeviceLibrary
>>
locationMap
=
allDevices
.
stream
()
.
collect
(
partitioningBy
(
d
->
d
.
getLocationUnit
().
equals
(
checkUnit
)));
.
collect
(
partitioningBy
(
d
->
d
.
getLocationUnit
().
equals
(
checkUnit
)));
...
@@ -271,14 +349,10 @@ public class DeviceCheckController {
...
@@ -271,14 +349,10 @@ public class DeviceCheckController {
devNotInLib
.
addAll
(
ls11Lib
);
devNotInLib
.
addAll
(
ls11Lib
);
// 更新detail
Map
<
Boolean
,
List
<
DeviceLibrary
>>
devLib
=
new
HashMap
<>();
detail
.
updateDevice
(
devInLib
,
devNotInLib
);
devLib
.
put
(
true
,
devInLib
);
devLib
.
put
(
false
,
devNotInLib
);
detail
=
detailRepo
.
save
(
detail
);
return
devLib
;
CheckDetailVo
cdVo
=
transUtil
.
CheckDetailDo2Vo
(
detail
);
return
ResponseEntity
.
ok
(
new
ResultObj
<>(
cdVo
));
}
}
/**
/**
...
@@ -434,7 +508,12 @@ public class DeviceCheckController {
...
@@ -434,7 +508,12 @@ public class DeviceCheckController {
}
}
// check type = 1 检查页面 看见的是自查
// check type = 1 检查页面 看见的是自查
if
(
ctVo
.
getCheckType
()
==
1
)
{
if
(
ctVo
.
getCheckType
()
==
1
)
{
linkVo
.
setType
(
2
);
Integer
createUserId
=
ctVo
.
getCreateUserId
();
if
(
userIsProv
(
createUserId
)){
linkVo
.
setType
(
2
);
}
else
{
linkVo
.
setType
(
3
);
}
//看到的都是自查 根据tpye和billId找到父级节点 这里的根节点只能是检查节点
//看到的都是自查 根据tpye和billId找到父级节点 这里的根节点只能是检查节点
Task
rootTask
=
taskRepo
.
findAllByBillIdAndBusinessType
(
billId
,
type
).
stream
()
Task
rootTask
=
taskRepo
.
findAllByBillIdAndBusinessType
(
billId
,
type
).
stream
()
.
filter
(
task
->
Objects
.
nonNull
(
task
.
getCustomInfo
())
&&
task
.
getCustomInfo
().
contains
(
"exam"
))
.
filter
(
task
->
Objects
.
nonNull
(
task
.
getCustomInfo
())
&&
task
.
getCustomInfo
().
contains
(
"exam"
))
...
@@ -484,7 +563,7 @@ public class DeviceCheckController {
...
@@ -484,7 +563,7 @@ public class DeviceCheckController {
// type = 8 跳转
// type = 8 跳转
if
(
type
.
equals
(
CONFIRM_CHECK_DETAIL
.
id
))
{
if
(
type
.
equals
(
CONFIRM_CHECK_DETAIL
.
id
))
{
linkVo
.
setType
(
3
);
linkVo
.
setType
(
4
);
linkVo
.
setDetailId
(
billId
);
linkVo
.
setDetailId
(
billId
);
}
}
...
@@ -605,9 +684,9 @@ public class DeviceCheckController {
...
@@ -605,9 +684,9 @@ public class DeviceCheckController {
boolean
allOk
=
okCount
>=
map
.
size
();
boolean
allOk
=
okCount
>=
map
.
size
();
if
(
waitAudit
)
{
if
(
waitAudit
)
{
checkReuslt
=
"等待省审核"
;
checkReuslt
=
CHECK_RESULT_WAIT
;
}
else
if
(
allOk
)
{
}
else
if
(
allOk
)
{
checkReuslt
=
"无误"
;
checkReuslt
=
CHECK_RESULT_DONE
;
}
else
if
(
notPassed
)
{
}
else
if
(
notPassed
)
{
checkReuslt
=
"未通过"
;
checkReuslt
=
"未通过"
;
}
else
{
}
else
{
...
@@ -687,16 +766,16 @@ public class DeviceCheckController {
...
@@ -687,16 +766,16 @@ public class DeviceCheckController {
Integer
detailId
=
task
.
getBillId
();
Integer
detailId
=
task
.
getBillId
();
Integer
userCId
=
detailRepo
.
findById
(
detailId
).
get
().
getUserCId
();
Integer
userCId
=
detailRepo
.
findById
(
detailId
).
get
().
getUserCId
();
if
(
task
.
getBillStatus
().
equals
(
END
.
id
)
&&
userIsProv
(
userCId
)){
if
(
task
.
getBillStatus
().
equals
(
END
.
id
)
&&
userIsProv
(
userCId
)){
checkResult
=
"无误"
;
checkResult
=
CHECK_RESULT_DONE
;
}
else
{
}
else
{
checkResult
=
"等待省审核"
;
checkResult
=
CHECK_RESULT_WAIT
;
}
}
}
}
}
else
{
}
else
{
checkResult
=
"等待省审核"
;
checkResult
=
CHECK_RESULT_WAIT
;
}
}
}
else
if
(
comSituation
==
12
)
{
}
else
if
(
comSituation
==
12
)
{
checkResult
=
"无误"
;
checkResult
=
CHECK_RESULT_DONE
;
}
else
if
(
comSituation
==
13
)
{
}
else
if
(
comSituation
==
13
)
{
int
redoTime
=
1
;
int
redoTime
=
1
;
if
(
Objects
.
nonNull
(
remark
)
&&
remark
.
contains
(
"ROLLBACK"
))
{
if
(
Objects
.
nonNull
(
remark
)
&&
remark
.
contains
(
"ROLLBACK"
))
{
...
@@ -711,7 +790,7 @@ public class DeviceCheckController {
...
@@ -711,7 +790,7 @@ public class DeviceCheckController {
}
}
checkResult
=
redoTime
+
"次未通过"
;
checkResult
=
redoTime
+
"次未通过"
;
}
else
{
}
else
{
checkResult
=
"等待省审核"
;
checkResult
=
CHECK_RESULT_WAIT
;
}
}
}
else
{
}
else
{
checkResult
=
"状态异常"
;
checkResult
=
"状态异常"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论