Commit Graph

312 Commits

Author SHA1 Message Date
irving
e6ad24e015 chore(docker): 调整 docker-compose 配置,优化本地依赖服务 2025-11-01 23:55:13 -04:00
irving
4f4b2f9027 docs: 更新 README,补充使用说明 2025-11-01 23:55:07 -04:00
irving
c7684e3199 Merge branch 'api-test-1'
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
API test first run
2025-11-01 15:18:03 -04:00
irving
04b9960e35 API-test-in-progress 2025-11-01 15:16:45 -04:00
irving
b1fd515fb3 feat(order): 新增管理端完成订单能力(店员端触发)
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
- OrderConstant 新增角色 GROUP_LEADER、触发源 WX_CLERK_MGMT;补充映射
- IPlayOrderInfoService 新增 completeOrderByManagement 方法
- PlayOrderInfoServiceImpl:校验权限(仅运营/组长,组长仅限本组);ACCEPTED 自动切换为 IN_PROGRESS 后完成;抽取 completeOrderInternal;完善 GROUP_LEADER 的 Actor/Source 映射
- WxClerkController 新增 POST /wx/clerk/order/complete 接口,支持备注参数
- 新增请求体 PlayOrderCompleteVo
- 新增单测 PlayOrderInfoServiceImplTest 覆盖核心流程与边界
2025-11-01 15:07:59 -04:00
irving
16ea9b9d48 fix(order): guard nulls and compare enums safely in clerk order details; add privacy masking for RANDOM pending; apply spotless (2025-11-01) 2025-11-01 14:05:30 -04:00
irving
427ad4b08a allow admin to by pass clerk list filtering
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
2025-11-01 13:28:19 -04:00
irving
f3480b6ba0 feat(apitest): 新增 API 测试环境与安全配置
- 新增 apitest 专用 MySQL 配置与 Docker 编排(docker/apitest-mysql.yml、docker/apitest-mysql/)

- 增加 ApiTestSecurityConfig / ApiTestSecurityProperties 与 ApiTestAuthenticationFilter

- 新增 application-apitest.yml 与相关测试目录(play-admin/src/test/java/com/starry/admin/api/)

- 调整根 pom 与 play-admin/pom 依赖,优化 SpringSecurityConfig 以兼容 apitest
2025-11-01 10:33:54 -04:00
irving
fb2bd510b1 fix 管理员看不到订单
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-31 23:59:52 -04:00
irving
b6f89045ab Merge branch 'fired-clerk-fix'
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
修复离职店员可以接单问题
2025-10-31 22:53:00 -04:00
irving
754af2f540 fix: 修复离职店员登录与权限校验,优化订单与微信流程,新增店员状态与角色枚举
ClerkUserLoginAspect: 修复登录拦截,禁止离职/禁用店员继续访问

IPlayClerkUserInfoService/Impl: 调整权限校验与查询逻辑

PlayOrderInfoServiceImpl: 订单创建/生命周期兼容店员状态

WxOauthController/WxCustomController/WxOauthService/WxCustomMpService: 完善 OAuth 与消息处理流程

新增枚举: ClerkRoleStatus、ListingStatus、OnboardingStatus
2025-10-31 22:49:09 -04:00
irving
8f89955405 fix: fix performance salary calculation
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-31 21:31:56 -04:00
irving
e7ccadaea0 refactor: 盲盒功能代码优化和完善
修复和改进:
- 修复字段映射:blind_box_gift_id -> blind_box_id
- 移除不必要的 @Version 乐观锁字段
- 优化 Mapper 方法:统一使用 listActiveEntries,简化查询逻辑
- 新增客户端接口:盲盒购买、奖励查询和兑现
- 增强权限校验:奖励兑现时验证客户身份
- 完善单元测试:增加客户身份验证测试用例
- 代码格式化:调整 import 顺序,优化代码结构

客户端 API:
- GET /wx/blind-box/config/list - 查询可用盲盒列表
- POST /wx/blind-box/order/purchase - 购买盲盒
- GET /wx/blind-box/reward/list - 查询我的盲盒奖励
- POST /wx/blind-box/reward/{id}/dispatch - 兑现盲盒奖励

其他优化:
- 增强 SQL 查询安全性,添加 deleted 字段过滤
- 优化店员提成计算逻辑
- 改进参数可选性(levelId 参数改为可选)
2025-10-31 02:48:03 -04:00
irving
422e781c60 feat: 实现盲盒功能模块
新增功能:
- 盲盒配置管理:支持盲盒的创建、编辑、上下架
- 盲盒奖池管理:支持奖池配置、Excel导入、权重抽奖、库存管理
- 盲盒购买流程:客户购买盲盒并抽取奖励
- 奖励兑现流程:客户可将盲盒奖励兑现为实际礼物订单
- 店员提成:奖励兑现时自动增加店员礼物提成

