diff --git a/framework/src/main/java/cn/lili/modules/im/entity/dto/ImQueryParams.java b/framework/src/main/java/cn/lili/modules/im/entity/dto/ImQueryParams.java new file mode 100644 index 00000000..8dc1f0fa --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/im/entity/dto/ImQueryParams.java @@ -0,0 +1,36 @@ +package cn.lili.modules.im.entity.dto; + +import cn.hutool.core.text.CharSequenceUtil; +import cn.lili.common.vo.PageVO; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author chc + * @since 2022/6/2114:46 + */ +@Data +@ApiModel +public class ImQueryParams extends PageVO { + + @ApiModelProperty("用户Id") + private String memberId; + + @ApiModelProperty("店铺Id") + private String storeId; + + public QueryWrapper queryWrapper() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (CharSequenceUtil.isNotEmpty(memberId)) { + queryWrapper.eq("member_id", memberId); + } + if (CharSequenceUtil.isNotEmpty(storeId)) { + queryWrapper.eq("store_id", storeId); + } + queryWrapper.eq("delete_flag",false); + queryWrapper.orderByDesc("create_time"); + return queryWrapper; + } +} diff --git a/framework/src/main/java/cn/lili/modules/im/entity/enums/MessageTypeEnum.java b/framework/src/main/java/cn/lili/modules/im/entity/enums/MessageTypeEnum.java index a966c242..6b06d3b7 100644 --- a/framework/src/main/java/cn/lili/modules/im/entity/enums/MessageTypeEnum.java +++ b/framework/src/main/java/cn/lili/modules/im/entity/enums/MessageTypeEnum.java @@ -18,5 +18,6 @@ public enum MessageTypeEnum { PICTURE, VOICE, GOODS, + ORDER, VIDEO } diff --git a/framework/src/main/java/cn/lili/modules/member/entity/dto/FootPrintQueryParams.java b/framework/src/main/java/cn/lili/modules/member/entity/dto/FootPrintQueryParams.java index 4c819e1b..d2a5ec50 100644 --- a/framework/src/main/java/cn/lili/modules/member/entity/dto/FootPrintQueryParams.java +++ b/framework/src/main/java/cn/lili/modules/member/entity/dto/FootPrintQueryParams.java @@ -30,7 +30,7 @@ public class FootPrintQueryParams extends PageVO { queryWrapper.eq("store_id", storeId); } queryWrapper.eq("delete_flag",false); - queryWrapper.orderByDesc("update_time"); + queryWrapper.orderByDesc("create_time"); return queryWrapper; } } diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java index 28367672..f0c92f6c 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java @@ -44,19 +44,17 @@ public class FootprintServiceImpl extends ServiceImpl oldPrints = list(queryWrapper); if (oldPrints != null && !oldPrints.isEmpty()) { FootPrint oldPrint = oldPrints.get(0); - oldPrint.setSkuId(footPrint.getSkuId()); - this.updateById(oldPrint); - return oldPrint; - } else { - footPrint.setCreateTime(new Date()); - this.save(footPrint); - //删除超过100条后的记录 - this.baseMapper.deleteLastFootPrint(footPrint.getMemberId()); - return footPrint; + this.removeById(oldPrint.getId()); } + footPrint.setCreateTime(new Date()); + this.save(footPrint); + //删除超过100条后的记录 + this.baseMapper.deleteLastFootPrint(footPrint.getMemberId()); + return footPrint; } @Override diff --git a/im-api/src/main/java/cn/lili/controller/goods/GoodsImController.java b/im-api/src/main/java/cn/lili/controller/goods/GoodsImController.java index c9223a41..4e5aa3c7 100644 --- a/im-api/src/main/java/cn/lili/controller/goods/GoodsImController.java +++ b/im-api/src/main/java/cn/lili/controller/goods/GoodsImController.java @@ -3,28 +3,19 @@ package cn.lili.controller.goods; import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultUtil; import cn.lili.common.exception.ServiceException; -import cn.lili.common.vo.PageVO; import cn.lili.common.vo.ResultMessage; -import cn.lili.modules.goods.entity.dos.Goods; -import cn.lili.modules.goods.entity.dto.GoodsSearchParams; -import cn.lili.modules.goods.entity.vos.GoodsVO; import cn.lili.modules.goods.service.GoodsService; import cn.lili.modules.goods.service.GoodsSkuService; -import cn.lili.modules.search.entity.dos.EsGoodsIndex; -import cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo; -import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO; import cn.lili.modules.search.service.EsGoodsSearchService; import cn.lili.modules.search.service.HotWordsService; import cn.lili.modules.statistics.aop.PageViewPoint; import cn.lili.modules.statistics.aop.enums.PageViewEnum; -import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.elasticsearch.core.SearchPage; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -35,13 +26,13 @@ import java.util.List; import java.util.Map; /** - * 买家端,商品接口 + * IM端,商品接口 * - * @author Chopper - * @since 2020/11/16 10:06 下午 + * @author chc + * @since 2022-12-28 18:30:33 */ @Slf4j -@Api(tags = "买家端,商品接口") +@Api(tags = "IM端,商品接口") @RestController @RequestMapping("/im/goods/goods") public class GoodsImController { diff --git a/im-api/src/main/java/cn/lili/controller/orders/ImOrderComtroller.java b/im-api/src/main/java/cn/lili/controller/orders/ImOrderComtroller.java new file mode 100644 index 00000000..4b057f6c --- /dev/null +++ b/im-api/src/main/java/cn/lili/controller/orders/ImOrderComtroller.java @@ -0,0 +1,42 @@ +package cn.lili.controller.orders; + +import cn.lili.common.enums.ResultUtil; +import cn.lili.common.vo.ResultMessage; +import cn.lili.modules.im.entity.dto.ImQueryParams; +import cn.lili.modules.member.entity.dto.FootPrintQueryParams; +import cn.lili.modules.order.order.entity.dos.Order; +import cn.lili.modules.order.order.entity.dto.OrderSearchParams; +import cn.lili.modules.order.order.entity.vo.OrderSimpleVO; +import cn.lili.modules.order.order.service.OrderService; +import cn.lili.modules.search.entity.dos.EsGoodsIndex; +import cn.lili.mybatis.util.PageUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * IM端,订单接口 + * + * @author chc + * @since 2022/6/2114:46 + */ +@Slf4j +@Api(tags = "IM端,订单接口") +@RestController +@RequestMapping("/im/orders/orders") +public class ImOrderComtroller { + + @Autowired + private OrderService orderService; + + @GetMapping("") + @ApiOperation(value = "获取会员订单列表") + public ResultMessage> getMemberHistory(OrderSearchParams params) { + return ResultUtil.data(orderService.queryByParams(params)); + } +} diff --git a/im-api/src/main/java/cn/lili/controller/im/SeatLogin.java b/im-api/src/main/java/cn/lili/controller/seat/SeatLogin.java similarity index 98% rename from im-api/src/main/java/cn/lili/controller/im/SeatLogin.java rename to im-api/src/main/java/cn/lili/controller/seat/SeatLogin.java index 685c546d..d6d59877 100644 --- a/im-api/src/main/java/cn/lili/controller/im/SeatLogin.java +++ b/im-api/src/main/java/cn/lili/controller/seat/SeatLogin.java @@ -1,4 +1,4 @@ -package cn.lili.controller.im; +package cn.lili.controller.seat; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; diff --git a/im-api/src/main/java/cn/lili/controller/im/SeatSettingStoreController.java b/im-api/src/main/java/cn/lili/controller/seat/SeatSettingStoreController.java similarity index 97% rename from im-api/src/main/java/cn/lili/controller/im/SeatSettingStoreController.java rename to im-api/src/main/java/cn/lili/controller/seat/SeatSettingStoreController.java index 48c99ed8..b5d6d69a 100644 --- a/im-api/src/main/java/cn/lili/controller/im/SeatSettingStoreController.java +++ b/im-api/src/main/java/cn/lili/controller/seat/SeatSettingStoreController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.im; +package cn.lili.controller.seat; import cn.lili.common.enums.ResultUtil; import cn.lili.common.security.context.UserContext; diff --git a/im-api/src/main/java/cn/lili/controller/im/SeatStoreController.java b/im-api/src/main/java/cn/lili/controller/seat/SeatStoreController.java similarity index 97% rename from im-api/src/main/java/cn/lili/controller/im/SeatStoreController.java rename to im-api/src/main/java/cn/lili/controller/seat/SeatStoreController.java index 9edd6857..e6b4552d 100644 --- a/im-api/src/main/java/cn/lili/controller/im/SeatStoreController.java +++ b/im-api/src/main/java/cn/lili/controller/seat/SeatStoreController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.im; +package cn.lili.controller.seat; import cn.lili.common.enums.ResultUtil; import cn.lili.common.security.context.UserContext; diff --git a/im-api/src/main/java/cn/lili/controller/im/SeatStoreManagerController.java b/im-api/src/main/java/cn/lili/controller/seat/SeatStoreManagerController.java similarity index 97% rename from im-api/src/main/java/cn/lili/controller/im/SeatStoreManagerController.java rename to im-api/src/main/java/cn/lili/controller/seat/SeatStoreManagerController.java index c729903b..40f46b08 100644 --- a/im-api/src/main/java/cn/lili/controller/im/SeatStoreManagerController.java +++ b/im-api/src/main/java/cn/lili/controller/seat/SeatStoreManagerController.java @@ -1,4 +1,4 @@ -package cn.lili.controller.im; +package cn.lili.controller.seat; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage;