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 b066ac71
authored
Mar 26, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:导出字段填充
1 parent
528d6f7f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
81 additions
and
19 deletions
aus-admin/src/main/java/com/glsx/usedcar/export/InspectionWorkOrderExportBean.java
aus-config/src/main/resources/config/aus-inspector-dev.yaml
aus-config/src/main/resources/config/common-dev.yaml
aus-core/src/main/java/com/glsx/usedcar/consts/inspect/JpaQueryConstants.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectionWorkOrderRepository.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/entity/InspectionWorkOrder.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
aus-core/src/main/resources/messages.properties
aus-inspector/src/main/java/com/glsx/usedcar/controller/InspectionWorkOrderController.java
aus-admin/src/main/java/com/glsx/usedcar/export/InspectionWorkOrderExportBean.java
View file @
b066ac7
...
...
@@ -5,7 +5,6 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import
com.glsx.usedcar.module.inspect.vo.InspectionWORespVO
;
import
com.glsx.usedcar.module.vehicle.entity.Vehicle
;
import
lombok.*
;
import
org.hibernate.Hibernate
;
import
java.io.Serial
;
import
java.io.Serializable
;
...
...
@@ -65,6 +64,11 @@ public class InspectionWorkOrderExportBean implements Serializable {
@ColumnWidth
(
20
)
private
String
venueName
;
@ExcelProperty
(
"车辆所在地址"
)
@ColumnWidth
(
20
)
private
String
handoverAddress
;
/**
* 车辆保管人
*/
...
...
@@ -195,13 +199,8 @@ public class InspectionWorkOrderExportBean implements Serializable {
this
.
venueName
=
""
;
if
(
vehicle
.
getVenue
()
!=
null
)
{
try
{
// 检查并初始化懒加载对象(需确保Hibernate依赖已引入)
if
(
Hibernate
.
isInitialized
(
vehicle
.
getVenue
()))
{
this
.
venueName
=
vehicle
.
getVenue
().
getVenueName
();
}
else
{
// 若未初始化,赋值为空(或根据业务处理)
this
.
venueName
=
""
;
}
String
name
=
vehicle
.
getVenue
().
getVenueName
();
this
.
venueName
=
(
name
==
null
||
name
.
trim
().
isEmpty
())
?
"未知门店"
:
name
.
trim
();
}
catch
(
Exception
e
)
{
// 捕获懒加载异常,兜底处理
this
.
venueName
=
""
;
...
...
@@ -211,6 +210,7 @@ public class InspectionWorkOrderExportBean implements Serializable {
if
(
vehicle
.
getCustodianInfo
()
!=
null
)
{
this
.
custodianName
=
vehicle
.
getCustodianInfo
().
getCustodianName
();
this
.
custodianPhone
=
vehicle
.
getCustodianInfo
().
getCustodianPhone
();
this
.
handoverAddress
=
vehicle
.
getCustodianInfo
().
getHandoverAddress
();
}
else
{
this
.
custodianName
=
""
;
this
.
custodianPhone
=
""
;
...
...
aus-config/src/main/resources/config/aus-inspector-dev.yaml
View file @
b066ac7
...
...
@@ -18,9 +18,6 @@ spring:
await-termination
:
true
await-termination-period
:
30s
thread-name-prefix
:
inspector-dev-
inspector
:
inspection-audit-url
:
http://192.168.1.125:5173/#/detection/order
inspection-record-h5-url
:
http://192.168.1.125:5173/#/detection/record?id=%s
application
:
jwt
:
...
...
aus-config/src/main/resources/config/common-dev.yaml
View file @
b066ac7
...
...
@@ -199,3 +199,6 @@ application:
storage-dictionary
:
${DATA_PATH:/Volumes/disk/IdeaProjects/aus/data/}
domain-url
:
${DOMAIN_URL:http://localhost:6901}
resource-url
:
/data/
inspector
:
inspection-audit-url
:
http://192.168.1.125:5173/#/detection/order
inspection-record-h5-url
:
http://192.168.1.178:8082/inspect-report?recordId=%s
aus-core/src/main/java/com/glsx/usedcar/consts/inspect/JpaQueryConstants.java
View file @
b066ac7
...
...
@@ -53,6 +53,11 @@ public interface JpaQueryConstants {
* 关键字,检测师名称或手机号,模糊查询
*/
String
KEYWORD
=
"keyword"
;
/**
* 关键字,车型,模糊查询
*/
String
CARTYPE
=
"carTypeName"
;
/**
* 精确匹配
*/
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectionWorkOrderRepository.java
View file @
b066ac7
...
...
@@ -85,7 +85,7 @@ public interface InspectionWorkOrderRepository extends BaseRepository<Inspection
Optional
<
Integer
>
summaryAVGInspectTimeByInspectorIdAndTime
(
Inspector
inspector
,
LocalDateTime
start
,
LocalDateTime
end
);
@Override
@EntityGraph
(
attributePaths
=
{
"vehicle"
,
"inspector"
})
@EntityGraph
(
attributePaths
=
{
"vehicle"
,
"
vehicle.venue"
,
"
inspector"
})
Page
<
InspectionWorkOrder
>
findAll
(
Specification
<
InspectionWorkOrder
>
spec
,
Pageable
pageable
);
boolean
existsByVehicleAndDeleteFlagAndStatusIn
(
Vehicle
vehicle
,
String
deleteFlag
,
List
<
Integer
>
status
);
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/entity/InspectionWorkOrder.java
View file @
b066ac7
...
...
@@ -59,7 +59,7 @@ public class InspectionWorkOrder extends AuditingEntity implements Serializable
@JsonView
(
value
=
Summary
.
class
)
private
Long
id
;
@
One
ToOne
(
cascade
=
{},
fetch
=
FetchType
.
LAZY
)
@
Many
ToOne
(
cascade
=
{},
fetch
=
FetchType
.
LAZY
)
@JoinColumn
(
name
=
"vehicle_id"
,
referencedColumnName
=
"vehicleId"
,
...
...
@@ -68,7 +68,7 @@ public class InspectionWorkOrder extends AuditingEntity implements Serializable
@ReadOnlyProperty
private
Vehicle
vehicle
;
@
One
ToOne
(
cascade
=
{},
fetch
=
FetchType
.
LAZY
)
@
Many
ToOne
(
cascade
=
{},
fetch
=
FetchType
.
LAZY
)
@JoinColumn
(
name
=
"inspector_id"
,
referencedColumnName
=
"id"
,
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
View file @
b066ac7
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
service
;
import
cn.hutool.core.util.StrUtil
;
import
com.glsx.usedcar.config.InspectorConfig
;
import
com.glsx.usedcar.consts.common.SymbolConsts
;
import
com.glsx.usedcar.consts.inspect.JpaQueryConstants
;
import
com.glsx.usedcar.converts.*
;
...
...
@@ -56,6 +57,8 @@ public class InspectionWorkOrderService {
private
final
MessageSource
messageSource
;
private
final
InspectionNodeService
inspectionNodeService
;
private
final
InspectionTemplateRepository
inspectionTemplateRepository
;
private
final
InspectionRecordRepository
inspectionRecordRepository
;
private
final
InspectorConfig
inspectorConfig
;
/**
* 保存检测工单操作日志
...
...
@@ -174,23 +177,35 @@ public class InspectionWorkOrderService {
boolean
isModified
=
false
;
StringBuilder
modifyContent
=
new
StringBuilder
();
boolean
needSendMsg
=
false
;
if
(
updateVO
.
getInspectorId
()
!=
null
)
{
Inspector
inspector
=
inspectorRepository
.
findByIdAndDeleteFlag
(
updateVO
.
getInspectorId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()).
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"检测师不存在,检测师ID:"
+
updateVO
.
getInspectorId
()));
if
(!
updateVO
.
getInspectorId
().
equals
(
originalInspectorId
))
{
workOrder
.
setInspector
(
inspector
);
modifyContent
.
append
(
String
.
format
(
"检测师从ID:%s改为ID:%s;"
,
originalInspectorId
,
updateVO
.
getInspectorId
()));
isModified
=
true
;
Object
[]
args
=
{
workOrder
.
getWoId
()};
String
message
=
messageSource
.
getMessage
(
"SMS.INSPECTION.WO.UPDATE.INSPECTOR_NEW"
,
args
,
Locale
.
CHINESE
);
log
.
info
(
"发送工单修改短信: 手机号={}, 内容={}"
,
workOrder
.
getInspector
().
getPhone
(),
message
);
gscApiInvoker
.
sendMsg
(
workOrder
.
getInspector
().
getPhone
(),
message
);
String
m
=
messageSource
.
getMessage
(
"SMS.INSPECTION.WO.UPDATE.INSPECTOR_ORIGIN"
,
new
Object
[]{},
Locale
.
CHINESE
);
log
.
info
(
"发送工单修改短信: 手机号={}, 内容={}"
,
workOrder
.
getInspector
().
getPhone
(),
m
);
gscApiInvoker
.
sendMsg
(
originalInspector
.
getPhone
(),
m
);
}
}
if
(
updateVO
.
getRemark
()
!=
null
&&
!
StrUtil
.
equals
(
updateVO
.
getRemark
(),
originalRemark
))
{
workOrder
.
setRemark
(
updateVO
.
getRemark
());
modifyContent
.
append
(
String
.
format
(
"备注从'%s'改为'%s';"
,
StrUtil
.
isBlank
(
originalRemark
)
?
"空"
:
originalRemark
,
updateVO
.
getRemark
()));
isModified
=
true
;
needSendMsg
=
true
;
}
if
(
updateVO
.
getInspectionAddress
()
!=
null
&&
!
StrUtil
.
equals
(
updateVO
.
getInspectionAddress
(),
originalInspectionAddress
))
{
workOrder
.
setInspectionAddress
(
updateVO
.
getInspectionAddress
());
modifyContent
.
append
(
String
.
format
(
"检测地址从'%s'改为'%s';"
,
StrUtil
.
isBlank
(
originalInspectionAddress
)
?
"空"
:
originalInspectionAddress
,
updateVO
.
getInspectionAddress
()));
isModified
=
true
;
needSendMsg
=
true
;
}
if
(!
isModified
)
{
log
.
info
(
"检测工单无修改:ID={}, 唯一ID={}"
,
workOrder
.
getId
(),
workOrder
.
getWoId
());
...
...
@@ -200,10 +215,12 @@ public class InspectionWorkOrderService {
workOrder
.
setUpdateTime
(
LocalDateTime
.
now
());
inspectionWorkOrderRepository
.
save
(
workOrder
);
Object
[]
args
=
{
workOrder
.
getWoId
()};
String
message
=
messageSource
.
getMessage
(
"SMS.INSPECTION.WO.ADD"
,
args
,
Locale
.
CHINESE
);
log
.
info
(
"发送工单修改短信: 手机号={}, 内容={}"
,
originalInspector
.
getPhone
(),
message
);
gscApiInvoker
.
sendMsg
(
originalInspector
.
getPhone
(),
message
);
if
(
needSendMsg
)
{
Object
[]
args
=
{
workOrder
.
getWoId
()};
String
message
=
messageSource
.
getMessage
(
"SMS.INSPECTION.WO.ADD"
,
args
,
Locale
.
CHINESE
);
log
.
info
(
"发送工单修改短信: 手机号={}, 内容={}"
,
workOrder
.
getInspector
().
getPhone
(),
message
);
gscApiInvoker
.
sendMsg
(
workOrder
.
getInspector
().
getPhone
(),
message
);
}
String
operationContent
=
StrUtil
.
removeSuffix
(
modifyContent
.
toString
(),
";"
);
String
description
=
"编辑检测工单信息,无状态变更"
;
...
...
@@ -334,6 +351,30 @@ public class InspectionWorkOrderService {
));
}
Object
carType
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
InspectionWorkOrder
.
CARTYPE
);
if
(
carType
instanceof
String
ct
&&
StrUtil
.
isNotBlank
(
ct
))
{
pagination
.
removeFilter
(
JpaQueryConstants
.
InspectionWorkOrder
.
CARTYPE
);
String
likePattern
=
SymbolConsts
.
PERCENT
+
ct
+
SymbolConsts
.
PERCENT
;
pagination
.
addCondition
((
root
,
query
,
builder
)
->
builder
.
or
(
// 工单表:woId
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
woId
),
likePattern
),
// 车辆表:baseInfo.sourceNo
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
sourceNo
),
likePattern
),
// 车辆表:baseInfo.licensePlate
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
licensePlate
),
likePattern
),
// 车辆表:baseInfo.vin
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
vin
),
likePattern
),
// 检测师姓名
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
inspector
).
get
(
Inspector_
.
name
),
likePattern
),
// 检测师手机号
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
inspector
).
get
(
Inspector_
.
phone
),
likePattern
),
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
carTypeName
),
likePattern
),
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
carChildsBrandName
),
likePattern
),
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
carSeriesName
),
likePattern
),
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
carBrand
),
likePattern
)
));
}
Object
inspectorId
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
InspectionWorkOrder
.
INSPECTOR_ID
);
if
(
inspectorId
!=
null
)
{
pagination
.
removeFilter
(
JpaQueryConstants
.
InspectionWorkOrder
.
INSPECTOR_ID
);
...
...
@@ -391,6 +432,14 @@ public class InspectionWorkOrderService {
InspectionWODetailRespVO
result
=
new
InspectionWODetailRespVO
();
result
.
setInspectionWORespVO
(
inspectionWORespVO
);
result
.
setLogList
(
inspectionWOOpLogRespVos
);
if
(
wo
.
getStatus
().
equals
(
InspectionWorkOrderStatusEnum
.
COMPLETED
.
getCode
())
&&
wo
.
getAuditStatus
().
equals
(
InspectionWorkOrderAuditStatusEnum
.
WAIT_AUDIT
.
getCode
()))
{
inspectionReportRespVO
=
new
InspectionReportRespVO
();
// 拼接一个默认报告
InspectionRecord
inspectionRecord
=
inspectionRecordRepository
.
findByTaskIdAndDeletedFlag
(
wo
.
getId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
())
.
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
COMMON_ERROR
,
"检测记录不存在,ID:"
+
wo
.
getId
()));
String
h5Url
=
String
.
format
(
inspectorConfig
.
getInspectionRecordH5Url
(),
inspectionRecord
.
getId
());
inspectionReportRespVO
.
setH5Url
(
h5Url
);
}
if
(
inspectionReportRespVO
!=
null
)
{
result
.
setInspectionReportRespVO
(
inspectionReportRespVO
);
}
...
...
@@ -476,6 +525,11 @@ public class InspectionWorkOrderService {
workOrder
.
setUpdateTime
(
now
);
inspectionWorkOrderRepository
.
save
(
workOrder
);
Object
[]
args
=
{
workOrder
.
getWoId
(),
auditVO
.
getAuditOpinion
()};
String
message
=
messageSource
.
getMessage
(
"SMS.INSPECTION.WO.REJECT"
,
args
,
Locale
.
CHINESE
);
log
.
info
(
"发送工单驳回短信: 手机号={}, 内容={}"
,
workOrder
.
getInspector
().
getPhone
(),
message
);
gscApiInvoker
.
sendMsg
(
workOrder
.
getInspector
().
getPhone
(),
message
);
operationContent
=
String
.
format
(
"拒绝审批工单,工单ID:%s,审批意见:%s"
,
auditVO
.
getId
(),
auditVO
.
getAuditOpinion
());
description
=
String
.
format
(
"审批工单[%s]拒绝,审批状态从[%s]改为[%s], 工单状态从[%s]改为[%s],未生成检测报告"
,
workOrder
.
getWoId
(),
originalAuditStatus
,
targetAuditStatus
,
originalStatus
,
InspectionWorkOrderStatusEnum
.
IN_PROGRESS
.
getCode
());
...
...
aus-core/src/main/resources/messages.properties
View file @
b066ac7
...
...
@@ -65,3 +65,6 @@ Inspector.Login.SMSCODE=\u60a8\u6b63\u5728\u767b\u5f55\u68c0\u6d4b\u7cfb\u7edf\u
SMS.INSPECTION.WO.CANCEL
=
\u
60a8
\u
597d
\u3002\u
60a8
\u6240\u
8d1f
\u
8d23
\u7684\u
68c0
\u
6d4b
\u
5de5
\u5355
{0}
\u
5df2
\u
88ab
\u
53d6
\u
6d88
\u
ff0c
\u
4efb
\u
52a1
\u
72b6
\u6001\u
5df2
\u
66f4
\u
65b0
\u
4e3a
\u
201c
\u
5df2
\u
53d6
\u
6d88
\u
201d
\u
ff0c
\u
8bf7
\u
52ff
\u
518d
\u
524d
\u
5f80
\u
68c0
\u
6d4b
\u3002
SMS.INSPECTION.WO.ADD
=
\u
60a8
\u6709\u
65b0
\u7684\u
8f66
\u
8f86
\u
68c0
\u
6d4b
\u
4efb
\u
52a1
\u
5f85
\u
68c0
\u
6d4b
\u
ff0c
\u
8bf7
\u
53ca
\u
65f6
\u5904\u7406\u3002\u
4efb
\u
52a1
\u
8f66
\u
8f86
\u
ff1a{0}
SMS.INSPECTION.WO.UPDATE
=
\u
68c0
\u
6d4b
\u
5de5
\u5355
{0}
\u
4efb
\u
52a1
\u
5df2
\u
66f4
\u
65b0
\u
ff0c
\u
8bf7
\u
53ca
\u
65f6
\u
67e5
\u
770b
\u3002
SMS.INSPECTION.WO.UPDATE.INSPECTOR_NEW
=
\u
60a8
\u
597d
\u
ff0c
\u
60a8
\u
5df2
\u
88ab
\u
66f4
\u
65b0
\u
4e3a
\u
68c0
\u
6d4b
\u
4eba
\u5458\u
4fe1
\u
606f
\u
ff0c
\u
5de5
\u5355\u
53f7
\u3010
{0}
\u3011\u3002\u
540e
\u
7eed
\u
8bf7
\u6309\u8981\u
6c42
\u
53ca
\u
65f6
\u
5f00
\u
5c55
\u
68c0
\u
6d4b
\u
5de5
\u
4f5c
\u
ff0c
\u
4fdd
\u6301\u
901a
\u
8baf
\u7545\u
901a
\u3002
SMS.INSPECTION.WO.UPDATE.INSPECTOR_ORIGIN
=
\u
60a8
\u
597d
\u
ff0c
\u
7cfb
\u
7edf
\u
5df2
\u
66f4
\u
65b0
\u
68c0
\u
6d4b
\u
4eba
\u5458\u
540d
\u5355\u
ff0c
\u
60a8
\u
4ecd
\u
4fdd
\u7559\u
68c0
\u
6d4b
\u
4eba
\u5458\u
8d44
\u
683c
\u
ff0c
\u
8bf7
\u
7ee7
\u
7eed
\u6309\u
89c4
\u8303\u
5f00
\u
5c55
\u
68c0
\u
6d4b
\u
5de5
\u
4f5c
\u
ff0c
\u
4fdd
\u6301\u
901a
\u
8baf
\u7545\u
901a
\u
ff0c
\u5982\u6709\u
53d8
\u
52a8
\u
5c06
\u
53e6
\u
884c
\u
901a
\u
77e5
\u3002
SMS.INSPECTION.WO.REJECT
=
\u3010\u
68c0
\u
6d4b
\u
5de5
\u5355\u
9a73
\u
56de
\u
901a
\u
77e5
\u3011\u
60a8
\u
63d0
\u
4ea4
\u7684\u
68c0
\u
6d4b
\u
5de5
\u5355\u
ff08
\u
7f16
\u
53f7
\u
ff1a{0}
\u
ff09
\u
5df2
\u
9a73
\u
56de
\u
ff0c
\u
9a73
\u
56de
\u
539f
\u
56e0
\u
ff1a{1}
\u3002
aus-inspector/src/main/java/com/glsx/usedcar/controller/InspectionWorkOrderController.java
View file @
b066ac7
...
...
@@ -51,7 +51,7 @@ public class InspectionWorkOrderController {
pagination
.
addFilter
(
JpaQueryConstants
.
InspectionWorkOrder
.
STATUS
,
req
.
getStatus
(),
Operator
.
eq
);
pagination
.
addFilter
(
JpaQueryConstants
.
InspectionWorkOrder
.
INSPECTOR_ID
,
InspectorContext
.
getInspectorId
(),
Operator
.
eq
);
if
(
StringUtils
.
isNotBlank
(
req
.
getKeyword
()))
{
pagination
.
addFilter
(
JpaQueryConstants
.
InspectionWorkOrder
.
KEYWORD
,
req
.
getKeyword
(),
Operator
.
eq
);
pagination
.
addFilter
(
JpaQueryConstants
.
InspectionWorkOrder
.
CARTYPE
,
req
.
getKeyword
(),
Operator
.
eq
);
}
log
.
info
(
"分页查询检测工单请求: page={}, size={}, status={}"
,
page
,
size
,
req
.
getStatus
());
Page
<
InspectionWORespVO
>
result
=
inspectionWorkOrderService
.
pageList
(
pagination
);
...
...
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