Commit 6ea7ac98 by 郑勇

feat: [1006602] 扫码接口优化

parent 70d20230
...@@ -461,4 +461,13 @@ public class BookConstant { ...@@ -461,4 +461,13 @@ public class BookConstant {
public static final String SUPER_MERCHANT_LIST = CacheConstant.BOOK + "superMerchantList"; public static final String SUPER_MERCHANT_LIST = CacheConstant.BOOK + "superMerchantList";
/**
* 资源配置sceneId查询
*/
public static final String RESOURCE_PAGE_BY_SCENE_ID = CacheConstant.BOOK + "resourcePageBySceneId";
/**
* 资源配置bookGroupId查询
*/
public static final String RESOURCE_PAGE_BY_BOOK_GROUP_ID = CacheConstant.BOOK + "resourcePageByBookGroupId";
} }
...@@ -713,4 +713,25 @@ public class QrcodeSceneConsr { ...@@ -713,4 +713,25 @@ public class QrcodeSceneConsr {
LOGGER.error("调用qrcodeSceneService.updateLandingPageType失败"+e.getMessage(),e); LOGGER.error("调用qrcodeSceneService.updateLandingPageType失败"+e.getMessage(),e);
} }
} }
@ParamLog("删除二维码解析地址")
public void deleteParseRedis(Long sceneId, Long bookGroupId) {
try {
qrcodeSceneService.deleteParseRedis(null,sceneId, bookGroupId);
}catch (Exception e) {
LOGGER.error("调用qrcodeSceneService.updateLandingPageType失败"+e.getMessage(),e);
}
}
@ParamLog(description = "获取二维码基本信息")
public QrcodeSceneDto getOnlySceneInfoById(Long sceneId) throws BizException {
if(sceneId == null) return null;
try {
return ResponseHandleUtil.parseResponse(qrcodeSceneService.getOnlySceneInfoById(sceneId), QrcodeSceneDto.class);
} catch (BizException e) {
LOGGER.error("【二维码-渠道(消)】 获取二维码最最基本信息失败,<ERROR>.[getById]:" + e.getMessage(),
e);
}
return null;
}
} }
...@@ -240,7 +240,7 @@ public class ReaderConsr { ...@@ -240,7 +240,7 @@ public class ReaderConsr {
public Map<Long, AgentCity> getAgentPositionByAdviserIds(List<Long> advisers) { public Map<Long, AgentCity> getAgentPositionByAdviserIds(List<Long> advisers) {
LOGGER.info("根据advisers查询出版社地理位置:{}", advisers); LOGGER.info("根据advisers查询出版社地理位置:{}", advisers);
Map<Long, AgentCity> map = CollUtil.newHashMap(0); Map<Long, AgentCity> map = new HashMap<>();
try { try {
map = ResponseHandleUtil.parseMap(agentService.getAgentPositionByAdviserIds(advisers), Long.class, AgentCity.class); map = ResponseHandleUtil.parseMap(agentService.getAgentPositionByAdviserIds(advisers), Long.class, AgentCity.class);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -138,6 +138,51 @@ public class ProductConsr { ...@@ -138,6 +138,51 @@ public class ProductConsr {
} }
} }
/**
* 资源中心拉取商品最最基本信息
*/
public Map<Long, ProductDto> getProductBasesByIds(List<Long> productIds) throws BizException {
LOGGER.info("【资源中心(消)】获取商品最最基本信息,<START>.[productIds]=" + productIds + "]");
if (productIds == null || productIds.isEmpty()) {
return null;
}
Map<Long, ProductDto> productDtoMap = new HashMap<>();
productIds = productIds.stream().distinct().collect(Collectors.toList());
Integer size = productIds.size();
if (productIds.size() > 1000) {
Integer[] queryCountArray = {0, 1, 2, 3};
Integer queryCount = 4;
//并发查询
List<Long> finalProductIds = productIds;
Map<Long, ProductDto> finalProductDtoMap = productDtoMap;
CompletableFuture[] completableFutures = Arrays.stream(queryCountArray).
map(x -> CompletableFuture.supplyAsync(() -> {
Integer startIndex = size / queryCount * x;
Integer endIndex = size / queryCount * (x + 1);
List<Long> queryList = finalProductIds.subList(startIndex, endIndex);
Map<Long, ProductDto> productMap = ResponseHandleUtil.parseMapResponse(productService.getProductBasesByIds(queryList), Long.class,
ProductDto.class);
return productMap;
}, ThreadPoolUtils.EXPORT_THREAD_POOL).whenComplete(((productMap, throwable) -> {
finalProductDtoMap.putAll(productMap);
}))).toArray(CompletableFuture[]::new);
try {
CompletableFuture.allOf(completableFutures).get();
} catch (InterruptedException | ExecutionException e) {
LOGGER.warn("[getProBasesByIds] 填充信息失败,err:{}", e.getMessage(), e);
}
return finalProductDtoMap;
} else {
try {
productDtoMap = ResponseHandleUtil.parseMapResponse(productService.getProductBasesByIds(productIds), Long.class, ProductDto.class);
} catch (BizException e) {
LOGGER.warn("调用:productService.getProductBasesByIds报错", e.getMessage(), e);
}
return productDtoMap;
}
}
/** /**
* 资源中心拉取商品基本信息 * 资源中心拉取商品基本信息
......
...@@ -254,7 +254,7 @@ public class TradeConsr { ...@@ -254,7 +254,7 @@ public class TradeConsr {
*/ */
public Map<Long, OrderGroupFormDto> getOrderGroupForm4ES(List<Long> qrcodeIds) { public Map<Long, OrderGroupFormDto> getOrderGroupForm4ES(List<Long> qrcodeIds) {
LOGGER.error("根据群ID去交易中心查询群内订单统计信息.[getOrderGroupForm4ES] qrcodeIds:{}", qrcodeIds); LOGGER.error("根据群ID去交易中心查询群内订单统计信息.[getOrderGroupForm4ES] qrcodeIds:{}", qrcodeIds);
Map<Long, OrderGroupFormDto> map = CollUtil.newHashMap(0); Map<Long, OrderGroupFormDto> map = new HashMap<>();
if (CollUtil.isEmpty(qrcodeIds)) { if (CollUtil.isEmpty(qrcodeIds)) {
return map; return map;
} }
......
...@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -38,7 +39,7 @@ public class WechatConsr { ...@@ -38,7 +39,7 @@ public class WechatConsr {
public Map<String, ESGroupBookQrcodeDTO> aggGroupMemberUser(List<String> wxGroupIds) { public Map<String, ESGroupBookQrcodeDTO> aggGroupMemberUser(List<String> wxGroupIds) {
log.info("WechatConsr.aggGroupMemberUser 获取群成员城市及性别信息 wxGroupIds:{}", wxGroupIds); log.info("WechatConsr.aggGroupMemberUser 获取群成员城市及性别信息 wxGroupIds:{}", wxGroupIds);
Map<String, ESGroupBookQrcodeDTO> map = CollUtil.newHashMap(0); Map<String, ESGroupBookQrcodeDTO> map = new HashMap<>();
try { try {
map = ResponseHandleUtil.parseMap(groupMemberService.aggGroupMemberUser(wxGroupIds), String.class, ESGroupBookQrcodeDTO.class); map = ResponseHandleUtil.parseMap(groupMemberService.aggGroupMemberUser(wxGroupIds), String.class, ESGroupBookQrcodeDTO.class);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -676,6 +676,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -676,6 +676,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
if (JoinGroupTypeEnum.XIAORUI.getCode().equals(joinGroupType)) { if (JoinGroupTypeEnum.XIAORUI.getCode().equals(joinGroupType)) {
this.createBookGroupAppletUrl(bookGroup.getId(), bookId, channelId, adviserId); this.createBookGroupAppletUrl(bookGroup.getId(), bookId, channelId, adviserId);
} }
//删除二维码解析缓存
qrcodeSceneConsr.deleteParseRedis(null,bookGroup.getId());
return bookGroup; return bookGroup;
} }
...@@ -1114,6 +1116,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1114,6 +1116,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
bookGroupDao.update(bookGroup); bookGroupDao.update(bookGroup);
//更新至超级搜索 //更新至超级搜索
searchProducer.update(bookGroup.getId()); searchProducer.update(bookGroup.getId());
//删除二维码跳转解析
qrcodeSceneConsr.deleteParseRedis(null,bookGroup.getId());
} }
/** /**
...@@ -1202,7 +1206,14 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1202,7 +1206,14 @@ public class BookGroupBizImpl implements BookGroupBiz {
@ParamLog(value = "根据书刊ID删除", isAfterReturn = false) @ParamLog(value = "根据书刊ID删除", isAfterReturn = false)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void deleteByBookId( Long bookId, Long channelId, Long adviserId ) throws BizException { public void deleteByBookId( Long bookId, Long channelId, Long adviserId ) throws BizException {
List<BookGroupDTO> bookGroupDTOList = bookGroupDao.listBookGroup(bookId, channelId, adviserId);
bookGroupDao.deleteByBookId(bookId, channelId, adviserId); bookGroupDao.deleteByBookId(bookId, channelId, adviserId);
if(CollUtil.isNotEmpty(bookGroupDTOList)){
//删除二维码解析缓存
for (BookGroupDTO bookGroupDTO : bookGroupDTOList) {
qrcodeSceneConsr.deleteParseRedis(null,bookGroupDTO.getId());
}
}
} }
/** /**
...@@ -1212,7 +1223,14 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1212,7 +1223,14 @@ public class BookGroupBizImpl implements BookGroupBiz {
@ParamLog(value = "根据书刊ID恢复", isAfterReturn = false) @ParamLog(value = "根据书刊ID恢复", isAfterReturn = false)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void recoverByBookId( Long bookId, Long channelId, Long adviserId ) throws BizException { public void recoverByBookId( Long bookId, Long channelId, Long adviserId ) throws BizException {
List<BookGroupDTO> bookGroupDTOList = bookGroupDao.listBookGroup(bookId, channelId, adviserId);
bookGroupDao.recoverByBookId(bookId, channelId, adviserId); bookGroupDao.recoverByBookId(bookId, channelId, adviserId);
if(CollUtil.isNotEmpty(bookGroupDTOList)){
//删除二维码解析缓存
for (BookGroupDTO bookGroupDTO : bookGroupDTOList) {
qrcodeSceneConsr.deleteParseRedis(null,bookGroupDTO.getId());
}
}
} }
/** /**
...@@ -1237,6 +1255,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1237,6 +1255,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
bookGroup.setBookId(bookId); bookGroup.setBookId(bookId);
bookGroup.setId(bookGroupId); bookGroup.setId(bookGroupId);
long result = bookGroupDao.linkBookGroup(bookGroup); long result = bookGroupDao.linkBookGroup(bookGroup);
//删除二维码解析缓存
qrcodeSceneConsr.deleteParseRedis(null,bookGroupId);
if (result <= 0) { if (result <= 0) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "关联社群书失败!"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "关联社群书失败!");
} }
...@@ -1982,6 +2002,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1982,6 +2002,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "该社群码下已有分类!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "该社群码下已有分类!");
} }
bookGroupDao.deleteByBookGroupId(bookGroupId); bookGroupDao.deleteByBookGroupId(bookGroupId);
//删除二维码解析缓存
qrcodeSceneConsr.deleteParseRedis(null,bookGroupId);
} }
@Override @Override
...@@ -1994,6 +2016,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1994,6 +2016,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
throw new BookBizException(BookBizException.ID_NOT_EXIST, "没有该数据!"); throw new BookBizException(BookBizException.ID_NOT_EXIST, "没有该数据!");
} }
bookGroupDao.deleteByBookGroupId(bookGroupId); bookGroupDao.deleteByBookGroupId(bookGroupId);
//删除二维码解析缓存
qrcodeSceneConsr.deleteParseRedis(null,bookGroupId);
bookAppletSceneDao.deleteByBookGroupId(bookGroupId); bookAppletSceneDao.deleteByBookGroupId(bookGroupId);
//更新至超级搜索中 //更新至超级搜索中
searchProducer.delete(bookGroupId); searchProducer.delete(bookGroupId);
...@@ -4740,6 +4764,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -4740,6 +4764,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
} }
//删除旧数据 //删除旧数据
bookGroupDao.deleteByBookGroupId(oldBookGroupId); bookGroupDao.deleteByBookGroupId(oldBookGroupId);
//删除二维码解析缓存
qrcodeSceneConsr.deleteParseRedis(null,oldBookGroupId);
//插入转换记录表 //插入转换记录表
QrChangeRecord qrChangeRecord = QrChangeRecord.builder().oldBookGroupId(oldBookGroupId).newBookGroupId(newBookGroupId).build(); QrChangeRecord qrChangeRecord = QrChangeRecord.builder().oldBookGroupId(oldBookGroupId).newBookGroupId(newBookGroupId).build();
bookGroupDao.insertQrChangeRecord(qrChangeRecord); bookGroupDao.insertQrChangeRecord(qrChangeRecord);
...@@ -5689,6 +5715,7 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -5689,6 +5715,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
this.createBookGroupAppletUrl(bookGroupId,bookGroupDTO.getBookId(),bookGroupDTO.getChannelId(),bookGroupDTO.getCreateUser()); this.createBookGroupAppletUrl(bookGroupId,bookGroupDTO.getBookId(),bookGroupDTO.getChannelId(),bookGroupDTO.getCreateUser());
//修改joinGroupType //修改joinGroupType
bookGroupDao.updateJoinGroupType(bookGroupId,JoinGroupTypeEnum.XIAORUI.getCode()); bookGroupDao.updateJoinGroupType(bookGroupId,JoinGroupTypeEnum.XIAORUI.getCode());
qrcodeSceneConsr.deleteParseRedis(null,bookGroupId);
} }
bookGroupDao.updateBookGroupOpenWeapp(bookGroupId, openWeapp); bookGroupDao.updateBookGroupOpenWeapp(bookGroupId, openWeapp);
} }
......
...@@ -391,6 +391,8 @@ public interface BookGroupDao extends BaseDao<BookGroup> { ...@@ -391,6 +391,8 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
List<BookGroupDTO> getDTOByBookIdList(Long bookId, Long channelId, Long adviserId); List<BookGroupDTO> getDTOByBookIdList(Long bookId, Long channelId, Long adviserId);
List<BookGroupDTO> listBookGroup(Long bookId, Long channelId, Long adviserId);
List<BookQrcodeVO> listBookQrcodes(Long bookId, Long channelId, Long adviserId, String sceneName, List<Long> locationIds); List<BookQrcodeVO> listBookQrcodes(Long bookId, Long channelId, Long adviserId, String sceneName, List<Long> locationIds);
List<BookQrcodeVO> listBookQrcodeVOByIds(List<Long> bookGroupIds); List<BookQrcodeVO> listBookQrcodeVOByIds(List<Long> bookGroupIds);
......
...@@ -92,6 +92,8 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{ ...@@ -92,6 +92,8 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
* * @param null * * @param null
*/ */
void updateBookBySceneIds(List<Long> sceneIds, Long bookId, Long channelId); void updateBookBySceneIds(List<Long> sceneIds, Long bookId, Long channelId);
List<ResourcePage> getBySceneIds(List<Long> sceneIds);
/** /**
*同一本书其他码下关闭小睿流程 *同一本书其他码下关闭小睿流程
* @author:zhuyajie * @author:zhuyajie
...@@ -100,6 +102,8 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{ ...@@ -100,6 +102,8 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
*/ */
void setOtherPageRaysClose(Long bookId, Long channelId, Long createUser, Long sceneId, Long bookGroupId); void setOtherPageRaysClose(Long bookId, Long channelId, Long createUser, Long sceneId, Long bookGroupId);
List<ResourcePage> getOtherPageRaysClose(Long bookId, Long channelId, Long createUser, Long sceneId, Long bookGroupId);
/** /**
* 书刊是否开启小睿 * 书刊是否开启小睿
* @author:zhuyajie * @author:zhuyajie
......
...@@ -320,7 +320,7 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp ...@@ -320,7 +320,7 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp
@Override @Override
public List<BookAdviserInfo> getBookAndAdviserByClassifyIds(Set<Long> classifyIds) { public List<BookAdviserInfo> getBookAndAdviserByClassifyIds(Set<Long> classifyIds) {
HashMap<String, Object> map = CollUtil.newHashMap(1); HashMap<String, Object> map = new HashMap<>();
map.put("classifyIds",classifyIds); map.put("classifyIds",classifyIds);
return getSqlSession().selectList("getBookAndAdviserByClassifyIds",map); return getSqlSession().selectList("getBookAndAdviserByClassifyIds",map);
} }
......
...@@ -528,6 +528,15 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou ...@@ -528,6 +528,15 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
} }
@Override @Override
public List<BookGroupDTO> listBookGroup(Long bookId, Long channelId, Long adviserId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookId", bookId);
paramMap.put("channelId", channelId);
paramMap.put("adviserId", adviserId);
return super.getSqlSession().selectList(getStatement("listBookGroup"), paramMap);
}
@Override
public List<BookQrcodeVO> listBookQrcodes(Long bookId, Long channelId, Long adviserId, String sceneName, List<Long> locationIds) { public List<BookQrcodeVO> listBookQrcodes(Long bookId, Long channelId, Long adviserId, String sceneName, List<Long> locationIds) {
Map<String, Object> paramMap = MapUtil.of("bookId", bookId); Map<String, Object> paramMap = MapUtil.of("bookId", bookId);
paramMap.put("channelId", channelId); paramMap.put("channelId", channelId);
......
...@@ -334,7 +334,7 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou ...@@ -334,7 +334,7 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
@Override @Override
public List<ESBookGroupQrcode> selectPage(long start, long offset) { public List<ESBookGroupQrcode> selectPage(long start, long offset) {
HashMap<String, Object> map = CollUtil.newHashMap(2); HashMap<String, Object> map = new HashMap<>();
map.put("start",start); map.put("start",start);
map.put("offset",offset); map.put("offset",offset);
return getSessionTemplate().selectList("selectPage",map); return getSessionTemplate().selectList("selectPage",map);
...@@ -342,14 +342,14 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou ...@@ -342,14 +342,14 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
@Override @Override
public String getMediaId(Long id) { public String getMediaId(Long id) {
HashMap<String, Object> map = CollUtil.newHashMap(2); HashMap<String, Object> map = new HashMap<>();
map.put("id",id); map.put("id",id);
return getSessionTemplate().selectOne(getStatement("getMediaId"),map); return getSessionTemplate().selectOne(getStatement("getMediaId"),map);
} }
@Override @Override
public void updateMediaId(Long id, String mediaId, Date date) { public void updateMediaId(Long id, String mediaId, Date date) {
HashMap<String, Object> map = CollUtil.newHashMap(2); HashMap<String, Object> map = new HashMap<>();
map.put("id",id); map.put("id",id);
map.put("mediaId",mediaId); map.put("mediaId",mediaId);
map.put("date",date); map.put("date",date);
...@@ -358,7 +358,7 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou ...@@ -358,7 +358,7 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
@Override @Override
public List<GroupQrcodeDTO> getMigrateGroup(List<String> groups) { public List<GroupQrcodeDTO> getMigrateGroup(List<String> groups) {
HashMap<String, Object> map = CollUtil.newHashMap(1); HashMap<String, Object> map = new HashMap<>();
map.put("list",groups); map.put("list",groups);
return getSessionTemplate().selectList(getStatement("getMigrateGroup"),map); return getSessionTemplate().selectList(getStatement("getMigrateGroup"),map);
} }
...@@ -370,7 +370,7 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou ...@@ -370,7 +370,7 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
@Override @Override
public void removeMediaIdByIds(List<Long> ids) { public void removeMediaIdByIds(List<Long> ids) {
HashMap<String, Object> map = CollUtil.newHashMap(1); HashMap<String, Object> map = new HashMap<>();
map.put("list",ids); map.put("list",ids);
getSessionTemplate().delete(getStatement("removeMediaIdByIds"),map); getSessionTemplate().delete(getStatement("removeMediaIdByIds"),map);
} }
......
...@@ -82,6 +82,13 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re ...@@ -82,6 +82,13 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
} }
@Override @Override
public List<ResourcePage> getBySceneIds(List<Long> sceneIds) {
Map<String, Object> map = new HashMap<>();
map.put("sceneIds", sceneIds);
return getSessionTemplate().selectList(getStatement("getBySceneIds"), map);
}
@Override
public void setOtherPageRaysClose(Long bookId, Long channelId, Long createUser, Long sceneId, Long bookGroupId) { public void setOtherPageRaysClose(Long bookId, Long channelId, Long createUser, Long sceneId, Long bookGroupId) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("bookId", bookId); map.put("bookId", bookId);
...@@ -93,6 +100,17 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re ...@@ -93,6 +100,17 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
} }
@Override @Override
public List<ResourcePage> getOtherPageRaysClose(Long bookId, Long channelId, Long createUser, Long sceneId, Long bookGroupId) {
Map<String, Object> map = new HashMap<>();
map.put("bookId", bookId);
map.put("channelId", channelId);
map.put("createUser", createUser);
map.put("bookGroupId", bookGroupId);
map.put("sceneId", sceneId);
return getSessionTemplate().selectList(getStatement("getOtherPageRaysClose"), map);
}
@Override
public Boolean isOpenRaysBook(Long bookId, Long channelId, Long adviserId) { public Boolean isOpenRaysBook(Long bookId, Long channelId, Long adviserId) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("bookId", bookId); map.put("bookId", bookId);
......
...@@ -361,7 +361,7 @@ public class BookBrowseRecordBizImpl implements BookBrowseRecordBiz { ...@@ -361,7 +361,7 @@ public class BookBrowseRecordBizImpl implements BookBrowseRecordBiz {
@Override @Override
public Map<String, String> getCitiesByIp(List<String> ips) { public Map<String, String> getCitiesByIp(List<String> ips) {
Map<String, String> map = CollUtil.newHashMap(); Map<String, String> map = new HashMap<>();
List<IpData> ipData = ipDataMapper.listCityByIp(ips); List<IpData> ipData = ipDataMapper.listCityByIp(ips);
if (!CollUtil.isEmpty(ipData)) { if (!CollUtil.isEmpty(ipData)) {
map = ipData.stream().collect(Collectors.toMap(IpData::getIp, IpData::getCity)); map = ipData.stream().collect(Collectors.toMap(IpData::getIp, IpData::getCity));
......
...@@ -1678,7 +1678,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1678,7 +1678,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if (null != rightsSettingTitle){ if (null != rightsSettingTitle){
List<RightsNowItem> nowItems = null; List<RightsNowItem> nowItems = null;
if(hasPage){ if(hasPage){
Map<String, Object> map = CollUtil.newHashMap(2); Map<String, Object> map = new HashMap<>();
map.put("rightsSettingTitleId",rightsSettingTitle.getId()); map.put("rightsSettingTitleId",rightsSettingTitle.getId());
map.put("types",Collections.singletonList(RightsNowItemTypeNew.ONLINE_EXCL_COURSE.value)); map.put("types",Collections.singletonList(RightsNowItemTypeNew.ONLINE_EXCL_COURSE.value));
PageBeanNew<RightsNowItem> pageBeanNew = rightsNowItemDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getListByRightsSettingTitleId"); PageBeanNew<RightsNowItem> pageBeanNew = rightsNowItemDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getListByRightsSettingTitleId");
...@@ -1708,7 +1708,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1708,7 +1708,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if (null != rightsSettingTitle){ if (null != rightsSettingTitle){
List<RightsNowItem> nowItems = null; List<RightsNowItem> nowItems = null;
if (hasPage){ if (hasPage){
Map<String, Object> map = CollUtil.newHashMap(2); Map<String, Object> map = new HashMap<>();
map.put("rightsSettingTitleId",rightsSettingTitle.getId()); map.put("rightsSettingTitleId",rightsSettingTitle.getId());
map.put("types",Collections.singletonList(RightsNowItemTypeNew.ONLINE_COURSE.value)); map.put("types",Collections.singletonList(RightsNowItemTypeNew.ONLINE_COURSE.value));
PageBeanNew<RightsNowItem> pageBeanNew = rightsNowItemDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getListByRightsSettingTitleId"); PageBeanNew<RightsNowItem> pageBeanNew = rightsNowItemDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getListByRightsSettingTitleId");
...@@ -3420,7 +3420,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -3420,7 +3420,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
List<RightsNowItem> nowItems = null; List<RightsNowItem> nowItems = null;
if(hasPage){ if(hasPage){
Map<String, Object> map = CollUtil.newHashMap(2); Map<String, Object> map = new HashMap<>();
map.put("rightsSettingTitleId",rightsSettingTitle.getId()); map.put("rightsSettingTitleId",rightsSettingTitle.getId());
map.put("types",Collections.singletonList(RightsNowItemTypeNew.GROUP_SERVICE.value)); map.put("types",Collections.singletonList(RightsNowItemTypeNew.GROUP_SERVICE.value));
PageBeanNew<RightsNowItem> pageBeanNew = rightsNowItemDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getListByRightsSettingTitleId"); PageBeanNew<RightsNowItem> pageBeanNew = rightsNowItemDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getListByRightsSettingTitleId");
...@@ -4033,7 +4033,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -4033,7 +4033,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
// 查询书刊权益ID列表 // 查询书刊权益ID列表
List<Long> rightsSettingIds = rightsSettingDtos.stream().map(RightsSettingDto::getId).collect(Collectors.toList()); List<Long> rightsSettingIds = rightsSettingDtos.stream().map(RightsSettingDto::getId).collect(Collectors.toList());
if (CollUtil.isNotEmpty(rightsSettingIds)) { if (CollUtil.isNotEmpty(rightsSettingIds)) {
Map<String, Object> map = CollUtil.newHashMap(4); Map<String, Object> map = new HashMap<>();
map.put("list", rightsSettingIds); map.put("list", rightsSettingIds);
map.put("deepRead", deepRead); map.put("deepRead", deepRead);
map.put("easyRead", easyRead); map.put("easyRead", easyRead);
......
...@@ -156,6 +156,16 @@ ...@@ -156,6 +156,16 @@
and join_group_type != 4 and join_group_type != 4
</select> </select>
<select id="listBookGroup" resultMap="BookGroupDTO" parameterType="map">
select
<include refid="Base_Column_List"/>
from book_group
where is_delete = 0
and book_id = #{bookId,jdbcType=BIGINT}
and channel_id = #{channelId,jdbcType=BIGINT}
and create_user = #{adviserId,jdbcType=BIGINT}
</select>
<select id="getDTOByBookIdsAnsAdviserIds" resultMap="BookGroupDTO" parameterType="map"> <select id="getDTOByBookIdsAnsAdviserIds" resultMap="BookGroupDTO" parameterType="map">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
......
...@@ -244,6 +244,17 @@ ...@@ -244,6 +244,17 @@
</foreach> </foreach>
</update> </update>
<select id="getBySceneIds" parameterType="map" resultMap="ResourcePageMap">
select
<include refid="Base_Column_List"/>
from resource_page
WHERE
scene_id IN
<foreach collection="sceneIds" close=")" open="(" separator="," index="index" item="item">
#{item}
</foreach>
</select>
<update id="setOtherPageRaysClose" parameterType="map"> <update id="setOtherPageRaysClose" parameterType="map">
UPDATE resource_page UPDATE resource_page
SET open_rays = 0 SET open_rays = 0
...@@ -259,6 +270,22 @@ ...@@ -259,6 +270,22 @@
</if> </if>
</update> </update>
<select id="getOtherPageRaysClose" parameterType="map" resultMap="ResourcePageMap">
select
<include refid="Base_Column_List"/>
from resource_page
WHERE
book_id = #{bookId}
AND channel_id = #{channelId}
AND create_user = #{createUser}
<if test="sceneId != null">
AND scene_id != #{sceneId}
</if>
<if test="bookGroupId != null">
AND book_group_id != #{bookGroupId}
</if>
</select>
<select id="isOpenRaysBook" resultType="boolean" parameterType="map"> <select id="isOpenRaysBook" resultType="boolean" parameterType="map">
SELECT SELECT
COUNT(1) COUNT(1)
......
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