Commit f585a61c by 章家宝

feat:工单检测审批,开始检测工单,结束检测工单代码提交

1 parent 9be30d29
......@@ -121,4 +121,30 @@ public class InspectionWorkOrderController {
return BaseResp.fail("系统异常: " + e.getMessage());
}
}
@Operation(summary = "审批检测工单", description = "审批检测工单(仅工单状态为已完成时可审批,同意则生成检测报告)")
@PostMapping("/audit")
public BaseResp<Void> audit(@Valid @RequestBody InspectionWorkOrderAuditVO auditVO, Authentication authentication) {
log.info("审批检测工单请求: {}", JSON.toJSONString(auditVO));
try {
if (authentication == null || authentication.getPrincipal() == null) {
throw new BusinessCodeException(ErrorCodeEnum.LOGIN_ERROR, "未登录,无法操作");
}
User user = (User) authentication.getPrincipal();
inspectionWorkOrderService.auditInspectionWorkOrder(
auditVO,
user.getUserId(),
user.getUserName(),
InspectionPlatTypeEnum.BACKEND
);
} catch (BusinessCodeException be) {
log.error("审批检测工单失败!业务异常!", be);
return BaseResp.fail(StrUtil.toString(be.getCode()), StrUtil.toString(be.getMessage()));
} catch (Exception e) {
log.error("审批检测工单失败!系统异常!", e);
return BaseResp.fail("系统异常: " + e.getMessage());
}
return BaseResp.success();
}
}
package com.glsx.usedcar.module.inspect.vo;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 检测工单审批VO
*/
@Data
public class InspectionWorkOrderAuditVO {
/**
* 工单主键ID
*/
@NotNull(message = "工单ID不能为空")
private Long id;
/**
* 审批结果:1=同意,2=不同意
*/
@NotNull(message = "审批结果不能为空")
private Integer auditResult;
/**
* 审批意见
*/
@NotBlank(message = "审批意见不能为空")
private String auditOpinion;
}
\ 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!