feat(config): 更新测试环境配置并优化订单导入逻辑

- 修改Redis主机地址和端口以适配新环境- 更新SocketIO监听地址为0.0.0.0
- 配置文件服务器地址及上传路径- 添加阿里云OSS存储配置信息
- 调整证书加载模式为VOLUME并设置根路径
- 新增支付配置缓存键前缀和过期时间- 修改订单导入时使用的字段匹配条件
-修正导入参数类中的字段类型和注解说明- 更新实体类ShopDealerOrder增加title字段
-优化订单价格处理逻辑避免空指针异常
- 注释掉部分冗余的推荐关系查询代码
- 调整订单无效状态默认值为0(有效)
This commit is contained in:
2025-10-18 09:01:26 +08:00
parent b86c91d8a8
commit 540f866d93
5 changed files with 85 additions and 64 deletions

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gxwebsoft</groupId>
<artifactId>com-gxwebsoft-modules</artifactId>
<artifactId>mp-api</artifactId>
<version>1.5.0</version>
<name>com-gxwebsoft-api</name>

View File

@@ -80,7 +80,7 @@ public class SdyDealerOrderController extends BaseController {
for (SdyDealerOrderImportParam d : list) {
// 检查是否已存在相同的记录根据comments字段和未结算状态
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<ShopDealerOrder> queryWrapper = new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<>();
queryWrapper.eq(ShopDealerOrder::getComments, d.getComments()); // 使用comments字段
queryWrapper.eq(ShopDealerOrder::getTitle, d.getTitle()); // 使用comments字段
queryWrapper.eq(ShopDealerOrder::getIsSettled, 0); // 未结算状态
if (shopDealerOrderService.count(queryWrapper) == 0) {
@@ -91,61 +91,66 @@ public class SdyDealerOrderController extends BaseController {
String orderNo = Long.toString(IdUtil.getSnowflakeNextId());
// 手动映射字段
item.setOrderNo(d.getOrderNo());
// item.setOrderNo(d.getOrderNo());
item.setOrderNo(orderNo);
item.setOrderPrice(d.getOrderPrice());
item.setTitle(d.getTitle());
item.setDegreePrice(d.getOrderPrice().multiply(new BigDecimal(1000)));
item.setFirstUserId(d.getFirstUserId());
item.setSecondUserId(d.getSecondUserId());
item.setThirdUserId(d.getThirdUserId());
item.setFirstUserId(Integer.valueOf(d.getFirstUserId()));
item.setSecondUserId(Integer.valueOf(d.getSecondUserId()));
item.setThirdUserId(Integer.valueOf(d.getThirdUserId()));
item.setFirstMoney(d.getFirstMoney());
item.setSecondMoney(d.getSecondMoney());
item.setThirdMoney(d.getThirdMoney());
item.setTenantId(d.getTenantId());
item.setComments(d.getComments());
// 假设d.getPrice()返回的BigDecimal未设置精度
if(d.getPrice() == null){
item.setPrice(d.getPrice().divide(new BigDecimal(1000), 3, BigDecimal.ROUND_HALF_UP));
}else {
item.setPrice(d.getPrice());
}
item.setSettledPrice(d.getSettledPrice());
item.setPayPrice(d.getPayPrice());
item.setRate(d.getRate());
item.setMonth(d.getMonth());
item.setIsInvalid(1);
item.setIsInvalid(0);
item.setIsSettled(0); // 新导入的数据设为未结算
// TODO 导入指定用户ID
if(d.getUserId() != null){
item.setUserId(d.getUserId());
item.setIsInvalid(1);
}else {
// TODO 通过报备客户信息查询绑定关系
ShopDealerApply dealerApply = shopDealerApplyService.getByDealerNameRel(d.getComments());
// 已签约客户
if(dealerApply != null){
item.setIsInvalid(0);
item.setUserId(dealerApply.getUserId());
item.setFirstUserId(dealerApply.getRefereeId());
}
}
// if(d.getUserId() != null){
// item.setUserId(d.getUserId());
// item.setIsInvalid(1);
//
// }else {
// // TODO 通过报备客户信息查询绑定关系
// ShopDealerApply dealerApply = shopDealerApplyService.getByDealerNameRel(d.getComments());
//
// // 已签约客户
// if(dealerApply != null){
// item.setIsInvalid(0);
// item.setUserId(dealerApply.getUserId());
// item.setFirstUserId(dealerApply.getRefereeId());
// }
// }
// 查询推荐关系
if(ObjectUtil.isNotEmpty(item.getUserId())){
ShopDealerReferee referee = shopDealerRefereeService.getByUserIdRel(item.getUserId());
item.setFirstUserId(referee.getDealerId());
item.setFirstNickname(referee.getDealerName());
ShopDealerReferee referee2 = shopDealerRefereeService.getByUserIdRel(referee.getDealerId());
if(ObjectUtil.isNotEmpty(referee2)){
item.setSecondUserId(referee2.getDealerId());
item.setSecondNickname(referee2.getDealerName());
ShopDealerReferee referee3 = shopDealerRefereeService.getByUserIdRel(referee2.getDealerId());
if(ObjectUtil.isNotEmpty(referee3)){
item.setThirdUserId(referee3.getDealerId());
item.setThirdNickname(referee3.getDealerName());
}
}
item.setIsInvalid(0);
}
// if(ObjectUtil.isNotEmpty(item.getUserId())){
// ShopDealerReferee referee = shopDealerRefereeService.getByUserIdRel(item.getUserId());
// item.setFirstUserId(referee.getDealerId());
// item.setFirstNickname(referee.getDealerName());
// ShopDealerReferee referee2 = shopDealerRefereeService.getByUserIdRel(referee.getDealerId());
// if(ObjectUtil.isNotEmpty(referee2)){
// item.setSecondUserId(referee2.getDealerId());
// item.setSecondNickname(referee2.getDealerName());
// ShopDealerReferee referee3 = shopDealerRefereeService.getByUserIdRel(referee2.getDealerId());
// if(ObjectUtil.isNotEmpty(referee3)){
// item.setThirdUserId(referee3.getDealerId());
// item.setThirdNickname(referee3.getDealerName());
// }
// }
// item.setIsInvalid(0);
// }
System.out.println("准备导入数据: " + item);
if (ObjectUtil.isNotEmpty(item)) {

View File

@@ -19,12 +19,15 @@ import java.time.LocalDateTime;
public class SdyDealerOrderImportParam implements Serializable {
private static final long serialVersionUID = 1L;
@Excel(name = "实际收款人")
private Integer userId;
@Excel(name = "业务员ID")
private String userId;
@Excel(name = "订单编号")
private String orderNo;
@Excel(name = "公司名称")
private String title;
@Excel(name = "结算电量")
private BigDecimal orderPrice;
@@ -47,24 +50,24 @@ public class SdyDealerOrderImportParam implements Serializable {
private String month;
@Excel(name = "一级分销商ID")
private Integer firstUserId;
private String firstUserId;
@Excel(name = "二级分销商ID")
private Integer secondUserId;
private String secondUserId;
@Excel(name = "三级分销商ID")
private Integer thirdUserId;
private String thirdUserId;
@Excel(name = "一级佣金")
@Excel(name = "一级佣金30%")
private BigDecimal firstMoney;
@Excel(name = "二级佣金")
@Excel(name = "二级佣金10%")
private BigDecimal secondMoney;
@Excel(name = "三级佣金")
@Excel(name = "三级佣金60%")
private BigDecimal thirdMoney;
@Excel(name = "公司名称")
@Excel(name = "备注")
private String comments;
@Excel(name = "租户ID")

View File

@@ -36,6 +36,9 @@ public class ShopDealerOrder implements Serializable {
@Excel(name = "订单编号")
private String orderNo;
@Excel(name = "商品名称")
private String title;
@Schema(description = "买家用户昵称")
@TableField(exist = false)
private String nickname;

View File

@@ -16,8 +16,8 @@ spring:
# redis
redis:
database: 0
host: 8.134.169.209
port: 16379
host: 1Panel-redis-Q1LE
port: 6379
password: redis_WSDb88
# 日志配置
@@ -29,7 +29,7 @@ logging:
org.apache.ibatis: DEBUG
socketio:
host: localhost #IP地址
host: 0.0.0.0 #IP地址
# MQTT配置
mqtt:
@@ -44,22 +44,32 @@ mqtt:
keep-alive-interval: 20
auto-reconnect: true
# 框架配置
config:
# 开发环境接口
# 文件服务器
file-server: https://file-s209.shoplnk.cn
# 生产环境接口
server-url: https://server.websoft.top/api
upload-path: /Users/gxwebsoft/JAVA/mp-java/src/main/resources # window(D:\Temp)
upload-path: /www/wwwroot/file.ws
# JWT配置
jwt:
secret: websoft-jwt-secret-key-2025-dev-environment
expire: 86400 # token过期时间(秒) 24小时
# 阿里云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: CLASSPATH # 开发环境从classpath加载
wechat-pay:
dev:
private-key-file: "apiclient_key.pem"
apiclient-cert-file: "apiclient_cert.pem"
wechatpay-cert-file: "wechatpay_cert.pem"
load-mode: VOLUME # 生产环境从Docker挂载卷加载
cert-root-path: /www/wwwroot/file.ws
# 支付配置缓存
payment:
cache:
# 支付配置缓存键前缀,生产环境使用 Payment:1* 格式
key-prefix: "Payment:1"
# 缓存过期时间(小时)
expire-hours: 24