Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9c754c3b
authored
May 06, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:检测评分提交时定位到精确的3级检测项
1 parent
521b8976
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
5 deletions
aus-core/src/main/java/com/glsx/usedcar/module/inspect/delegate/InspectionSaveDelegate.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionRecordService.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
aus-framework/src/main/java/org/summerframework/core/enums/ErrorCodeEnum.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/delegate/InspectionSaveDelegate.java
View file @
9c754c3
...
...
@@ -21,6 +21,11 @@ import java.util.Set;
*/
public
interface
InspectionSaveDelegate
{
/**
* 设置当前操作的节点 ID
*
* @param nodeIds 节点 ID 集合
*/
default
void
operationNodeIds
(
Set
<
Long
>
nodeIds
)
{}
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionRecordService.java
View file @
9c754c3
...
...
@@ -959,7 +959,7 @@ public class InspectionRecordService {
.
sorted
(
Comparator
.
comparingInt
(
n
->
Optional
.
ofNullable
(
n
.
getSortOrder
()).
orElse
(
0
)))
.
toList
();
if
(
CollUtil
.
isEmpty
(
rootNodes
))
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_EXISTS
,
"检测模板节点配置"
);
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_EXISTS
_
,
"检测模板节点配置"
);
}
Map
<
Long
,
List
<
InspectionNodeVO
>>
parentChildMap
=
buildParentChildMap
(
allNodes
);
...
...
@@ -1197,8 +1197,8 @@ public class InspectionRecordService {
int
childNodeType
=
Optional
.
ofNullable
(
children
.
get
(
0
).
getNodeType
()).
orElse
(
InspectConstants
.
NODE_TYPE_LEAF
);
if
(
childNodeType
==
InspectConstants
.
NODE_TYPE_LEAF
)
{
// 一级直挂三级(无二级)
InspectionNodeVO
lv3
=
findFirstUncompleted
(
children
,
resultMap
);
// 一级直挂三级(无二级)
:三级按必填+无结果判断是否未完成
InspectionNodeVO
lv3
=
findFirstUncompleted
Lv3
(
children
,
resultMap
);
return
buildUncompletedResp
(
rootNode
,
null
,
lv3
);
}
else
{
// 标准三层:一级 → 二级 → 三级
...
...
@@ -1209,7 +1209,8 @@ public class InspectionRecordService {
}
log
.
info
(
"存在未完成的二级节点,nodeId: {}, nodeName: {}"
,
secondNode
.
getId
(),
secondNode
.
getNodeName
());
List
<
InspectionNodeVO
>
thirdNodes
=
parentChildMap
.
getOrDefault
(
secondNode
.
getId
(),
List
.
of
());
InspectionNodeVO
lv3
=
findFirstUncompleted
(
thirdNodes
,
resultMap
);
// 三级按必填+无结果判断是否未完成(不用completedFlag,因为它同步自上级)
InspectionNodeVO
lv3
=
findFirstUncompletedLv3
(
thirdNodes
,
resultMap
);
return
buildUncompletedResp
(
rootNode
,
secondNode
,
lv3
);
}
}
...
...
@@ -1232,6 +1233,27 @@ public class InspectionRecordService {
}
/**
* 从三级节点列表中找第一个真正未完成的节点
* <p>三级节点的completedFlag同步自上级,上级未完成时三级也被标记未完成,
* 因此不能用completedFlag判断。正确逻辑:必填(required=1)且没有检测结果(resultMap中不存在),
* 或者有结果但inspectionValues为空(未填值),才是真正未完成</p>
*/
private
InspectionNodeVO
findFirstUncompletedLv3
(
List
<
InspectionNodeVO
>
nodes
,
Map
<
Long
,
InspectionResult
>
resultMap
)
{
for
(
InspectionNodeVO
node
:
nodes
)
{
if
(
node
.
getRequired
()
==
null
||
node
.
getRequired
()
!=
1
)
{
continue
;
// 非必填项跳过
}
InspectionResult
result
=
resultMap
.
get
(
node
.
getId
());
// 必填且(无结果 或 结果中无值) → 未完成
if
(
result
==
null
||
CollUtil
.
isEmpty
(
result
.
getInspectionValues
()))
{
log
.
info
(
"存在未完成的三级节点(必填无结果或无值),nodeId: {}, nodeName: {}"
,
node
.
getId
(),
node
.
getNodeName
());
return
node
;
}
}
return
null
;
}
/**
* 构建未完成节点响应 VO,lv2/lv3 为 null 时对应字段也为 null
*/
private
CompleteInspectionRespVO
buildUncompletedResp
(
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
View file @
9c754c3
...
...
@@ -648,7 +648,7 @@ public class InspectionWorkOrderService {
targetStatus
,
operationContent
,
description
,
Long
.
valueOf
(
operatorId
)
,
operatorId
,
operatorName
,
platTypeEnum
.
getCode
());
...
...
aus-framework/src/main/java/org/summerframework/core/enums/ErrorCodeEnum.java
View file @
9c754c3
...
...
@@ -28,6 +28,7 @@ public enum ErrorCodeEnum {
/* 七位错误码,第一位标志位,前三位模块,后三位具体错误码 */
/** 检测模块 1001 */
DATA_NOT_EXISTS
(
1001001
,
"id为[{0}]的[{1}]不存在!"
),
DATA_NOT_EXISTS_
(
1001001
,
"[{0}]不存在!"
),
INSPECTION_WO_DELETE_ERROR
(
1001002
,
"已完成/已取消/审批通过的工单不允许删除"
),
PARAM_ERROR
(
1001003
,
"{0} {1}"
),
DATA_ALREADY_EXISTS
(
1001004
,
"工单唯一ID已存在:{0}"
),
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment