Commit 7766da9f authored by shiyu's avatar shiyu

首页展示藏家逻辑修改,开放公域流量

parent a6a7bc7e
...@@ -3,6 +3,8 @@ package com.wwdz.ch.db.dao; ...@@ -3,6 +3,8 @@ package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.CollectorWhiteList; import com.wwdz.ch.db.domain.CollectorWhiteList;
import java.util.List;
public interface CollectorWhiteListDao { public interface CollectorWhiteListDao {
boolean isExisted(long collectorId); boolean isExisted(long collectorId);
...@@ -11,4 +13,6 @@ public interface CollectorWhiteListDao { ...@@ -11,4 +13,6 @@ public interface CollectorWhiteListDao {
CollectorWhiteList findById(long collectorId); CollectorWhiteList findById(long collectorId);
List<CollectorWhiteList> findShowList();
} }
...@@ -11,7 +11,7 @@ import lombok.Data; ...@@ -11,7 +11,7 @@ import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/07/22 * @date 2024/08/08
*/ */
@Data @Data
public class CollectorWhiteList implements Entity { public class CollectorWhiteList implements Entity {
...@@ -42,6 +42,11 @@ public class CollectorWhiteList implements Entity { ...@@ -42,6 +42,11 @@ public class CollectorWhiteList implements Entity {
*/ */
private Integer deliveryAuth; private Integer deliveryAuth;
/**
* 是有展示在首页
*/
private Boolean isShow;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Override @Override
...@@ -56,6 +61,7 @@ public class CollectorWhiteList implements Entity { ...@@ -56,6 +61,7 @@ public class CollectorWhiteList implements Entity {
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", isValid=").append(isValid); sb.append(", isValid=").append(isValid);
sb.append(", deliveryAuth=").append(deliveryAuth); sb.append(", deliveryAuth=").append(deliveryAuth);
sb.append(", isShow=").append(isShow);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
...@@ -78,7 +84,8 @@ public class CollectorWhiteList implements Entity { ...@@ -78,7 +84,8 @@ public class CollectorWhiteList implements Entity {
&& (this.getChannelCostRebate() == null ? other.getChannelCostRebate() == null : this.getChannelCostRebate().equals(other.getChannelCostRebate())) && (this.getChannelCostRebate() == null ? other.getChannelCostRebate() == null : this.getChannelCostRebate().equals(other.getChannelCostRebate()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid())) && (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()))
&& (this.getDeliveryAuth() == null ? other.getDeliveryAuth() == null : this.getDeliveryAuth().equals(other.getDeliveryAuth())); && (this.getDeliveryAuth() == null ? other.getDeliveryAuth() == null : this.getDeliveryAuth().equals(other.getDeliveryAuth()))
&& (this.getIsShow() == null ? other.getIsShow() == null : this.getIsShow().equals(other.getIsShow()));
} }
@Override @Override
...@@ -91,6 +98,7 @@ public class CollectorWhiteList implements Entity { ...@@ -91,6 +98,7 @@ public class CollectorWhiteList implements Entity {
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode()); result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
result = prime * result + ((getDeliveryAuth() == null) ? 0 : getDeliveryAuth().hashCode()); result = prime * result + ((getDeliveryAuth() == null) ? 0 : getDeliveryAuth().hashCode());
result = prime * result + ((getIsShow() == null) ? 0 : getIsShow().hashCode());
return result; return result;
} }
...@@ -107,7 +115,8 @@ public class CollectorWhiteList implements Entity { ...@@ -107,7 +115,8 @@ public class CollectorWhiteList implements Entity {
channelCostRebate("channel_cost_rebate", "channelCostRebate", "DECIMAL", false), channelCostRebate("channel_cost_rebate", "channelCostRebate", "DECIMAL", false),
createTime("create_time", "createTime", "TIMESTAMP", false), createTime("create_time", "createTime", "TIMESTAMP", false),
isValid("is_valid", "isValid", "BIT", false), isValid("is_valid", "isValid", "BIT", false),
deliveryAuth("delivery_auth", "deliveryAuth", "INTEGER", false); deliveryAuth("delivery_auth", "deliveryAuth", "INTEGER", false),
isShow("is_show", "isShow", "BIT", false);
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
......
...@@ -940,6 +940,138 @@ public class CollectorWhiteListExample { ...@@ -940,6 +940,138 @@ public class CollectorWhiteListExample {
addCriterion("delivery_auth not between", value1, value2, "deliveryAuth"); addCriterion("delivery_auth not between", value1, value2, "deliveryAuth");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIsShowIsNull() {
addCriterion("is_show is null");
return (Criteria) this;
}
public Criteria andIsShowIsNotNull() {
addCriterion("is_show is not null");
return (Criteria) this;
}
public Criteria andIsShowEqualTo(Boolean value) {
addCriterion("is_show =", value, "isShow");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsShowEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("is_show = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsShowNotEqualTo(Boolean value) {
addCriterion("is_show <>", value, "isShow");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsShowNotEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("is_show <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsShowGreaterThan(Boolean value) {
addCriterion("is_show >", value, "isShow");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsShowGreaterThanColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("is_show > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsShowGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_show >=", value, "isShow");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsShowGreaterThanOrEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("is_show >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsShowLessThan(Boolean value) {
addCriterion("is_show <", value, "isShow");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsShowLessThanColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("is_show < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsShowLessThanOrEqualTo(Boolean value) {
addCriterion("is_show <=", value, "isShow");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsShowLessThanOrEqualToColumn(CollectorWhiteList.Column column) {
addCriterion(new StringBuilder("is_show <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsShowIn(List<Boolean> values) {
addCriterion("is_show in", values, "isShow");
return (Criteria) this;
}
public Criteria andIsShowNotIn(List<Boolean> values) {
addCriterion("is_show not in", values, "isShow");
return (Criteria) this;
}
public Criteria andIsShowBetween(Boolean value1, Boolean value2) {
addCriterion("is_show between", value1, value2, "isShow");
return (Criteria) this;
}
public Criteria andIsShowNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_show not between", value1, value2, "isShow");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
...@@ -9,6 +9,7 @@ import org.springframework.stereotype.Repository; ...@@ -9,6 +9,7 @@ import org.springframework.stereotype.Repository;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
@Repository @Repository
public class CollectorWhiteListDaoImpl implements CollectorWhiteListDao { public class CollectorWhiteListDaoImpl implements CollectorWhiteListDao {
...@@ -48,4 +49,13 @@ public class CollectorWhiteListDaoImpl implements CollectorWhiteListDao { ...@@ -48,4 +49,13 @@ public class CollectorWhiteListDaoImpl implements CollectorWhiteListDao {
criteria.andIsValidEqualTo(true); criteria.andIsValidEqualTo(true);
return collectorWhiteListMapper.selectOneByExample(example); return collectorWhiteListMapper.selectOneByExample(example);
} }
@Override
public List<CollectorWhiteList> findShowList() {
CollectorWhiteListExample example = new CollectorWhiteListExample();
CollectorWhiteListExample.Criteria criteria = example.createCriteria();
criteria.andIsValidEqualTo(true);
criteria.andIsShowEqualTo(true);
return collectorWhiteListMapper.selectByExample(example);
}
} }
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="is_valid" jdbcType="BIT" property="isValid" /> <result column="is_valid" jdbcType="BIT" property="isValid" />
<result column="delivery_auth" jdbcType="INTEGER" property="deliveryAuth" /> <result column="delivery_auth" jdbcType="INTEGER" property="deliveryAuth" />
<result column="is_show" jdbcType="BIT" property="isShow" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -68,7 +69,7 @@ ...@@ -68,7 +69,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth, is_show
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultMap="BaseResultMap">
select select
...@@ -103,7 +104,8 @@ ...@@ -103,7 +104,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth, is_show
</otherwise> </otherwise>
</choose> </choose>
from collector_white_list from collector_white_list
...@@ -134,7 +136,8 @@ ...@@ -134,7 +136,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth, is_show
</otherwise> </otherwise>
</choose> </choose>
from collector_white_list from collector_white_list
...@@ -155,9 +158,11 @@ ...@@ -155,9 +158,11 @@
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into collector_white_list (collector_id, channel_cost_rebate, create_time, insert into collector_white_list (collector_id, channel_cost_rebate, create_time,
is_valid, delivery_auth) is_valid, delivery_auth, is_show
)
values (#{collectorId,jdbcType=BIGINT}, #{channelCostRebate,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, values (#{collectorId,jdbcType=BIGINT}, #{channelCostRebate,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP},
#{isValid,jdbcType=BIT}, #{deliveryAuth,jdbcType=INTEGER}) #{isValid,jdbcType=BIT}, #{deliveryAuth,jdbcType=INTEGER}, #{isShow,jdbcType=BIT}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.CollectorWhiteList"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.CollectorWhiteList">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
...@@ -180,6 +185,9 @@ ...@@ -180,6 +185,9 @@
<if test="deliveryAuth != null"> <if test="deliveryAuth != null">
delivery_auth, delivery_auth,
</if> </if>
<if test="isShow != null">
is_show,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="collectorId != null"> <if test="collectorId != null">
...@@ -197,6 +205,9 @@ ...@@ -197,6 +205,9 @@
<if test="deliveryAuth != null"> <if test="deliveryAuth != null">
#{deliveryAuth,jdbcType=INTEGER}, #{deliveryAuth,jdbcType=INTEGER},
</if> </if>
<if test="isShow != null">
#{isShow,jdbcType=BIT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultType="java.lang.Long">
...@@ -226,6 +237,9 @@ ...@@ -226,6 +237,9 @@
<if test="record.deliveryAuth != null"> <if test="record.deliveryAuth != null">
delivery_auth = #{record.deliveryAuth,jdbcType=INTEGER}, delivery_auth = #{record.deliveryAuth,jdbcType=INTEGER},
</if> </if>
<if test="record.isShow != null">
is_show = #{record.isShow,jdbcType=BIT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -238,7 +252,8 @@ ...@@ -238,7 +252,8 @@
channel_cost_rebate = #{record.channelCostRebate,jdbcType=DECIMAL}, channel_cost_rebate = #{record.channelCostRebate,jdbcType=DECIMAL},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
is_valid = #{record.isValid,jdbcType=BIT}, is_valid = #{record.isValid,jdbcType=BIT},
delivery_auth = #{record.deliveryAuth,jdbcType=INTEGER} delivery_auth = #{record.deliveryAuth,jdbcType=INTEGER},
is_show = #{record.isShow,jdbcType=BIT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -261,6 +276,9 @@ ...@@ -261,6 +276,9 @@
<if test="deliveryAuth != null"> <if test="deliveryAuth != null">
delivery_auth = #{deliveryAuth,jdbcType=INTEGER}, delivery_auth = #{deliveryAuth,jdbcType=INTEGER},
</if> </if>
<if test="isShow != null">
is_show = #{isShow,jdbcType=BIT},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
...@@ -270,7 +288,8 @@ ...@@ -270,7 +288,8 @@
channel_cost_rebate = #{channelCostRebate,jdbcType=DECIMAL}, channel_cost_rebate = #{channelCostRebate,jdbcType=DECIMAL},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
is_valid = #{isValid,jdbcType=BIT}, is_valid = #{isValid,jdbcType=BIT},
delivery_auth = #{deliveryAuth,jdbcType=INTEGER} delivery_auth = #{deliveryAuth,jdbcType=INTEGER},
is_show = #{isShow,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultMap="BaseResultMap"> <select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.CollectorWhiteListExample" resultMap="BaseResultMap">
...@@ -306,7 +325,8 @@ ...@@ -306,7 +325,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth id, collector_id, channel_cost_rebate, create_time, is_valid, delivery_auth, is_show
</otherwise> </otherwise>
</choose> </choose>
from collector_white_list from collector_white_list
......
...@@ -63,16 +63,16 @@ ...@@ -63,16 +63,16 @@
<!--生成Model类存放位置--> <!--生成Model类存放位置-->
<javaModelGenerator targetPackage="com.wwdz.ch.db.domain.distribution" targetProject="ch-dao/src/main/java"> <javaModelGenerator targetPackage="com.wwdz.ch.db.domain" targetProject="ch-dao/src/main/java">
<property name="enableSubPackages" value="true"/> <property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/> <property name="trimStrings" value="true"/>
</javaModelGenerator> </javaModelGenerator>
<sqlMapGenerator targetPackage="com.wwdz.ch.db.mapper.distribution" targetProject="ch-dao/src/main/resources"/> <sqlMapGenerator targetPackage="com.wwdz.ch.db.mapper" targetProject="ch-dao/src/main/resources"/>
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="user_bank_card" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="collector_white_list" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
...@@ -1105,29 +1105,26 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -1105,29 +1105,26 @@ public class SupplierItemServiceImpl implements SupplierItemService {
} }
} }
//用户默认展示系统账号发布的藏品和白名单中藏家的藏品 //用户默认展示系统账号发布的藏品和白名单中藏家的藏品
long sellerId = 291997;
SupplierItemRequestDto searchDto = new SupplierItemRequestDto(); SupplierItemRequestDto searchDto = new SupplierItemRequestDto();
//查询用户关注的人 //查询用户关注的人
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto(); FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFansId(userId); followFansRecordRequestDto.setFansId(userId);
List<FollowFansRecord> followFansRecordList = followFansRecordDao.findList(followFansRecordRequestDto); List<FollowFansRecord> followFansRecordList = followFansRecordDao.findList(followFansRecordRequestDto);
List<Long> followerIds = followFansRecordList.stream().map(FollowFansRecord::getFollowerId).collect(Collectors.toList()); List<Long> followerIds = followFansRecordList.stream().map(FollowFansRecord::getFollowerId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(followerIds)) {
followerIds.add(sellerId); //查询可展示在首页的藏家
//换藏系统账号 List<CollectorWhiteList> collectorWhiteListList = collectorWhiteListDao.findShowList();
followerIds.add(9357942L); for (CollectorWhiteList collectorWhiteList : collectorWhiteListList) {
followerIds.add(42273900L); followerIds.add(collectorWhiteList.getCollectorId());
followerIds.add(1000226L);
followerIds.add(577783L);
followerIds.add(290583L);
} }
List<Long> distinctCollectorIds = followerIds.stream().distinct().collect(Collectors.toList());
searchDto.setIsDeleted(false); searchDto.setIsDeleted(false);
if (dto.getType() == DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode()) { if (dto.getType() == DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode()) {
searchDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode(), DistributionEnum.DistributionTypeEnum.COLLECT.getCode())); searchDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode(), DistributionEnum.DistributionTypeEnum.COLLECT.getCode()));
} else { } else {
searchDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.AUCTION.getCode())); searchDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.AUCTION.getCode()));
} }
searchDto.setCreatorIdList(followerIds); searchDto.setCreatorIdList(distinctCollectorIds);
searchDto.setStock(0);//库存大于0 searchDto.setStock(0);//库存大于0
searchDto.setPage(dto.getPage()); searchDto.setPage(dto.getPage());
searchDto.setLimit(dto.getLimit()); searchDto.setLimit(dto.getLimit());
......
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