fix: 修复查询系统日志报错问题,修复添加直播商品报错问题
This commit is contained in:
parent
a80b5ed961
commit
88db57c64b
@ -53,7 +53,7 @@ public interface StudioService extends IService<Studio> {
|
||||
* @param storeId 店铺ID
|
||||
* @return 操作结果
|
||||
*/
|
||||
Boolean push(Integer roomId,Integer goodsId, String storeId);
|
||||
Boolean push(Integer roomId,Integer liveGoodsId, String storeId, String goodsId);
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
|
@ -161,12 +161,12 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> 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<StudioCommodity>().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<StudioMapper, Studio> 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);
|
||||
|
@ -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 = "请求用户")
|
||||
|
@ -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<Studio> push(@PathVariable Integer roomId, @PathVariable Integer liveGoodsId) {
|
||||
public ResultMessage<Studio> 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user