Commit f2fd04f7 by 田超

Merge branch 'feature/raysHomePageUpdate' into 'master'

feat: [none] 编辑端首页改版

See merge request rays/pcloud-book!1290
parents 14a18e0b 80237a75
......@@ -777,4 +777,10 @@ public interface BookBiz {
* * @param null
*/
PageBeanNew<BookDto> listAll4Adviser(BookSearchParamVO bookSearchParamVO);
/**
* 查询首页统计数据
*/
Map<String, Object> getRaysHomePageStatistics(Long adviserId);
}
......@@ -14,6 +14,7 @@ import com.pcloud.analysisengine.qrcode.dto.BookScanStatistics4OfficialAccountsD
import com.pcloud.analysisengine.qrcode.dto.BookScanStatistics4OfficialAccountsReqDTO;
import com.pcloud.analysisengine.qrcode.dto.BookTimeSourceDto;
import com.pcloud.analysisengine.qrcode.service.SceneRecordService;
import com.pcloud.appcenter.app.dto.AppCountDto;
import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.appcenter.assist.dto.AssistTempletDTO;
import com.pcloud.appcenter.base.dto.AppPriceCacheDTO;
......@@ -4238,4 +4239,21 @@ public class BookBizImpl implements BookBiz {
PageBeanNew<BookDto> page = new PageBeanNew<>(currentPage, numPerPage, (int) esPage.getTotalElements(), bookDtos);
return page;
}
@Override
public Map<String, Object> getRaysHomePageStatistics(Long adviserId){
Integer bookCount = bookDao.getBookCountByAdviserId(adviserId);
Map<Long, AppCountDto> appCountMap = appConsr.getCount4Adviser(CollUtil.toList(adviserId));
Integer appCount = 0;
if(CollUtil.isNotEmpty(appCountMap)){
AppCountDto appCountDto = appCountMap.get(adviserId);
if(appCountDto != null){
appCount = appCountDto.getCount();
}
}
return MapUtil.<String, Object>builder()
.put("bookCount", bookCount)
.put("appCount", appCount)
.build();
}
}
......@@ -380,4 +380,6 @@ public interface BookDao extends BaseDao<Book> {
Integer getBookMinimunSupportCount4Platform(Map<String, Object> paramMap);
Integer getFundBookCounts(List<Long> advisers,int month);
Integer getBookCountByAdviserId(Long adviserId);
}
......@@ -455,4 +455,9 @@ public class BookDaoImpl extends BaseDaoImpl<Book> implements BookDao {
paramMap.put("month", month);
return getSessionTemplate().selectOne(getStatement("getFundBookCounts"), paramMap);
}
@Override
public Integer getBookCountByAdviserId(Long adviserId) {
return getSessionTemplate().selectOne(getStatement("getBookCountByAdviserId"), adviserId);
}
}
......@@ -1359,4 +1359,12 @@ public class BookFacadeImpl implements BookFacade {
SessionUtil.getToken4Redis(token);
return new ResponseDto<>(bookBiz.listAll4Adviser(bookSearchParamVO));
}
@ApiOperation("获取RAYS首页书刊数量、应用数理")
@GetMapping("getRaysHomePageStatistics")
public ResponseDto<?> getRaysHomePageStatistics(@RequestHeader("token") String token) throws BizException, PermissionException {
SessionUtil.getToken4Redis(token);
Long adviserId = (Long) SessionUtil.getVlaue(token,SessionUtil.PARTY_ID);
return new ResponseDto<>(bookBiz.getRaysHomePageStatistics(adviserId));
}
}
package com.pcloud.book.consumer.app;
import cn.hutool.core.collection.CollUtil;
import com.pcloud.appcenter.app.dto.AppCountDto;
import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.appcenter.app.dto.AppIdTypeDTO;
import com.pcloud.appcenter.app.dto.AppRaysDTO;
......@@ -268,4 +269,14 @@ public class AppConsr {
return new ArrayList<>();
}
}
public Map<Long, AppCountDto> getCount4Adviser(List<Long> adviserIds) {
if (CollUtil.isEmpty(adviserIds)) return new HashMap<>();
try {
return ResponseHandleUtil.parseMapResponse(appService.getCount4Adviser(adviserIds), Long.class, AppCountDto.class);
} catch (Exception e) {
LOGGER.warn("根据ID获取应用数理失败!, adviserIds:{}", adviserIds, e);
return new HashMap<>();
}
}
}
......@@ -659,6 +659,13 @@
</if>
</select>
<select id="getBookCountByAdviserId" resultType="integer">
SELECT COUNT(1)
FROM
BOOK_ADVISER A
INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0
</select>
<!-- 获取未创建社群码的书刊列表 -->
<select id="listBook4CreateBookGroup" resultMap="bookMap" parameterType="map">
SELECT
......
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