fix(security): 工单取消日志区分操作来源

根据 operatorType 区分日志描述:
- SYSTEM → "系统自动取消(原因)"
- ADMIN → "管理员手动取消(原因)"
- 其他 → "安保工单已取消(原因)"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
lzh
2026-03-26 16:14:34 +08:00
parent 4763caf2cc
commit 4dffd21751

View File

@@ -258,12 +258,23 @@ public class SecurityOrderEventListener {
private void handleCancelled(Long orderId, OrderStateChangedEvent event) {
Long operatorId = event.getOperatorId();
OperatorTypeEnum operatorType = event.getOperatorType();
String remark = event.getRemark();
String message = "安保工单已取消";
if (remark != null && !remark.isEmpty()) {
message += "" + remark + "";
// 区分取消来源
String source;
if (operatorType == OperatorTypeEnum.SYSTEM) {
source = "系统自动取消";
} else if (operatorType == OperatorTypeEnum.ADMIN) {
source = "管理员手动取消";
} else {
source = "安保工单已取消";
}
String message = remark != null && !remark.isEmpty()
? source + "" + remark + ""
: source;
recordLog(EventDomain.DISPATCH, LogType.ORDER_CANCELLED, message, orderId, operatorId);
// 取消后自动派发下一个等待工单