Commit 38490458 by 田超

Merge branch 'fixbug/fixqrcode' into 'master'

bug: [none] fixqrcode

See merge request rays/pcloud-book!1154
parents 25f080bd 5d8a9354
......@@ -259,4 +259,16 @@ public class ChannelConsr {
}
return new ArrayList<>();
}
public Map<Long, QrcodeSceneDto> listQrcodeScene4Rights(List<Long> bookIds) {
if (CollectionUtils.isEmpty(bookIds)) {
return new HashMap<>();
}
try {
return ResponseHandleUtil.parseMap(qrcodeSceneService.listQrcodeScene4Rights(bookIds), Long.class, QrcodeSceneDto.class);
} catch (Exception e) {
LOGGER.error("批量获取二维码及其印码位置 失败:{} ", e.getMessage(), e);
}
return new HashMap<>();
}
}
......@@ -5481,9 +5481,9 @@ public class BookGroupBizImpl implements BookGroupBiz {
Map<String, Object> map = new HashMap<>();
//是否小睿,小睿权益id
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOByBookId(bookId, channelId, adviserId);
Boolean isXIAORUI = false;
if (null != bookGroupDTO && JoinGroupTypeEnum.XIAORUI.getCode().equals(bookGroupDTO.getJoinGroupType())) {
isXIAORUI = true;
Integer isXIAORUI = bookAdviserDao.getIsRui(adviserId, bookId, channelId);
map.put("isXIAORUI", YesOrNoEnums.YES.getValue().equals(isXIAORUI) ? Boolean.TRUE : Boolean.FALSE);
if (YesOrNoEnums.YES.getValue().equals(isXIAORUI)) {
RightsSettingDto rightsSettingDto = rightsSettingBiz.getRightsSettingByBookId4AppletHome(bookId, adviserId, channelId);
if (null != rightsSettingDto) {
map.put("rightsSettingId", rightsSettingDto.getId());
......@@ -5511,7 +5511,6 @@ public class BookGroupBizImpl implements BookGroupBiz {
map.put("coverImg", bookDto.getCoverImg());
map.put("publish", bookDto.getPublish());
}
map.put("isXIAORUI", isXIAORUI);
map.put("isLibraryBook", bookBiz.checkIsLibraryBook(adviserId, bookId) ? 1 : 0);
if (Objects.isNull(map.get("rightsSettingId"))) {
map.put("rightsSettingId", bookBiz.getDefaultRightsSettingId());
......
......@@ -40,6 +40,7 @@ import com.pcloud.book.consumer.erp.ErpConsr;
import com.pcloud.book.consumer.reader.ReaderConsr;
import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.consumer.user.PartyConsr;
import com.pcloud.book.cultivate.enums.ReadTypeEnum;
import com.pcloud.book.custom.biz.CustomPlanBiz;
......@@ -245,6 +246,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
private LabelService labelService;
@Autowired
private PartyConsr partyConsr;
@Autowired
private ChannelConsr channelConsr;
@Override
@ParamLog("新增权益设置")
......@@ -1944,7 +1947,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
//填充编辑名称
fillAdviserName(rightsSettingDtoPageBeanNew.getRecordList());
fillPartyName(rightsSettingDtoPageBeanNew.getRecordList());
fillLabelNames4DTO(rightsSettingDtoPageBeanNew.getRecordList());
fillBookGroupUrl(rightsSettingDtoPageBeanNew.getRecordList());
} else {
paramMap.put("firstClassify", rightsSetting.getFirstClassify());
paramMap.put("secondClassify", rightsSetting.getSecondClassify());
......@@ -1965,6 +1968,39 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
return rightsSettingDtoPageBeanNew;
}
private void fillBookGroupUrl(List<RightsSettingDto> recordList) {
if (ListUtils.isEmpty(recordList) ) {
return;
}
List<Long> bookIds = new ArrayList<>();
recordList.stream().forEach(rightsSettingDto -> {
List<RightsSettingBookRelation> rightsSettingBookRelations = rightsSettingDto.getRightsSettingBookRelations();
if (ListUtils.isEmpty(rightsSettingBookRelations)) {
return;
}
rightsSettingBookRelations.stream().forEach(rightsSettingBookRelation -> bookIds.add(rightsSettingBookRelation.getBookId()));
});
if (ListUtils.isEmpty(bookIds)) {
return;
}
Map<Long, QrcodeSceneDto> qrcodeSceneDtoMap = channelConsr.listQrcodeScene4Rights(bookIds);
if (MapUtils.isEmpty(qrcodeSceneDtoMap)) {
return;
}
recordList.forEach(rightsSettingDto -> {
List<RightsSettingBookRelation> rightsSettingBookRelations = rightsSettingDto.getRightsSettingBookRelations();
if (ListUtils.isEmpty(rightsSettingBookRelations)) {
return;
}
rightsSettingBookRelations.stream().forEach(rightsSettingBookRelation -> {
if (null == rightsSettingBookRelation.getGroupQrcodeUrl() && null != qrcodeSceneDtoMap.get(rightsSettingBookRelation.getBookId())) {
rightsSettingBookRelation.setGroupQrcodeUrl(qrcodeSceneDtoMap.get(rightsSettingBookRelation.getBookId()).getQrcodeUrl());
}
});
});
}
private void fillLabelNames4DTO(List<RightsSettingDto> rightsSettingList) {
if (ListUtils.isEmpty(rightsSettingList)) {
return;
......
......@@ -835,6 +835,10 @@
a.CHANNEL_ID = #{channelId}
AND
a.ADVISER_ID = #{adviserId}
and
a.is_delete =0
and
b.is_delete = 0
limit 1
</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