fix(hjmCar): 调整无坐标分页查询默认限制及状态

- 将无纬度或经度时的分页限制由2000缩减到500
- 设置无坐标查询时默认状态为1,优化数据筛选
- 删除了历史退款订单修复相关的控制器与服务代码
- 移除多个环境配置文件,清理无用资源
- 删除多项测试代码,去除无用单元测试与集成测试代码
This commit is contained in:
2026-04-29 22:14:07 +08:00
parent 4ec637d7f8
commit 01101d422f
31 changed files with 2 additions and 3078 deletions

View File

@@ -336,7 +336,8 @@ public class HjmCarController extends BaseController {
if (param.getLatitude() == null || param.getLatitude().isEmpty() ||
param.getLongitude() == null || param.getLongitude().isEmpty()) {
// 如果坐标为空,直接返回分页结果
param.setLimit(2000L);
param.setLimit(500L);
param.setStatus(1);
return success(hjmCarService.pageRel(param));
}

View File

@@ -1,72 +0,0 @@
package com.gxwebsoft.shop.controller;
import cn.hutool.core.util.ObjectUtil;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.shop.dto.RefundedOrderGltRepairRequest;
import com.gxwebsoft.shop.service.ShopOrderGltRepairService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* 历史订单修复:用于对“已退款的旧订单”补偿撤销水票相关数据。
*/
@Tag(name = "订单修复")
@RestController
@RequestMapping("/api/shop/shop-order/repair")
public class ShopOrderGltRepairController extends BaseController {
@Resource
private ShopOrderGltRepairService shopOrderGltRepairService;
@PreAuthorize("hasAuthority('shop:shopOrder:manage')")
@Operation(summary = "修复:已退款旧订单补偿撤销水票/释放计划/送水单支持dryRun预览")
@PostMapping("/revoke-glt-after-refund")
public ApiResult<?> revokeGltAfterRefund(@RequestBody RefundedOrderGltRepairRequest req) {
if (req == null) {
return fail("请求体不能为空");
}
Integer tenantId = ObjectUtil.defaultIfNull(req.getTenantId(), getTenantId());
if (tenantId == null) {
return fail("tenantId不能为空");
}
boolean dryRun = req.getDryRun() == null || req.getDryRun();
// 防误操作:既未指定订单,也未指定时间窗口时,只允许 dryRun
boolean noTargets = (req.getOrderIds() == null || req.getOrderIds().isEmpty())
&& (req.getOrderNos() == null || req.getOrderNos().isEmpty())
&& req.getRefundTimeStart() == null
&& req.getRefundTimeEnd() == null;
if (noTargets && !dryRun) {
return fail("请指定 orderIds/orderNos 或 refundTimeStart/refundTimeEnd否则仅允许 dryRun=true 预览");
}
ShopOrderGltRepairService.RepairResult r = shopOrderGltRepairService.revokeTicketsForRefundedOrders(
tenantId,
req.getOrderIds(),
req.getOrderNos(),
req.getRefundTimeStart(),
req.getRefundTimeEnd(),
req.getBatchSize(),
dryRun
);
Map<String, Object> data = new HashMap<>();
data.put("tenantId", tenantId);
data.put("dryRun", r.dryRun());
data.put("scannedOrders", r.scannedOrders());
data.put("ordersWithTicketsRevoked", r.ordersWithTicketsRevoked());
data.put("revokedTicketCount", r.revokedTicketCount());
data.put("processedOrderIds", r.processedOrderIds());
return success(data);
}
}

View File

@@ -1,109 +0,0 @@
package com.gxwebsoft.shop.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.glt.service.GltTicketRevokeService;
import com.gxwebsoft.shop.entity.ShopOrder;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* 历史订单修复:对已退款订单补偿撤销水票相关数据。
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class ShopOrderGltRepairService {
/** shop_order.order_status退款成功 */
private static final int ORDER_STATUS_REFUND_SUCCESS = 6;
private final ShopOrderService shopOrderService;
private final GltTicketRevokeService gltTicketRevokeService;
public RepairResult revokeTicketsForRefundedOrders(Integer tenantId,
List<Integer> orderIds,
List<String> orderNos,
LocalDateTime refundTimeStart,
LocalDateTime refundTimeEnd,
Integer batchSize,
boolean dryRun) {
if (tenantId == null) {
throw new IllegalArgumentException("tenantId不能为空");
}
int limit = batchSize == null ? 200 : Math.max(1, Math.min(batchSize, 2000));
List<ShopOrder> orders = new ArrayList<>();
// 1) 精准修复:指定 orderIds / orderNos
if (orderIds != null && !orderIds.isEmpty()) {
orders = shopOrderService.list(new LambdaQueryWrapper<ShopOrder>()
.eq(ShopOrder::getTenantId, tenantId)
.eq(ShopOrder::getDeleted, 0)
.eq(ShopOrder::getOrderStatus, ORDER_STATUS_REFUND_SUCCESS)
.in(ShopOrder::getOrderId, orderIds)
.last("limit " + limit));
} else if (orderNos != null && !orderNos.isEmpty()) {
orders = shopOrderService.list(new LambdaQueryWrapper<ShopOrder>()
.eq(ShopOrder::getTenantId, tenantId)
.eq(ShopOrder::getDeleted, 0)
.eq(ShopOrder::getOrderStatus, ORDER_STATUS_REFUND_SUCCESS)
.in(ShopOrder::getOrderNo, orderNos)
.last("limit " + limit));
} else {
// 2) 扫描修复:按 refundTime 窗口分页处理
LambdaQueryWrapper<ShopOrder> qw = new LambdaQueryWrapper<ShopOrder>()
.eq(ShopOrder::getTenantId, tenantId)
.eq(ShopOrder::getDeleted, 0)
.eq(ShopOrder::getOrderStatus, ORDER_STATUS_REFUND_SUCCESS);
if (refundTimeStart != null) {
qw.ge(ShopOrder::getRefundTime, refundTimeStart);
}
if (refundTimeEnd != null) {
qw.le(ShopOrder::getRefundTime, refundTimeEnd);
}
orders = shopOrderService.list(qw.orderByAsc(ShopOrder::getRefundTime).orderByAsc(ShopOrder::getOrderId).last("limit " + limit));
}
int scanned = orders == null ? 0 : orders.size();
int revokedTickets = 0;
int revokedOrders = 0;
List<Integer> processedOrderIds = new ArrayList<>();
if (orders != null) {
for (ShopOrder o : orders) {
if (o == null || o.getOrderId() == null) {
continue;
}
processedOrderIds.add(o.getOrderId());
if (dryRun) {
continue;
}
int revoked = gltTicketRevokeService.revokeByShopOrder(
tenantId,
o.getOrderId(),
o.getOrderNo(),
"历史退款订单补偿撤销水票"
);
if (revoked > 0) {
revokedTickets += revoked;
revokedOrders++;
}
}
}
return new RepairResult(scanned, revokedOrders, revokedTickets, processedOrderIds, dryRun);
}
public record RepairResult(int scannedOrders,
int ordersWithTicketsRevoked,
int revokedTicketCount,
List<Integer> processedOrderIds,
boolean dryRun) {
}
}

View File

@@ -1,85 +0,0 @@
# 生产环境配置
# 数据源配置
spring:
datasource:
url: jdbc:mysql://1Panel-mysql-XsWW:3306/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username: modules
password: tYmmMGh5wpwXR3ae
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
remove-abandoned: true
# redis
redis:
database: 0
host: 1Panel-redis-GmNr
port: 6379
password: redis_t74P8C
# 日志配置
logging:
file:
name: websoft-modules.log
level:
root: WARN
com.gxwebsoft: ERROR
com.baomidou.mybatisplus: ERROR
socketio:
host: 0.0.0.0 #IP地址
# MQTT配置
mqtt:
enabled: false # 启用MQTT服务
host: tcp://132.232.214.96:1883
username: swdev
password: Sw20250523
client-id-prefix: hjm_car_
topic: /SW_GPS/#
qos: 2
connection-timeout: 10
keep-alive-interval: 20
auto-reconnect: true
# 框架配置
config:
# 文件服务器
file-server: https://file-s209.shoplnk.cn
# 生产环境接口
server-url: https://glt-server.websoft.top/api
# 业务模块接口
api-url: https://glt-api.websoft.top/api
upload-path: /www/wwwroot/file.ws
# 阿里云OSS云存储
endpoint: https://oss-cn-shenzhen.aliyuncs.com
accessKeyId: LTAI4GKGZ9Z2Z8JZ77c3GNZP
accessKeySecret: BiDkpS7UXj72HWwDWaFZxiXjNFBNCM
bucketName: oss-gxwebsoft
bucketDomain: https://oss.wsdns.cn
aliyunDomain: https://oss-gxwebsoft.oss-cn-shenzhen.aliyuncs.com
# 生产环境证书配置
certificate:
load-mode: VOLUME # 生产环境从Docker挂载卷加载
cert-root-path: /www/wwwroot/file.ws
# 支付配置缓存
payment:
cache:
# 支付配置缓存键前缀,生产环境使用 Payment:1* 格式
key-prefix: "Payment:1"
# 缓存过期时间(小时)
expire-hours: 24
# 阿里云翻译配置
aliyun:
translate:
access-key-id: LTAI5tEsyhW4GCKbds1qsopg
access-key-secret: zltFlQrYVAoq2KMFDWgLa3GhkMNeyO
endpoint: mt.cn-hangzhou.aliyuncs.com
wechatpay:
transfer:
scene-id: 1005
scene-report-infos-json: '[{"info_type":"岗位类型","info_content":"配送员"},{"info_type":"报酬说明","info_content":"12月份配送费"}]'

View File

@@ -1,73 +0,0 @@
# 开发环境配置
# 服务器配置
server:
port: 9200
# 数据源配置
spring:
datasource:
url: jdbc:mysql://8.134.55.105:13306/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
username: modules
password: tYmmMGh5wpwXR3ae
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
# redis
redis:
database: 0
host: 8.134.55.105
port: 16379
password: redis_t74P8C
# 日志配置
logging:
level:
com.gxwebsoft: DEBUG
com.baomidou.mybatisplus: DEBUG
socketio:
host: localhost #IP地址
# MQTT配置
mqtt:
enabled: false # 添加开关来禁用MQTT服务
host: tcp://132.232.214.96:1883
username: swdev
password: Sw20250523
client-id-prefix: hjm_car_
topic: /SW_GPS/#
qos: 2
connection-timeout: 10
keep-alive-interval: 20
auto-reconnect: true
# 框架配置
config:
# 基础模块接口
server-url: https://glt-server.websoft.top/api
# 业务模块接口
api-url: https://glt-api.websoft.top/api
upload-path: /Users/gxwebsoft/Documents/uploads/ # window(D:\Temp)
# 开发环境证书配置
certificate:
load-mode: CLASSPATH # 开发环境从classpath加载
wechat-pay:
dev:
private-key-file: "apiclient_key.pem"
apiclient-cert-file: "apiclient_cert.pem"
wechatpay-cert-file: "wechatpay_cert.pem"
# 阿里云翻译配置
aliyun:
translate:
access-key-id: LTAI5tEsyhW4GCKbds1qsopg
access-key-secret: zltFlQrYVAoq2KMFDWgLa3GhkMNeyO
endpoint: mt.cn-hangzhou.aliyuncs.com
# 微信支付-商家转账(升级版)转账场景报备信息(必须与商户平台 transfer_scene_id=1005 的报备信息一致)
wechatpay:
transfer:
scene-id: 1005
scene-report-infos-json: '[{"info_type":"岗位类型","info_content":"业务员"},{"info_type":"报酬说明","info_content":"配送费"}]'

View File

@@ -1,86 +0,0 @@
# 服务器配置
server:
port: 9300
# 数据源配置
spring:
datasource:
url: jdbc:mysql://1Panel-mysql-XsWW:3306/gltdb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username: gltdb
password: EeD4FtzyA5ksj7Bk
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
remove-abandoned: true
# redis
redis:
database: 0
host: 1Panel-redis-GmNr
port: 6379
password: redis_t74P8C
# 日志配置
logging:
file:
name: websoft-modules.log
level:
root: WARN
com.gxwebsoft: ERROR
com.baomidou.mybatisplus: ERROR
socketio:
host: 0.0.0.0 #IP地址
# MQTT配置
mqtt:
enabled: false # 启用MQTT服务
host: tcp://132.232.214.96:1883
username: swdev
password: Sw20250523
client-id-prefix: hjm_car_
topic: /SW_GPS/#
qos: 2
connection-timeout: 10
keep-alive-interval: 20
auto-reconnect: true
# 框架配置
config:
# 文件服务器
file-server: https://file-s209.shoplnk.cn
# 生产环境接口
server-url: https://glt-server.websoft.top/api
# 业务模块接口
api-url: https://glt-api.websoft.top/api
upload-path: /www/wwwroot/file.ws
# 阿里云OSS云存储
endpoint: https://oss-cn-shenzhen.aliyuncs.com
accessKeyId: LTAI4GKGZ9Z2Z8JZ77c3GNZP
accessKeySecret: BiDkpS7UXj72HWwDWaFZxiXjNFBNCM
bucketName: oss-gxwebsoft
bucketDomain: https://oss.wsdns.cn
aliyunDomain: https://oss-gxwebsoft.oss-cn-shenzhen.aliyuncs.com
# 生产环境证书配置
certificate:
load-mode: VOLUME # 生产环境从Docker挂载卷加载
cert-root-path: /www/wwwroot/file.ws
# 支付配置缓存
payment:
cache:
# 支付配置缓存键前缀,生产环境使用 Payment:1* 格式
key-prefix: "Payment:1"
# 缓存过期时间(小时)
expire-hours: 24
# 阿里云翻译配置
aliyun:
translate:
access-key-id: LTAI5tEsyhW4GCKbds1qsopg
access-key-secret: zltFlQrYVAoq2KMFDWgLa3GhkMNeyO
endpoint: mt.cn-hangzhou.aliyuncs.com
wechatpay:
transfer:
scene-id: 1005
scene-report-infos-json: '[{"info_type":"岗位类型","info_content":"配送员"},{"info_type":"报酬说明","info_content":"12月份配送费"}]'

View File

@@ -1,101 +0,0 @@
# 生产环境配置
server:
port: 9300
# 数据源配置
spring:
datasource:
url: jdbc:mysql://1Panel-mysql-Bqdt:3306/ysb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username: ysb
password: 5Zf45CE2YneBfXkR
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
remove-abandoned: true
# redis
redis:
database: 0
host: 1Panel-redis-Q1LE
port: 6379
password: redis_WSDb88
# 日志配置
logging:
file:
name: websoft-modules.log
level:
root: WARN
com.gxwebsoft: ERROR
com.baomidou.mybatisplus: ERROR
socketio:
host: 0.0.0.0 #IP地址
# MQTT配置
mqtt:
enabled: false # 启用MQTT服务
host: tcp://132.232.214.96:1883
username: swdev
password: Sw20250523
client-id-prefix: hjm_car_
topic: /SW_GPS/#
qos: 2
connection-timeout: 10
keep-alive-interval: 20
auto-reconnect: true
# Mybatis-plus配置
mybatis-plus:
mapper-locations: classpath*:com/gxwebsoft/**/*Mapper.xml
configuration:
map-underscore-to-camel-case: true
cache-enabled: true
global-config:
banner: false
# SqlRunner.db().xxx 需要开启该开关,否则会报:
# Mapped Statements collection does not contain value for com.baomidou.mybatisplus.core.mapper.SqlRunner.Delete
enable-sql-runner: true
db-config:
id-type: auto
logic-delete-value: 1
logic-not-delete-value: 0
# 框架配置
config:
# 文件服务器
file-server: https://file-s209.shoplnk.cn
# 生产环境接口
server-url: https://server.websoft.top/api
# 业务模块接口
api-url: https://ysb-api.websoft.top/api
upload-path: /www/wwwroot/file.ws
# 阿里云OSS云存储
endpoint: https://oss-cn-shenzhen.aliyuncs.com
accessKeyId: LTAI4GKGZ9Z2Z8JZ77c3GNZP
accessKeySecret: BiDkpS7UXj72HWwDWaFZxiXjNFBNCM
bucketName: oss-gxwebsoft
bucketDomain: https://oss.wsdns.cn
aliyunDomain: https://oss-gxwebsoft.oss-cn-shenzhen.aliyuncs.com
# 生产环境证书配置
certificate:
load-mode: VOLUME # 生产环境从Docker挂载卷加载
cert-root-path: /www/wwwroot/file.ws
# 支付配置缓存
payment:
cache:
# 支付配置缓存键前缀,生产环境使用 Payment:1* 格式
key-prefix: "Payment:1"
# 缓存过期时间(小时)
expire-hours: 24
# 阿里云翻译配置
aliyun:
translate:
access-key-id: LTAI5tEsyhW4GCKbds1qsopg
access-key-secret: zltFlQrYVAoq2KMFDWgLa3GhkMNeyO
endpoint: mt.cn-hangzhou.aliyuncs.com
wechatpay:
transfer:
scene-id: 1005
scene-report-infos-json: '[{"info_type":"岗位类型","info_content":"配送员"},{"info_type":"报酬说明","info_content":"12月份配送费"}]'

View File

@@ -1,98 +0,0 @@
# 服务器配置
server:
port: 9200
# 数据源配置
spring:
datasource:
url: jdbc:mysql://47.119.165.234:13308/ysb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username: ysb
password: 5Zf45CE2YneBfXkR
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
remove-abandoned: true
# redis
redis:
database: 0
host: 47.119.165.234
port: 16379
password: redis_WSDb88
# 日志配置
logging:
level:
com.gxwebsoft: DEBUG
com.baomidou.mybatisplus: DEBUG
socketio:
host: 0.0.0.0 #IP地址
# MQTT配置
mqtt:
enabled: false # 启用MQTT服务
host: tcp://132.232.214.96:1883
username: swdev
password: Sw20250523
client-id-prefix: hjm_car_
topic: /SW_GPS/#
qos: 2
connection-timeout: 10
keep-alive-interval: 20
auto-reconnect: true
# Mybatis-plus配置
mybatis-plus:
mapper-locations: classpath*:com/gxwebsoft/**/*Mapper.xml
configuration:
map-underscore-to-camel-case: true
cache-enabled: true
global-config:
banner: false
# SqlRunner.db().xxx 需要开启该开关,否则会报:
# Mapped Statements collection does not contain value for com.baomidou.mybatisplus.core.mapper.SqlRunner.Delete
enable-sql-runner: true
db-config:
id-type: auto
logic-delete-value: 1
logic-not-delete-value: 0
# 框架配置
config:
# 文件服务器
file-server: https://file-s209.shoplnk.cn
# 生产环境接口
server-url: https://server.websoft.top/api
# 业务模块接口
api-url: https://ysb-api.websoft.top/api
upload-path: /www/wwwroot/file.ws
# 阿里云OSS云存储
endpoint: https://oss-cn-shenzhen.aliyuncs.com
accessKeyId: LTAI4GKGZ9Z2Z8JZ77c3GNZP
accessKeySecret: BiDkpS7UXj72HWwDWaFZxiXjNFBNCM
bucketName: oss-gxwebsoft
bucketDomain: https://oss.wsdns.cn
aliyunDomain: https://oss-gxwebsoft.oss-cn-shenzhen.aliyuncs.com
# 生产环境证书配置
certificate:
load-mode: VOLUME # 生产环境从Docker挂载卷加载
cert-root-path: /www/wwwroot/file.ws
# 支付配置缓存
payment:
cache:
# 支付配置缓存键前缀,生产环境使用 Payment:1* 格式
key-prefix: "Payment:1"
# 缓存过期时间(小时)
expire-hours: 24
# 阿里云翻译配置
aliyun:
translate:
access-key-id: LTAI5tEsyhW4GCKbds1qsopg
access-key-secret: zltFlQrYVAoq2KMFDWgLa3GhkMNeyO
endpoint: mt.cn-hangzhou.aliyuncs.com
wechatpay:
transfer:
scene-id: 1005
scene-report-infos-json: '[{"info_type":"岗位类型","info_content":"配送员"},{"info_type":"报酬说明","info_content":"12月份配送费"}]'