Commit 9ccc4133 authored by wp's avatar wp

一幕管理后台新增预热功能

parent 4a57d9fd
...@@ -107,7 +107,7 @@ public class GoodsListController { ...@@ -107,7 +107,7 @@ public class GoodsListController {
return resFac.getResponse(MallResponseError.NO_AUTH_ERROR); return resFac.getResponse(MallResponseError.NO_AUTH_ERROR);
} }
} }
spuService.offGoods(goodsId, type); spuService.offGoods(goodsId, type ,onOffDTO.getPreheatEndTime());
return resFac.getSimpleSuccessResponse(); return resFac.getSimpleSuccessResponse();
} }
......
...@@ -201,7 +201,7 @@ public class SpuController { ...@@ -201,7 +201,7 @@ public class SpuController {
return resFac.getResponse(MallResponseError.NO_AUTH_ERROR); return resFac.getResponse(MallResponseError.NO_AUTH_ERROR);
} }
} }
spuService.offGoods(goodsId, type); spuService.offGoods(goodsId, type,onOffDTO.getPreheatEndTime());
return resFac.getSimpleSuccessResponse(); return resFac.getSimpleSuccessResponse();
} }
......
...@@ -24,8 +24,12 @@ public class OnOffDTO { ...@@ -24,8 +24,12 @@ public class OnOffDTO {
@NotBlank(message = MallResponseError.NULL_PARAM_ERROR) @NotBlank(message = MallResponseError.NULL_PARAM_ERROR)
private String goodsId; private String goodsId;
@ApiModelProperty("上下架参数") @ApiModelProperty("上下架参数(1.上架 2.下架 10.预热)")
@CustomType(pType = MALLGlobalConfig.ON_OFF, message = MallResponseError.PARAM_ERROR) // @CustomType(pType = MALLGlobalConfig.ON_OFF, message = MallResponseError.PARAM_ERROR)
@NotNull(message = MallResponseError.NULL_PARAM_ERROR) @NotNull(message = MallResponseError.NULL_PARAM_ERROR)
private Integer type; private Integer type;
@ApiModelProperty("开售时间")
// @CustomType(pType = MALLGlobalConfig.ON_OFF, message = MallResponseError.PARAM_ERROR)
private Long preheatEndTime;
} }
...@@ -181,4 +181,8 @@ public class Spu implements Serializable { ...@@ -181,4 +181,8 @@ public class Spu implements Serializable {
@ApiModelProperty(value = "盲盒规则") @ApiModelProperty(value = "盲盒规则")
private String blindBoxRule; private String blindBoxRule;
@ApiModelProperty(value = "预热结束时间")
private Long preheatEndTime;
} }
...@@ -104,7 +104,7 @@ public interface ISpuService extends IService<Spu> { ...@@ -104,7 +104,7 @@ public interface ISpuService extends IService<Spu> {
* @param goodsId 商品id * @param goodsId 商品id
* @param type 上下架类型 * @param type 上下架类型
*/ */
void offGoods(String goodsId, Integer type); void offGoods(String goodsId, Integer type, Long preheatEndTime);
/** /**
* 批量删除商品 * 批量删除商品
......
...@@ -397,7 +397,7 @@ public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu> implements ISpuS ...@@ -397,7 +397,7 @@ public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu> implements ISpuS
} }
@Override @Override
public void offGoods(String goodsId, Integer type) { public void offGoods(String goodsId, Integer type, Long preheatEndTime) {
if (getByGoodsId(goodsId).getType().equals(AUCTION.getType())) { if (getByGoodsId(goodsId).getType().equals(AUCTION.getType())) {
QueryWrapper<Auction> qw = new QueryWrapper<>(); QueryWrapper<Auction> qw = new QueryWrapper<>();
qw.lambda().eq(Auction::getGoodsId, goodsId); qw.lambda().eq(Auction::getGoodsId, goodsId);
...@@ -423,6 +423,9 @@ public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu> implements ISpuS ...@@ -423,6 +423,9 @@ public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu> implements ISpuS
ExternalToken externalToken = externalTokenService.getOne(qw2); ExternalToken externalToken = externalTokenService.getOne(qw2);
spu.setHash(externalToken.getHash()); spu.setHash(externalToken.getHash());
} }
if (preheatEndTime != null) {
spu.setPreheatEndTime(preheatEndTime);
}
spu.setStatus(type); spu.setStatus(type);
updateById(spu); updateById(spu);
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
<result column="difficulty" property="difficulty"/> <result column="difficulty" property="difficulty"/>
<result column="blind_box_price" property="blindBoxPrice"/> <result column="blind_box_price" property="blindBoxPrice"/>
<result column="blind_box_rule" property="blindBoxRule"/> <result column="blind_box_rule" property="blindBoxRule"/>
<result column="preheat_end_time" property="preheatEndTime"/>
</resultMap> </resultMap>
<select id="page" resultType="com.fzm.mall.server.admin.goods_center.entity.vo.GoodsSpuVO"> <select id="page" resultType="com.fzm.mall.server.admin.goods_center.entity.vo.GoodsSpuVO">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment