Commit cc8c8199 authored by wulixian's avatar wulixian

Merge branch 'test' into 'master'

楼层商品添加预热 See merge request !29
parents e93d4b9b ce71993a
...@@ -273,6 +273,30 @@ public class NftEvm { ...@@ -273,6 +273,30 @@ public class NftEvm {
// System.err.println(); // System.err.println();
// System.err.println(ra.walletUnlock("ymc12345")); // System.err.println(ra.walletUnlock("ymc12345"));
/*JSONObject userDetail = new JSONObject();
userDetail.put("user_name", merchant.getApplyName());
userDetail.put("user_icon", "");
userDetail.put("phone", merchant.getApplyPhone());
userDetail.put("email", merchant.getLinkMail());
userDetail.put("auth_type", 1);
JSONObject personalAuth = new JSONObject();
personalAuth.put("real_name", merchant.getShortName());
JSONObject enterpriseAuth = new JSONObject();
enterpriseAuth.put("enterprise_name", "复杂美");
JSONObject json = new JSONObject();
json.put("op", "set");
json.put("organization", "system");
json.put("role", "member");
json.put("address", merchant.getTokenIssueAddr());
json.put("organization_note", "");
json.put("address_note", "");
json.put("user_detail", userDetail);
json.put("personal_auth", personalAuth);
json.put("enterprise_auth", enterpriseAuth);
String processGeneralTran = chainUtilFactory.processGeneralTran(json);*/
} }
} }
...@@ -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();
} }
......
...@@ -55,4 +55,7 @@ public class ExternalTokenDTO implements Serializable { ...@@ -55,4 +55,7 @@ public class ExternalTokenDTO implements Serializable {
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private Long updateTime; private Long updateTime;
@ApiModelProperty(value = "溯源hash")
private String hash;
} }
...@@ -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;
} }
...@@ -49,4 +49,5 @@ public class GoodsSpuVO { ...@@ -49,4 +49,5 @@ public class GoodsSpuVO {
@TableField(exist = false) @TableField(exist = false)
private String tokenIdStr; private String tokenIdStr;
private Long preheatEndTime;
} }
...@@ -86,6 +86,6 @@ public class ExternalToken implements Serializable { ...@@ -86,6 +86,6 @@ public class ExternalToken implements Serializable {
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Long updateTime; private Long updateTime;
@ApiModelProperty(value = "商户id") @ApiModelProperty(value = "溯源hash")
private String hash; private String hash;
} }
...@@ -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,13 +33,14 @@ ...@@ -33,13 +33,14 @@
<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">
SELECT SELECT
G.goods_id,G.name,G.thumb,G.status,G.max_price,G.default_price, G.goods_id,G.name,G.thumb,G.status,G.max_price,G.default_price,
M.enterprise_name,M.apply_name AS linkName,M.apply_phone AS linkPhone,G.check_fail_reason,G.type, M.enterprise_name,M.apply_name AS linkName,M.apply_phone AS linkPhone,G.check_fail_reason,G.type,
G.create_time,G.commodity_pass G.create_time,G.commodity_pass, G.preheat_end_time
FROM FROM
goods_spu G goods_spu G
LEFT JOIN LEFT JOIN
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
s.name, s.description, s.thumb s.name, s.description, s.thumb
from opration_floor_goods f from opration_floor_goods f
left join goods_spu s on f.goods_id = s.goods_id left join goods_spu s on f.goods_id = s.goods_id
where f.operation_floor_id = #{operationFloorId} and f.status = false and s.status = 1 where f.operation_floor_id = #{operationFloorId} and f.status = false and s.status in (1, 10)
order by f.display_order asc, f.update_time desc order by f.display_order asc, f.update_time desc
</select> </select>
</mapper> </mapper>
...@@ -17,8 +17,8 @@ import java.util.List; ...@@ -17,8 +17,8 @@ import java.util.List;
* @since 2021-04-02 * @since 2021-04-02
*/ */
public interface OprationFloorGoodsMapper extends BaseMapper<OprationFloorGoods> { public interface OprationFloorGoodsMapper extends BaseMapper<OprationFloorGoods> {
@Select("select * from goods_spu a left join opration_floor_goods b on a.goods_id = b.goods_id where b.operation_floor_id = #{operationFloorId} and a.status = 1 and b.status = 0 order by display_order asc limit ${start},${end}") @Select("select * from goods_spu a left join opration_floor_goods b on a.goods_id = b.goods_id where b.operation_floor_id = #{operationFloorId} and a.status in (1, 10) and b.status = 0 order by display_order asc limit ${start},${end}")
List<SaleHotVo> getList(@Param("operationFloorId") String operationFloorId, @Param("start") int start, @Param("end")int end); List<SaleHotVo> getList(@Param("operationFloorId") String operationFloorId, @Param("start") int start, @Param("end")int end);
@Select("select count(*) from goods_spu a left join opration_floor_goods b on a.goods_id = b.goods_id where b.operation_floor_id = #{operationFloorId} and a.status = 1 and b.status = 0") @Select("select count(*) from goods_spu a left join opration_floor_goods b on a.goods_id = b.goods_id where b.operation_floor_id = #{operationFloorId} and a.status in (1, 10) and b.status = 0")
Integer getCount(@Param("operationFloorId") String operationFloorId); Integer getCount(@Param("operationFloorId") String operationFloorId);
} }
...@@ -82,4 +82,10 @@ public class GoodsVo { ...@@ -82,4 +82,10 @@ public class GoodsVo {
@ApiModelProperty(value = "盲盒规则") @ApiModelProperty(value = "盲盒规则")
private String blindBoxRule; private String blindBoxRule;
@ApiModelProperty(value = "预热开始时间")
private Long preheatStartTime;
@ApiModelProperty(value = "预热结束时间")
private Long preheatEndTime;
} }
...@@ -42,4 +42,10 @@ public class SaleHotVo { ...@@ -42,4 +42,10 @@ public class SaleHotVo {
@ApiModelProperty(value = "(销售方式)1.普通 4.盲盒") @ApiModelProperty(value = "(销售方式)1.普通 4.盲盒")
private Integer salesType; private Integer salesType;
@ApiModelProperty(value = "预热开始时间")
private Long preheatStartTime;
@ApiModelProperty(value = "预热结束时间")
private Long preheatEndTime;
} }
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<select id="getByCategoryId" resultType="com.fzm.mall.server.front.goods.model.vo.GoodsVo"> <select id="getByCategoryId" resultType="com.fzm.mall.server.front.goods.model.vo.GoodsVo">
select a.*,c.shop_name as merchantName,c.* from goods_spu a left join goods_count b on a.goods_id = b.goods_id left join shop c on a.merchant_id = c.merchant_id select a.*,c.shop_name as merchantName,c.* from goods_spu a left join goods_count b on a.goods_id = b.goods_id left join shop c on a.merchant_id = c.merchant_id
left join goods_category_spu d on d.goods_id = a.goods_id where d.category_id = #{categoryId} and a.status = 1 order by a.default_price ${price},b.sales ${sale},a.create_time desc limit ${start},${end}; left join goods_category_spu d on d.goods_id = a.goods_id where d.category_id = #{categoryId} and a.status in (1,10) order by a.default_price ${price},b.sales ${sale},a.create_time desc limit ${start},${end};
</select> </select>
<select id="getSearch" resultType="com.fzm.mall.server.front.goods.model.vo.GoodsVo"> <select id="getSearch" resultType="com.fzm.mall.server.front.goods.model.vo.GoodsVo">
select a.*,c.shop_name as merchantName,c.* from goods_spu a left join goods_count b on a.goods_id = b.goods_id left join shop c on a.merchant_id = c.merchant_id select a.*,c.shop_name as merchantName,c.* from goods_spu a left join goods_count b on a.goods_id = b.goods_id left join shop c on a.merchant_id = c.merchant_id
where a.name like #{searchKey} and a.status = 1 order by a.default_price ${price},b.sales ${sale},a.create_time desc limit ${start},${end}; where a.name like #{searchKey} and a.status in (1,10) order by a.default_price ${price},b.sales ${sale},a.create_time desc limit ${start},${end};
</select> </select>
<select id="getByGoodsId" resultType="com.fzm.mall.server.front.goods.model.vo.GoodsVo"> <select id="getByGoodsId" resultType="com.fzm.mall.server.front.goods.model.vo.GoodsVo">
select a.*,c.shop_name as merchantName,c.* from goods_spu a left join goods_count b on a.goods_id = b.goods_id left join shop c on a.merchant_id = c.merchant_id select a.*,c.shop_name as merchantName,c.* from goods_spu a left join goods_count b on a.goods_id = b.goods_id left join shop c on a.merchant_id = c.merchant_id
where a.goods_id = #{goodsId} and a.status = 1; where a.goods_id = #{goodsId} and a.status in (1, 10);
</select> </select>
<select id="getByCategoryIdCount" resultType="integer"> <select id="getByCategoryIdCount" resultType="integer">
...@@ -23,6 +23,6 @@ ...@@ -23,6 +23,6 @@
left join goods_count b on a.goods_id = b.goods_id left join goods_count b on a.goods_id = b.goods_id
left join merchant c on a.merchant_id = c.merchant_id left join merchant c on a.merchant_id = c.merchant_id
left join goods_category_spu d on d.goods_id = a.goods_id left join goods_category_spu d on d.goods_id = a.goods_id
where d.category_id = #{categoryId} and a.status = 1 where d.category_id = #{categoryId} and a.status in (1, 10)
</select> </select>
</mapper> </mapper>
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