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 ec2c4215
authored
Mar 25, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:新增待检测车辆接口
1 parent
d86e40aa
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
153 additions
and
38 deletions
aus-admin/src/main/java/com/glsx/usedcar/export/InspectionReportExportBean.java
aus-admin/src/main/java/com/glsx/usedcar/web/rest/vehicle/VehicleController.java
aus-core/src/main/java/com/glsx/usedcar/consts/inspect/JpaQueryConstants.java
aus-core/src/main/java/com/glsx/usedcar/enums/inspect/InspectionReportBindStatus.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectionReportRepository.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectionWorkOrderRepository.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionReportService.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectionWorkOrderAuditVO.java
aus-core/src/main/java/com/glsx/usedcar/module/vehicle/service/VehicleService.java
aus-core/src/main/resources/messages.properties
aus-framework/src/main/java/org/summerframework/orm/paging/Pagination.java
aus-admin/src/main/java/com/glsx/usedcar/export/InspectionReportExportBean.java
View file @
ec2c421
...
@@ -29,12 +29,10 @@ public class InspectionReportExportBean implements Serializable {
...
@@ -29,12 +29,10 @@ public class InspectionReportExportBean implements Serializable {
// 日期格式化器
// 日期格式化器
private
static
final
DateTimeFormatter
DATE_TIME_FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
private
static
final
DateTimeFormatter
DATE_TIME_FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
/**
* 工单单号
@ExcelProperty
(
"报告编号"
)
*/
@ExcelProperty
(
"工单单号"
)
@ColumnWidth
(
20
)
@ColumnWidth
(
20
)
private
String
woId
;
private
String
reportNo
;
/**
/**
* 生成时间(创建时间)
* 生成时间(创建时间)
...
@@ -44,6 +42,13 @@ public class InspectionReportExportBean implements Serializable {
...
@@ -44,6 +42,13 @@ public class InspectionReportExportBean implements Serializable {
private
String
createTime
;
private
String
createTime
;
/**
/**
* 工单单号
*/
@ExcelProperty
(
"工单单号"
)
@ColumnWidth
(
20
)
private
String
woId
;
/**
* 车源号
* 车源号
*/
*/
@ExcelProperty
(
"车源号"
)
@ExcelProperty
(
"车源号"
)
...
@@ -110,6 +115,7 @@ public class InspectionReportExportBean implements Serializable {
...
@@ -110,6 +115,7 @@ public class InspectionReportExportBean implements Serializable {
return
;
return
;
}
}
this
.
reportNo
=
vo
.
getReportNo
();
// 工单信息
// 工单信息
this
.
woId
=
vo
.
getWoId
();
this
.
woId
=
vo
.
getWoId
();
...
@@ -123,6 +129,7 @@ public class InspectionReportExportBean implements Serializable {
...
@@ -123,6 +129,7 @@ public class InspectionReportExportBean implements Serializable {
case
2
->
"未绑定"
;
case
2
->
"未绑定"
;
default
->
"未知状态"
;
default
->
"未知状态"
;
};
};
this
.
score
=
vo
.
getInspectionRecord
().
getOverallScore
().
intValue
()
+
"分"
;
// 车辆信息
// 车辆信息
Vehicle
vehicle
=
vo
.
getVehicle
();
Vehicle
vehicle
=
vo
.
getVehicle
();
...
...
aus-admin/src/main/java/com/glsx/usedcar/web/rest/vehicle/VehicleController.java
View file @
ec2c421
...
@@ -88,6 +88,18 @@ public class VehicleController {
...
@@ -88,6 +88,18 @@ public class VehicleController {
return
vehicleService
.
pageVehicle
(
pagination
);
return
vehicleService
.
pageVehicle
(
pagination
);
}
}
/**
* 分页查询可以检测的车辆
*
* @param pagination
* @return
*/
@PostMapping
(
"pageEnableInspectVehicle"
)
public
Page
<
Vehicle
>
pageEnableInspectVehicle
(
@RequestBody
Pagination
<
Vehicle
>
pagination
)
{
return
vehicleService
.
pageEnableInspectVehicle
(
pagination
);
}
@PostMapping
(
"pagePriceVehicle"
)
@PostMapping
(
"pagePriceVehicle"
)
public
Page
<
Vehicle
>
pagePriceVehicle
(
@RequestBody
Pagination
<
Vehicle
>
pagination
)
{
public
Page
<
Vehicle
>
pagePriceVehicle
(
@RequestBody
Pagination
<
Vehicle
>
pagination
)
{
String
auditState
=
(
String
)
pagination
.
getDataValue
(
"auditState"
);
String
auditState
=
(
String
)
pagination
.
getDataValue
(
"auditState"
);
...
...
aus-core/src/main/java/com/glsx/usedcar/consts/inspect/JpaQueryConstants.java
View file @
ec2c421
...
@@ -90,6 +90,8 @@ public interface JpaQueryConstants {
...
@@ -90,6 +90,8 @@ public interface JpaQueryConstants {
* 车辆状态,精确匹配
* 车辆状态,精确匹配
*/
*/
String
VEHICLE_STATE
=
"vehicleState"
;
String
VEHICLE_STATE
=
"vehicleState"
;
String
SORT_SCORELEVEL
=
"scoreLevel"
;
}
}
}
}
aus-core/src/main/java/com/glsx/usedcar/enums/inspect/InspectionReportBindStatus.java
0 → 100644
View file @
ec2c421
package
com
.
glsx
.
usedcar
.
enums
.
inspect
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
*
*/
@Getter
@AllArgsConstructor
public
enum
InspectionReportBindStatus
{
BIND
(
1
,
"绑定"
),
UNBIND
(
2
,
"解绑"
),
;
private
Integer
code
;
private
String
desc
;
}
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectionReportRepository.java
View file @
ec2c421
...
@@ -44,6 +44,15 @@ public interface InspectionReportRepository extends BaseRepository<InspectionRep
...
@@ -44,6 +44,15 @@ public interface InspectionReportRepository extends BaseRepository<InspectionRep
*/
*/
List
<
InspectionReport
>
findByVehicleAndDeleteFlag
(
Vehicle
vehicle
,
String
deleteFlag
);
List
<
InspectionReport
>
findByVehicleAndDeleteFlag
(
Vehicle
vehicle
,
String
deleteFlag
);
/**
* 根据车辆ID查询未删除的检测报告
* @param bindStatus 绑定状态(1:已绑定;2:未绑定)
* @param vehicle 车辆
* @param deleteFlag 删除标识(N:未删除 D:已删除)
* @return 检测报告列表
*/
Optional
<
InspectionReport
>
findByBindStatusAndVehicleAndDeleteFlag
(
int
bindStatus
,
Vehicle
vehicle
,
String
deleteFlag
);
/**
/**
* 根据绑定状态查询未删除的检测报告
* 根据绑定状态查询未删除的检测报告
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/dao/InspectionWorkOrderRepository.java
View file @
ec2c421
...
@@ -131,4 +131,17 @@ public interface InspectionWorkOrderRepository extends BaseRepository<Inspection
...
@@ -131,4 +131,17 @@ public interface InspectionWorkOrderRepository extends BaseRepository<Inspection
@Param
(
"deleteFlag"
)
String
deleteFlag
,
@Param
(
"deleteFlag"
)
String
deleteFlag
,
@Param
(
"status"
)
List
<
Integer
>
status
@Param
(
"status"
)
List
<
Integer
>
status
);
);
/**
* 根据工单状态列表和删除标识,查询所有关联的车辆ID
* @param statusList 工单状态列表
* @param deleteFlag 删除标识
* @return 车辆ID集合
*/
@Query
(
"SELECT DISTINCT w.vehicle.id FROM InspectionWorkOrder w WHERE w.deleteFlag = :deleteFlag AND w.status IN :statusList"
)
List
<
Long
>
findVehicleIdsByStatusInAndDeleteFlag
(
@Param
(
"statusList"
)
List
<
Integer
>
statusList
,
@Param
(
"deleteFlag"
)
String
deleteFlag
);
}
}
\ No newline at end of file
\ No newline at end of file
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionReportService.java
View file @
ec2c421
...
@@ -6,8 +6,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
...
@@ -6,8 +6,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.glsx.usedcar.config.InspectorConfig
;
import
com.glsx.usedcar.config.InspectorConfig
;
import
com.glsx.usedcar.consts.common.SymbolConsts
;
import
com.glsx.usedcar.consts.common.SymbolConsts
;
import
com.glsx.usedcar.consts.inspect.JpaQueryConstants
;
import
com.glsx.usedcar.consts.inspect.JpaQueryConstants
;
import
com.glsx.usedcar.converts.*
;
import
com.glsx.usedcar.converts.InspectionReportConverter
;
import
com.glsx.usedcar.converts.InspectionReportOpLogConverter
;
import
com.glsx.usedcar.enums.common.DeleteFlag
;
import
com.glsx.usedcar.enums.common.DeleteFlag
;
import
com.glsx.usedcar.enums.inspect.InspectionReportBindStatus
;
import
com.glsx.usedcar.enums.inspect.InspectionReportOperationTypeEnum
;
import
com.glsx.usedcar.enums.inspect.InspectionReportOperationTypeEnum
;
import
com.glsx.usedcar.module.inspect.dao.*
;
import
com.glsx.usedcar.module.inspect.dao.*
;
import
com.glsx.usedcar.module.inspect.dto.AccidentBurnWadeDTO
;
import
com.glsx.usedcar.module.inspect.dto.AccidentBurnWadeDTO
;
...
@@ -16,17 +18,20 @@ import com.glsx.usedcar.module.inspect.vo.*;
...
@@ -16,17 +18,20 @@ import com.glsx.usedcar.module.inspect.vo.*;
import
com.glsx.usedcar.module.vehicle.dao.VehicleDao
;
import
com.glsx.usedcar.module.vehicle.dao.VehicleDao
;
import
com.glsx.usedcar.module.vehicle.entity.*
;
import
com.glsx.usedcar.module.vehicle.entity.*
;
import
com.glsx.usedcar.util.RedisCacheUtil
;
import
com.glsx.usedcar.util.RedisCacheUtil
;
import
jakarta.persistence.metamodel.SingularAttribute
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.summerframework.core.enums.ErrorCodeEnum
;
import
org.summerframework.core.enums.ErrorCodeEnum
;
import
org.summerframework.core.exception.BusinessCodeException
;
import
org.summerframework.core.exception.BusinessCodeException
;
import
org.summerframework.orm.paging.Pagination
;
import
org.summerframework.orm.paging.Pagination
;
import
org.summerframework.orm.paging.SortOrder
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -420,6 +425,14 @@ public class InspectionReportService {
...
@@ -420,6 +425,14 @@ public class InspectionReportService {
* 分页查询
* 分页查询
*/
*/
public
Page
<
InspectionReportRespVO
>
pageList
(
Pagination
<
InspectionReport
>
pagination
)
{
public
Page
<
InspectionReportRespVO
>
pageList
(
Pagination
<
InspectionReport
>
pagination
)
{
String
sort
=
pagination
.
getSort
();
if
(
StrUtil
.
isNotBlank
(
sort
)
&&
sort
.
equals
(
JpaQueryConstants
.
InspectionReport
.
SORT_SCORELEVEL
))
{
SingularAttribute
<?,
?>
joinAttr
=
InspectionReport_
.
inspectionRecord
;
SingularAttribute
<?,
?>
sortField
=
InspectionRecord_
.
overallScore
;
pagination
.
addSortOrder
(
new
SortOrder
(
pagination
.
getSortDirection
(),
joinAttr
,
sortField
));
pagination
.
setSort
(
null
);
}
pagination
.
addSortOrder
(
new
SortOrder
(
Sort
.
Direction
.
DESC
,
InspectionReport_
.
createTime
));
// 1. 处理关键词模糊查询(复用工单查询的KEYWORD常量)
// 1. 处理关键词模糊查询(复用工单查询的KEYWORD常量)
Object
keyword
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
InspectionReport
.
KEYWORD
);
Object
keyword
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
InspectionReport
.
KEYWORD
);
if
(
keyword
instanceof
String
kw
&&
StrUtil
.
isNotBlank
(
kw
))
{
if
(
keyword
instanceof
String
kw
&&
StrUtil
.
isNotBlank
(
kw
))
{
...
@@ -494,47 +507,32 @@ public class InspectionReportService {
...
@@ -494,47 +507,32 @@ public class InspectionReportService {
* @return 评分/评级VO
* @return 评分/评级VO
*/
*/
public
VehicleInspectScoreRespVO
getVehicleInspectScoreByVehicleId
(
Integer
vehicleId
)
{
public
VehicleInspectScoreRespVO
getVehicleInspectScoreByVehicleId
(
Integer
vehicleId
)
{
// 1. 校验车辆ID合法性
if
(
vehicleId
==
null
||
vehicleId
<=
0
)
{
if
(
vehicleId
==
null
||
vehicleId
<=
0
)
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"车辆ID不能为空且为正整数"
);
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"车辆ID不能为空且为正整数"
);
}
}
// 2. 查询车辆是否存在(复用现有VehicleDao)
Vehicle
vehicle
=
vehicleDao
.
findById
(
vehicleId
)
Vehicle
vehicle
=
vehicleDao
.
findById
(
vehicleId
)
.
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_FOUND
,
"车辆不存在,vehicleId="
+
vehicleId
));
.
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_FOUND
,
"车辆不存在,vehicleId="
+
vehicleId
));
// 3. 查询该车辆绑定的未删除检测报告(复用现有Repository方法)
InspectionReport
bindReport
=
inspectionReportRepository
.
findByBindStatusAndVehicleAndDeleteFlag
(
List
<
InspectionReport
>
bindReportList
=
inspectionReportRepository
.
findByVehicleAndDeleteFlag
(
InspectionReportBindStatus
.
BIND
.
getCode
(),
vehicle
,
vehicle
,
DeleteFlag
.
NOT_DELETED
.
getCode
()
// 复用枚举:N=未删除
DeleteFlag
.
NOT_DELETED
.
getCode
()
);
).
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_FOUND
,
"该车辆未绑定任何检测报告,vehicleId="
+
vehicleId
));
if
(
bindReportList
==
null
||
bindReportList
.
isEmpty
())
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_FOUND
,
"该车辆未绑定任何检测报告,vehicleId="
+
vehicleId
);
}
// 4. 取第一条绑定报告(业务规则:同一车辆仅绑定一个报告)
InspectionReport
bindReport
=
bindReportList
.
get
(
0
);
if
(
bindReport
.
getWorkOrder
()
==
null
||
bindReport
.
getWorkOrder
().
getId
()
==
null
)
{
if
(
bindReport
.
getWorkOrder
()
==
null
||
bindReport
.
getWorkOrder
().
getId
()
==
null
)
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"检测报告关联的工单为空,reportNo="
,
bindReport
.
getReportNo
());
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"检测报告关联的工单为空,reportNo="
,
bindReport
.
getReportNo
());
}
}
// 5. 获取工单的taskId(从InspectionWorkOrder实体取taskId,需确保WorkOrder关联正确)
Long
taskId
=
bindReport
.
getWorkOrder
().
getId
();
Long
taskId
=
bindReport
.
getWorkOrder
().
getId
();
// 6. 根据taskId查询检测记录(复用现有InspectionRecordRepository方法)
InspectionRecord
record
=
inspectionRecordRepository
.
findByTaskIdAndDeletedFlag
(
taskId
,
DeleteFlag
.
NOT_DELETED
.
getCode
())
Optional
<
InspectionRecord
>
recordOpt
=
inspectionRecordRepository
.
findByTaskIdAndDeletedFlag
(
.
orElseThrow
(()
->
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_FOUND
,
"未查询到检测记录,taskId="
+
taskId
));
taskId
,
DeleteFlag
.
NOT_DELETED
.
getCode
()
// N=未删除
);
if
(
recordOpt
.
isEmpty
())
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
DATA_NOT_FOUND
,
"未查询到检测记录,taskId="
+
taskId
);
}
// 7. 封装返回VO(字段完全对齐InspectionRecord实体)
InspectionRecord
record
=
recordOpt
.
get
();
VehicleInspectScoreRespVO
respVO
=
new
VehicleInspectScoreRespVO
();
VehicleInspectScoreRespVO
respVO
=
new
VehicleInspectScoreRespVO
();
respVO
.
setOverallScore
(
record
.
getOverallScore
());
// 综合分数
respVO
.
setOverallScore
(
record
.
getOverallScore
());
respVO
.
setExteriorScore
(
record
.
getExteriorScore
());
// 外观分数
respVO
.
setExteriorScore
(
record
.
getExteriorScore
());
respVO
.
setSkeletonLevel
(
record
.
getSkeletonLevel
());
// 骨架评级
respVO
.
setSkeletonLevel
(
record
.
getSkeletonLevel
());
respVO
.
setInteriorLevel
(
record
.
getInteriorLevel
());
// 内饰评级
respVO
.
setInteriorLevel
(
record
.
getInteriorLevel
());
AccidentBurnWadeDTO
accidentBurnWadeDTO
=
InspectionRecordService
.
getAccidentBurnWadeDTO
(
record
.
getId
());
AccidentBurnWadeDTO
accidentBurnWadeDTO
=
InspectionRecordService
.
getAccidentBurnWadeDTO
(
record
.
getId
());
respVO
.
setAccident
(
accidentBurnWadeDTO
.
getAccident
());
respVO
.
setAccident
(
accidentBurnWadeDTO
.
getAccident
());
respVO
.
setBurn
(
accidentBurnWadeDTO
.
getBurn
());
respVO
.
setBurn
(
accidentBurnWadeDTO
.
getBurn
());
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/service/InspectionWorkOrderService.java
View file @
ec2c421
...
@@ -137,6 +137,11 @@ public class InspectionWorkOrderService {
...
@@ -137,6 +137,11 @@ public class InspectionWorkOrderService {
wo
.
setUpdateTime
(
now
);
wo
.
setUpdateTime
(
now
);
inspectionWorkOrderRepository
.
save
(
wo
);
inspectionWorkOrderRepository
.
save
(
wo
);
Object
[]
args
=
{
vehicle
.
getBaseInfo
().
getCarTypeName
()};
String
message
=
messageSource
.
getMessage
(
"SMS.INSPECTION.WO.ADD"
,
args
,
Locale
.
CHINESE
);
log
.
info
(
"发送工单新增短信: 手机号={}, 内容={}"
,
wo
.
getInspector
().
getPhone
(),
message
);
gscApiInvoker
.
sendMsg
(
wo
.
getInspector
().
getPhone
(),
message
);
String
operationContent
=
String
.
format
(
"新增检测工单,车辆ID:%s,检测师ID:%s,检测地址:%s"
,
vehicleId
,
inspectorId
,
addVO
.
getInspectionAddress
());
String
operationContent
=
String
.
format
(
"新增检测工单,车辆ID:%s,检测师ID:%s,检测地址:%s"
,
vehicleId
,
inspectorId
,
addVO
.
getInspectionAddress
());
saveWorkOrderOpLog
(
wo
,
InspectionWorkOrderOperationTypeEnum
.
CREATE_ORDER
.
getCode
(),
0
,
wo
.
getStatus
(),
operationContent
,
"用户新增检测工单,默认状态为已派单"
,
Long
.
valueOf
(
opId
),
opName
,
platTypeEnum
.
getCode
());
saveWorkOrderOpLog
(
wo
,
InspectionWorkOrderOperationTypeEnum
.
CREATE_ORDER
.
getCode
(),
0
,
wo
.
getStatus
(),
operationContent
,
"用户新增检测工单,默认状态为已派单"
,
Long
.
valueOf
(
opId
),
opName
,
platTypeEnum
.
getCode
());
...
@@ -163,6 +168,7 @@ public class InspectionWorkOrderService {
...
@@ -163,6 +168,7 @@ public class InspectionWorkOrderService {
Integer
originalStatus
=
workOrder
.
getStatus
();
Integer
originalStatus
=
workOrder
.
getStatus
();
Long
originalInspectorId
=
workOrder
.
getInspector
()
!=
null
?
workOrder
.
getInspector
().
getId
()
:
null
;
Long
originalInspectorId
=
workOrder
.
getInspector
()
!=
null
?
workOrder
.
getInspector
().
getId
()
:
null
;
Inspector
originalInspector
=
workOrder
.
getInspector
();
String
originalRemark
=
workOrder
.
getRemark
();
String
originalRemark
=
workOrder
.
getRemark
();
String
originalInspectionAddress
=
workOrder
.
getInspectionAddress
();
String
originalInspectionAddress
=
workOrder
.
getInspectionAddress
();
...
@@ -193,6 +199,12 @@ public class InspectionWorkOrderService {
...
@@ -193,6 +199,12 @@ public class InspectionWorkOrderService {
workOrder
.
setUpdateBy
(
opName
);
workOrder
.
setUpdateBy
(
opName
);
workOrder
.
setUpdateTime
(
LocalDateTime
.
now
());
workOrder
.
setUpdateTime
(
LocalDateTime
.
now
());
inspectionWorkOrderRepository
.
save
(
workOrder
);
inspectionWorkOrderRepository
.
save
(
workOrder
);
Object
[]
args
=
{
workOrder
.
getWoId
()};
String
message
=
messageSource
.
getMessage
(
"SMS.INSPECTION.WO.ADD"
,
args
,
Locale
.
CHINESE
);
log
.
info
(
"发送工单修改短信: 手机号={}, 内容={}"
,
wo
.
getInspector
().
getPhone
(),
message
);
gscApiInvoker
.
sendMsg
(
originalInspector
.
getPhone
(),
message
);
String
operationContent
=
StrUtil
.
removeSuffix
(
modifyContent
.
toString
(),
";"
);
String
operationContent
=
StrUtil
.
removeSuffix
(
modifyContent
.
toString
(),
";"
);
String
description
=
"编辑检测工单信息,无状态变更"
;
String
description
=
"编辑检测工单信息,无状态变更"
;
saveWorkOrderOpLog
(
workOrder
,
InspectionWorkOrderOperationTypeEnum
.
UPDATE_ORDER_INFO
.
getCode
(),
originalStatus
,
originalStatus
,
StrUtil
.
isBlank
(
operationContent
)
?
"无具体修改内容"
:
operationContent
,
description
,
Long
.
valueOf
(
opId
),
opName
,
platTypeEnum
.
getCode
());
saveWorkOrderOpLog
(
workOrder
,
InspectionWorkOrderOperationTypeEnum
.
UPDATE_ORDER_INFO
.
getCode
(),
originalStatus
,
originalStatus
,
StrUtil
.
isBlank
(
operationContent
)
?
"无具体修改内容"
:
operationContent
,
description
,
Long
.
valueOf
(
opId
),
opName
,
platTypeEnum
.
getCode
());
...
@@ -314,7 +326,13 @@ public class InspectionWorkOrderService {
...
@@ -314,7 +326,13 @@ public class InspectionWorkOrderService {
// 车辆表:baseInfo.licensePlate
// 车辆表:baseInfo.licensePlate
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
licensePlate
),
likePattern
),
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
licensePlate
),
likePattern
),
// 车辆表:baseInfo.vin
// 车辆表:baseInfo.vin
builder
.
like
(
root
.
get
(
InspectionWorkOrder_
.
vehicle
).
get
(
Vehicle_
.
baseInfo
).
get
(
BaseInfo_
.
vin
),
likePattern
)));
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
)
));
}
}
Object
inspectorId
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
InspectionWorkOrder
.
INSPECTOR_ID
);
Object
inspectorId
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
InspectionWorkOrder
.
INSPECTOR_ID
);
if
(
inspectorId
!=
null
)
{
if
(
inspectorId
!=
null
)
{
...
@@ -402,9 +420,6 @@ public class InspectionWorkOrderService {
...
@@ -402,9 +420,6 @@ public class InspectionWorkOrderService {
if
(
auditVO
.
getAuditResult
()
==
null
||
(
auditVO
.
getAuditResult
()
!=
1
&&
auditVO
.
getAuditResult
()
!=
2
))
{
if
(
auditVO
.
getAuditResult
()
==
null
||
(
auditVO
.
getAuditResult
()
!=
1
&&
auditVO
.
getAuditResult
()
!=
2
))
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"审批结果仅支持1=同意/2=不同意"
);
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"审批结果仅支持1=同意/2=不同意"
);
}
}
if
(
StrUtil
.
isBlank
(
auditVO
.
getAuditOpinion
()))
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PARAM_ERROR
,
"审批意见不能为空"
);
}
// 2. 查询工单并校验状态
// 2. 查询工单并校验状态
InspectionWorkOrder
workOrder
=
inspectionWorkOrderRepository
.
findByIdAndDeleteFlag
(
auditVO
.
getId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
())
InspectionWorkOrder
workOrder
=
inspectionWorkOrderRepository
.
findByIdAndDeleteFlag
(
auditVO
.
getId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
())
...
...
aus-core/src/main/java/com/glsx/usedcar/module/inspect/vo/InspectionWorkOrderAuditVO.java
View file @
ec2c421
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
vo
;
package
com
.
glsx
.
usedcar
.
module
.
inspect
.
vo
;
import
jakarta.validation.constraints.NotBlank
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotNull
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -14,17 +14,19 @@ public class InspectionWorkOrderAuditVO {
...
@@ -14,17 +14,19 @@ public class InspectionWorkOrderAuditVO {
* 工单主键ID
* 工单主键ID
*/
*/
@NotNull
(
message
=
"工单ID不能为空"
)
@NotNull
(
message
=
"工单ID不能为空"
)
@Schema
(
description
=
"工单ID"
)
private
Long
id
;
private
Long
id
;
/**
/**
* 审批结果:1=同意,2=不同意
* 审批结果:1=同意,2=不同意
*/
*/
@NotNull
(
message
=
"审批结果不能为空"
)
@NotNull
(
message
=
"审批结果不能为空"
)
@Schema
(
description
=
"审批结果 1=同意,2=不同意"
)
private
Integer
auditResult
;
private
Integer
auditResult
;
/**
/**
* 审批意见
* 审批意见
*/
*/
@
NotBlank
(
message
=
"审批意见不能为空
"
)
@
Schema
(
description
=
"审批意见
"
)
private
String
auditOpinion
;
private
String
auditOpinion
;
}
}
\ No newline at end of file
\ No newline at end of file
aus-core/src/main/java/com/glsx/usedcar/module/vehicle/service/VehicleService.java
View file @
ec2c421
package
com
.
glsx
.
usedcar
.
module
.
vehicle
.
service
;
package
com
.
glsx
.
usedcar
.
module
.
vehicle
.
service
;
import
com.glsx.usedcar.enums.common.DeleteFlag
;
import
com.glsx.usedcar.enums.inspect.InspectionWorkOrderStatusEnum
;
import
com.glsx.usedcar.module.analysis.domain.NameCount
;
import
com.glsx.usedcar.module.analysis.domain.NameCount
;
import
com.glsx.usedcar.module.auction.dao.AuctionDao
;
import
com.glsx.usedcar.module.auction.dao.AuctionDao
;
import
com.glsx.usedcar.module.auction.entity.Auction
;
import
com.glsx.usedcar.module.auction.entity.Auction
;
import
com.glsx.usedcar.module.auction.entity.Auction.AuctionType
;
import
com.glsx.usedcar.module.auction.entity.Auction.AuctionType
;
import
com.glsx.usedcar.module.auction.entity.dto.LightPollingBidConfigDTO
;
import
com.glsx.usedcar.module.auction.entity.dto.LightPollingBidConfigDTO
;
import
com.glsx.usedcar.module.inspect.dao.InspectionWorkOrderRepository
;
import
com.glsx.usedcar.module.vehicle.dao.VehicleDao
;
import
com.glsx.usedcar.module.vehicle.dao.VehicleDao
;
import
com.glsx.usedcar.module.vehicle.dao.VehicleHistoryDao
;
import
com.glsx.usedcar.module.vehicle.dao.VehicleHistoryDao
;
import
com.glsx.usedcar.module.vehicle.domain.*
;
import
com.glsx.usedcar.module.vehicle.domain.*
;
...
@@ -25,6 +28,7 @@ import org.springframework.transaction.annotation.Propagation;
...
@@ -25,6 +28,7 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.summerframework.orm.paging.Operator
;
import
org.summerframework.orm.paging.Pagination
;
import
org.summerframework.orm.paging.Pagination
;
import
org.summerframework.storage.domain.FileInfo
;
import
org.summerframework.storage.domain.FileInfo
;
...
@@ -59,6 +63,9 @@ public class VehicleService {
...
@@ -59,6 +63,9 @@ public class VehicleService {
@Autowired
@Autowired
private
AuctionDao
auctionDao
;
private
AuctionDao
auctionDao
;
@Autowired
private
InspectionWorkOrderRepository
inspectionWorkOrderRepository
;
/**
/**
* 通过ID查询一个库存车辆
* 通过ID查询一个库存车辆
*
*
...
@@ -365,4 +372,23 @@ public class VehicleService {
...
@@ -365,4 +372,23 @@ public class VehicleService {
vehicleDao
.
save
(
vehicle
);
vehicleDao
.
save
(
vehicle
);
return
BaseResp
.
success
(
true
);
return
BaseResp
.
success
(
true
);
}
}
/**
* 分页查询待检测车辆
* 仅能选择车辆状态为“待入库、场地待维护、待定价、待关联拍场”、,且未关联任何“待检测”或“检测中”工单的车辆。已取消或已完成检测的车辆可被重新选择。
*
*/
public
Page
<
Vehicle
>
pageEnableInspectVehicle
(
Pagination
<
Vehicle
>
pagination
)
{
List
<
Integer
>
status
=
List
.
of
(
InspectionWorkOrderStatusEnum
.
DISPATCHED
.
getCode
(),
InspectionWorkOrderStatusEnum
.
IN_PROGRESS
.
getCode
());
List
<
Long
>
vehicleIdList
=
inspectionWorkOrderRepository
.
findVehicleIdsByStatusInAndDeleteFlag
(
status
,
DeleteFlag
.
NOT_DELETED
.
getCode
());
List
<
Vehicle
.
VehicleState
>
vehicleStates
=
List
.
of
(
Vehicle
.
VehicleState
.
INVENTORY
,
Vehicle
.
VehicleState
.
VENUE
,
Vehicle
.
VehicleState
.
TO_BE_PRICED
,
Vehicle
.
VehicleState
.
PRICED
);
pagination
.
addCondition
((
root
,
query
,
builder
)
->
builder
.
not
(
root
.
get
(
Vehicle_
.
vehicleId
).
in
(
vehicleIdList
)));
pagination
.
addFilter
(
"vehicleState"
,
vehicleStates
,
Operator
.
in
);
return
vehicleDao
.
findAll
(
pagination
,
pagination
.
getPageRequest
());
}
}
}
\ No newline at end of file
\ No newline at end of file
aus-core/src/main/resources/messages.properties
View file @
ec2c421
...
@@ -63,3 +63,5 @@ Deposit.RefundState.REFUNDING=\u9000\u6B3E\u4E2D
...
@@ -63,3 +63,5 @@ Deposit.RefundState.REFUNDING=\u9000\u6B3E\u4E2D
Deposit.RefundState.REFUNDED
=
\u
5DF2
\u9000\u
6B3E
Deposit.RefundState.REFUNDED
=
\u
5DF2
\u9000\u
6B3E
Inspector.Login.SMSCODE
=
\u
60a8
\u
6b63
\u5728\u
767b
\u
5f55
\u
68c0
\u
6d4b
\u
7cfb
\u
7edf
\u
8d26
\u
53f7
\u
ff0c
\u
9a8c
\u
8bc1
\u7801\u
ff1a{0}
\u
ff0c{1}
\u5206\u
949f
\u5185\u6709\u6548\u3002\u5982\u
975e
\u
672c
\u
4eba
\u
64cd
\u
4f5c
\u
ff0c
\u
8bf7
\u
5ffd
\u7565\u
6b64
\u
77ed
\u
4fe1
\u3002
Inspector.Login.SMSCODE
=
\u
60a8
\u
6b63
\u5728\u
767b
\u
5f55
\u
68c0
\u
6d4b
\u
7cfb
\u
7edf
\u
8d26
\u
53f7
\u
ff0c
\u
9a8c
\u
8bc1
\u7801\u
ff1a{0}
\u
ff0c{1}
\u5206\u
949f
\u5185\u6709\u6548\u3002\u5982\u
975e
\u
672c
\u
4eba
\u
64cd
\u
4f5c
\u
ff0c
\u
8bf7
\u
5ffd
\u7565\u
6b64
\u
77ed
\u
4fe1
\u3002
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.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
aus-framework/src/main/java/org/summerframework/orm/paging/Pagination.java
View file @
ec2c421
...
@@ -753,4 +753,16 @@ public class Pagination<T> implements Specification<T> {
...
@@ -753,4 +753,16 @@ public class Pagination<T> implements Specification<T> {
fetchers
=
null
;
fetchers
=
null
;
}
}
public
Sort
.
Direction
getSortDirection
()
{
if
(
StringUtils
.
isBlank
(
this
.
order
))
{
return
null
;
}
if
(
this
.
order
.
equalsIgnoreCase
(
"asc"
))
{
return
Sort
.
Direction
.
ASC
;
}
else
if
(
this
.
order
.
equalsIgnoreCase
(
"desc"
))
{
return
Sort
.
Direction
.
DESC
;
}
return
null
;
}
}
}
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