74 Commits
Author SHA1 Message Date
duzhichao 5236c7a035 Merge pull request 'fix:退款订单按租户查询' (#3) from feature_dzc into test
Reviewed-on: #3
2026-12-03 03:58:40 +00:00
duzhichao 815f9e311e fix:退款订单按租户查询 2026-12-03 11:54:41 +08:00
duzhichao 5836a76cfd Merge pull request 'Feature dzc' (#1) from feature_dzc into test
Reviewed-on: #1
2026-11-19 07:42:27 +00:00
duzhichao 60983728ab Merge pull request 'feat: 物联网卡管理' (#88) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/88
2026-03-27 10:32:25 +00:00
duzhichao 1ed35d1373 Merge pull request 'feature_dzc' (#86) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/86
2026-03-17 10:07:44 +00:00
duzhichao 613e4fc57e Merge pull request 'feat: 客户端pad' (#84) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/84
2026-03-11 13:30:46 +00:00
duzhichao 3b3d1ddc1e Merge pull request 'feat: 1:一键成片参数动态配置' (#82) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/82
2026-03-10 15:03:06 +00:00
duzhichao 232672a6b9 Merge pull request 'feat: 1:一键成片参数动态配置' (#80) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/80
2026-03-10 14:14:18 +00:00
duzhichao ce17f6ec90 Merge pull request 'feat: 中科低空一键成片推送2' (#78) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/78
2026-03-04 12:53:59 +00:00
duzhichao b8c25eccd7 Merge pull request 'feat: 1:中科低空一键成片推送' (#76) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/76
2026-03-04 12:42:18 +00:00
duzhichao 7b4a5b52e7 Merge pull request 'feat: 1:订单列表添加排队信息' (#74) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/74
2026-03-01 13:49:49 +00:00
duzhichao c2fabdfbe4 Merge pull request 'feat: 海南携程以及中科低空订单统计' (#72) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/72
2026-02-26 11:58:17 +00:00
duzhichao 3faedcb033 Merge pull request 'feat: 创建订单接口排除中科低空待支付与排队中的订单状态检查' (#70) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/70
2026-02-19 16:32:45 +00:00
duzhichao 56cfffbee4 Merge pull request 'feat: 视频剪辑推送中科低空' (#68) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/68
2026-02-19 10:54:47 +00:00
duzhichao 9326b0e5e9 Merge pull request 'feat: 剪辑视频添加参数2' (#66) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/66
2026-02-11 13:04:50 +00:00
duzhichao 515792a2f8 Merge pull request 'feat: 剪辑视频添加参数' (#64) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/64
2026-02-11 11:50:43 +00:00
duzhichao 0bdfeed86c Merge pull request 'feat: 携程后台退款3' (#62) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/62
2026-02-05 12:43:57 +00:00
duzhichao 78337a0cc0 Merge pull request 'feat: 携程后台退款2' (#60) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/60
2026-02-05 12:12:09 +00:00
duzhichao 31e87a98d5 Merge pull request 'feat: 携程后台退款' (#58) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/58
2026-02-05 11:36:41 +00:00
duzhichao d7e5802979 Merge pull request 'feat: 修改天气风速为m/s' (#56) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/56
2026-02-05 09:20:35 +00:00
duzhichao 0a3721f35e Merge pull request 'feat: 1:调用携程退款接口 2:新增携程订单查询页面 3:新增携程退款订单页面' (#55) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/55
2026-02-05 08:49:03 +00:00
duzhichao 527a12fd30 Merge pull request 'feat: 获取任务列表及图片根据当前登录人查询' (#54) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/54
2026-01-30 10:14:01 +00:00
duzhichao 8a4b710bce Merge pull request 'feat: 获取任务列表及图片根据当前登录人查询' (#52) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/52
2026-01-30 10:13:02 +00:00
duzhichao 8113e1a7c3 Merge pull request 'feat: 获取任务列表及图片根据当前登录人查询' (#50) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/50
2026-01-30 09:46:46 +00:00
duzhichao f135d5fc3c Merge pull request 'feat: 天气系统规则引擎2' (#48) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/48
2026-01-29 08:58:25 +00:00
duzhichao e82389d2dc Merge pull request 'feat: 天气系统规则引擎' (#46) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/46
2026-01-28 09:35:16 +00:00
duzhichao a358522d4e Merge pull request 'feat: 删除没用的项目' (#44) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/44
2026-01-26 07:22:06 +00:00
duzhichao 30510653a0 Merge pull request 'feat: 无人机产品id改为AutoDock3' (#42) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/42
2026-01-26 05:24:16 +00:00
duzhichao df9ac8a574 Merge pull request 'feat: 1:根据登录人获取任务以及图片' (#40) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/40
2026-01-22 10:49:16 +00:00
duzhichao 5119989f2e Merge pull request 'feature_dzc' (#38) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/38
2026-01-22 08:21:06 +00:00
duzhichao 39ec2e3f59 Merge pull request 'feat: 根据租户获取景区二维码内容' (#36) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/36
2026-01-15 08:46:37 +00:00
duzhichao 1a862c3e2b Merge pull request 'feat: 根据租户获取景区二维码内容' (#34) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/34
2026-01-15 08:17:03 +00:00
duzhichao e7d40a658c Merge pull request 'feat: 根据租户获取景区二维码内容' (#32) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/32
2026-01-15 08:08:31 +00:00
duzhichao caa4ec68c0 Merge pull request 'feat: 根据租户获取景区二维码内容' (#30) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/30
2026-01-15 07:35:28 +00:00
duzhichao 79d517d24c Merge pull request 'feat: 根据租户获取景区二维码内容' (#28) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/28
2026-01-15 06:34:35 +00:00
duzhichao c684905484 Merge pull request 'feat: 获取当前租户' (#26) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/26
2026-01-09 13:35:11 +00:00
duzhichao b3bd36be60 Merge pull request 'feat: 获取当前租户' (#24) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/24
2026-01-09 13:20:41 +00:00
duzhichao a83edf6a05 Merge pull request 'feature_dzc' (#22) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/22
2026-01-09 12:24:38 +00:00
duzhichao ab6aff8671 Merge pull request 'feature_dzc' (#20) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/20
2026-01-04 13:28:28 +00:00
duzhichao 1c72dba543 Merge pull request 'feature_dzc' (#17) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/17
2026-01-04 12:35:13 +00:00
duzhichao 7fc388d049 Merge pull request 'feature_dzc' (#15) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/15
2025-12-30 09:15:24 +00:00
duzhichao 0bf4d47bf6 Merge pull request 'feat: 下任务推流地址修改' (#13) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/13
2025-12-25 09:17:22 +00:00
duzhichao 54c5a33658 Merge pull request 'feat: 优化webSocket的连接问题' (#11) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/11
2025-12-24 11:05:01 +00:00
duzhichao 3fabed19f2 Merge pull request 'feat: 通过接口获取机库和无人机数据' (#9) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/9
2025-12-24 08:12:08 +00:00
duzhichao 80afc4045e Merge pull request 'feat: 航线任务与一键起飞任务' (#7) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/7
2025-12-23 11:44:24 +00:00
duzhichao b86def053c Merge pull request 'feat: 航线解析以及websocket订阅不关闭bug修复' (#5) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/5
2025-12-21 06:25:05 +00:00
duzhichao a74ad64109 Merge pull request 'feature_dzc' (#3) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/3
2025-12-17 03:48:46 +00:00
duzhichao e119517d79 Merge pull request 'feature_dzc' (#1) from feature_dzc into test
Reviewed-on: http://220.205.16.27:18081/goflytec/GoFly-platform-services/pulls/1
2025-11-28 05:19:09 +00:00
duzhichao f0d50d53a9 !71 feat: 首页查询景区返回二维码code
Merge pull request !71 from 鸭先知/feature_dzc
2025-11-12 08:05:56 +00:00
duzhichao 4f41f51def !69 feat: 1:视频剪辑模板管理
Merge pull request !69 from 鸭先知/feature_dzc
2025-11-11 04:00:45 +00:00
duzhichao 96ee918cb1 !67 feat: 优惠券打包
Merge pull request !67 from 鸭先知/feature_dzc
2025-11-07 10:30:46 +00:00
duzhichao c0746dfd0c !66 feat: 打包
Merge pull request !66 from 鸭先知/feature_dzc
2025-11-07 10:24:32 +00:00
duzhichao 4f7e4bf27f !65 feat: 优惠券
Merge pull request !65 from 鸭先知/feature_dzc
2025-11-07 09:30:33 +00:00
duzhichao 68fe9c8e41 !63 feat: 1:优化景区素材,查询景区素材从套餐中获取
Merge pull request !63 from 鸭先知/feature_dzc
2025-11-07 08:33:56 +00:00
duzhichao 7ba5689e48 !61 feat: 1:资源列表批量下载优化,可以下载为zip
Merge pull request !61 from 鸭先知/feature_dzc
2025-11-06 11:30:05 +00:00
duzhichao 586c792e1e !60 feat: 资源列表批量下载优化
Merge pull request !60 from 鸭先知/feature_dzc
2025-11-06 09:07:42 +00:00
duzhichao 3ed189ca6c !59 feat: 资源列表批量下载优化
Merge pull request !59 from 鸭先知/feature_dzc
2025-11-04 09:33:16 +00:00
duzhichao 680972f7c1 !57 feat: 航线管理页面优化
Merge pull request !57 from 鸭先知/feature_dzc
2025-11-04 06:50:03 +00:00
duzhichao caa112b0bd !55 feat: 暂时去掉定时任务,等小程序正式使用后再放开,现在还是用以前的服务定时任务
Merge pull request !55 from 鸭先知/feature_dzc
2025-10-30 09:04:56 +00:00
duzhichao 7f75f35db0 !53 feat: 优化退款审核页面
Merge pull request !53 from 鸭先知/feature_dzc
2025-10-30 08:45:05 +00:00
duzhichao 030ab15cc2 !51 feat: 优化退款审核页面
Merge pull request !51 from 鸭先知/feature_dzc
2025-10-30 07:09:57 +00:00
duzhichao 8a25b120e3 !49 feat: 退款订单与订单列表整合5
Merge pull request !49 from 鸭先知/feature_dzc
2025-10-29 10:08:15 +00:00
duzhichao 4ba0457073 !47 feat: 退款订单与订单列表整合
Merge pull request !47 from 鸭先知/feature_dzc
2025-10-29 07:01:38 +00:00
duzhichao 9998468d2a !45 feat: 二维码新增或者编辑绑定景区素材
Merge pull request !45 from 鸭先知/feature_dzc
2025-10-26 08:50:26 +00:00
duzhichao 4d8a02d45f !43 feat: 修改首页,添加景区订单列表统计
Merge pull request !43 from 鸭先知/feature_dzc
2025-10-22 07:34:07 +00:00
duzhichao 8e05e1335d !42 feat: 修改生产环境的配置文件
Merge pull request !42 from 鸭先知/feature_dzc
2025-10-20 04:39:03 +00:00
duzhichao 35a8d33053 !41 feat: 日志更新
Merge pull request !41 from 鸭先知/feature_dzc
2025-10-20 03:51:55 +00:00
duzhichao 0ce6c412ae !40 feat: 1:文件访问分oss和s3 2:去掉定时任务去同步每天的数据
Merge pull request !40 from 鸭先知/feature_dzc
2025-10-20 03:37:08 +00:00
duzhichao af5438e1bc !39 1:用户管理页面优化 2:角色管理页面优化 3:分配角色权限优化
Merge pull request !39 from 鸭先知/feature_dzc
2025-10-13 09:12:02 +00:00
duzhichao 3a27f05122 !38 1:用户管理页面优化 2:角色管理页面优化 3:分配角色权限优化
Merge pull request !38 from 鸭先知/feature_dzc
2025-10-11 04:24:22 +00:00
duzhichao 1235f019e4 !37 Merge branch 'feature_lsl' of gitee.com:L-Shilin/go-fly-platform-servi…
Merge pull request !37 from 鸭先知/feature_dzc
2025-10-10 07:52:13 +00:00
duzhichao 5cafcd3f43 !36 1:首页多租户查询优化 2:景点列表查询优化
Merge pull request !36 from 鸭先知/feature_dzc
2025-10-09 13:22:54 +00:00
duzhichao eaef798aef !35 首页统计
Merge pull request !35 from 鸭先知/feature_dzc
2025-09-30 21:12:07 +00:00
duzhichao 02175cad3f !33 feat(react-web-next): 新增.editorconfig和.prettierrc配置文件,添加public/.gitkeep占位文件
Merge pull request !33 from 鸭先知/feature_dzc
2025-09-23 07:15:44 +00:00
9 changed files with 175 additions and 15 deletions
+5
View File
@@ -80,6 +80,11 @@
<groupId>io.micrometer</groupId> <groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId> <artifactId>micrometer-registry-prometheus</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
@@ -210,8 +210,10 @@ public class AliPayController {
throw new IllegalStateException("订单不存在: " + outTradeNo); throw new IllegalStateException("订单不存在: " + outTradeNo);
} }
if (OrderStatus.PAID.getId().equals(order.getOrderStatus())) { // 与微信回调保持一致:仅待支付订单受理,避免重复通知把已执行订单拉回排队队列
log.info("订单已支付,跳过: {}", outTradeNo); if (!OrderStatus.UNPAID.getId().equals(order.getOrderStatus())) {
log.warn("订单状态非待支付,忽略本次支付成功通知: orderNo={}, status={}, tradeNo:{}",
outTradeNo, order.getOrderStatus(), tradeNo);
return; return;
} }
@@ -82,7 +82,7 @@ public class RefundController {
/** /**
* 列表 * 列表
*/ */
@Operation(summary = "查询全部列表") @Operation(summary = "按订单所属景区查询当前租户范围内的退款列表")
@Parameters({ @Parameters({
@Parameter(name = "page",description = "分页起始位置",required = true,in= ParameterIn.QUERY), @Parameter(name = "page",description = "分页起始位置",required = true,in= ParameterIn.QUERY),
@Parameter(name = "limit",description = "分页结束位置",required = true,in=ParameterIn.QUERY) @Parameter(name = "limit",description = "分页结束位置",required = true,in=ParameterIn.QUERY)
@@ -157,11 +157,20 @@ public class WxPayController {
return; return;
} }
// 微信会重复推送同一笔通知,仅待支付订单受理,避免把已执行的订单重新拉回排队队列造成重复飞行
if (!OrderStatus.UNPAID.getId().equals(order.getOrderStatus())) {
log.warn("订单状态非待支付,忽略本次支付成功通知: orderNo={}, status={}, transactionId={}",
outTradeNo, order.getOrderStatus(), transaction.getTransactionId());
return;
}
// 2. 更新订单状态 // 2. 更新订单状态
order.setOrderStatus(OrderStatus.PAID.getId()); order.setOrderStatus(OrderStatus.PAID.getId());
order.setPayType(PayTypeEnum.WECHAT_PAY.getCode()); order.setPayType(PayTypeEnum.WECHAT_PAY.getCode());
order.setPayTime(new Date()); order.setPayTime(new Date());
orderService.updateOrder(order); if (!orderService.updateOrder(order)) {
log.error("支付成功但订单状态未更新,订单可能仍停留在待支付: orderNo={}", outTradeNo);
}
// === 携程分销订单创建 === // === 携程分销订单创建 ===
if (Integer.valueOf(1).equals(qrCode.getEnableCtripOrder())) { if (Integer.valueOf(1).equals(qrCode.getEnableCtripOrder())) {
@@ -220,11 +229,20 @@ public class WxPayController {
return; return;
} }
// 微信会重复推送同一笔通知,仅待支付订单受理,避免把已执行的订单重新拉回排队队列造成重复飞行
if (!OrderStatus.UNPAID.getId().equals(order.getOrderStatus())) {
log.warn("订单状态非待支付,忽略本次支付成功通知: orderNo={}, status={}, transactionId={}",
outTradeNo, order.getOrderStatus(), transaction.getTransactionId());
return;
}
// 2. 更新订单状态 // 2. 更新订单状态
order.setOrderStatus(OrderStatus.PAID.getId()); order.setOrderStatus(OrderStatus.PAID.getId());
order.setPayType(PayTypeEnum.WECHAT_PAY.getCode()); order.setPayType(PayTypeEnum.WECHAT_PAY.getCode());
order.setPayTime(new Date()); order.setPayTime(new Date());
orderService.updateOrder(order); if (!orderService.updateOrder(order)) {
log.error("支付成功但订单状态未更新,订单可能仍停留在待支付: orderNo={}", outTradeNo);
}
// === 携程分销订单创建 === // === 携程分销订单创建 ===
if (Integer.valueOf(1).equals(qrCode.getEnableCtripOrder())) { if (Integer.valueOf(1).equals(qrCode.getEnableCtripOrder())) {
@@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Order information * Order information
@@ -17,13 +16,7 @@ import java.util.Map;
*/ */
@Mapper @Mapper
public interface RefundMapper extends SuperMapper<Refund> { public interface RefundMapper extends SuperMapper<Refund> {
/** List<Refund> findList(Page<Refund> page, @Param("tenantIds") List<String> tenantIds);
* 分页查询用户列表
* @param page
* @param params
* @return
*/
List<Refund> findList(Page<Refund> page, @Param("p") Map<String, Object> params);
/** /**
* 根据订单编码查询退款详情 * 根据订单编码查询退款详情
@@ -2,6 +2,7 @@ package com.central.order.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.central.common.context.LoginUserContextHolder;
import com.central.common.feign.UserService; import com.central.common.feign.UserService;
import com.central.common.model.PageResult; import com.central.common.model.PageResult;
import com.central.common.model.SysUser; import com.central.common.model.SysUser;
@@ -17,6 +18,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
@@ -48,8 +51,12 @@ public class RefundServiceImpl extends SuperServiceImpl<RefundMapper, Refund> im
*/ */
@Override @Override
public PageResult<Refund> findList(Map<String, Object> params){ public PageResult<Refund> findList(Map<String, Object> params){
List<String> tenantIds = resolveRefundTenantIds(MapUtils.getString(params, "tenantId"));
if (CollectionUtils.isEmpty(tenantIds)) {
return PageResult.<Refund>builder().data(List.of()).resp_code(0).count(0L).build();
}
Page<Refund> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); Page<Refund> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit"));
List<Refund> list = baseMapper.findList(page, params); List<Refund> list = baseMapper.findList(page, tenantIds);
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
for (Refund refund: list){ for (Refund refund: list){
//用户手机号 //用户手机号
@@ -74,6 +81,21 @@ public class RefundServiceImpl extends SuperServiceImpl<RefundMapper, Refund> im
return PageResult.<Refund>builder().data(list).resp_code(0).count(page.getTotal()).build(); return PageResult.<Refund>builder().data(list).resp_code(0).count(page.getTotal()).build();
} }
private List<String> resolveRefundTenantIds(String requestedTenant) {
String currentTenant = LoginUserContextHolder.getCurrentTenantId();
if (!StringUtils.hasText(currentTenant)) {
return List.of();
}
List<String> allowed = userService.getSonTenantIds(currentTenant);
if (!StringUtils.hasText(requestedTenant) || currentTenant.equals(requestedTenant)) {
return allowed;
}
if (CollectionUtils.isEmpty(allowed) || !allowed.contains(requestedTenant)) {
return List.of();
}
return userService.getSonTenantIds(requestedTenant);
}
@Override @Override
public boolean createRefund(Refund refund) { public boolean createRefund(Refund refund) {
@@ -4,7 +4,14 @@
<mapper namespace="com.central.order.mapper.RefundMapper"> <mapper namespace="com.central.order.mapper.RefundMapper">
<select id="findList" resultType="com.central.order.model.Refund"> <select id="findList" resultType="com.central.order.model.Refund">
select * from orders_refund t ORDER BY id DESC SELECT r.* FROM orders_refund r
WHERE EXISTS (
SELECT 1 FROM orders o
JOIN tourisms t ON t.id = o.tourism_id AND t.is_del = 0
WHERE o.order_no = r.order_no AND t.tenant_id IN
<foreach collection="tenantIds" item="tenantId" open="(" separator="," close=")">#{tenantId}</foreach>
)
ORDER BY r.id DESC
</select> </select>
<!-- 根据订单编码查询退款详情 --> <!-- 根据订单编码查询退款详情 -->
@@ -0,0 +1,109 @@
package com.central.order.service.impl;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.central.common.context.LoginUserContextHolder;
import com.central.common.feign.UserService;
import com.central.common.model.LoginAppUser;
import com.central.common.model.PageResult;
import com.central.order.mapper.RefundMapper;
import com.central.order.model.Refund;
import com.central.order.service.IOrderService;
import org.apache.ibatis.builder.xml.XMLMapperBuilder;
import org.apache.ibatis.datasource.unpooled.UnpooledDataSource;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.mapping.Environment;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.test.util.ReflectionTestUtils;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
class RefundListTenantTest {
private final RefundServiceImpl service = new RefundServiceImpl();
private final UserService users = mock(UserService.class);
private SqlSession session;
@BeforeEach
void setUp() throws Exception {
var dataSource = new UnpooledDataSource("org.h2.Driver", "jdbc:h2:mem:" + UUID.randomUUID() + ";MODE=MySQL", "sa", "");
var config = new MybatisConfiguration(new Environment("test", new JdbcTransactionFactory(), dataSource));
var pagination = new MybatisPlusInterceptor();
pagination.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
config.addInterceptor(pagination);
String resource = "mapper/RefundMapper.xml";
try (var xml = Resources.getResourceAsStream(resource)) {
new XMLMapperBuilder(xml, config, resource, config.getSqlFragments()).parse();
}
session = new MybatisSqlSessionFactoryBuilder().build(config).openSession();
try (var sql = session.getConnection().createStatement()) {
sql.execute("CREATE TABLE tourisms (id BIGINT PRIMARY KEY, tenant_id VARCHAR(32), is_del INT)");
sql.execute("CREATE TABLE orders (order_no VARCHAR(32) PRIMARY KEY, tourism_id BIGINT)");
sql.execute("CREATE TABLE orders_refund (id BIGINT PRIMARY KEY, order_no VARCHAR(32), tenant_id VARCHAR(32))");
sql.execute("INSERT INTO tourisms VALUES (1,'parent',0),(2,'child',0),(3,'other',0),(4,'parent',1)");
sql.execute("INSERT INTO orders VALUES ('P',1),('C',2),('O',3),('D',4)");
sql.execute("INSERT INTO orders_refund VALUES (1,'P','parent'),(2,'C','platform'),(3,'O','parent'),(4,'D','parent'),(5,'missing','parent')");
}
ReflectionTestUtils.setField(service, "baseMapper", session.getMapper(RefundMapper.class));
ReflectionTestUtils.setField(service, "userService", users);
ReflectionTestUtils.setField(service, "orderService", mock(IOrderService.class));
when(users.getSonTenantIds("parent")).thenReturn(List.of("parent", "child"));
when(users.getSonTenantIds("child")).thenReturn(List.of("child"));
when(users.getSonTenantIds("other")).thenReturn(List.of("other"));
}
@AfterEach
void tearDown() {
LoginUserContextHolder.clear();
if (session != null) session.close();
}
@Test
void pagesByOriginalOrderScenicAreaIncludingChildren() {
login("parent");
assertPage(service.findList(Map.of("page", 1, "limit", 1)), 2, 2L);
assertPage(service.findList(Map.of("page", 2, "limit", 1)), 2, 1L);
login("other");
assertPage(service.findList(Map.of("page", 1, "limit", 10)), 1, 3L);
}
@Test
void tenantSelectionCanNarrowButNotExpandTheScope() {
login("parent");
assertPage(service.findList(Map.of("page", 1, "limit", 10, "tenantId", "child")), 1, 2L);
assertPage(service.findList(Map.of("page", 1, "limit", 10, "tenantId", "other")), 0);
}
@Test
void noTenantOrNoVisibleScenicAreaReturnsEmptyPage() {
assertPage(service.findList(Map.of("page", 1, "limit", 10, "tenantId", "parent")), 0);
login("unresolved");
assertPage(service.findList(Map.of("page", 1, "limit", 10)), 0);
login("empty");
when(users.getSonTenantIds("empty")).thenReturn(List.of("empty"));
assertPage(service.findList(Map.of("page", 1, "limit", 10)), 0);
}
private void login(String tenantId) {
var user = new LoginAppUser();
user.setCompany(tenantId);
LoginUserContextHolder.setUser(user);
}
private void assertPage(PageResult<Refund> page, long total, Long... ids) {
assertEquals(total, page.getCount());
assertEquals(List.of(ids), page.getData().stream().map(Refund::getId).toList());
}
}
@@ -12,6 +12,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
/** /**
* 支付宝小程序二维码服务 * 支付宝小程序二维码服务
* <p> * <p>
@@ -71,6 +74,7 @@ public class AlipayQrcodeService {
biz.put("url_param", urlParam); biz.put("url_param", urlParam);
biz.put("query_param", (queryKey == null || queryKey.isEmpty() ? "uuid" : queryKey) + "=" + codeId); biz.put("query_param", (queryKey == null || queryKey.isEmpty() ? "uuid" : queryKey) + "=" + codeId);
biz.put("describe", trimDescribe(describe)); biz.put("describe", trimDescribe(describe));
log.info("支付宝小程序码 bizContent: {}", biz.toJSONString());
request.setBizContent(biz.toJSONString()); request.setBizContent(biz.toJSONString());
if (Boolean.TRUE.equals(cfg.getIsServiceMode()) && cfg.getAuthToken() != null) { if (Boolean.TRUE.equals(cfg.getIsServiceMode()) && cfg.getAuthToken() != null) {