Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
# Conflicts: # yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java
This commit is contained in:
commit
7efa6fe57d
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.framework.ai.core.model.deepseek;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.ai.chat.metadata.ChatGenerationMetadata;
|
||||
|
@ -70,12 +71,12 @@ public class DeepSeekChatModel implements ChatModel {
|
|||
OpenAiApi.ChatCompletion chatCompletion = completionEntity.getBody();
|
||||
if (chatCompletion == null) {
|
||||
log.warn("No chat completion returned for prompt: {}", prompt);
|
||||
return new ChatResponse(List.of());
|
||||
return new ChatResponse(ListUtil.of());
|
||||
}
|
||||
List<OpenAiApi.ChatCompletion.Choice> choices = chatCompletion.choices();
|
||||
if (choices == null) {
|
||||
log.warn("No choices returned for prompt: {}", prompt);
|
||||
return new ChatResponse(List.of());
|
||||
return new ChatResponse(ListUtil.of());
|
||||
}
|
||||
|
||||
// 2. 转换 ChatResponse 返回
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.framework.ai.core.model.xinghuo;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.ai.chat.metadata.ChatGenerationMetadata;
|
||||
|
@ -72,12 +73,12 @@ public class XingHuoChatModel implements ChatModel {
|
|||
OpenAiApi.ChatCompletion chatCompletion = completionEntity.getBody();
|
||||
if (chatCompletion == null) {
|
||||
log.warn("No chat completion returned for prompt: {}", prompt);
|
||||
return new ChatResponse(List.of());
|
||||
return new ChatResponse(ListUtil.of());
|
||||
}
|
||||
List<OpenAiApi.ChatCompletion.Choice> choices = chatCompletion.choices();
|
||||
if (choices == null) {
|
||||
log.warn("No choices returned for prompt: {}", prompt);
|
||||
return new ChatResponse(List.of());
|
||||
return new ChatResponse(ListUtil.of());
|
||||
}
|
||||
|
||||
// 2. 转换 ChatResponse 返回
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.alibaba.cloud.ai.tongyi.audio.transcription;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.alibaba.cloud.ai.tongyi.audio.AudioTranscriptionModels;
|
||||
import com.alibaba.cloud.ai.tongyi.audio.transcription.api.AudioTranscriptionPrompt;
|
||||
import com.alibaba.cloud.ai.tongyi.audio.transcription.api.AudioTranscriptionResponse;
|
||||
|
@ -82,7 +83,7 @@ public class TongYiAudioTranscriptionModel
|
|||
try {
|
||||
transcriptionParam = TranscriptionParam.builder()
|
||||
.model(AudioTranscriptionModels.Paraformer_V1)
|
||||
.fileUrls(List.of(String.valueOf(instructions.getURL())))
|
||||
.fileUrls(ListUtil.of(String.valueOf(instructions.getURL())))
|
||||
.build();
|
||||
}
|
||||
catch (IOException e) {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.alibaba.cloud.ai.tongyi.chat;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.alibaba.cloud.ai.tongyi.common.exception.TongYiException;
|
||||
import com.alibaba.dashscope.aigc.conversation.ConversationParam;
|
||||
import com.alibaba.dashscope.aigc.generation.Generation;
|
||||
|
@ -207,7 +208,7 @@ public class TongYiChatModel extends
|
|||
.getChoices()
|
||||
.get(0)
|
||||
));
|
||||
return new ChatResponse(List.of(gen));
|
||||
return new ChatResponse(ListUtil.of(gen));
|
||||
})
|
||||
)
|
||||
.publishOn(Schedulers.parallel());
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.alibaba.cloud.ai.tongyi.embedding;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.alibaba.cloud.ai.tongyi.common.exception.TongYiException;
|
||||
import com.alibaba.cloud.ai.tongyi.metadata.TongYiTextEmbeddingResponseMetadata;
|
||||
import com.alibaba.dashscope.embeddings.TextEmbedding;
|
||||
|
@ -100,7 +101,7 @@ public class TongYiTextEmbeddingModel extends AbstractEmbeddingModel {
|
|||
|
||||
return this.call(
|
||||
new EmbeddingRequest(
|
||||
List.of(document.getFormattedContent(this.metadataMode)),
|
||||
ListUtil.of(document.getFormattedContent(this.metadataMode)),
|
||||
null)
|
||||
).getResults().stream()
|
||||
.map(Embedding::getOutput)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.framework.ai.music;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.iocoder.yudao.framework.ai.core.model.suno.api.SunoApi;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -66,7 +67,7 @@ public class SunoApiTests {
|
|||
String id = "584729e5-0fe9-4157-86da-1b4803ff42bf";
|
||||
|
||||
// 调用方法
|
||||
List<SunoApi.MusicData> musicList = sunoApi.getMusicList(List.of(id));
|
||||
List<SunoApi.MusicData> musicList = sunoApi.getMusicList(ListUtil.of(id));
|
||||
// 打印结果
|
||||
System.out.println(musicList);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.statistics.service.member;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.ip.core.Area;
|
||||
import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
|
||||
|
@ -16,10 +16,10 @@ import cn.iocoder.yudao.module.statistics.service.pay.PayWalletStatisticsService
|
|||
import cn.iocoder.yudao.module.statistics.service.pay.bo.RechargeSummaryRespBO;
|
||||
import cn.iocoder.yudao.module.statistics.service.trade.TradeOrderStatisticsService;
|
||||
import cn.iocoder.yudao.module.statistics.service.trade.TradeStatisticsService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
@ -70,9 +70,12 @@ public class MemberStatisticsServiceImpl implements MemberStatisticsService {
|
|||
bo -> AreaUtils.getParentIdByType(bo.getAreaId(), AreaTypeEnum.PROVINCE),
|
||||
bo -> bo,
|
||||
(a, b) -> new MemberAreaStatisticsRespBO()
|
||||
.setOrderCreateUserCount(a.getOrderCreateUserCount() + b.getOrderCreateUserCount())
|
||||
.setOrderPayUserCount(a.getOrderPayUserCount() + b.getOrderPayUserCount())
|
||||
.setOrderPayPrice(ObjUtil.defaultIfNull(a.getOrderPayPrice(), 0) + ObjUtil.defaultIfNull(b.getOrderPayPrice(), 0)));
|
||||
.setOrderCreateUserCount(ObjectUtil.defaultIfNull(a.getOrderCreateUserCount(), 0)
|
||||
+ ObjectUtil.defaultIfNull(b.getOrderCreateUserCount(), 0))
|
||||
.setOrderPayUserCount(ObjectUtil.defaultIfNull(a.getOrderPayUserCount(), 0)
|
||||
+ ObjectUtil.defaultIfNull(b.getOrderPayUserCount(), 0))
|
||||
.setOrderPayPrice(ObjectUtil.defaultIfNull(a.getOrderPayPrice(), 0)
|
||||
+ ObjectUtil.defaultIfNull(b.getOrderPayPrice(), 0)));
|
||||
// 拼接数据
|
||||
List<Area> areaList = AreaUtils.getByType(AreaTypeEnum.PROVINCE, area -> area);
|
||||
areaList.add(new Area().setId(null).setName("未知"));
|
||||
|
|
|
@ -43,7 +43,8 @@ public interface AfterSaleConvert {
|
|||
@Mapping(source = "afterSale.orderId", target = "merchantOrderId"),
|
||||
@Mapping(source = "afterSale.id", target = "merchantRefundId"),
|
||||
@Mapping(source = "afterSale.applyReason", target = "reason"),
|
||||
@Mapping(source = "afterSale.refundPrice", target = "price")
|
||||
@Mapping(source = "afterSale.refundPrice", target = "price"),
|
||||
@Mapping(source = "orderProperties.payAppKey", target = "appKey")
|
||||
})
|
||||
PayRefundCreateReqDTO convert(String userIp, AfterSaleDO afterSale,
|
||||
TradeOrderProperties orderProperties);
|
||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.mysql.aftersale;
|
|||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.AfterSaleLogDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -10,7 +11,9 @@ import java.util.List;
|
|||
public interface AfterSaleLogMapper extends BaseMapperX<AfterSaleLogDO> {
|
||||
|
||||
default List<AfterSaleLogDO> selectListByAfterSaleId(Long afterSaleId) {
|
||||
return selectList(AfterSaleLogDO::getAfterSaleId, afterSaleId);
|
||||
return selectList(new LambdaQueryWrapper<AfterSaleLogDO>()
|
||||
.eq(AfterSaleLogDO::getAfterSaleId, afterSaleId)
|
||||
.orderByDesc(AfterSaleLogDO::getCreateTime));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.mysql.order;
|
|||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderLogDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -10,7 +11,9 @@ import java.util.List;
|
|||
public interface TradeOrderLogMapper extends BaseMapperX<TradeOrderLogDO> {
|
||||
|
||||
default List<TradeOrderLogDO> selectListByOrderId(Long orderId) {
|
||||
return selectList(TradeOrderLogDO::getOrderId, orderId);
|
||||
return selectList(new LambdaQueryWrapper<TradeOrderLogDO>()
|
||||
.eq(TradeOrderLogDO::getOrderId, orderId)
|
||||
.orderByDesc(TradeOrderLogDO::getCreateTime));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ public class ExpressTrackQueryReqDTO {
|
|||
|
||||
/**
|
||||
* 快递公司编码
|
||||
*
|
||||
* <p>
|
||||
* 对应 {@link DeliveryExpressDO#getCode()}
|
||||
*/
|
||||
private String expressCode;
|
||||
|
@ -28,4 +28,9 @@ public class ExpressTrackQueryReqDTO {
|
|||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 自定义名称(顺丰专用)
|
||||
*/
|
||||
private String customerName;
|
||||
|
||||
}
|
||||
|
|
|
@ -29,4 +29,10 @@ public class KdNiaoExpressQueryReqDTO {
|
|||
@JsonProperty("OrderCode")
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 自定义名称(顺丰专用)
|
||||
*/
|
||||
@JsonProperty("CustomerName")
|
||||
private String customerName;
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kdniao
|
|||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.net.URLEncodeUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.module.trade.framework.delivery.config.TradeExpressProperties;
|
||||
|
@ -60,6 +62,11 @@ public class KdNiaoExpressClient implements ExpressClient {
|
|||
// 发起请求
|
||||
KdNiaoExpressQueryReqDTO requestDTO = INSTANCE.convert(reqDTO)
|
||||
.setExpressCode(reqDTO.getExpressCode().toUpperCase());
|
||||
if (ObjUtil.equal(requestDTO.getExpressCode(), "SF")
|
||||
&& StrUtil.isBlank(reqDTO.getCustomerName())
|
||||
&& StrUtil.length(reqDTO.getPhone()) >= 4) {
|
||||
requestDTO.setCustomerName(StrUtil.subSufByLength(reqDTO.getPhone(), 4));
|
||||
}
|
||||
KdNiaoExpressQueryRespDTO respDTO = httpRequest(REAL_TIME_QUERY_URL, REAL_TIME_FREE_REQ_TYPE,
|
||||
requestDTO, KdNiaoExpressQueryRespDTO.class);
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
|
|||
|
||||
/**
|
||||
* 查询物流轨迹
|
||||
*
|
||||
* <p>
|
||||
* 缓存的目的:考虑及时性要求不高,但是每次调用需要钱
|
||||
*
|
||||
* @param code 快递公司编码
|
||||
|
@ -217,9 +217,8 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
|
|||
@Cacheable(cacheNames = RedisKeyConstants.EXPRESS_TRACK, key = "#code + '-' + #logisticsNo + '-' + #receiverMobile",
|
||||
condition = "#result != null && #result.length() > 0")
|
||||
public List<ExpressTrackRespDTO> getExpressTrackList(String code, String logisticsNo, String receiverMobile) {
|
||||
return expressClientFactory.getDefaultExpressClient().getExpressTrackList(
|
||||
new ExpressTrackQueryReqDTO().setExpressCode(code).setLogisticsNo(logisticsNo)
|
||||
.setPhone(receiverMobile));
|
||||
return expressClientFactory.getDefaultExpressClient().getExpressTrackList(new ExpressTrackQueryReqDTO()
|
||||
.setExpressCode(code).setLogisticsNo(logisticsNo).setPhone(receiverMobile));
|
||||
}
|
||||
|
||||
// =================== Order Item ===================
|
||||
|
|
|
@ -78,12 +78,10 @@ public class TradeMemberPointOrderHandler implements TradeOrderHandler {
|
|||
|
||||
@Override
|
||||
public void afterCancelOrderItem(TradeOrderDO order, TradeOrderItemDO orderItem) {
|
||||
// 扣减(回滚)积分(订单赠送)
|
||||
reducePoint(order.getUserId(), orderItem.getGivePoint(), MemberPointBizTypeEnum.ORDER_GIVE_CANCEL_ITEM,
|
||||
orderItem.getId());
|
||||
// 增加(回滚)积分(订单抵扣)
|
||||
addPoint(order.getUserId(), orderItem.getUsePoint(), MemberPointBizTypeEnum.ORDER_USE_CANCEL_ITEM,
|
||||
orderItem.getId());
|
||||
addPoint(order.getUserId(), orderItem.getUsePoint(), MemberPointBizTypeEnum.ORDER_USE_CANCEL_ITEM, orderItem.getId());
|
||||
// 扣减(回滚)积分(订单赠送)
|
||||
reducePoint(order.getUserId(), orderItem.getGivePoint(), MemberPointBizTypeEnum.ORDER_GIVE_CANCEL_ITEM, orderItem.getId());
|
||||
|
||||
// 扣减(回滚)用户经验
|
||||
AfterSaleDO afterSale = afterSaleService.getAfterSale(orderItem.getAfterSaleId());
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.module.system.framework.sms.core.client.impl;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.KeyValue;
|
||||
import cn.iocoder.yudao.module.system.framework.sms.core.client.dto.SmsReceiveRespDTO;
|
||||
import cn.iocoder.yudao.module.system.framework.sms.core.client.dto.SmsSendRespDTO;
|
||||
|
@ -47,7 +48,7 @@ public class SmsClientTests {
|
|||
String mobile = "15601691323";
|
||||
String apiTemplateId = "SMS_207945135";
|
||||
// 调用
|
||||
SmsSendRespDTO sendRespDTO = client.sendSms(sendLogId, mobile, apiTemplateId, List.of(new KeyValue<>("code", "1024")));
|
||||
SmsSendRespDTO sendRespDTO = client.sendSms(sendLogId, mobile, apiTemplateId, ListUtil.of(new KeyValue<>("code", "1024")));
|
||||
// 打印结果
|
||||
System.out.println(sendRespDTO);
|
||||
}
|
||||
|
@ -96,7 +97,7 @@ public class SmsClientTests {
|
|||
String mobile = "15601691323";
|
||||
String apiTemplateId = "2136358";
|
||||
// 调用
|
||||
SmsSendRespDTO sendRespDTO = client.sendSms(sendLogId, mobile, apiTemplateId, List.of(new KeyValue<>("code", "1024")));
|
||||
SmsSendRespDTO sendRespDTO = client.sendSms(sendLogId, mobile, apiTemplateId, ListUtil.of(new KeyValue<>("code", "1024")));
|
||||
// 打印结果
|
||||
System.out.println(sendRespDTO);
|
||||
}
|
||||
|
@ -131,7 +132,7 @@ public class SmsClientTests {
|
|||
Long sendLogId = System.currentTimeMillis();
|
||||
String mobile = "15601691323";
|
||||
String apiTemplateId = "xx test01";
|
||||
List<KeyValue<String, Object>> templateParams = List.of(new KeyValue<>("code", "1024"));
|
||||
List<KeyValue<String, Object>> templateParams = ListUtil.of(new KeyValue<>("code", "1024"));
|
||||
// 调用
|
||||
SmsSendRespDTO smsSendRespDTO = client.sendSms(sendLogId, mobile, apiTemplateId, templateParams);
|
||||
// 打印结果
|
||||
|
|
Loading…
Reference in New Issue