Commit e05eb669 by yancanhua

Merge branch 'v1.3.0' of https://gitee.com/foutouren/aus into v1.3.0

2 parents 28ace58b 84c92f21
...@@ -163,10 +163,10 @@ public class InspectionWorkOrderExportBean implements Serializable { ...@@ -163,10 +163,10 @@ public class InspectionWorkOrderExportBean implements Serializable {
// 审核状态转换 // 审核状态转换
this.auditStatus = switch (vo.getAuditStatus()) { this.auditStatus = switch (vo.getAuditStatus()) {
case 1 -> "待审批"; case 1 -> "待审核";
case 2 -> "审批中"; case 2 -> "审批中";
case 3 -> "审批通过"; case 3 -> "已通过";
case 4 -> "审批驳回"; case 4 -> "已驳回";
default -> "未知状态"; default -> "未知状态";
}; };
......
...@@ -22,12 +22,12 @@ public enum InspectionWorkOrderAuditStatusEnum { ...@@ -22,12 +22,12 @@ public enum InspectionWorkOrderAuditStatusEnum {
/** /**
* 审批通过 * 审批通过
*/ */
PASS(3, "审批通过"), PASS(3, "已通过"),
/** /**
* 审批驳回 * 审批驳回
*/ */
REJECT(4, "审批驳回"), REJECT(4, "已驳回"),
; ;
...@@ -77,4 +77,12 @@ public enum InspectionWorkOrderAuditStatusEnum { ...@@ -77,4 +77,12 @@ public enum InspectionWorkOrderAuditStatusEnum {
public static boolean isValidCode(Integer code) { public static boolean isValidCode(Integer code) {
return Objects.nonNull(getByCode(code)); return Objects.nonNull(getByCode(code));
} }
public static String getDescByCode(Integer status) {
InspectionWorkOrderAuditStatusEnum s = getByCode(status);
if (s == null) {
return "";
}
return s.getDesc();
}
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.usedcar.module.inspect.dao; package com.glsx.usedcar.module.inspect.dao;
import com.glsx.usedcar.module.inspect.domain.InspectorWorkOrderStatsProjection; import com.glsx.usedcar.module.inspect.domain.InspectorWorkOrderStatsProjection;
import com.glsx.usedcar.module.inspect.domain.WoAddressProjection;
import com.glsx.usedcar.module.inspect.entity.InspectionWorkOrder; import com.glsx.usedcar.module.inspect.entity.InspectionWorkOrder;
import com.glsx.usedcar.module.inspect.entity.Inspector; import com.glsx.usedcar.module.inspect.entity.Inspector;
import com.glsx.usedcar.module.vehicle.entity.Vehicle; import com.glsx.usedcar.module.vehicle.entity.Vehicle;
...@@ -13,8 +15,7 @@ import org.springframework.stereotype.Repository; ...@@ -13,8 +15,7 @@ import org.springframework.stereotype.Repository;
import org.summerframework.orm.BaseRepository; import org.summerframework.orm.BaseRepository;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.*;
import java.util.Optional;
/** /**
* 检测工单数据访问层 * 检测工单数据访问层
...@@ -144,4 +145,13 @@ public interface InspectionWorkOrderRepository extends BaseRepository<Inspection ...@@ -144,4 +145,13 @@ public interface InspectionWorkOrderRepository extends BaseRepository<Inspection
@Param("statusList") List<Integer> statusList, @Param("statusList") List<Integer> statusList,
@Param("deleteFlag") String deleteFlag @Param("deleteFlag") String deleteFlag
); );
/**
* 根据工单ID列表,查询工单的检测地址
* @param woIdSet 工单ID列表
* @return 工单ID和检测地址的映射
*/
@Query("SELECT w.woId AS woId, w.inspectionAddress AS inspectionAddress FROM InspectionWorkOrder w WHERE w.woId IN :woIdSet")
List<WoAddressProjection> findInspectionAddressByWoIdList(Set<String> woIdSet);
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.usedcar.module.inspect.domain;
public interface WoAddressProjection {
String getWoId();
String getInspectionAddress();
}
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,7 @@ import com.glsx.usedcar.enums.common.DeleteFlag; ...@@ -12,6 +12,7 @@ import com.glsx.usedcar.enums.common.DeleteFlag;
import com.glsx.usedcar.enums.inspect.InspectionReportBindStatus; 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.domain.WoAddressProjection;
import com.glsx.usedcar.module.inspect.dto.AccidentBurnWadeDTO; import com.glsx.usedcar.module.inspect.dto.AccidentBurnWadeDTO;
import com.glsx.usedcar.module.inspect.entity.*; import com.glsx.usedcar.module.inspect.entity.*;
import com.glsx.usedcar.module.inspect.vo.*; import com.glsx.usedcar.module.inspect.vo.*;
...@@ -38,6 +39,7 @@ import java.time.LocalDateTime; ...@@ -38,6 +39,7 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/** /**
* 检测报告服务(含操作日志保存) * 检测报告服务(含操作日志保存)
...@@ -49,6 +51,7 @@ import java.util.concurrent.TimeUnit; ...@@ -49,6 +51,7 @@ import java.util.concurrent.TimeUnit;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true) @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class InspectionReportService { public class InspectionReportService {
private final InspectionReportRepository inspectionReportRepository; private final InspectionReportRepository inspectionReportRepository;
private final InspectionWorkOrderRepository inspectionWorkOrderRepository;
private final InspectionReportOpLogRepository inspectionReportOpLogRepository; private final InspectionReportOpLogRepository inspectionReportOpLogRepository;
private final ObjectMapper objectMapper = new ObjectMapper(); private final ObjectMapper objectMapper = new ObjectMapper();
private final RedisCacheUtil redisCacheUtil; private final RedisCacheUtil redisCacheUtil;
...@@ -124,7 +127,8 @@ public class InspectionReportService { ...@@ -124,7 +127,8 @@ public class InspectionReportService {
log.info("【报告日志】保存成功: 报告编号={}, 操作人={}, 操作类型={}, 平台标识={}", log.info("【报告日志】保存成功: 报告编号={}, 操作人={}, 操作类型={}, 平台标识={}",
report.getReportNo(), operatorName, operationType, platType); report.getReportNo(), operatorName, operationType, platType);
} catch (Exception e) { } catch (Exception e) {
log.error("【报告日志】保存失败: 报告编号={}, 操作人={}", report.getReportNo(), operatorName, e); String reportNo = report == null ? "" : report.getReportNo();
log.error("【报告日志】保存失败: 报告编号={}, 操作人={}", reportNo, operatorName, e);
} }
} }
...@@ -462,6 +466,7 @@ public class InspectionReportService { ...@@ -462,6 +466,7 @@ public class InspectionReportService {
pagination.removeFilter(JpaQueryConstants.InspectionReport.CARTYPE); pagination.removeFilter(JpaQueryConstants.InspectionReport.CARTYPE);
String likePattern = SymbolConsts.PERCENT + ct + SymbolConsts.PERCENT; String likePattern = SymbolConsts.PERCENT + ct + SymbolConsts.PERCENT;
pagination.addCondition((root, query, builder) -> builder.or( pagination.addCondition((root, query, builder) -> builder.or(
builder.like(root.get(InspectionReport_.reportNo), likePattern),
builder.like(root.get(InspectionReport_.vehicle).get(Vehicle_.baseInfo).get(BaseInfo_.licensePlate), likePattern), builder.like(root.get(InspectionReport_.vehicle).get(Vehicle_.baseInfo).get(BaseInfo_.licensePlate), likePattern),
builder.like(root.get(InspectionReport_.vehicle).get(Vehicle_.baseInfo).get(BaseInfo_.vin), likePattern), builder.like(root.get(InspectionReport_.vehicle).get(Vehicle_.baseInfo).get(BaseInfo_.vin), likePattern),
builder.like(root.get(InspectionReport_.vehicle).get(Vehicle_.baseInfo).get(BaseInfo_.carTypeName), likePattern), builder.like(root.get(InspectionReport_.vehicle).get(Vehicle_.baseInfo).get(BaseInfo_.carTypeName), likePattern),
...@@ -484,7 +489,23 @@ public class InspectionReportService { ...@@ -484,7 +489,23 @@ public class InspectionReportService {
Page<InspectionReport> resultPage = inspectionReportRepository.findAll(pagination, pagination.getPageRequest()); Page<InspectionReport> resultPage = inspectionReportRepository.findAll(pagination, pagination.getPageRequest());
// 4. 转换为VO分页对象 // 4. 转换为VO分页对象
return resultPage.map(inspectionReportConverter::inspectionReportMapRespVO); Page<InspectionReportRespVO> map = resultPage.map(inspectionReportConverter::inspectionReportMapRespVO);
// 5. 填充检测地址
List<InspectionReportRespVO> content = map.getContent();
if (!content.isEmpty()) {
Set<String> woIdSet = content.stream().map(InspectionReportRespVO::getWoId).collect(Collectors.toSet());
List<WoAddressProjection> inspectionAddressByWoIdList = inspectionWorkOrderRepository.findInspectionAddressByWoIdList(woIdSet);
Map<String, String> resultMap = inspectionAddressByWoIdList.stream()
.collect(Collectors.toMap(
WoAddressProjection::getWoId, // Key:工单ID
WoAddressProjection::getInspectionAddress // Value:检测地址
));
for (InspectionReportRespVO inspectionReportRespVO : content) {
inspectionReportRespVO.setInspectionAddress(resultMap.get(inspectionReportRespVO.getWoId()));
}
}
return map;
} }
......
...@@ -147,7 +147,7 @@ public class InspectionWorkOrderService { ...@@ -147,7 +147,7 @@ public class InspectionWorkOrderService {
log.info("发送工单新增短信: 手机号={}, 内容={}", wo.getInspector().getPhone(), message); log.info("发送工单新增短信: 手机号={}, 内容={}", wo.getInspector().getPhone(), message);
gscApiInvoker.sendMsg(wo.getInspector().getPhone(), message); gscApiInvoker.sendMsg(wo.getInspector().getPhone(), message);
String operationContent = String.format("新增检测工单,车辆ID:%s,检测师:%s,检测地址:%s", vehicleId, inspector.getName(), addVO.getInspectionAddress()); String operationContent = "新增检测工单";
saveWorkOrderOpLog(wo, InspectionWorkOrderOperationTypeEnum.CREATE_ORDER.getCode(), 0, wo.getStatus(), operationContent, operationContent, Long.valueOf(opId), opName, platTypeEnum.getCode()); saveWorkOrderOpLog(wo, InspectionWorkOrderOperationTypeEnum.CREATE_ORDER.getCode(), 0, wo.getStatus(), operationContent, operationContent, Long.valueOf(opId), opName, platTypeEnum.getCode());
log.info("检测工单新增成功: ID={}, 唯一ID={}, 操作人={}, 平台={}", wo.getId(), wo.getWoId(), opName, platTypeEnum.getDesc()); log.info("检测工单新增成功: ID={}, 唯一ID={}, 操作人={}, 平台={}", wo.getId(), wo.getWoId(), opName, platTypeEnum.getDesc());
...@@ -164,13 +164,19 @@ public class InspectionWorkOrderService { ...@@ -164,13 +164,19 @@ public class InspectionWorkOrderService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateInspectionWorkOrder(InspectionWorkOrderUpdateVO updateVO, Integer opId, String opName, InspectionPlatTypeEnum platTypeEnum) { public void updateInspectionWorkOrder(InspectionWorkOrderUpdateVO updateVO, Integer opId, String opName, InspectionPlatTypeEnum platTypeEnum) {
if (opId == null || StrUtil.isBlank(opName) || platTypeEnum == null) { if (opId == null || StrUtil.isBlank(opName) || platTypeEnum == null) {
throw new BusinessCodeException(ErrorCodeEnum.PARAM_ERROR, "操作人信息/平台标识不能为空"); throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "操作人信息/平台标识不能为空");
} }
if (updateVO == null || updateVO.getId() == null) { if (updateVO == null || updateVO.getId() == null) {
throw new BusinessCodeException(ErrorCodeEnum.PARAM_ERROR, "工单ID不能为空"); throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "工单ID不能为空");
} }
InspectionWorkOrder workOrder = inspectionWorkOrderRepository.findById(updateVO.getId()).orElseThrow(() -> new BusinessCodeException(ErrorCodeEnum.DATA_NOT_EXIST, "检测工单不存在,工单ID:" + updateVO.getId())); InspectionWorkOrder workOrder = inspectionWorkOrderRepository.findById(updateVO.getId()).orElseThrow(() -> new BusinessCodeException(ErrorCodeEnum.DATA_NOT_EXIST, "检测工单不存在,工单ID:" + updateVO.getId()));
// 校验工单状态 为待检测才可以更新
Integer dispatchedCode = InspectionWorkOrderStatusEnum.DISPATCHED.getCode();
if (!Objects.equals(workOrder.getStatus(), dispatchedCode)) {
throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "当前工单不能修改");
}
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;
String originalInspectorName = workOrder.getInspector() != null ? workOrder.getInspector().getName() : null; String originalInspectorName = workOrder.getInspector() != null ? workOrder.getInspector().getName() : null;
...@@ -183,6 +189,9 @@ public class InspectionWorkOrderService { ...@@ -183,6 +189,9 @@ public class InspectionWorkOrderService {
boolean needSendMsg = false; boolean needSendMsg = false;
if (updateVO.getInspectorId() != null) { if (updateVO.getInspectorId() != null) {
Inspector inspector = inspectorRepository.findByIdAndDeleteFlag(updateVO.getInspectorId(), DeleteFlag.NOT_DELETED.getCode()).orElseThrow(() -> new BusinessCodeException(ErrorCodeEnum.PARAM_ERROR, "检测师不存在,检测师ID:" + updateVO.getInspectorId())); Inspector inspector = inspectorRepository.findByIdAndDeleteFlag(updateVO.getInspectorId(), DeleteFlag.NOT_DELETED.getCode()).orElseThrow(() -> new BusinessCodeException(ErrorCodeEnum.PARAM_ERROR, "检测师不存在,检测师ID:" + updateVO.getInspectorId()));
if (inspector == null || inspector.getStatus() == 0) {
throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "当前检测师不能派单");
}
if (!updateVO.getInspectorId().equals(originalInspectorId)) { if (!updateVO.getInspectorId().equals(originalInspectorId)) {
workOrder.setInspector(inspector); workOrder.setInspector(inspector);
modifyContent.append(String.format("检测师:%s改为:%s;", originalInspectorName, inspector.getName())); modifyContent.append(String.format("检测师:%s改为:%s;", originalInspectorName, inspector.getName()));
...@@ -225,10 +234,10 @@ public class InspectionWorkOrderService { ...@@ -225,10 +234,10 @@ public class InspectionWorkOrderService {
gscApiInvoker.sendMsg(workOrder.getInspector().getPhone(), message); gscApiInvoker.sendMsg(workOrder.getInspector().getPhone(), message);
} }
String operationContent = StrUtil.removeSuffix(modifyContent.toString(), ";"); String operationContent = "编辑检测工单信息";
String description = "编辑检测工单信息 " + modifyContent; String description = "编辑检测工单信息 " + modifyContent;
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(modifyContent) ? "无具体修改内容" : operationContent, description, Long.valueOf(opId), opName, platTypeEnum.getCode());
log.info("检测工单修改成功: ID={}, 唯一ID={}, 修改内容={}", workOrder.getId(), workOrder.getWoId(), operationContent); log.info("检测工单修改成功: ID={}, 唯一ID={}, 修改内容={}", workOrder.getId(), workOrder.getWoId(), description);
} }
/** /**
...@@ -414,7 +423,7 @@ public class InspectionWorkOrderService { ...@@ -414,7 +423,7 @@ public class InspectionWorkOrderService {
String message = messageSource.getMessage("SMS.INSPECTION.WO.CANCEL", args, Locale.CHINESE); String message = messageSource.getMessage("SMS.INSPECTION.WO.CANCEL", args, Locale.CHINESE);
log.info("发送取消短信: 手机号={}, 内容={}", wo.getInspector().getPhone(), message); log.info("发送取消短信: 手机号={}, 内容={}", wo.getInspector().getPhone(), message);
gscApiInvoker.sendMsg(wo.getInspector().getPhone(), message); gscApiInvoker.sendMsg(wo.getInspector().getPhone(), message);
String operationContent = String.format("取消检测工单,取消原因:%s,原状态:%s", vo.getCancelReason(), originalStatus); String operationContent = "取消检测工单";
String description = "取消检测工单,状态从" + InspectionWorkOrderStatusEnum.getDescByStatus(originalStatus) + "改为" + InspectionWorkOrderStatusEnum.CANCELED.getDesc() + ", 取消类型:" + vo.getCancelType() + ", 取消原因:" + vo.getCancelReason(); String description = "取消检测工单,状态从" + InspectionWorkOrderStatusEnum.getDescByStatus(originalStatus) + "改为" + InspectionWorkOrderStatusEnum.CANCELED.getDesc() + ", 取消类型:" + vo.getCancelType() + ", 取消原因:" + vo.getCancelReason();
saveWorkOrderOpLog(wo, InspectionWorkOrderOperationTypeEnum.CANCEL_ORDER.getCode(), originalStatus, InspectionWorkOrderStatusEnum.CANCELED.getCode(), operationContent, description, Long.valueOf(opId), opName, platTypeEnum.getCode()); saveWorkOrderOpLog(wo, InspectionWorkOrderOperationTypeEnum.CANCEL_ORDER.getCode(), originalStatus, InspectionWorkOrderStatusEnum.CANCELED.getCode(), operationContent, description, Long.valueOf(opId), opName, platTypeEnum.getCode());
...@@ -453,7 +462,8 @@ public class InspectionWorkOrderService { ...@@ -453,7 +462,8 @@ public class InspectionWorkOrderService {
return result; return result;
} else { } else {
Long reportId = reqVO.getReportId(); Long reportId = reqVO.getReportId();
InspectionReport report = inspectionReportRepository.findByIdAndDeleteFlag(reportId, DeleteFlag.NOT_DELETED.getCode()).orElse(null); InspectionReport report = inspectionReportRepository.findByIdAndDeleteFlag(reportId, DeleteFlag.NOT_DELETED.getCode())
.orElseThrow(() -> new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "检测报告不存在,报告ID:" + reportId));
InspectionWorkOrder wo = report.getWorkOrder(); InspectionWorkOrder wo = report.getWorkOrder();
List<InspectionReportOpLog> logList = inspectionReportOpLogRepository.findByReportInnerIdAndDeleteFlag(reportId, DeleteFlag.NOT_DELETED.getCode()); List<InspectionReportOpLog> logList = inspectionReportOpLogRepository.findByReportInnerIdAndDeleteFlag(reportId, DeleteFlag.NOT_DELETED.getCode());
List<InspectionNodeSummaryDTO> nodeVOList = inspectionNodeService.summaryLeafNodes(wo.getId()); List<InspectionNodeSummaryDTO> nodeVOList = inspectionNodeService.summaryLeafNodes(wo.getId());
...@@ -481,13 +491,13 @@ public class InspectionWorkOrderService { ...@@ -481,13 +491,13 @@ public class InspectionWorkOrderService {
public void auditInspectionWorkOrder(InspectionWorkOrderAuditVO auditVO, Integer opId, String opName, InspectionPlatTypeEnum platTypeEnum) { public void auditInspectionWorkOrder(InspectionWorkOrderAuditVO auditVO, Integer opId, String opName, InspectionPlatTypeEnum platTypeEnum) {
// 1. 基础参数校验 // 1. 基础参数校验
if (opId == null || StrUtil.isBlank(opName) || platTypeEnum == null) { if (opId == null || StrUtil.isBlank(opName) || platTypeEnum == null) {
throw new BusinessCodeException(ErrorCodeEnum.PARAM_ERROR, "操作人信息/平台标识不能为空"); throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "操作人信息/平台标识不能为空");
} }
if (auditVO == null || auditVO.getId() == null) { if (auditVO == null || auditVO.getId() == null) {
throw new BusinessCodeException(ErrorCodeEnum.PARAM_ERROR, "工单ID不能为空"); throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "工单ID不能为空");
} }
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.COMMON_ERROR, "审批结果仅支持1=同意/2=不同意");
} }
// 2. 查询工单并校验状态 // 2. 查询工单并校验状态
...@@ -497,10 +507,17 @@ public class InspectionWorkOrderService { ...@@ -497,10 +507,17 @@ public class InspectionWorkOrderService {
// 校验工单状态是否为已完成(仅已完成状态可审批) // 校验工单状态是否为已完成(仅已完成状态可审批)
Integer completedStatus = InspectionWorkOrderStatusEnum.COMPLETED.getCode(); Integer completedStatus = InspectionWorkOrderStatusEnum.COMPLETED.getCode();
if (!Objects.equals(workOrder.getStatus(), completedStatus)) { if (!Objects.equals(workOrder.getStatus(), completedStatus)) {
throw new BusinessCodeException(ErrorCodeEnum.PARAM_ERROR, throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR,
String.format("工单状态为[%s],仅已完成状态可审批,工单ID:%s", workOrder.getStatus(), auditVO.getId())); String.format("工单状态为[%s],仅已完成状态可审批,工单ID:%s", workOrder.getStatus(), auditVO.getId()));
} }
// 校验工单审批状态是否为待审批(仅待审批状态可审批)
Integer waitAuditCode = InspectionWorkOrderAuditStatusEnum.WAIT_AUDIT.getCode();
if (!Objects.equals(workOrder.getAuditStatus(), waitAuditCode)) {
throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR,
String.format("工单状态为[%s],仅待审批状态可审批,工单编号:%s", InspectionWorkOrderAuditStatusEnum.getDescByCode(workOrder.getStatus()), workOrder.getWoId()));
}
// 3. 保存审批前原始状态(用于日志) // 3. 保存审批前原始状态(用于日志)
Integer originalAuditStatus = workOrder.getAuditStatus(); Integer originalAuditStatus = workOrder.getAuditStatus();
Integer targetAuditStatus; Integer targetAuditStatus;
...@@ -530,7 +547,7 @@ public class InspectionWorkOrderService { ...@@ -530,7 +547,7 @@ public class InspectionWorkOrderService {
platTypeEnum.getCode() platTypeEnum.getCode()
); );
operationContent = String.format("同意审批工单,工单ID:%s,审批意见:%s,已生成检测报告", auditVO.getId(), auditVO.getAuditOpinion()); operationContent = "同意审批工单";
description = String.format("审批工单[%s]通过,状态从[%s]改为[%s],生成检测报告", description = String.format("审批工单[%s]通过,状态从[%s]改为[%s],生成检测报告",
workOrder.getWoId(), InspectionWorkOrderAuditStatusEnum.WAIT_AUDIT.getDesc(), InspectionWorkOrderAuditStatusEnum.PASS.getDesc()); workOrder.getWoId(), InspectionWorkOrderAuditStatusEnum.WAIT_AUDIT.getDesc(), InspectionWorkOrderAuditStatusEnum.PASS.getDesc());
auditOperationType = InspectionWorkOrderOperationTypeEnum.APPROVE_PASS; auditOperationType = InspectionWorkOrderOperationTypeEnum.APPROVE_PASS;
...@@ -550,7 +567,7 @@ public class InspectionWorkOrderService { ...@@ -550,7 +567,7 @@ public class InspectionWorkOrderService {
log.info("发送工单驳回短信: 手机号={}, 内容={}", workOrder.getInspector().getPhone(), message); log.info("发送工单驳回短信: 手机号={}, 内容={}", workOrder.getInspector().getPhone(), message);
gscApiInvoker.sendMsg(workOrder.getInspector().getPhone(), message); gscApiInvoker.sendMsg(workOrder.getInspector().getPhone(), message);
operationContent = String.format("驳回审批工单,工单ID:%s,审批意见:%s", auditVO.getId(), auditVO.getAuditOpinion()); operationContent = "驳回审批工单";
description = String.format("审批工单[%s]驳回,审批状态从[%s]改为[%s], 工单状态从[%s]改为[%s],未生成检测报告", description = String.format("审批工单[%s]驳回,审批状态从[%s]改为[%s], 工单状态从[%s]改为[%s],未生成检测报告",
workOrder.getWoId(), workOrder.getWoId(),
InspectionWorkOrderAuditStatusEnum.WAIT_AUDIT.getDesc(), InspectionWorkOrderAuditStatusEnum.WAIT_AUDIT.getDesc(),
...@@ -619,7 +636,7 @@ public class InspectionWorkOrderService { ...@@ -619,7 +636,7 @@ public class InspectionWorkOrderService {
inspectionWorkOrderRepository.save(workOrder); inspectionWorkOrderRepository.save(workOrder);
// 5. 保存操作日志 // 5. 保存操作日志
String operationContent = String.format("开始检测,工单ID:%s,原状态:已派单,新状态:检测中", id); String operationContent = "开始检测";
String description = String.format("开始检测 操作人[%s]启动工单检测,开始时间:%s", opName, now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); String description = String.format("开始检测 操作人[%s]启动工单检测,开始时间:%s", opName, now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
saveWorkOrderOpLog(workOrder, saveWorkOrderOpLog(workOrder,
InspectionWorkOrderOperationTypeEnum.START_INSPECTION.getCode(), InspectionWorkOrderOperationTypeEnum.START_INSPECTION.getCode(),
...@@ -676,7 +693,7 @@ public class InspectionWorkOrderService { ...@@ -676,7 +693,7 @@ public class InspectionWorkOrderService {
inspectionWorkOrderRepository.save(workOrder); inspectionWorkOrderRepository.save(workOrder);
// 5. 保存操作日志 // 5. 保存操作日志
String operationContent = String.format("完成检测,工单ID:%s,原状态:检测中,新状态:已完成", id); String operationContent = "完成检测";
String description = String.format("操作人[%s]完成工单检测,结束时间:%s", opName, now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); String description = String.format("操作人[%s]完成工单检测,结束时间:%s", opName, now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
saveWorkOrderOpLog(workOrder, saveWorkOrderOpLog(workOrder,
InspectionWorkOrderOperationTypeEnum.COMPLETE_ORDER.getCode(), InspectionWorkOrderOperationTypeEnum.COMPLETE_ORDER.getCode(),
......
...@@ -43,4 +43,7 @@ public class InspectionReportRespVO { ...@@ -43,4 +43,7 @@ public class InspectionReportRespVO {
@Schema(description = "更新时间") @Schema(description = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime updateTime; private LocalDateTime updateTime;
@Schema(description = "检测地址")
private String inspectionAddress;
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!