Commit 478d5dbd authored by shiyu's avatar shiyu

我推荐的列表个数展示

parent 2ce031c5
...@@ -28,6 +28,9 @@ public interface FollowFansRecordDao { ...@@ -28,6 +28,9 @@ public interface FollowFansRecordDao {
List<FollowFansRecord> findList(FollowFansRecordRequestDto dto); List<FollowFansRecord> findList(FollowFansRecordRequestDto dto);
List<FollowFansRecord> findListGroupByFollowerId(FollowFansRecordRequestDto dto);
FollowFansRecord findOne(FollowFansRecordRequestDto dto); FollowFansRecord findOne(FollowFansRecordRequestDto dto);
......
...@@ -56,6 +56,13 @@ public class FollowFansRecordDaoImpl implements FollowFansRecordDao { ...@@ -56,6 +56,13 @@ public class FollowFansRecordDaoImpl implements FollowFansRecordDao {
} }
@Override
public List<FollowFansRecord> findListGroupByFollowerId(FollowFansRecordRequestDto dto) {
int start = (dto.page -1) * dto.getLimit();
dto.setPage(start);
return followFansRecordMapper.findListGroupByFollowerId(dto);
}
@Override @Override
public FollowFansRecord findOne(FollowFansRecordRequestDto dto) { public FollowFansRecord findOne(FollowFansRecordRequestDto dto) {
FollowFansRecordExample example = new FollowFansRecordExample(); FollowFansRecordExample example = new FollowFansRecordExample();
......
...@@ -4,6 +4,7 @@ import com.wwdz.ch.db.domain.FollowFansRecord; ...@@ -4,6 +4,7 @@ import com.wwdz.ch.db.domain.FollowFansRecord;
import com.wwdz.ch.db.domain.FollowFansRecordExample; import com.wwdz.ch.db.domain.FollowFansRecordExample;
import java.util.List; import java.util.List;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -48,6 +49,9 @@ public interface FollowFansRecordMapper { ...@@ -48,6 +49,9 @@ public interface FollowFansRecordMapper {
List<FollowFansRecord> selectByExample(FollowFansRecordExample example); List<FollowFansRecord> selectByExample(FollowFansRecordExample example);
List<FollowFansRecord> findListGroupByFollowerId(@Param("dto") FollowFansRecordRequestDto dto);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record * This method corresponds to the database table follow_fans_record
......
...@@ -335,4 +335,11 @@ ...@@ -335,4 +335,11 @@
</if> </if>
limit 1 limit 1
</select> </select>
<select id="findListGroupByFollowerId" parameterType="map" resultMap="BaseResultMap">
select * from `follow_fans_record` where `introducer_id` = ${dto.introducerId} and state =1 group by follower_id limit ${dto.page}, ${dto.limit}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -47,9 +47,9 @@ public class WebMvcConfiguration implements WebMvcConfigurer { ...@@ -47,9 +47,9 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/supplierItem/findItemsOfCurrentDistributor", "/wx/selfPage/updateSwitch", "/wx/supplierItem/findHomePage" "/wx/supplierItem/findItemsOfCurrentDistributor", "/wx/selfPage/updateSwitch", "/wx/supplierItem/findHomePage"
//下列路径上线注释 //下列路径上线注释
, "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**", /*, "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**",
"/wx/shareRecord/**","/wx/collectionBook/**", "/wx/collectedRecord/**", "/wx/collectionItemsRelation/**","/wx/collectionShareRecord/**" "/wx/shareRecord/**","/wx/collectionBook/**", "/wx/collectedRecord/**", "/wx/collectionItemsRelation/**","/wx/collectionShareRecord/**"
,"/wx/logistics/**","/wx/follow/**" ,"/wx/logistics/**","/wx/follow/**"*/
......
...@@ -324,7 +324,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService { ...@@ -324,7 +324,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
} }
List<FollowFansRecordVo> followFansRecordVos = new ArrayList<>(); List<FollowFansRecordVo> followFansRecordVos = new ArrayList<>();
dto.setIntroducerId(dto.getSearchTargetId()); dto.setIntroducerId(dto.getSearchTargetId());
List<FollowFansRecord> followFansRecordList = followFansRecordDao.findList(dto); List<FollowFansRecord> followFansRecordList = followFansRecordDao.findListGroupByFollowerId(dto);
PageInfo<FollowFansRecord> pageInfo = new PageInfo<>(followFansRecordList); PageInfo<FollowFansRecord> pageInfo = new PageInfo<>(followFansRecordList);
List<FollowFansRecord> list = followFansRecordList.stream().filter(StringUtil.distinctByKey(FollowFansRecord::getFollowerId)).collect(Collectors.toList()); List<FollowFansRecord> list = followFansRecordList.stream().filter(StringUtil.distinctByKey(FollowFansRecord::getFollowerId)).collect(Collectors.toList());
list.forEach(f -> { list.forEach(f -> {
......
...@@ -633,7 +633,7 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -633,7 +633,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
collectionItemsRelationDao.delete(deleteDto); collectionItemsRelationDao.delete(deleteDto);
} }
}); });
} else if (StringUtils.isEmpty(dto.getCollectionBookId()) && !CollectionUtils.isEmpty(collectionBookIds)) { } else if (StringUtils.isEmpty(dto.getCollectionBookId())) {
//取消所有的标签关联 //取消所有的标签关联
collectionBookIds.forEach(id -> { collectionBookIds.forEach(id -> {
CollectionItemsRelationRequestDto deleteDto = new CollectionItemsRelationRequestDto(); CollectionItemsRelationRequestDto deleteDto = new CollectionItemsRelationRequestDto();
......
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