【功能完善】商城: 客服

This commit is contained in:
puhui999 2024-11-10 18:01:58 +08:00
parent 6695aeeb8f
commit 43cb8b1f21
5 changed files with 19 additions and 7 deletions

View File

@ -51,7 +51,8 @@ public class ProductBrowseHistoryController {
convertSet(pageResult.getList(), ProductBrowseHistoryDO::getSpuId));
return success(BeanUtils.toBean(pageResult, ProductBrowseHistoryRespVO.class,
vo -> Optional.ofNullable(spuMap.get(vo.getSpuId()))
.ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice()))));
.ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice())
.setSalesCount(spu.getSalesCount()).setStock(spu.getStock()))));
}
}

View File

@ -1,12 +1,9 @@
package cn.iocoder.yudao.module.product.controller.admin.history.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
@Schema(description = "管理后台 - 商品浏览记录 Response VO")
@ -31,4 +28,10 @@ public class ProductBrowseHistoryRespVO {
@Schema(description = "商品单价", example = "100")
private Integer price;
@Schema(description = "商品销量", example = "100")
private Integer salesCount;
@Schema(description = "库存", example = "100")
private Integer stock;
}

View File

@ -71,7 +71,8 @@ public class AppProductBrowseHistoryController {
Map<Long, ProductSpuDO> spuMap = convertMap(productSpuService.getSpuList(spuIds), ProductSpuDO::getId);
return success(BeanUtils.toBean(pageResult, AppProductBrowseHistoryRespVO.class,
vo -> Optional.ofNullable(spuMap.get(vo.getSpuId()))
.ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice()))));
.ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice())
.setSalesCount(spu.getSalesCount()).setStock(spu.getStock()))));
}
}

View File

@ -26,4 +26,11 @@ public class AppProductBrowseHistoryRespVO {
@Schema(description = "商品单价", example = "100")
private Integer price;
@Schema(description = "商品销量", example = "100")
private Integer salesCount;
@Schema(description = "库存", example = "100")
private Integer stock;
}

View File

@ -112,9 +112,9 @@ public class KeFuMessageServiceImpl implements KeFuMessageService {
// 2.3 发送消息通知会员管理员已读 -> 会员更新发送的消息状态
KeFuMessageDO keFuMessage = getFirst(filterList(messageList, message -> UserTypeEnum.MEMBER.getValue().equals(message.getSenderType())));
assert keFuMessage != null; // 断言避免警告
getSelf().sendAsyncMessageToMember(keFuMessage.getSenderId(), KEFU_MESSAGE_ADMIN_READ, conversation);
getSelf().sendAsyncMessageToMember(keFuMessage.getSenderId(), KEFU_MESSAGE_ADMIN_READ, conversation.getId());
// 2.4 通知所有管理员消息已读
getSelf().sendAsyncMessageToAdmin(KEFU_MESSAGE_ADMIN_READ, conversation);
getSelf().sendAsyncMessageToAdmin(KEFU_MESSAGE_ADMIN_READ, conversation.getId());
}
private void validateReceiverExist(Long receiverId, Integer receiverType) {