Commit 5d8a9354 by 吴博

bug: [none] fixqrcode

parent 25f080bd
...@@ -259,4 +259,16 @@ public class ChannelConsr { ...@@ -259,4 +259,16 @@ public class ChannelConsr {
} }
return new ArrayList<>(); 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 { ...@@ -5481,9 +5481,9 @@ public class BookGroupBizImpl implements BookGroupBiz {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
//是否小睿,小睿权益id //是否小睿,小睿权益id
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOByBookId(bookId, channelId, adviserId); BookGroupDTO bookGroupDTO = bookGroupDao.getDTOByBookId(bookId, channelId, adviserId);
Boolean isXIAORUI = false; Integer isXIAORUI = bookAdviserDao.getIsRui(adviserId, bookId, channelId);
if (null != bookGroupDTO && JoinGroupTypeEnum.XIAORUI.getCode().equals(bookGroupDTO.getJoinGroupType())) { map.put("isXIAORUI", YesOrNoEnums.YES.getValue().equals(isXIAORUI) ? Boolean.TRUE : Boolean.FALSE);
isXIAORUI = true; if (YesOrNoEnums.YES.getValue().equals(isXIAORUI)) {
RightsSettingDto rightsSettingDto = rightsSettingBiz.getRightsSettingByBookId4AppletHome(bookId, adviserId, channelId); RightsSettingDto rightsSettingDto = rightsSettingBiz.getRightsSettingByBookId4AppletHome(bookId, adviserId, channelId);
if (null != rightsSettingDto) { if (null != rightsSettingDto) {
map.put("rightsSettingId", rightsSettingDto.getId()); map.put("rightsSettingId", rightsSettingDto.getId());
...@@ -5511,7 +5511,6 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -5511,7 +5511,6 @@ public class BookGroupBizImpl implements BookGroupBiz {
map.put("coverImg", bookDto.getCoverImg()); map.put("coverImg", bookDto.getCoverImg());
map.put("publish", bookDto.getPublish()); map.put("publish", bookDto.getPublish());
} }
map.put("isXIAORUI", isXIAORUI);
map.put("isLibraryBook", bookBiz.checkIsLibraryBook(adviserId, bookId) ? 1 : 0); map.put("isLibraryBook", bookBiz.checkIsLibraryBook(adviserId, bookId) ? 1 : 0);
if (Objects.isNull(map.get("rightsSettingId"))) { if (Objects.isNull(map.get("rightsSettingId"))) {
map.put("rightsSettingId", bookBiz.getDefaultRightsSettingId()); map.put("rightsSettingId", bookBiz.getDefaultRightsSettingId());
......
...@@ -40,6 +40,7 @@ import com.pcloud.book.consumer.erp.ErpConsr; ...@@ -40,6 +40,7 @@ import com.pcloud.book.consumer.erp.ErpConsr;
import com.pcloud.book.consumer.reader.ReaderConsr; import com.pcloud.book.consumer.reader.ReaderConsr;
import com.pcloud.book.consumer.resource.ProductConsr; import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.consumer.user.AdviserConsr; 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.consumer.user.PartyConsr;
import com.pcloud.book.cultivate.enums.ReadTypeEnum; import com.pcloud.book.cultivate.enums.ReadTypeEnum;
import com.pcloud.book.custom.biz.CustomPlanBiz; import com.pcloud.book.custom.biz.CustomPlanBiz;
...@@ -245,6 +246,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -245,6 +246,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
private LabelService labelService; private LabelService labelService;
@Autowired @Autowired
private PartyConsr partyConsr; private PartyConsr partyConsr;
@Autowired
private ChannelConsr channelConsr;
@Override @Override
@ParamLog("新增权益设置") @ParamLog("新增权益设置")
...@@ -1944,7 +1947,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1944,7 +1947,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
//填充编辑名称 //填充编辑名称
fillAdviserName(rightsSettingDtoPageBeanNew.getRecordList()); fillAdviserName(rightsSettingDtoPageBeanNew.getRecordList());
fillPartyName(rightsSettingDtoPageBeanNew.getRecordList()); fillPartyName(rightsSettingDtoPageBeanNew.getRecordList());
fillLabelNames4DTO(rightsSettingDtoPageBeanNew.getRecordList()); fillBookGroupUrl(rightsSettingDtoPageBeanNew.getRecordList());
} else { } else {
paramMap.put("firstClassify", rightsSetting.getFirstClassify()); paramMap.put("firstClassify", rightsSetting.getFirstClassify());
paramMap.put("secondClassify", rightsSetting.getSecondClassify()); paramMap.put("secondClassify", rightsSetting.getSecondClassify());
...@@ -1965,6 +1968,39 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1965,6 +1968,39 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
return rightsSettingDtoPageBeanNew; 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) { private void fillLabelNames4DTO(List<RightsSettingDto> rightsSettingList) {
if (ListUtils.isEmpty(rightsSettingList)) { if (ListUtils.isEmpty(rightsSettingList)) {
return; return;
......
...@@ -835,6 +835,10 @@ ...@@ -835,6 +835,10 @@
a.CHANNEL_ID = #{channelId} a.CHANNEL_ID = #{channelId}
AND AND
a.ADVISER_ID = #{adviserId} a.ADVISER_ID = #{adviserId}
and
a.is_delete =0
and
b.is_delete = 0
limit 1 limit 1
</select> </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