From 88db57c64bd3884ce706e5c06871b1cca2e6884a Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 20 Sep 2022 19:06:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=97=A5=E5=BF=97=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E5=95=86=E5=93=81=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/goods/service/StudioService.java | 2 +- .../lili/modules/goods/serviceimpl/StudioServiceImpl.java | 8 ++++---- .../cn/lili/modules/permission/entity/vo/SystemLogVO.java | 3 +-- .../controller/other/broadcast/StudioStoreController.java | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/service/StudioService.java b/framework/src/main/java/cn/lili/modules/goods/service/StudioService.java index 906c3696..2d783800 100644 --- a/framework/src/main/java/cn/lili/modules/goods/service/StudioService.java +++ b/framework/src/main/java/cn/lili/modules/goods/service/StudioService.java @@ -53,7 +53,7 @@ public interface StudioService extends IService { * @param storeId 店铺ID * @return 操作结果 */ - Boolean push(Integer roomId,Integer goodsId, String storeId); + Boolean push(Integer roomId,Integer liveGoodsId, String storeId, String goodsId); /** * 删除商品 diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StudioServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StudioServiceImpl.java index 3e4aff1c..540a1f11 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StudioServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StudioServiceImpl.java @@ -161,12 +161,12 @@ public class StudioServiceImpl extends ServiceImpl impleme @Override @Transactional(rollbackFor = Exception.class) - public Boolean push(Integer roomId, Integer goodsId, String storeId) { + public Boolean push(Integer roomId, Integer liveGoodsId, String storeId, String goodsId) { //判断直播间是否已添加商品 if (studioCommodityService.getOne( new LambdaQueryWrapper().eq(StudioCommodity::getRoomId, roomId) - .eq(StudioCommodity::getGoodsId, goodsId)) != null) { + .eq(StudioCommodity::getGoodsId, liveGoodsId)) != null) { throw new ServiceException(ResultCode.STODIO_GOODS_EXIST_ERROR); } @@ -176,8 +176,8 @@ public class StudioServiceImpl extends ServiceImpl impleme } //调用微信接口添加直播间商品并进行记录 - if (Boolean.TRUE.equals(wechatLivePlayerUtil.pushGoods(roomId, goodsId))) { - studioCommodityService.save(new StudioCommodity(roomId, goodsId)); + if (Boolean.TRUE.equals(wechatLivePlayerUtil.pushGoods(roomId, liveGoodsId))) { + studioCommodityService.save(new StudioCommodity(roomId, liveGoodsId)); //添加直播间商品数量 Studio studio = this.getByRoomId(roomId); studio.setRoomGoodsNum(studio.getRoomGoodsNum() != null ? studio.getRoomGoodsNum() + 1 : 1); diff --git a/framework/src/main/java/cn/lili/modules/permission/entity/vo/SystemLogVO.java b/framework/src/main/java/cn/lili/modules/permission/entity/vo/SystemLogVO.java index b3a9ec9c..6c5a813e 100644 --- a/framework/src/main/java/cn/lili/modules/permission/entity/vo/SystemLogVO.java +++ b/framework/src/main/java/cn/lili/modules/permission/entity/vo/SystemLogVO.java @@ -9,7 +9,6 @@ import lombok.NoArgsConstructor; import lombok.ToString; import lombok.experimental.Accessors; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.annotations.DateFormat; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; @@ -42,7 +41,7 @@ public class SystemLogVO implements Serializable { @ApiModelProperty(value = "日志记录时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - @Field(type = FieldType.Date, format = DateFormat.basic_date_time, fielddata = true) + @Field(type = FieldType.Date, fielddata = true) private Date createTime = new Date(); @ApiModelProperty(value = "请求用户") diff --git a/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java index efe697e3..44d90022 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/broadcast/StudioStoreController.java @@ -74,9 +74,9 @@ public class StudioStoreController { @ApiImplicitParam(name = "liveGoodsId", value = "直播商品ID", required = true, dataType = "Integer", paramType = "path") }) @PutMapping(value = "/push/{roomId}/{liveGoodsId}") - public ResultMessage push(@PathVariable Integer roomId, @PathVariable Integer liveGoodsId) { + public ResultMessage push(@PathVariable Integer roomId, @PathVariable Integer liveGoodsId, @RequestParam String goodsId) { String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); - if (Boolean.TRUE.equals(studioService.push(roomId, liveGoodsId, storeId))) { + if (Boolean.TRUE.equals(studioService.push(roomId, liveGoodsId, storeId, goodsId))) { return ResultUtil.success(ResultCode.SUCCESS); } throw new ServiceException(ResultCode.ERROR);