Commit 229d28e5 by 杨卫

Merge remote-tracking branch 'origin/v1.3.0' into v1.3.0

2 parents 629c6a31 7bcba797
Showing 22 changed files with 336 additions and 42 deletions
...@@ -9,6 +9,7 @@ import com.glsx.usedcar.module.inspect.entity.InspectionReport; ...@@ -9,6 +9,7 @@ import com.glsx.usedcar.module.inspect.entity.InspectionReport;
import com.glsx.usedcar.module.inspect.service.InspectionReportService; import com.glsx.usedcar.module.inspect.service.InspectionReportService;
import com.glsx.usedcar.module.inspect.vo.*; import com.glsx.usedcar.module.inspect.vo.*;
import com.glsx.usedcar.module.security.entity.User; import com.glsx.usedcar.module.security.entity.User;
import com.glsx.usedcar.req.CommonLongIdListReq;
import com.glsx.usedcar.resp.BaseResp; import com.glsx.usedcar.resp.BaseResp;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
...@@ -86,14 +87,14 @@ public class InspectionReportController { ...@@ -86,14 +87,14 @@ public class InspectionReportController {
} }
@Operation(summary = "检测报告绑定", description = "绑定报告到车辆(同一车辆仅允许绑定一个报告)") @Operation(summary = "检测报告绑定", description = "绑定报告到车辆(同一车辆仅允许绑定一个报告)")
@GetMapping("/bind/{id}") @PostMapping("/bind")
public BaseResp<Void> bind( public BaseResp<Void> bind(
@Parameter(description = "检测报告ID", required = true) @PathVariable("id") Long id, @Valid @RequestBody CommonLongIdListReq req,
Authentication authentication) { Authentication authentication) {
log.info("【接口请求】检测报告绑定,操作人={},报告ID={}", getUserName(authentication), id); log.info("【接口请求】检测报告绑定,操作人={},报告ID={}", getUserName(authentication), req.getIdList());
try { try {
User user = (User) authentication.getPrincipal(); User user = (User) authentication.getPrincipal();
inspectionReportService.bindInspectionReport(id, (long)user.getUserId(), user.getUserName(), InspectionPlatTypeEnum.BACKEND.getCode()); inspectionReportService.bindInspectionReport(req.getIdList(), (long)user.getUserId(), user.getUserName(), InspectionPlatTypeEnum.BACKEND.getCode());
return BaseResp.success(); return BaseResp.success();
} catch (BusinessCodeException be) { } catch (BusinessCodeException be) {
log.error("【接口响应】检测报告绑定失败!操作人={},业务异常!", getUserName(authentication), be); log.error("【接口响应】检测报告绑定失败!操作人={},业务异常!", getUserName(authentication), be);
...@@ -105,14 +106,14 @@ public class InspectionReportController { ...@@ -105,14 +106,14 @@ public class InspectionReportController {
} }
@Operation(summary = "检测报告解绑", description = "解除报告与车辆的绑定关系") @Operation(summary = "检测报告解绑", description = "解除报告与车辆的绑定关系")
@GetMapping("/unbind/{id}") @PostMapping("/unbind")
public BaseResp<Void> unbind( public BaseResp<Void> unbind(
@Parameter(description = "检测报告ID", required = true) @PathVariable("id") Long id, @Valid @RequestBody CommonLongIdListReq req,
Authentication authentication) { Authentication authentication) {
log.info("【接口请求】检测报告解绑,操作人={},报告ID={}", getUserName(authentication), id); log.info("【接口请求】检测报告解绑,操作人={},报告ID={}", getUserName(authentication), req.getIdList());
try { try {
User user = (User) authentication.getPrincipal(); User user = (User) authentication.getPrincipal();
inspectionReportService.unbindInspectionReport(id, (long)user.getUserId(), user.getUserName(), InspectionPlatTypeEnum.BACKEND.getCode()); inspectionReportService.unbindInspectionReport(req.getIdList(), (long)user.getUserId(), user.getUserName(), InspectionPlatTypeEnum.BACKEND.getCode());
return BaseResp.success(); return BaseResp.success();
} catch (BusinessCodeException be) { } catch (BusinessCodeException be) {
log.error("【接口响应】检测报告解绑失败!操作人={},业务异常!", getUserName(authentication), be); log.error("【接口响应】检测报告解绑失败!操作人={},业务异常!", getUserName(authentication), be);
......
...@@ -188,10 +188,15 @@ public class InspectionWorkOrderController { ...@@ -188,10 +188,15 @@ public class InspectionWorkOrderController {
@Operation(summary = "统计各状态工单数量", description = "统计未删除的待检测、检测中、已完成、已取消工单数量") @Operation(summary = "统计各状态工单数量", description = "统计未删除的待检测、检测中、已完成、已取消工单数量")
@GetMapping("/countByStatus") @GetMapping("/countByStatus")
public BaseResp<InspectionWorkOrderStatusCountVO> countByStatus() { public BaseResp<InspectionWorkOrderStatusCountVO> countByStatus(@RequestParam(name = "inspectorId", required = false) Long id) {
log.info("开始统计各状态检测工单数量"); log.info("开始统计各状态检测工单数量");
try { try {
InspectionWorkOrderStatusCountVO countVO = inspectionWorkOrderService.countByStatus(); InspectionWorkOrderStatusCountVO countVO = null;
if (id == null) {
countVO = inspectionWorkOrderService.countByStatus();
} else {
countVO = inspectionWorkOrderService.countByStatusAndInspector(id);
}
return BaseResp.success(countVO); return BaseResp.success(countVO);
} catch (BusinessCodeException be) { } catch (BusinessCodeException be) {
log.error("统计各状态工单数量失败!业务异常!", be); log.error("统计各状态工单数量失败!业务异常!", be);
......
...@@ -53,9 +53,13 @@ public interface JpaQueryConstants { ...@@ -53,9 +53,13 @@ public interface JpaQueryConstants {
* 关键字,检测师名称或手机号,模糊查询 * 关键字,检测师名称或手机号,模糊查询
*/ */
String KEYWORD = "keyword"; String KEYWORD = "keyword";
/**
* 精确匹配
*/
String INSPECTOR_ID = "inspectorId";
/** /**
* 账号状态,精确匹配 * 精确匹配
*/ */
String STATUS = "status"; String STATUS = "status";
...@@ -65,4 +69,22 @@ public interface JpaQueryConstants { ...@@ -65,4 +69,22 @@ public interface JpaQueryConstants {
String UPDATE_TIME = "updateTime"; String UPDATE_TIME = "updateTime";
} }
/**
* 检测报告
* @see com.glsx.usedcar.module.inspect.entity.InspectionReport
*/
interface InspectionReport
{
String ID = "id";
/**
* 关键字,检测师名称或手机号,模糊查询
*/
String KEYWORD = "keyword";
/**
* 精确匹配
*/
String INSPECTOR_ID = "inspectorId";
}
} }
...@@ -269,9 +269,9 @@ public class InspectionReportService { ...@@ -269,9 +269,9 @@ public class InspectionReportService {
* 绑定检测报告(接收操作人参数,核心规则:同一车辆仅绑定一个报告) * 绑定检测报告(接收操作人参数,核心规则:同一车辆仅绑定一个报告)
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void bindInspectionReport(Long id, Long operatorId, String operatorName, Integer platType) { public void bindInspectionReport(List<Long> idList, Long operatorId, String operatorName, Integer platType) {
log.info("【报告绑定】操作人={},开始处理,报告ID={}", operatorName, id); List<String> bindSourceNoList = new ArrayList<>();
for (Long id : idList) {
// 1. 查找报告并校验 // 1. 查找报告并校验
InspectionReport report = inspectionReportRepository.findById(id) InspectionReport report = inspectionReportRepository.findById(id)
.orElseThrow(() -> new BusinessCodeException(ErrorCodeEnum.DATA_NOT_EXIST, "检测报告不存在,ID:" + id)); .orElseThrow(() -> new BusinessCodeException(ErrorCodeEnum.DATA_NOT_EXIST, "检测报告不存在,ID:" + id));
...@@ -279,20 +279,23 @@ public class InspectionReportService { ...@@ -279,20 +279,23 @@ public class InspectionReportService {
// 已绑定则直接返回 // 已绑定则直接返回
if (Objects.equals(report.getBindStatus(), 1)) { if (Objects.equals(report.getBindStatus(), 1)) {
log.info("【报告绑定】操作人={},报告已绑定,无需重复操作,报告编号={}", operatorName, report.getReportNo()); log.info("【报告绑定】操作人={},报告已绑定,无需重复操作,报告编号={}", operatorName, report.getReportNo());
return; continue;
} }
// 2. 检查该车辆是否已绑定其他报告 // 2. 检查该车辆是否已绑定其他报告
Vehicle vehicle = report.getVehicle(); Vehicle vehicle = report.getVehicle();
List<InspectionReport> bindedReports = inspectionReportRepository.findByVehicleAndBindStatusAndDeleteFlag( List<InspectionReport> bindedReports = inspectionReportRepository.findByVehicleAndBindStatusAndDeleteFlag(vehicle, 1, DeleteFlag.NOT_DELETED.getCode());
vehicle, 1, DeleteFlag.NOT_DELETED.getCode()
);
if (!bindedReports.isEmpty()) { if (!bindedReports.isEmpty()) {
String bindedReportNos = bindedReports.stream().map(InspectionReport::getReportNo).reduce((a, b) -> a + "," + b).get(); bindSourceNoList.add(vehicle.getBaseInfo().getSourceNo());
throw new BusinessCodeException(ErrorCodeEnum.OPERATION_ERROR, continue;
String.format("该车辆已绑定其他检测报告(报告编号:%s),不允许重复绑定", bindedReportNos));
} }
bindInspectionReport(report, vehicle, operatorId, operatorName, platType);
}
if (!bindSourceNoList.isEmpty()) {
throw new BusinessCodeException(ErrorCodeEnum.VEHICLE_ALREADY_BIND, String.join(",", bindSourceNoList));
}
}
private void bindInspectionReport(InspectionReport report, Vehicle vehicle, Long operatorId, String operatorName, Integer platType) {
log.info("【报告绑定】操作人={},开始处理,报告ID={}", operatorName, report.getId());
// 3. 保存绑定前的原始数据 // 3. 保存绑定前的原始数据
String originalData = ""; String originalData = "";
try { try {
...@@ -325,7 +328,12 @@ public class InspectionReportService { ...@@ -325,7 +328,12 @@ public class InspectionReportService {
* 解绑检测报告(接收操作人参数) * 解绑检测报告(接收操作人参数)
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void unbindInspectionReport(Long id, Long operatorId, String operatorName, Integer platType) { public void unbindInspectionReport(List<Long> idList, Long operatorId, String operatorName, Integer platType) {
idList.forEach(reportId -> {
unbindInspectionReport(reportId, operatorId, operatorName, platType);
});
}
private void unbindInspectionReport(Long id, Long operatorId, String operatorName, Integer platType) {
log.info("【报告解绑】操作人={},开始处理,报告ID={}", operatorName, id); log.info("【报告解绑】操作人={},开始处理,报告ID={}", operatorName, id);
// 1. 查找报告并校验 // 1. 查找报告并校验
...@@ -421,9 +429,9 @@ public class InspectionReportService { ...@@ -421,9 +429,9 @@ public class InspectionReportService {
*/ */
public Page<InspectionReportRespVO> pageList(Pagination<InspectionReport> pagination) { public Page<InspectionReportRespVO> pageList(Pagination<InspectionReport> pagination) {
// 1. 处理关键词模糊查询(复用工单查询的KEYWORD常量) // 1. 处理关键词模糊查询(复用工单查询的KEYWORD常量)
Object keyword = pagination.getFilterValueOrElseNull(JpaQueryConstants.Inspector.KEYWORD); Object keyword = pagination.getFilterValueOrElseNull(JpaQueryConstants.InspectionReport.KEYWORD);
if (keyword instanceof String kw && StrUtil.isNotBlank(kw)) { if (keyword instanceof String kw && StrUtil.isNotBlank(kw)) {
pagination.removeFilter(JpaQueryConstants.Inspector.KEYWORD); pagination.removeFilter(JpaQueryConstants.InspectionReport.KEYWORD);
String likePattern = SymbolConsts.PERCENT + kw + SymbolConsts.PERCENT; String likePattern = SymbolConsts.PERCENT + kw + SymbolConsts.PERCENT;
// 2. 添加多字段模糊查询条件(报告表+关联表) // 2. 添加多字段模糊查询条件(报告表+关联表)
...@@ -442,7 +450,11 @@ public class InspectionReportService { ...@@ -442,7 +450,11 @@ public class InspectionReportService {
builder.like(root.get(InspectionReport_.workOrder).get(InspectionWorkOrder_.woId), likePattern) builder.like(root.get(InspectionReport_.workOrder).get(InspectionWorkOrder_.woId), likePattern)
)); ));
} }
Object inspectorId = pagination.getFilterValueOrElseNull(JpaQueryConstants.InspectionReport.INSPECTOR_ID);
if (inspectorId != null) {
pagination.removeFilter(JpaQueryConstants.InspectionReport.INSPECTOR_ID);
pagination.addCondition((root, query, builder) -> builder.equal(root.get(InspectionReport_.workOrder).get(InspectionWorkOrder_.inspector).get(Inspector_.id), inspectorId));
}
// 3. 执行分页查询 // 3. 执行分页查询
Page<InspectionReport> resultPage = inspectionReportRepository.findAll(pagination, pagination.getPageRequest()); Page<InspectionReport> resultPage = inspectionReportRepository.findAll(pagination, pagination.getPageRequest());
......
...@@ -281,9 +281,9 @@ public class InspectionWorkOrderService { ...@@ -281,9 +281,9 @@ public class InspectionWorkOrderService {
} }
public Page<InspectionWORespVO> pageList(Pagination<InspectionWorkOrder> pagination) { public Page<InspectionWORespVO> pageList(Pagination<InspectionWorkOrder> pagination) {
Object keyword = pagination.getFilterValueOrElseNull(JpaQueryConstants.Inspector.KEYWORD); Object keyword = pagination.getFilterValueOrElseNull(JpaQueryConstants.InspectionWorkOrder.KEYWORD);
if (keyword instanceof String kw && StrUtil.isNotBlank(kw)) { if (keyword instanceof String kw && StrUtil.isNotBlank(kw)) {
pagination.removeFilter(JpaQueryConstants.Inspector.KEYWORD); pagination.removeFilter(JpaQueryConstants.InspectionWorkOrder.KEYWORD);
String likePattern = SymbolConsts.PERCENT + kw + SymbolConsts.PERCENT; String likePattern = SymbolConsts.PERCENT + kw + SymbolConsts.PERCENT;
pagination.addCondition((root, query, builder) -> builder.or( pagination.addCondition((root, query, builder) -> builder.or(
// 工单表:woId // 工单表:woId
...@@ -295,6 +295,11 @@ public class InspectionWorkOrderService { ...@@ -295,6 +295,11 @@ public class InspectionWorkOrderService {
// 车辆表: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)));
} }
Object inspectorId = pagination.getFilterValueOrElseNull(JpaQueryConstants.InspectionWorkOrder.INSPECTOR_ID);
if (inspectorId != null) {
pagination.removeFilter(JpaQueryConstants.InspectionWorkOrder.INSPECTOR_ID);
pagination.addCondition((root, query, builder) -> builder.equal(root.get(InspectionWorkOrder_.inspector).get(Inspector_.id), inspectorId));
}
Page<InspectionWorkOrder> resultPage = inspectionWorkOrderRepository.findAll(pagination, pagination.getPageRequest()); Page<InspectionWorkOrder> resultPage = inspectionWorkOrderRepository.findAll(pagination, pagination.getPageRequest());
return resultPage.map(inspectionWorkOrderConverter::inspectorMapRespVO); return resultPage.map(inspectionWorkOrderConverter::inspectorMapRespVO);
} }
...@@ -590,6 +595,9 @@ public class InspectionWorkOrderService { ...@@ -590,6 +595,9 @@ public class InspectionWorkOrderService {
countVO.getCompletedCount(), countVO.getCanceledCount()); countVO.getCompletedCount(), countVO.getCanceledCount());
return countVO; return countVO;
} }
public InspectionWorkOrderStatusCountVO countByStatusAndInspector(Long inspectorId) {
return countByStatusAndInspector(inspectorRepository.findById(inspectorId).orElse(null));
}
/** /**
* 统计指定检测师的各状态检测工单数量(仅统计未删除工单) * 统计指定检测师的各状态检测工单数量(仅统计未删除工单)
* @param inspector 检测师 * @param inspector 检测师
......
package com.glsx.usedcar.req;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.util.List;
/**
* 通用的id列表请求参数
*/
@Data
public class CommonLongIdListReq {
@Size(min = 1)
@Schema(description = "id列表", example = "[1,2,3]")
private List<Long> idList;
}
package com.glsx.usedcar.req;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 通用的id列表请求参数
*/
@Data
public class CommonLongIdReq {
@Schema(description = "id", example = "3")
private Long id;
}
...@@ -34,6 +34,7 @@ public enum ErrorCodeEnum { ...@@ -34,6 +34,7 @@ public enum ErrorCodeEnum {
VEHICLE_ALREADY_INSPECTED(1001006, "车辆已经创建检测工单"), VEHICLE_ALREADY_INSPECTED(1001006, "车辆已经创建检测工单"),
OPERATION_ERROR(1001007, "已绑定的检测报告不允许删除"), OPERATION_ERROR(1001007, "已绑定的检测报告不允许删除"),
DATA_NOT_FOUND(1001008, "{0}"), DATA_NOT_FOUND(1001008, "{0}"),
VEHICLE_ALREADY_BIND(1001009, "{0}"),
/* 检测模版 */ /* 检测模版 */
......
...@@ -36,6 +36,23 @@ export class DetectionController { ...@@ -36,6 +36,23 @@ export class DetectionController {
} }
static inspectReportPage(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/report/page', params);
}
static PAGE_INSPECTOR_REPORT = 'inspect/report/page';
static inspectReportExport(axios: AxiosStatic, params: any, config?: any): Promise<AxiosResponse<void>> {
return axios.post('inspect/report/export', params, config);
}
static inspectReportBind(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/report/bind', params);
}
static inspectReportUnbind(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/report/unbind', params);
}
static inspectOrderPage(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectOrderPage(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/wo/page', params); return axios.post('inspect/wo/page', params);
...@@ -48,7 +65,7 @@ export class DetectionController { ...@@ -48,7 +65,7 @@ export class DetectionController {
} }
static inspectOrderCountByStatus(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectOrderCountByStatus(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('inspect/wo/countByStatus', params); return axios.get('inspect/wo/countByStatus' + (params.inspectorId ? '?inspectorId=' + params.inspectorId : ''), params);
} }
static inspectOrderUpdate(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectOrderUpdate(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
...@@ -56,15 +73,15 @@ export class DetectionController { ...@@ -56,15 +73,15 @@ export class DetectionController {
} }
static inspectOrderExport(axios: AxiosStatic, params: any, config?: any): Promise<AxiosResponse<void>> { static inspectOrderExport(axios: AxiosStatic, params: any, config?: any): Promise<AxiosResponse<void>> {
return axios.post('/inspect/wo/export', params, config); return axios.post('inspect/wo/export', params, config);
} }
static inspectOrderCancel(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectOrderCancel(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('/inspect/wo/cancel', params); return axios.post('inspect/wo/cancel', params);
} }
static inspectOrderDetail(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectOrderDetail(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('/inspect/wo/detail/' + params.id, params); return axios.get('inspect/wo/detail/' + params.id, params);
} }
} }
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-card class="stat-card"> <a-card class="stat-card">
<img src="@/assets/detection/inspectorCount.png" class="stat-img"> <img src="@/assets/detection/enableInspectorCount.png" class="stat-img">
<a-statistic class="stat-data" title="已启用账号数" :value="statisticsData.enableInspectorCount"> <a-statistic class="stat-data" title="已启用账号数" :value="statisticsData.enableInspectorCount">
</a-statistic> </a-statistic>
</a-card> </a-card>
......
...@@ -86,12 +86,13 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> { ...@@ -86,12 +86,13 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> {
this.getinspectOrderCountByStatus(); this.getinspectOrderCountByStatus();
this.init(this.axios, DetectionController.PAGE_INSPECTOR_ORDER); this.init(this.axios, DetectionController.PAGE_INSPECTOR_ORDER);
this.buildQueryForm({}); this.buildQueryForm({});
this.pagination.addDefaultFilter('inspectorId', this.$route.query.id, Operator.eq);
this.pagination.setDefaultSort('createTime', Order.desc); this.pagination.setDefaultSort('createTime', Order.desc);
this.changeTab(this.tabKey); this.changeTab(this.tabKey);
} }
getinspectOrderCountByStatus() { getinspectOrderCountByStatus() {
DetectionController.inspectOrderCountByStatus(this.axios, {}).then(res => { DetectionController.inspectOrderCountByStatus(this.axios, { inspectorId: this.$route.query.id }).then(res => {
this.ccountByStatusData = res.data.data || {}; this.ccountByStatusData = res.data.data || {};
}); });
} }
......
...@@ -25,6 +25,33 @@ ...@@ -25,6 +25,33 @@
:row-selection="{ selectedRowKeys: selectIds, onChange: onSelectChange, type: 'checkbox', preserveSelectedRowKeys: true, }"> :row-selection="{ selectedRowKeys: selectIds, onChange: onSelectChange, type: 'checkbox', preserveSelectedRowKeys: true, }">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'carTypeName'">
<div class="carTypeNameBox">
<div class="carTypeNameBox_image">
<a-image v-if="record.vehicle?.carImages?.[0]?.fileUrl" :width="60"
style="border-radius: 4px;" :src="record.vehicle?.carImages?.[0]?.fileUrl" />
</div>
<div class="carTypeNameBox_text">
<div class="carTypeNameBox_name" :title="record.vehicle?.baseInfo?.carTypeName || '-'">
{{ record.vehicle?.baseInfo?.carTypeName || '-' }}
</div>
<div class="carTypeNameBox_vin" :title="record.vehicle?.baseInfo?.vin || '-'">VIN码:{{
record.vehicle?.baseInfo?.vin || '-' }}</div>
</div>
</div>
</template>
<template v-if="column.key === 'custodianName'">
<div class="templateName" :title="record.vehicle?.custodianInfo?.custodianName || '-'" >{{ record.vehicle?.custodianInfo?.custodianName || '-' }}</div>
<div class="templatePhone">{{ record.vehicle?.custodianInfo?.custodianPhone || '-' }}</div>
</template>
<template v-if="column.key === 'name'">
<div class="templateName" :title="record.inspector?.name || '-'" >{{ record.inspector?.name || '-' }}</div>
<div class="templatePhone">{{ record.inspector?.phone || '-' }}</div>
</template>
<template v-if="column.key === 'vehicleState'"> <template v-if="column.key === 'vehicleState'">
<vehicle-state-tag :vehicle-state="record.vehicle.vehicleState"></vehicle-state-tag> <vehicle-state-tag :vehicle-state="record.vehicle.vehicleState"></vehicle-state-tag>
</template> </template>
...@@ -136,13 +163,13 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> { ...@@ -136,13 +163,13 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> {
}, },
{ title: '工单单号', dataIndex: 'woId', key: 'woId', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '工单单号', dataIndex: 'woId', key: 'woId', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '车源号', dataIndex: ['vehicle', 'baseInfo', "sourceNo"], key: 'sourceNo', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '车源号', dataIndex: ['vehicle', 'baseInfo', "sourceNo"], key: 'sourceNo', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '车型名称', dataIndex: ['vehicle', 'baseInfo', "carTypeName"], key: 'carTypeName', align: 'center', width: 240, resizable: true, ellipsis: true }, { title: '车型名称', dataIndex: ['vehicle', 'baseInfo', "carTypeName"], key: 'carTypeName', align: 'center', width: 286, resizable: true, ellipsis: true },
{ title: '车牌号', dataIndex: ['vehicle', 'baseInfo', "licensePlate"], key: 'licensePlate', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '车牌号', dataIndex: ['vehicle', 'baseInfo', "licensePlate"], key: 'licensePlate', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '所属门店', dataIndex: ['vehicle', 'venue', 'venueName'], key: 'venueName', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '所属门店', dataIndex: ['vehicle', 'venue', 'venueName'], key: 'venueName', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '车辆所在地址', dataIndex: ['vehicle', 'custodianInfo', "handoverAddress"], key: 'handoverAddress', width: 240, resizable: true, ellipsis: true }, { title: '车辆所在地址', dataIndex: ['vehicle', 'custodianInfo', "handoverAddress"], key: 'handoverAddress', width: 240, resizable: true, ellipsis: true },
{ title: '车辆保管人', dataIndex: ['vehicle', 'custodianInfo', "custodianName"], key: 'custodianName', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '车辆保管人', dataIndex: ['vehicle', 'custodianInfo', "custodianName"], key: 'custodianName', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '车辆状态', dataIndex: ['vehicle', "vehicleState"], key: 'vehicleState', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '车辆状态', dataIndex: ['vehicle', "vehicleState"], key: 'vehicleState', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '检测师', dataIndex: ['inspector', "name"], key: 'name', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '检测师', dataIndex: ['inspector', "name"], key: 'name', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '检测地址', dataIndex: 'inspectionAddress', key: 'inspectionAddress', align: 'center', width: 240, resizable: true, ellipsis: true }, { title: '检测地址', dataIndex: 'inspectionAddress', key: 'inspectionAddress', align: 'center', width: 240, resizable: true, ellipsis: true },
{ title: '检测单状态', dataIndex: 'status', key: 'status', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '检测单状态', dataIndex: 'status', key: 'status', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '审核状态', dataIndex: 'auditStatus', key: 'auditStatus', width: 170, align: 'center', resizable: true, ellipsis: true }, { title: '审核状态', dataIndex: 'auditStatus', key: 'auditStatus', width: 170, align: 'center', resizable: true, ellipsis: true },
...@@ -272,4 +299,72 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> { ...@@ -272,4 +299,72 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> {
</script> </script>
<style scoped lang="less"></style> <style scoped lang="less">
.templateName {
width: 100%;
color: #2f3133;
font-size: 14px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.templatePhone {
color: #777c85;
font-size: 12px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
}
.carTypeNameBox {
width: 100%;
display: flex;
}
.carTypeNameBox_image {
width: 60px;
height: 60px;
border-radius: 4px;
float: left;
}
.carTypeNameBox_text {
width: 200px;
float: left;
margin-left: 8px;
}
.carTypeNameBox_name {
width: 100%;
height: 22px;
color: #2f3133;
font-size: 14px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: 22px;
margin-top: 9px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.carTypeNameBox_vin {
width: 100%;
height: 20px;
opacity: 1;
color: #777c85;
font-size: 12px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
...@@ -55,7 +55,7 @@ import orderDetails from "@/views/detection/order/components/orderDetails.vue"; ...@@ -55,7 +55,7 @@ import orderDetails from "@/views/detection/order/components/orderDetails.vue";
export default class DetectionOrderView extends PaginationComponent<Vehicle> { export default class DetectionOrderView extends PaginationComponent<Vehicle> {
tabKey = "DETAIL"; tabKey = "REPORT";
routeData: any = { routeData: any = {
id: '', id: '',
......
<template>
<div>
<a-modal v-model:open="dialogVisible" :title="titleVisible" @ok="handleOk">
<a-spin :spinning="submitted" style="margin-top: 16px;">
<div class="disabledTip" v-if="bindStatus == 1">
<div class="outlinedBox">
<InfoCircleOutlined style="font-size: 16px; color: #1956FE;" />
</div>
<div class="disabledTxt">
<span>确定将此报告绑定到车辆 ( </span>
<span v-for="item in bindList" :key="item.id">
车源号:{{ item?.vehicle?.baseInfo?.sourceNo || '-' }}
</span>
<span> ) 的前端拍卖页面吗?</span>
</div>
</div>
<div class="disabledTip" v-if="bindStatus == 2">
<div class="outlinedBox">
<InfoCircleOutlined style="font-size: 16px; color: #FC8B0A;" />
</div>
<div class="disabledTxt">解绑后,该报告将不再于前端展示,是否确认解绑?</div>
</div>
</a-spin>
</a-modal>
</div>
</template>
<script lang="ts">
import { Component } from 'vue-facing-decorator';
import { EnhanceFormComponent } from "@/core/form/EnhanceFormComponent";
import { DetectionController } from "@/api/DetectionController";
import { message } from "ant-design-vue";
import { User } from "lib/src/entity/security/entity/User";
import { InfoCircleOutlined } from "@ant-design/icons-vue";
@Component({
components: { InfoCircleOutlined }
})
export default class bindDialog extends EnhanceFormComponent<User> {
bindList = [];
dialogVisible = false;
titleVisible = '绑定提示';
bindStatus = null;
init(data): void {
this.bindStatus = data.bindStatus;
if (this.bindStatus === 1) {
this.titleVisible = '绑定提示';
} else {
this.titleVisible = '解绑提示';
}
this.bindList = data.bindList || [];
this.dialogVisible = true;
}
handleOk() {
this.submitted = true;
const formData = { idList: this.bindList.map(item => item.id) }
if (this.bindStatus == 1) {
DetectionController.inspectReportBind(this.axios, formData).then(response => {
message.success("操作成功");
this.$emit("emitOk");
this.dialogVisible = false;
}).finally(() => this.submitted = false);
} else if (this.bindStatus == 2) {
DetectionController.inspectReportUnbind(this.axios, formData).then(response => {
message.success("操作成功");
this.$emit("emitOk");
this.dialogVisible = false;
}).finally(() => this.submitted = false);
}
}
}
</script>
<style scoped lang="less">
.disabledTip {
width: 100%;
height: 68px;
display: flex;
margin-bottom: 20px;
margin-top: 24px;
}
.outlinedBox {
float: left;
margin-left: 16px;
margin-top: 16px;
}
.disabledTxt {
padding-top: 14px;
padding-bottom: 14px;
padding-right: 16px;
padding-left: 8px;
}
</style>
\ No newline at end of file \ No newline at end of file
package com.glsx.usedcar.controller; package com.glsx.usedcar.controller;
import com.glsx.usedcar.annotation.RequireLogin; import com.glsx.usedcar.annotation.RequireLogin;
import com.glsx.usedcar.consts.inspect.JpaQueryConstants;
import com.glsx.usedcar.context.InspectorContext; import com.glsx.usedcar.context.InspectorContext;
import com.glsx.usedcar.module.inspect.entity.InspectionReport; import com.glsx.usedcar.module.inspect.entity.InspectionReport;
import com.glsx.usedcar.module.inspect.service.InspectionReportService; import com.glsx.usedcar.module.inspect.service.InspectionReportService;
...@@ -14,6 +15,7 @@ import lombok.RequiredArgsConstructor; ...@@ -14,6 +15,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.summerframework.orm.paging.Operator;
import org.summerframework.orm.paging.Pagination; import org.summerframework.orm.paging.Pagination;
@Slf4j @Slf4j
...@@ -45,7 +47,7 @@ public class InspectionReportController { ...@@ -45,7 +47,7 @@ public class InspectionReportController {
try { try {
// 2. 构建分页对象(offset = (页码-1)*每页条数) // 2. 构建分页对象(offset = (页码-1)*每页条数)
Pagination<InspectionReport> pagination = new Pagination<>((page - 1) * size, size); Pagination<InspectionReport> pagination = new Pagination<>((page - 1) * size, size);
pagination.addFilter(JpaQueryConstants.InspectionReport.INSPECTOR_ID, InspectorContext.getInspectorId(), Operator.eq);
// 3. 调用Service查询(若有关键词过滤,可在此添加pagination.addFilter逻辑) // 3. 调用Service查询(若有关键词过滤,可在此添加pagination.addFilter逻辑)
Page<InspectionReportRespVO> result = inspectionReportService.pageList(pagination); Page<InspectionReportRespVO> result = inspectionReportService.pageList(pagination);
return BaseResp.success(result); return BaseResp.success(result);
......
...@@ -48,7 +48,8 @@ public class InspectionWorkOrderController { ...@@ -48,7 +48,8 @@ public class InspectionWorkOrderController {
int page = req.getPage() == null || req.getPage() < 1 ? 1 : req.getPage(); int page = req.getPage() == null || req.getPage() < 1 ? 1 : req.getPage();
int size = req.getSize() == null || req.getSize() < 1 ? 20 : req.getSize(); int size = req.getSize() == null || req.getSize() < 1 ? 20 : req.getSize();
Pagination<InspectionWorkOrder> pagination = new Pagination<>((page - 1) * size, size); Pagination<InspectionWorkOrder> pagination = new Pagination<>((page - 1) * size, size);
pagination.addFilter("status", req.getStatus(), Operator.eq); pagination.addFilter(JpaQueryConstants.InspectionWorkOrder.STATUS, req.getStatus(), Operator.eq);
pagination.addFilter(JpaQueryConstants.InspectionWorkOrder.INSPECTOR_ID, InspectorContext.getInspectorId(), Operator.eq);
if (StringUtils.isNotBlank(req.getKeyword())) { if (StringUtils.isNotBlank(req.getKeyword())) {
pagination.addFilter(JpaQueryConstants.InspectionWorkOrder.KEYWORD, req.getKeyword(), Operator.eq); pagination.addFilter(JpaQueryConstants.InspectionWorkOrder.KEYWORD, req.getKeyword(), Operator.eq);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!