核心实现:
- BlindBoxService: 抽奖核心逻辑,支持权重算法和库存扣减
- BlindBoxDispatchService: 奖励兑现订单创建
- BlindBoxInventoryService: 奖池库存管理
- BlindBoxPoolAdminService: 奖池配置管理,支持批量导入

API接口:
- /play/blind-box/config: 盲盒配置CRUD
- /play/blind-box/pool: 奖池配置管理和导入
- /wx/blind-box: 客户端盲盒购买和奖励查询

数据库变更:
- blind_box_config: 盲盒配置表
- blind_box_pool: 盲盒奖池表
- blind_box_reward: 盲盒奖励记录表
- play_order_info: 新增 payment_source 和 source_reward_id 字段

其他改进:
- 订单模块支持盲盒支付来源,区分余额扣款和奖励抵扣
- 优惠券校验:盲盒相关订单不支持使用优惠券
- 完善单元测试覆盖
2025-10-31 02:46:51 -04:00
irving
c9439e1021 test: 补充优惠券库存相关单测
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-31 00:10:40 -04:00
irving
db6132d7e3 feat: 优化优惠券发放与库存校验流程 2025-10-31 00:10:24 -04:00
irving
48bdc9af33 重构收益与优惠券逻辑:统一使用 orderAmount,新增优惠券状态校验与过滤
- IPlayOrderInfoService/PlayOrderInfoServiceImpl/ClerkRevenueCalculator 将参数 finalAmount 更名为 orderAmount,避免语义混淆
- 预计收益计算兼容 null 与 0,防止 NPE 并明确边界
- 结算/回填:EarningsServiceImpl、EarningsBackfillServiceImpl 改为使用 orderMoney 兜底;0 金额允许,负数跳过
- 新增枚举:CouponOnlineState、CouponValidityPeriodType 用于券上下架与有效期判定
- IPlayCouponInfoService/Impl 增加 getCouponDetailRestrictionReason,支持已使用/过期/下架等状态校验
- WxCouponController 列表与下单查询增加状态/有效期/库存/白名单过滤逻辑
- OrderLifecycleServiceImpl 下单时校验优惠券状态,预计收益入参从 finalAmount 调整为 orderMoney
- 完善单元测试:订单生命周期、优惠券过滤、收益生成与回填等覆盖
2025-10-30 22:07:37 -04:00
irving
e29c5db276 重构订单下单逻辑,引入策略模式和命令模式
- 为OrderTriggerSource枚举添加详细注释说明
- 将IOrderLifecycleService接口的initiateOrder方法重构为placeOrder
- 新增OrderPlacementCommand、OrderPlacementResult、OrderAmountBreakdown等DTO
- 实现订单下单策略模式,支持不同类型订单的差异化处理
- 优化金额计算逻辑,完善优惠券折扣计算
- 改进余额扣减逻辑,增强异常处理
- 更新相关控制器使用新的下单接口
- 完善单元测试覆盖,确保代码质量
2025-10-30 21:12:37 -04:00
irving
67692ff79f clean up
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
2025-10-28 23:39:50 -04:00
irving
7db9318a7b feat: 完善订单生命周期幂等与日志追踪 2025-10-28 23:24:33 -04:00
irving
6dba6464f9 refactor(clerk-performance):make better performance analysis
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-27 23:35:17 -04:00
irving
1ec92cc2ab WIP 2025-10-27 22:53:40 -04:00
irving
8a9e7dc86f format
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
2025-10-27 22:25:44 -04:00
irving
4af3f3d161 improve logging, now correctly logs the status in result 2025-10-27 22:23:29 -04:00
irving
110e0d8e8c add more logging for 接单
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-27 21:56:42 -04:00
irving
e677ca3d33 fix: prevent duplicated clerk get's the same order 2025-10-27 21:51:28 -04:00
irving
8691a56f8a adjust logging, avoid add too much raw sql logging 2025-10-27 21:51:28 -04:00
irving
15e15bc01a add logging for duplicated notifcation 2025-10-27 21:51:28 -04:00
huchuansai
80de65731f fix: 店员筛选for移动端 2025-10-27 18:12:54 +08:00
irving
6b2a1c2ba7 fix: correct order lifecycle refunds and add coverage
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
2025-10-27 00:12:07 -04:00
irving
f7461abc83 add notification
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-26 15:08:37 -04:00
irving
38bc83d0f7 fix: 调整充值限额并规范日志目录 2025-10-26 14:55:13 -04:00
irving
5a116eedf6 fix: allow clerk apply without sms verification
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
2025-10-26 12:21:25 -04:00
irving
0356834b88 feat(gift): 修复赠礼事务并补充租户隔离
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-26 01:30:02 -04:00
irving
15aea7d779 feat: 审核通过时支持指定店员分组
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
2025-10-25 22:45:31 -04:00
irving
03e9ceee5b 重构:订单接单逻辑使用常量枚举替代魔法字符串,微信通知改为异步发送
Some checks failed
Build and Push Backend / docker (push) Failing after 8s
- 新增 OrderConstant.OperatorType 枚举(顾客/店员/管理员)
- 新增 EXCLUDE_HISTORY 常量(排除历史订单标识)
- updateStateTo1 方法使用枚举常量替代硬编码字符串
- 微信通知改为异步发送,防止 API 失败阻塞订单处理
- 新增 sendOrderMessageAsync/sendOrderFinishMessageAsync/sendOrderCancelMessageAsync 方法
- 订单接单、完成、取消通知均使用异步方式,提高系统稳定性
2025-10-25 15:33:35 -04:00
irving
8ece45da28 新增订单强制取消功能
- 新增管理后台强制取消进行中订单接口
- 实现已接单/服务中订单强制取消业务逻辑
- 支持自定义退款金额,默认退回全额支付金额
- 新增订单强制取消请求VO类及参数校验
- 新增单元测试验证强制取消功能的正确性
- 更新服务接口定义及文档注释
2025-10-25 12:15:26 -04:00
huchuansai
5b18f72ae8 fix: 随机单通知只发送给实åå在线用户 2025-10-22 17:32:26 +08:00
irving
7771b30366 修复:微信端评价列表自动过滤隐藏评价
Some checks failed
Build and Push Backend / docker (push) Failing after 8s
- 在微信店员评价查询接口中强制设置hidden=0
- 确保顾客端只能看到管理员未隐藏的评价
- 优化日志配置,减少SQL日志输出
2025-10-21 22:41:32 -04:00
irving
ef88ec7134 feat: 店员昵称及性别修改纳入资料审核 2025-10-20 23:10:44 -04:00
irving
75913e007b small fix
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-19 17:46:14 -04:00
irving
82b86ae86e feat: 引入店员资料审核状态枚举
Some checks failed
Build and Push Backend / docker (push) Failing after 8s
2025-10-19 17:37:51 -04:00
irving
3e079850e6 fix: 店员申请查询支持精准筛选 2025-10-19 16:25:17 -04:00
irving
62001fbd5f clean and fmt 2025-10-18 21:36:09 -04:00
irving
6153e6e4f1 fix: 创建提现时不再校验收款码确认时效
Some checks failed
Build and Push Backend / docker (push) Failing after 4s
2025-10-18 21:05:22 -04:00
irving
d681635394 adjust logic, avoide race condition 2025-10-18 21:05:22 -04:00
irving
b9779e7436 feat: 店员收益明细支持条件筛选并返回订单信息 2025-10-18 21:05:22 -04:00
huchuansai
07a86fbe66 fix: 用æ店员头像bug 2025-10-16 16:56:44 +08:00
irving
0725c94bbe 修复:防止提现创建中的竞态条件和重复收益
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
- 在 earnings_line 表添加唯一约束 (tenant_id, order_id, clerk_id, earning_type, deleted)
- 重排提现创建流程:先预留收益行,成功后才创建提现请求
- 在收益行预留时添加状态验证,检测并发修改
- 使用临时提现ID进行预留,创建请求后替换为真实ID
- 添加唯一约束前先清理重复的收益记录(V10 迁移)

此修复解决了关键的竞态条件问题:并发提现可能创建没有资金支持的孤儿请求记录。
修复后确保快速失败行为 - 如果收益行已被占用,提现请求永远不会被创建。
2025-10-13 22:45:53 -04:00
irving
5438a8e1f0 功能:新增收款码档案和收益补算功能
- 新增店员收款码档案管理(上传二维码和确认收款码)
- 提现请求新增收款码快照用于审计追踪
- 新增收益补算服务用于历史订单数据补录
- 新增收益补算日志表用于审计追踪
- 优化收益创建逻辑,根据解冻时间设置正确的初始状态
- 更新提现流程,要求店员确认收款码后才能提现
- 新增数据库迁移脚本 V7-V9
2025-10-13 22:13:51 -04:00