feat: 全系统优化 — 并发控制 + 冗余清理 + 数据流修复 + 全面测试

核心修复:
- 状态机加 SELECT FOR UPDATE 行锁,消除并发竞态
- hss_md_staff 加 role 列,登录从数据库读取真实角色
- 申请重复校验排除自身,全流程 20 步闭环通过
- 派单 SQL 修复 + 支付状态机过渡 + 完成服务 plan_item_id 修复

并发控制新增:
- RedisLockService (SET NX PX + Lua 安全解锁)
- RateLimiterService (Redis 滑动窗口 + API 拦截器)
- TransactionIsolationConfig (SERIALIZABLE for 支付回调)
- MqttPublisher (异步队列 + JDK TCP 探测)
- ObjectStorageService (AWS SigV4 预签名, 纯 JDK)

冗余清理:
- 删除 6 个死代码文件 (~620 行)
- hutool-all → JDK MessageDigest, 去 MapStruct, 去 jsr310
- haversine 提取到 GeoUtil, count/round 提取到 JdbcUtil
- 创建 platform layout 组件

前端修复:
- 登录页移除角色选择器, 由后端 JWT 返回
- 移除 ClientOnly 包裹, 页面正常渲染
- SPA fallback Nginx 配置修复

Docker: 运行时镜像 eclipse-temurin:17-jre-jammy (缩小 ~300MB)

文档: 新增系统实现与修复报告.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 11:48:07 +08:00
parent 7d92322b99
commit 01e1034cc1
387 changed files with 6220 additions and 12952 deletions

View File

@@ -0,0 +1,45 @@
<template>
<view class="page">
<view class="header"><view class="avatar">👤</view><text class="name">{{ userName }}</text><text class="role">服务人员</text></view>
<view class="stats">
<view class="stat"><text class="num">{{ stats.todayOrders || 0 }}</text><text class="lbl">今日工单</text></view>
<view class="stat"><text class="num">{{ stats.completedToday || 0 }}</text><text class="lbl">已完成</text></view>
<view class="stat"><text class="num red">{{ stats.exceptionCount || 0 }}</text><text class="lbl">异常</text></view>
</view>
<button @click="logout" class="btn-logout">退出登录</button>
</view>
</template>
<script>
import { apiGet } from '@/common/api.js';
export default {
data() { return { userName: '', stats: {} }; },
async onShow() {
try {
const u = uni.getStorageSync('userInfo');
this.userName = u?.userName || u?.name || '服务人员';
const res = await apiGet('/delivery/workbench');
this.stats = res.data?.data || {};
} catch(e) {}
},
methods: {
logout() {
uni.removeStorageSync('token'); uni.removeStorageSync('userInfo');
uni.reLaunch({ url: '/pages/delivery/login/login' });
}
}
};
</script>
<style>
.page { padding: 24rpx; background: #F8F8F8; min-height: 100vh; }
.header { text-align: center; padding: 48rpx 0; }
.avatar { font-size: 80rpx; margin-bottom: 16rpx; }
.name { font-size: 36rpx; font-weight: 700; display: block; }
.role { font-size: 26rpx; color: #999; }
.stats { display: flex; gap: 16rpx; margin-bottom: 32rpx; }
.stat { flex: 1; background: #fff; border-radius: 16rpx; padding: 32rpx; text-align: center; }
.num { font-size: 48rpx; font-weight: 800; display: block; color: #155EEF; } .num.red { color: #FF4D4F; }
.lbl { font-size: 24rpx; color: #999; margin-top: 4rpx; }
.btn-logout { background: #fff; color: #FF4D4F; border: 1px solid #FF4D4F; border-radius: 12rpx; padding: 24rpx; font-size: 30rpx; }
</style>