Commit 27a0dec2 by 李传峰

Merge remote-tracking branch 'remotes/origin/master' into 3.x

# Conflicts:
#	pcloud-service-book/src/main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
#	pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
#	pcloud-service-book/src/main/java/com/pcloud/book/group/constant/ResourcePageConstants.java
#	pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/ResourcePageFacade.java
parents 08858847 98cb038e
...@@ -449,4 +449,9 @@ public class BookConstant { ...@@ -449,4 +449,9 @@ public class BookConstant {
public static String IGNOR_BOOK_KEY = CacheConstant.BOOK + "ignorBookKey"; public static String IGNOR_BOOK_KEY = CacheConstant.BOOK + "ignorBookKey";
/**
* qq公众号
*/
public static final Long QQ_ACCOUNT_SETTING_ID = 999L;
} }
...@@ -43,6 +43,8 @@ import java.util.Map; ...@@ -43,6 +43,8 @@ import java.util.Map;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import static com.pcloud.book.book.constant.BookConstant.QQ_ACCOUNT_SETTING_ID;
/** /**
* @ClassName com.pcloud.book.applet.biz.impl.AnswerSubscribeBizImpl * @ClassName com.pcloud.book.applet.biz.impl.AnswerSubscribeBizImpl
* @Author zhuyajie * @Author zhuyajie
...@@ -294,6 +296,10 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz { ...@@ -294,6 +296,10 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
@Override @Override
public AnswerSubscribeDTO getSubscribeQrcodeState(Long wechatUserId, Long accountSettingId) { public AnswerSubscribeDTO getSubscribeQrcodeState(Long wechatUserId, Long accountSettingId) {
AnswerSubscribeDTO dto = new AnswerSubscribeDTO();
if (QQ_ACCOUNT_SETTING_ID.equals(accountSettingId)) {
return dto;
}
String openId = readerConsr.getOpenIdByWechatUserIdAndOfficialAccountsId(wechatUserId, accountSettingId); String openId = readerConsr.getOpenIdByWechatUserIdAndOfficialAccountsId(wechatUserId, accountSettingId);
WechatUserOfficialAccounts accounts = readerConsr.getOfficialAccounts(accountSettingId, openId, wechatUserId); WechatUserOfficialAccounts accounts = readerConsr.getOfficialAccounts(accountSettingId, openId, wechatUserId);
Boolean isSubscribe = false; Boolean isSubscribe = false;
...@@ -301,7 +307,6 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz { ...@@ -301,7 +307,6 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
isSubscribe = accounts.getIsSubscribe() == 1 ? true : false; isSubscribe = accounts.getIsSubscribe() == 1 ? true : false;
} }
GroupQrcodeVO groupQrcodeVO = qrcodeSceneConsr.getSubscribeQrcode(accountSettingId); GroupQrcodeVO groupQrcodeVO = qrcodeSceneConsr.getSubscribeQrcode(accountSettingId);
AnswerSubscribeDTO dto = new AnswerSubscribeDTO();
dto.setQrcodeUrl(groupQrcodeVO.getQrcodeUrl()); dto.setQrcodeUrl(groupQrcodeVO.getQrcodeUrl());
dto.setIsSubscribe(isSubscribe); dto.setIsSubscribe(isSubscribe);
return dto; return dto;
......
...@@ -91,7 +91,8 @@ public class AppletThirdResourcesStaticBizImpl implements AppletThirdResourcesSt ...@@ -91,7 +91,8 @@ public class AppletThirdResourcesStaticBizImpl implements AppletThirdResourcesSt
@Override @Override
@ParamLog("获取跟谁学统计数据") @ParamLog("获取跟谁学统计数据")
public void getAppletThirdResourceStatic(Integer isAll) { public void getAppletThirdResourceStatic(Integer isAll) {
PageBeanNew pageBeanNew = null; //20210831 接口调用不通 ,暂停调用
/*PageBeanNew pageBeanNew = null;
//PageBeanNew pageBeanNew = appletThirdResourcesStaticDao.listPageNew(new PageParam(0, 10), null, "getList"); //PageBeanNew pageBeanNew = appletThirdResourcesStaticDao.listPageNew(new PageParam(0, 10), null, "getList");
if (null != pageBeanNew && !ListUtils.isEmpty(pageBeanNew.getRecordList()) && YesOrNoEnums.YES.getValue().equals(isAll)) { if (null != pageBeanNew && !ListUtils.isEmpty(pageBeanNew.getRecordList()) && YesOrNoEnums.YES.getValue().equals(isAll)) {
throw new BookBizException(BookBizException.ERROR, "当统计数据表不为空时不能导入全部数据只能导入昨日数据"); throw new BookBizException(BookBizException.ERROR, "当统计数据表不为空时不能导入全部数据只能导入昨日数据");
...@@ -134,7 +135,7 @@ public class AppletThirdResourcesStaticBizImpl implements AppletThirdResourcesSt ...@@ -134,7 +135,7 @@ public class AppletThirdResourcesStaticBizImpl implements AppletThirdResourcesSt
} catch (ParseException e) { } catch (ParseException e) {
LOGGER.error("获取跟谁学统计数据失败", e); LOGGER.error("获取跟谁学统计数据失败", e);
} }
} }*/
} }
......
...@@ -1608,7 +1608,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz { ...@@ -1608,7 +1608,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
Map<String, BookAdviserDto> bookAdviserDtoMap = new HashMap<>(); Map<String, BookAdviserDto> bookAdviserDtoMap = new HashMap<>();
try { try {
bookAdviserDtoMap = bookAdviserSubmit.get(ThreadPoolUtils.REMOTE_TIME_OUT, TimeUnit.SECONDS); bookAdviserDtoMap = bookAdviserSubmit.get(ThreadPoolUtils.REMOTE_TIME_OUT_LONG, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) { } catch (InterruptedException | ExecutionException | TimeoutException e) {
LOGGER.error("获取现代纸书是否小睿流程错误: {}==", e); LOGGER.error("获取现代纸书是否小睿流程错误: {}==", e);
} }
...@@ -2736,6 +2736,9 @@ public class BookAdviserBizImpl implements BookAdviserBiz { ...@@ -2736,6 +2736,9 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
String key = CacheConstant.BOOK + "BOOKIDS4AGENT:" + agentId+"_"+month; String key = CacheConstant.BOOK + "BOOKIDS4AGENT:" + agentId+"_"+month;
if (StringUtil.isEmpty(JedisClusterUtils.get(key))) { if (StringUtil.isEmpty(JedisClusterUtils.get(key))) {
List<Long> adviserIds = adviserConsr.getByAgentId(agentId); List<Long> adviserIds = adviserConsr.getByAgentId(agentId);
if (CollUtil.isEmpty(adviserIds)) {
return new ArrayList<>();
}
List<ERPPublishNumDTO> erpPublishNumQueryParams = bookAdviserDao.getErpPublishNumQueryParamsByMonth(adviserIds,month); List<ERPPublishNumDTO> erpPublishNumQueryParams = bookAdviserDao.getErpPublishNumQueryParamsByMonth(adviserIds,month);
if (ListUtils.isEmpty(erpPublishNumQueryParams)) { if (ListUtils.isEmpty(erpPublishNumQueryParams)) {
return new ArrayList<>(); return new ArrayList<>();
......
...@@ -118,6 +118,7 @@ import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto; ...@@ -118,6 +118,7 @@ import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto;
import com.pcloud.usercenter.party.agent.dto.SaleAgentDTO; import com.pcloud.usercenter.party.agent.dto.SaleAgentDTO;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -2740,6 +2741,9 @@ public class BookBizImpl implements BookBiz { ...@@ -2740,6 +2741,9 @@ public class BookBizImpl implements BookBiz {
if (null != agentId) { if (null != agentId) {
adviserIds = adviserConsr.getByAgentId(agentId); adviserIds = adviserConsr.getByAgentId(agentId);
} }
if (!StringUtil.isEmpty(keyword)) {
keyword = QueryParser.escape(keyword);
}
Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getESAdviserBooks4AppletV2(grayStatus, keyword, templetIds, graLabelIds, subLabelIds, Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getESAdviserBooks4AppletV2(grayStatus, keyword, templetIds, graLabelIds, subLabelIds,
currentPage, numPerPage,scecondTempletIds, adviserIds, agentId); currentPage, numPerPage,scecondTempletIds, adviserIds, agentId);
......
...@@ -72,4 +72,6 @@ public class BookAuthInfo extends BaseEntity { ...@@ -72,4 +72,6 @@ public class BookAuthInfo extends BaseEntity {
@ApiModelProperty("授权后仍需付费") @ApiModelProperty("授权后仍需付费")
private Integer isAuthorizedPay; private Integer isAuthorizedPay;
@ApiModelProperty("打开支付功能;0:关闭;1:开启;")
private Integer openPay;
} }
...@@ -55,6 +55,8 @@ public class BookAuthInfoAndServesVO implements Serializable { ...@@ -55,6 +55,8 @@ public class BookAuthInfoAndServesVO implements Serializable {
@ApiModelProperty("授权后仍需付费") @ApiModelProperty("授权后仍需付费")
private Integer isAuthorizedPay; private Integer isAuthorizedPay;
@ApiModelProperty("打开支付功能;0:关闭;1:开启;")
private Integer openPay;
public Long getId() { public Long getId() {
return id; return id;
...@@ -160,6 +162,14 @@ public class BookAuthInfoAndServesVO implements Serializable { ...@@ -160,6 +162,14 @@ public class BookAuthInfoAndServesVO implements Serializable {
this.isAuthorizedPay = isAuthorizedPay; this.isAuthorizedPay = isAuthorizedPay;
} }
public Integer getOpenPay() {
return openPay;
}
public void setOpenPay(Integer openPay) {
this.openPay = openPay;
}
@Override @Override
public String toString() { public String toString() {
return "BookAuthInfoAndServesVO{" + return "BookAuthInfoAndServesVO{" +
......
...@@ -50,4 +50,7 @@ public class BookAuthInfoVO implements Serializable { ...@@ -50,4 +50,7 @@ public class BookAuthInfoVO implements Serializable {
@ApiModelProperty("授权后仍需付费") @ApiModelProperty("授权后仍需付费")
private Integer isAuthorizedPay; private Integer isAuthorizedPay;
@ApiModelProperty("打开支付功能;0:关闭;1:开启;")
private Integer openPay;
} }
...@@ -51,6 +51,9 @@ public class BookAuthInfoWechatVO implements Serializable { ...@@ -51,6 +51,9 @@ public class BookAuthInfoWechatVO implements Serializable {
@ApiModelProperty("coverImg") @ApiModelProperty("coverImg")
private String coverImg; private String coverImg;
@ApiModelProperty("打开支付功能;0:关闭;1:开启;")
private Integer openPay;
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -147,6 +150,14 @@ public class BookAuthInfoWechatVO implements Serializable { ...@@ -147,6 +150,14 @@ public class BookAuthInfoWechatVO implements Serializable {
this.coverImg = coverImg; this.coverImg = coverImg;
} }
public Integer getOpenPay() {
return openPay;
}
public void setOpenPay(Integer openPay) {
this.openPay = openPay;
}
@Override @Override
public String toString() { public String toString() {
return "BookAuthInfoWechatVO{" + return "BookAuthInfoWechatVO{" +
......
...@@ -54,4 +54,7 @@ public class SetAuthOpenParam implements Serializable { ...@@ -54,4 +54,7 @@ public class SetAuthOpenParam implements Serializable {
@ApiModelProperty("授权后仍需付费") @ApiModelProperty("授权后仍需付费")
private Integer isAuthorizedPay; private Integer isAuthorizedPay;
@ApiModelProperty("打开支付功能;0:关闭;1:开启;")
private Integer openPay;
} }
...@@ -5,11 +5,13 @@ import com.pcloud.book.group.dto.AddBookGroupServeDTO; ...@@ -5,11 +5,13 @@ import com.pcloud.book.group.dto.AddBookGroupServeDTO;
import com.pcloud.book.group.dto.BookGroupServeCountDTO; import com.pcloud.book.group.dto.BookGroupServeCountDTO;
import com.pcloud.book.group.dto.BookGroupServeDTO; import com.pcloud.book.group.dto.BookGroupServeDTO;
import com.pcloud.book.group.dto.BookServeDTO; import com.pcloud.book.group.dto.BookServeDTO;
import com.pcloud.book.group.dto.NavigationParamDTO;
import com.pcloud.book.group.dto.ResourcePageCourseDTO; import com.pcloud.book.group.dto.ResourcePageCourseDTO;
import com.pcloud.book.group.dto.ResourcePageDTO; import com.pcloud.book.group.dto.ResourcePageDTO;
import com.pcloud.book.group.entity.BookGroupServe; import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.entity.ResourcePage; import com.pcloud.book.group.entity.ResourcePage;
import com.pcloud.book.group.entity.ResourcePageCollect; import com.pcloud.book.group.entity.ResourcePageCollect;
import com.pcloud.book.group.entity.ResourcePagePic;
import com.pcloud.book.group.entity.ResourcePageTool; import com.pcloud.book.group.entity.ResourcePageTool;
import com.pcloud.book.group.entity.ResourceRecomManage; import com.pcloud.book.group.entity.ResourceRecomManage;
import com.pcloud.book.group.vo.ResourceColumnAndServeVO; import com.pcloud.book.group.vo.ResourceColumnAndServeVO;
...@@ -64,7 +66,7 @@ public interface ResourcePageBiz { ...@@ -64,7 +66,7 @@ public interface ResourcePageBiz {
* @date:2021/3/29 11:49 * @date:2021/3/29 11:49
* * @param null * * @param null
*/ */
List<ResourceColumnAndServeVO> getColumnAndServeListByPageId(Long resourcePageId, Boolean isWechat, Long bookId, Long adviserId, Long channelId, Integer enableAdverting); List<ResourceColumnAndServeVO> getColumnAndServeListByPageId(Long resourcePageId, Boolean isWechat, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId);
/** /**
* 根据书刊查资源页基本配置 * 根据书刊查资源页基本配置
* @author:zhuyajie * @author:zhuyajie
...@@ -404,6 +406,43 @@ public interface ResourcePageBiz { ...@@ -404,6 +406,43 @@ public interface ResourcePageBiz {
List<BookServeDTO> getBookAllServeIdsIncludeUrl(Long adviserId, Long bookId, Long channelId); List<BookServeDTO> getBookAllServeIdsIncludeUrl(Long adviserId, Long bookId, Long channelId);
/** /**
* 保存导航
* @author:zhuyajie
* @date:2021/8/17 16:42
* * @param null
*/
void saveNavigation(NavigationParamDTO navigationParamDTO);
/**
* 添加导航图片到图片库
* @author:zhuyajie
* @date:2021/8/24 14:46
* * @param null
*/
void addNavigationPic(ResourcePagePic resourcePagePic);
/**
* 删除导航图片库图片
* @author:zhuyajie
* @date:2021/8/24 14:50
* * @param null
*/
void deleteNavigationPic(Long id);
/**
* 查询导航图片库图片
* @author:zhuyajie
* @date:2021/8/24 14:51
* * @param null
*/
PageBeanNew<ResourcePagePic> listNavigationPic(Long adviserId, Integer currentPage, Integer numPerPage);
/**
* 批量更新栏目排序
* @author:zhuyajie
* @date:2021/8/27 19:35
* * @param null
*/
void batchUpdateColumnSeq(List<Long> navigationIds);
/**
* 客户端-根据页面id查要弹出的二维码 * 客户端-根据页面id查要弹出的二维码
* @author:zhuyajie * @author:zhuyajie
* @date:2021/8/23 17:31 * @date:2021/8/23 17:31
......
package com.pcloud.book.group.biz;
import com.pcloud.book.group.entity.ResourcePageBookstore;
import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.common.page.PageBeanNew;
import java.util.List;
/**
* 实体书购买(ResourcePageBookstore)表服务接口
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
public interface ResourcePageBookstoreBiz {
/**
* 通过ID查询单条数据
*/
ResourcePageBookstore getById(Long id);
/**
* 分页查询
*/
PageBeanNew getList(Integer currentPage, Integer numPerPage);
/**
* 新增数据
*/
Long insert(ResourcePageBookstore resourcePageBookstore);
/**
* 新增数据
*/
void insert(List<ResourcePageBookstore> list);
/**
* 修改数据
*/
void update(ResourcePageBookstore resourcePageBookstore);
/**
* 通过主键删除数据
*/
void deleteById(Long id);
void deleteByResourcePageId(Long resourcePageId);
List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId);
}
...@@ -5103,11 +5103,11 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -5103,11 +5103,11 @@ public class BookGroupBizImpl implements BookGroupBiz {
} }
Long raysClassifyId = null; Long raysClassifyId = null;
BookAdviserDto bookAdviserDto = bookAdviserDao.getBase(bookId, channelId, adviserId); BookAdviserDto bookAdviserDto = bookAdviserDao.getBase(bookId, channelId, adviserId);
if (null != bookAdviserDto) { if (null != bookAdviserDto && null != bookAdviserDto.getTempletId()) {
raysClassifyId = bookRaysClassifyDao.getClassifyIdByBookTemplateId(bookAdviserDto.getTempletId()); raysClassifyId = bookRaysClassifyDao.getClassifyIdByBookTemplateId(bookAdviserDto.getTempletId());
}
if (null == raysClassifyId) { if (null == raysClassifyId) {
LOGGER.error("书刊分类没有对应的小睿分类" + bookGroupId); LOGGER.warn("书刊分类没有对应的小睿分类" + bookGroupId);
}
} }
String page = null;//小程序跳转页 todo String page = null;//小程序跳转页 todo
String appletId = createOneAppletId(); String appletId = createOneAppletId();
......
package com.pcloud.book.group.biz.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.book.consumer.app.AppConsr;
import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.group.entity.ResourcePageBookstore;
import com.pcloud.book.group.dao.ResourcePageBookstoreDao;
import com.pcloud.book.group.biz.ResourcePageBookstoreBiz;
import com.pcloud.book.group.tools.SendWeixinRequestTools;
import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.NumberUtil;
import com.pcloud.resourcecenter.product.dto.ProductDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 实体书购买(ResourcePageBookstore)表服务实现类
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
@Service("resourcePageBookstoreBiz")
public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
private static final Logger LOGGER = LoggerFactory.getLogger(ResourcePageBookstoreBizImpl.class);
@Autowired
private ResourcePageBookstoreDao resourcePageBookstoreDao;
@Autowired
private AppConsr appConsr;
@Autowired
private ProductConsr productConsr;
@Autowired
private QrcodeSceneConsr qrcodeSceneConsr;
@Override
public ResourcePageBookstore getById(Long id) {
return resourcePageBookstoreDao.getById(id);
}
@Override
public PageBeanNew getList(Integer currentPage, Integer numPerPage) {
PageBeanNew pageBeanNew = resourcePageBookstoreDao.listPageNew(new PageParam(currentPage, numPerPage), null, "getList");
List recordList = pageBeanNew.getRecordList();
if (ListUtils.isEmpty(recordList)){
return pageBeanNew;
}
// 加载其它数据
return pageBeanNew;
}
@Override
public Long insert(ResourcePageBookstore resourcePageBookstore) {
resourcePageBookstoreDao.insert(resourcePageBookstore);
return resourcePageBookstore.getId();
}
@Override
public void insert(List<ResourcePageBookstore> list) {
resourcePageBookstoreDao.insert(list);
}
@Override
public void update(ResourcePageBookstore resourcePageBookstore) {
if(resourcePageBookstore == null || !NumberUtil.isNumber(resourcePageBookstore.getId())){
throw BizException.PARAM_DELETION;
}
resourcePageBookstoreDao.update(resourcePageBookstore);
}
@Override
public void deleteById(Long id) {
resourcePageBookstoreDao.deleteById(id);
}
@Override
public void deleteByResourcePageId(Long resourcePageId) {
resourcePageBookstoreDao.deleteByResourcePageId(resourcePageId);
}
@Override
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId) {
List<ResourcePageBookstoreVO> list = resourcePageBookstoreDao.getByResourcePageId(resourcePageId);
if(CollUtil.isEmpty(list) || channelId == null){
return CollUtil.toList();
}
List<Long> appIds = list.stream().filter(x -> ObjectUtil.equal(x.getServeType(), "APP")).map(x -> x.getServeId()).collect(Collectors.toList());
List<Long> productIds = list.stream().filter(x -> ObjectUtil.equal(x.getServeType(), "PRODUCT")).map(x -> x.getServeId()).collect(Collectors.toList());
Map<Long, AppDto> appDtoMap = appConsr.getBaseByIds(appIds);
Map<Long, ProductDto> productDtoMap = productConsr.getProBasesByIds(productIds);
AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
if (null == accountSettingDto) {
LOGGER.info("未配置公众号");
return CollUtil.toList();
}
for (ResourcePageBookstoreVO vo : list) {
if(ObjectUtil.equal(vo.getServeType(), "APP")){
AppDto appDto = appDtoMap.get(vo.getServeId());
if(appDto == null){
continue;
}
vo.setServeName(appDto.getTitle());
vo.setServePic(appDto.getSquareImg());
vo.setServeTypeCode(appDto.getTypeCode());
vo.setServeTypeName(appDto.getTypeName());
vo.setResultUrl(SendWeixinRequestTools.splitUrl(accountSettingDto, vo.getLinkUrl()));
}
if(ObjectUtil.equal(vo.getServeType(), "PRODUCT")){
ProductDto productDto = productDtoMap.get(vo.getServeId());
if(productDto == null){
continue;
}
vo.setServeName(productDto.getProductName());
vo.setServePic(productDto.getCoverImg());
if (productDto.getProductTypeDto() != null){
vo.setServeTypeCode(productDto.getProductTypeDto().getTypeCode());
vo.setServeTypeName(productDto.getProductTypeDto().getTypeName());
}
vo.setResultUrl(SendWeixinRequestTools.splitUrl(accountSettingDto, vo.getLinkUrl()));
}
}
return list;
}
}
...@@ -331,6 +331,54 @@ public class ResourcePageConstants { ...@@ -331,6 +331,54 @@ public class ResourcePageConstants {
} }
/** /**
* 导航类型
* @author:zhuyajie
* @date:2021/8/16 11:59
* * @param null
*/
public enum NavigationTypeEnum{
BOOK_SERVE(1,"本书配套"),
APPLET_QA(2,"书友互助"),
CUSTOM(3,"自定义"),
CLOCK(4,"阅读打卡");
private Integer code;
private String name;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
NavigationTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public static String getNameByCode(Integer code) {
for (NavigationTypeEnum navigationTypeEnum:NavigationTypeEnum.values()){
if (navigationTypeEnum.code.equals(code)){
return navigationTypeEnum.name;
}
}
return null;
}
}
//小程序默认导航,书友互助、阅读打卡
public static List<Integer> APPLET_DEFAULT_NAVIGATIONS = Arrays.asList(ResourcePageConstants.NavigationTypeEnum.APPLET_QA.getCode(),
ResourcePageConstants.NavigationTypeEnum.CLOCK.getCode());
/**
* H5-公众号二维码展示方式 * H5-公众号二维码展示方式
* @author:zhuyajie * @author:zhuyajie
* @date:2021/8/23 15:14 * @date:2021/8/23 15:14
......
package com.pcloud.book.group.dao;
import com.pcloud.book.group.entity.ResourcePageBookstore;
import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* 实体书购买(ResourcePageBookstore)表数据库访问层
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
public interface ResourcePageBookstoreDao extends BaseDao<ResourcePageBookstore> {
Integer deleteByResourcePageId(Long resourcePageId);
List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId);
}
...@@ -21,7 +21,7 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> { ...@@ -21,7 +21,7 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> {
* @date:2021/3/29 13:45 * @date:2021/3/29 13:45
* * @param null * * @param null
*/ */
Integer getMaxSeq(Long resourcePageId); Integer getMaxSeq(Long resourcePageId, Long navigationId);
/** /**
*栏目和资源列表 *栏目和资源列表
...@@ -29,7 +29,7 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> { ...@@ -29,7 +29,7 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> {
* @date:2021/3/29 13:45 * @date:2021/3/29 13:45
* * @param null * * @param null
*/ */
List<ResourceColumnAndServeVO> getColumnListByPageId(Long resourcePageId); List<ResourceColumnAndServeVO> getColumnListByPageId(Long resourcePageId, Long navigationId);
/** /**
* 根据类型查询 * 根据类型查询
...@@ -53,7 +53,7 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> { ...@@ -53,7 +53,7 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> {
* @date:2021/4/2 16:18 * @date:2021/4/2 16:18
* * @param null * * @param null
*/ */
ResourcePageColumn getColumByMoveType(String moveType, Long resourcePageId, Integer columnSeq); ResourcePageColumn getColumByMoveType(String moveType, Long resourcePageId, Integer columnSeq, Long navigationId);
/** /**
* 批量更新序号 * 批量更新序号
* @author:zhuyajie * @author:zhuyajie
...@@ -63,4 +63,8 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> { ...@@ -63,4 +63,8 @@ public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> {
void updateSeq4Batch(List<ResourceColumnAndServeVO> list); void updateSeq4Batch(List<ResourceColumnAndServeVO> list);
void deleteByPageId(Long resourcePageId); void deleteByPageId(Long resourcePageId);
void updateNavigationId(Long navigationId, Long resourcePageId);
List<ResourcePageColumn> getByNavigation(Long navigationId);
} }
\ No newline at end of file
...@@ -113,4 +113,12 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{ ...@@ -113,4 +113,12 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
List<ResourcePageVO> getAllBook4OpenFood(); List<ResourcePageVO> getAllBook4OpenFood();
void updateBookIdBySceneId(Long bookId, Long sceneId); void updateBookIdBySceneId(Long bookId, Long sceneId);
/**
* 修改导航样式
* @author:zhuyajie
* @date:2021/8/18 16:46
* * @param null
*/
void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat);
} }
package com.pcloud.book.group.dao;
import com.pcloud.book.group.entity.ResourcePageNavigation;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* 自有码H5页面导航(ResourcePageNavigation)表数据库访问层
*
* @author makejava
* @since 2021-08-16 10:43:21
*/
public interface ResourcePageNavigationDao extends BaseDao<ResourcePageNavigation>{
List<ResourcePageNavigation> getByPageId(Long resourcePageId);
List<Long> getNoNavigationPages(Integer openRays);
ResourcePageNavigation getByType(Long resourcePageId, Integer type);
Integer getMaxSeq(Long resourcePageId);
void deleteNavigation(Long resourcePageId, Integer type);
ResourcePageNavigation getByName(Long resourcePageId, String navigationName);
void updateSeq4Batch(List<ResourcePageNavigation> navigations);
ResourcePageNavigation getNavigationByMoveType(String moveType, Long resourcePageId, Integer navigationSeq);
void updateNavigationSeqNum(Long navigationId, Integer navigationSeq);
}
\ No newline at end of file
package com.pcloud.book.group.dao;
import com.pcloud.book.group.entity.ResourcePagePic;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* 资源页图片库(ResourcePagePic)表数据库访问层
*
* @author makejava
* @since 2021-08-24 14:36:56
*/
public interface ResourcePagePicDao extends BaseDao<ResourcePagePic>{
List<ResourcePagePic> getByType(Integer type, Long adviserId);
}
\ No newline at end of file
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.entity.ResourcePageBookstore;
import com.pcloud.book.group.dao.ResourcePageBookstoreDao;
import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 实体书购买(ResourcePageBookstore)表数据库访问层
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
@Repository("resourcePageBookstoreDaoImpl")
public class ResourcePageBookstoreDaoImpl extends BaseDaoImpl<ResourcePageBookstore> implements ResourcePageBookstoreDao {
@Override
public Integer deleteByResourcePageId(Long resourcePageId) {
return super.sqlSessionTemplate.delete(getStatement("deleteByResourcePageId"), resourcePageId);
}
@Override
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId) {
return super.sqlSessionTemplate.selectList(getStatement("getByResourcePageId"), resourcePageId);
}
}
...@@ -21,13 +21,19 @@ import java.util.Map; ...@@ -21,13 +21,19 @@ import java.util.Map;
@Component @Component
public class ResourcePageColumnDaoImpl extends BaseDaoImpl<ResourcePageColumn> implements ResourcePageColumnDao { public class ResourcePageColumnDaoImpl extends BaseDaoImpl<ResourcePageColumn> implements ResourcePageColumnDao {
@Override @Override
public Integer getMaxSeq(Long resourcePageId) { public Integer getMaxSeq(Long resourcePageId, Long navigationId) {
return getSessionTemplate().selectOne(getStatement("getMaxSeq"),resourcePageId); Map<String, Object> map = new HashMap<>();
map.put("navigationId", navigationId);
map.put("resourcePageId", resourcePageId);
return getSessionTemplate().selectOne(getStatement("getMaxSeq"), map);
} }
@Override @Override
public List<ResourceColumnAndServeVO> getColumnListByPageId(Long resourcePageId) { public List<ResourceColumnAndServeVO> getColumnListByPageId(Long resourcePageId, Long navigationId) {
return getSessionTemplate().selectList(getStatement("getColumnListByPageId"), resourcePageId); Map<String, Object> map = new HashMap<>();
map.put("navigationId", navigationId);
map.put("resourcePageId", resourcePageId);
return getSessionTemplate().selectList(getStatement("getColumnListByPageId"), map);
} }
@Override @Override
...@@ -47,11 +53,12 @@ public class ResourcePageColumnDaoImpl extends BaseDaoImpl<ResourcePageColumn> i ...@@ -47,11 +53,12 @@ public class ResourcePageColumnDaoImpl extends BaseDaoImpl<ResourcePageColumn> i
} }
@Override @Override
public ResourcePageColumn getColumByMoveType(String moveType, Long resourcePageId, Integer columnSeq) { public ResourcePageColumn getColumByMoveType(String moveType, Long resourcePageId, Integer columnSeq, Long navigationId) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("moveType", moveType); map.put("moveType", moveType);
map.put("resourcePageId", resourcePageId); map.put("resourcePageId", resourcePageId);
map.put("columnSeq", columnSeq); map.put("columnSeq", columnSeq);
map.put("navigationId", navigationId);
return getSessionTemplate().selectOne(getStatement("getColumByMoveType"), map); return getSessionTemplate().selectOne(getStatement("getColumByMoveType"), map);
} }
...@@ -64,4 +71,17 @@ public class ResourcePageColumnDaoImpl extends BaseDaoImpl<ResourcePageColumn> i ...@@ -64,4 +71,17 @@ public class ResourcePageColumnDaoImpl extends BaseDaoImpl<ResourcePageColumn> i
public void deleteByPageId(Long resourcePageId) { public void deleteByPageId(Long resourcePageId) {
getSessionTemplate().delete(getStatement("deleteByPageId"), resourcePageId); getSessionTemplate().delete(getStatement("deleteByPageId"), resourcePageId);
} }
@Override
public void updateNavigationId(Long navigationId, Long resourcePageId) {
Map<String, Object> map = new HashMap<>();
map.put("navigationId", navigationId);
map.put("resourcePageId", resourcePageId);
getSessionTemplate().update(getStatement("updateNavigationId"), map);
}
@Override
public List<ResourcePageColumn> getByNavigation(Long navigationId) {
return getSessionTemplate().selectList(getStatement("getByNavigation"), navigationId);
}
} }
...@@ -138,4 +138,13 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re ...@@ -138,4 +138,13 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
map.put("sceneId", sceneId); map.put("sceneId", sceneId);
getSessionTemplate().update(getStatement("updateBookIdBySceneId"), map); getSessionTemplate().update(getStatement("updateBookIdBySceneId"), map);
} }
@Override
public void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat) {
Map<String, Object> map = new HashMap<>();
map.put("id", resourcePageId);
map.put("navigationColor", navigationColor);
map.put("navigationFormat", navigationFormat);
getSessionTemplate().update(getStatement("updateNavigationFormat"), map);
}
} }
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.ResourcePageNavigationDao;
import com.pcloud.book.group.entity.ResourcePageNavigation;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName com.pcloud.book.group.dao.impl.ResourcePageNavigationDaoImpl
* @Author zhuyajie
* @Description 资源页导航
* @Date 2021/8/16 10:45
* @Version 1.0
**/
@Component
public class ResourcePageNavigationDaoImpl extends BaseDaoImpl<ResourcePageNavigation> implements ResourcePageNavigationDao {
@Override
public List<ResourcePageNavigation> getByPageId(Long resourcePageId) {
return getSessionTemplate().selectList(getStatement("getByPageId"), resourcePageId);
}
@Override
public List<Long> getNoNavigationPages(Integer openRays) {
Map<String, Object> map = new HashMap<>();
map.put("openRays", openRays);
return getSessionTemplate().selectList(getStatement("getNoNavigationPages"), map);
}
@Override
public ResourcePageNavigation getByType(Long resourcePageId, Integer type) {
Map<String, Object> map = new HashMap<>();
map.put("resourcePageId", resourcePageId);
map.put("navigationType", type);
return getSessionTemplate().selectOne(getStatement("getByType"), map);
}
@Override
public Integer getMaxSeq(Long resourcePageId) {
return getSessionTemplate().selectOne(getStatement("getMaxSeq"), resourcePageId);
}
@Override
public void deleteNavigation(Long resourcePageId, Integer type) {
Map<String, Object> map = new HashMap<>();
map.put("resourcePageId", resourcePageId);
map.put("navigationType", type);
getSessionTemplate().delete(getStatement("deleteNavigation"), map);
}
@Override
public ResourcePageNavigation getByName(Long resourcePageId, String navigationName) {
Map<String, Object> map = new HashMap<>();
map.put("resourcePageId", resourcePageId);
map.put("navigationName", navigationName.trim());
return getSessionTemplate().selectOne(getStatement("getByName"), map);
}
@Override
public void updateSeq4Batch(List<ResourcePageNavigation> list) {
getSessionTemplate().update(getStatement("updateSeq4Batch"), list);
}
@Override
public ResourcePageNavigation getNavigationByMoveType(String moveType, Long resourcePageId, Integer navigationSeq) {
Map<String, Object> map = new HashMap<>();
map.put("resourcePageId", resourcePageId);
map.put("moveType", moveType);
map.put("navigationSeq", navigationSeq);
return getSessionTemplate().selectOne(getStatement("getNavigationByMoveType"), map);
}
@Override
public void updateNavigationSeqNum(Long navigationId, Integer navigationSeq) {
Map<String, Object> map = new HashMap<>();
map.put("id", navigationId);
map.put("navigationSeq", navigationSeq);
getSessionTemplate().update(getStatement("updateNavigationSeqNum"), map);
}
}
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.ResourcePagePicDao;
import com.pcloud.book.group.entity.ResourcePagePic;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName com.pcloud.book.group.dao.impl.ResourcePagePicDaoImpl
* @Author zhuyajie
* @Description 图片库
* @Date 2021/8/24 14:39
* @Version 1.0
**/
@Component
public class ResourcePagePicDaoImpl extends BaseDaoImpl<ResourcePagePic> implements ResourcePagePicDao {
@Override
public List<ResourcePagePic> getByType(Integer type, Long adviserId) {
Map<String, Object> map = new HashMap<>();
map.put("type", type);
map.put("adviserId", adviserId);
return getSessionTemplate().selectList(getStatement("getByType"), map);
}
}
package com.pcloud.book.group.dto;
import com.pcloud.book.group.entity.ResourcePageNavigation;
import java.util.List;
import lombok.Data;
/**
* @ClassName com.pcloud.book.group.dto.NavigationParamDTO
* @Author zhuyajie
* @Description H5导航参数
* @Date 2021/8/17 16:39
* @Version 1.0
**/
@Data
public class NavigationParamDTO {
/**
* 资源页id
*/
private Long resourcePageId;
/**
* 导航列表
*/
private List<ResourcePageNavigation> navigationList;
/**
* 创建人
*/
private Long createUser;
/**
* 导航颜色样式
*/
private Integer navigationColor;
/**
* 导航版式
*/
private Integer navigationFormat;
}
...@@ -66,4 +66,12 @@ public class ResourcePage extends BaseEntity { ...@@ -66,4 +66,12 @@ public class ResourcePage extends BaseEntity {
* 背景图 * 背景图
*/ */
private String backgroundImg; private String backgroundImg;
/**
* 导航颜色样式
*/
private Integer navigationColor;
/**
* 导航版式
*/
private Integer navigationFormat;
} }
package com.pcloud.book.group.entity;
import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 实体书购买(ResourcePageBookstore)实体类
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResourcePageBookstore extends BaseEntity {
private static final long serialVersionUID = 537657968168101067L;
@ApiModelProperty("实体书购买id")
private Long id;
@ApiModelProperty("资源页id")
private Long resourcePageId;
@ApiModelProperty("服务id")
private Long serveId;
@ApiModelProperty("服务类型;APP/PRODUCT")
private String serveType;
@ApiModelProperty("应用作品相对链接")
private String linkUrl;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}
...@@ -52,4 +52,8 @@ public class ResourcePageColumn extends BaseEntity { ...@@ -52,4 +52,8 @@ public class ResourcePageColumn extends BaseEntity {
* 标签图标 * 标签图标
*/ */
private String labelIcon; private String labelIcon;
/**
* 导航id
*/
private Long navigationId;
} }
\ No newline at end of file
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
import lombok.Data;
/**
* 自有码H5页面导航(ResourcePageNavigation)实体类
*
* @author makejava
* @since 2021-08-16 10:43:21
*/
@Data
public class ResourcePageNavigation extends BaseEntity {
private static final long serialVersionUID = 211236647765087489L;
/**
* 资源页id
*/
private Long resourcePageId;
/**
* 类型(1本书配套2书友社区3自定义)
*/
private Integer navigationType;
/**
* 导航名称
*/
private String navigationName;
/**
* 图标
*/
private String navigationIcon;
/**
* 排序值
*/
private Integer navigationSeq;
/**
* 创建人
*/
private Long createUser;
}
\ No newline at end of file
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import lombok.Data;
/**
* 资源页图片库(ResourcePagePic)实体类
*
* @author makejava
* @since 2021-08-24 14:36:56
*/
@Data
public class ResourcePagePic extends BaseEntity {
private static final long serialVersionUID = -64480926548650160L;
/**
* 图片地址
*/
private String picUrl;
/**
* 是否默认图片
*/
private Integer isDefault;
/**
* 图片类型(1导航标签)
*/
private Integer type;
/**
* 编辑id
*/
private Long adviserId;
}
\ No newline at end of file
package com.pcloud.book.group.facade.impl; package com.pcloud.book.group.facade.impl;
import com.pcloud.book.group.biz.ResourcePageBiz; import com.pcloud.book.group.biz.ResourcePageBiz;
import com.pcloud.book.group.dto.NavigationParamDTO;
import com.pcloud.book.group.entity.ResourcePageCollect; import com.pcloud.book.group.entity.ResourcePageCollect;
import com.pcloud.book.group.entity.ResourcePagePic;
import com.pcloud.book.group.entity.ResourceRecomManage; import com.pcloud.book.group.entity.ResourceRecomManage;
import com.pcloud.book.group.vo.ResourcePageVO; import com.pcloud.book.group.vo.ResourcePageVO;
import com.pcloud.book.group.vo.UpdateResourceColumnVO; import com.pcloud.book.group.vo.UpdateResourceColumnVO;
...@@ -70,9 +72,10 @@ public class ResourcePageFacade { ...@@ -70,9 +72,10 @@ public class ResourcePageFacade {
@ApiOperation("编辑端-根据页面id查资源页栏目及资源") @ApiOperation("编辑端-根据页面id查资源页栏目及资源")
@GetMapping("getColumnAndServeListByPageId") @GetMapping("getColumnAndServeListByPageId")
public ResponseDto<?> getColumnAndServeListByPageId(@RequestHeader("token") String token, public ResponseDto<?> getColumnAndServeListByPageId(@RequestHeader("token") String token,
@RequestParam("resourcePageId") Long resourcePageId){ @RequestParam("resourcePageId") Long resourcePageId,
@RequestParam(value = "navigationId", required = false) Long navigationId){
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, false, null, null, null, null)); return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, false, null, null, null, null, navigationId));
} }
@ApiOperation("客户端-根据书刊查资源页基本配置") @ApiOperation("客户端-根据书刊查资源页基本配置")
...@@ -92,9 +95,10 @@ public class ResourcePageFacade { ...@@ -92,9 +95,10 @@ public class ResourcePageFacade {
@RequestParam(value = "bookId", required = false) Long bookId, @RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "adviserId", required = false) Long adviserId, @RequestParam(value = "adviserId", required = false) Long adviserId,
@RequestParam(value = "channelId", required = false) Long channelId, @RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "enableAdverting", required = false) Integer enableAdverting){ @RequestParam(value = "enableAdverting", required = false) Integer enableAdverting,
@RequestParam(value = "navigationId", required = false) Long navigationId){
Cookie.getId(userInfo,Cookie._WECHAT_USER_ID); Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, true, bookId, adviserId, channelId, enableAdverting)); return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, true, bookId, adviserId, channelId, enableAdverting, navigationId));
} }
@ApiOperation("客户端分页查栏目资源") @ApiOperation("客户端分页查栏目资源")
...@@ -279,6 +283,51 @@ public class ResourcePageFacade { ...@@ -279,6 +283,51 @@ public class ResourcePageFacade {
return new ResponseDto<>(); return new ResponseDto<>();
} }
@ApiOperation("保存导航")
@PostMapping("saveNavigation")
public ResponseDto<?> saveNavigation(@RequestHeader("token") String token,
@RequestBody NavigationParamDTO navigationParamDTO) {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
navigationParamDTO.setCreateUser(partyId);
resourcePageBiz.saveNavigation(navigationParamDTO);
return new ResponseDto<>();
}
@ApiOperation("添加导航图片到图片库")
@PostMapping("addNavigationPic")
public ResponseDto<?> addNavigationPic(@RequestHeader("token") String token,
@RequestBody ResourcePagePic resourcePagePic) {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
resourcePagePic.setAdviserId(partyId);
resourcePageBiz.addNavigationPic(resourcePagePic);
return new ResponseDto<>();
}
@ApiOperation("删除导航图片库图片")
@GetMapping("deleteNavigationPic")
public ResponseDto<?> deleteNavigationPic(@RequestHeader("token") String token,
@RequestParam("id") Long id) {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
resourcePageBiz.deleteNavigationPic(id);
return new ResponseDto<>();
}
@ApiOperation("查询导航图片库图片")
@GetMapping("listNavigationPic")
public ResponseDto<?> listNavigationPic(@RequestHeader("token") String token,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage) {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(resourcePageBiz.listNavigationPic(partyId, currentPage, numPerPage));
}
@ApiOperation("栏目重新排序")
@PostMapping("batchUpdateColumnSeq")
public ResponseDto<?> batchUpdateColumnSeq(@RequestBody List<Long> navigationIds) {
resourcePageBiz.batchUpdateColumnSeq(navigationIds);
return new ResponseDto<>();
}
@ApiOperation("客户端-根据页面id查要弹出的二维码") @ApiOperation("客户端-根据页面id查要弹出的二维码")
@GetMapping("getPopupQrcode4Wechat") @GetMapping("getPopupQrcode4Wechat")
public ResponseDto<?> getPopupQrcode4Wechat(@CookieValue("userInfo") String userInfo, public ResponseDto<?> getPopupQrcode4Wechat(@CookieValue("userInfo") String userInfo,
......
...@@ -92,4 +92,9 @@ public class ResourceColumnAndServeVO extends BaseDto{ ...@@ -92,4 +92,9 @@ public class ResourceColumnAndServeVO extends BaseDto{
@ApiModelProperty("广告配置项信息") @ApiModelProperty("广告配置项信息")
private List<AdvertisingSpaceItemDTO> advertisingItemList; private List<AdvertisingSpaceItemDTO> advertisingItemList;
/**
* 导航id
*/
private Long navigationId;
} }
package com.pcloud.book.group.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 实体书购买(ResourcePageBookstore)实体类
*
* @author makejava
* @since 2021-08-16 14:40:27
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResourcePageBookstoreVO {
@ApiModelProperty("实体书购买id")
private Long id;
@ApiModelProperty("资源页id")
private Long resourcePageId;
@ApiModelProperty("服务id")
private Long serveId;
@ApiModelProperty("相对链接")
private String linkUrl;
@ApiModelProperty("跳转结果页链接")
private String resultUrl;
@ApiModelProperty("服务类型;APP/PRODUCT")
private String serveType;
@ApiModelProperty("服务名称")
private String serveName;
@ApiModelProperty("图片")
private String servePic;
@ApiModelProperty("服务类型")
private String serveTypeCode;
@ApiModelProperty("服务类型名称")
private String serveTypeName;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}
package com.pcloud.book.group.vo; package com.pcloud.book.group.vo;
import com.pcloud.book.group.entity.ResourcePageNavigation;
import com.pcloud.common.dto.BaseDto; import com.pcloud.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.Data; import lombok.Data;
/** /**
...@@ -88,4 +92,19 @@ public class ResourcePageVO extends BaseDto { ...@@ -88,4 +92,19 @@ public class ResourcePageVO extends BaseDto {
* 背景图 * 背景图
*/ */
private String backgroundImg; private String backgroundImg;
@ApiModelProperty("实体书购买")
private List<ResourcePageBookstoreVO> resourcePageBookstoreList;
/**
* 导航
*/
private List<ResourcePageNavigation> navigationList;
/**
* 导航颜色样式
*/
private Integer navigationColor;
/**
* 导航版式
*/
private Integer navigationFormat;
} }
...@@ -66,4 +66,8 @@ public class UpdateResourceColumnVO { ...@@ -66,4 +66,8 @@ public class UpdateResourceColumnVO {
* 标签图标 * 标签图标
*/ */
private String labelIcon; private String labelIcon;
/**
* 导航id
*/
private Long navigationId;
} }
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import com.pcloud.book.group.entity.ResourcePageBookstore;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -58,4 +59,7 @@ public class UpdateResourcePageVO { ...@@ -58,4 +59,7 @@ public class UpdateResourcePageVO {
* 背景图 * 背景图
*/ */
private String backgroundImg; private String backgroundImg;
@ApiModelProperty("实体书购买")
private List<ResourcePageBookstore> resourcePageBookstoreList;
} }
...@@ -322,7 +322,7 @@ public class PushBizImpl implements PushBiz { ...@@ -322,7 +322,7 @@ public class PushBizImpl implements PushBiz {
//获取群信息 //获取群信息
GroupQrcode groupQrcode = groupQrcodeDao.getById(pushGroup.getBookGroupQrcodeId()); GroupQrcode groupQrcode = groupQrcodeDao.getById(pushGroup.getBookGroupQrcodeId());
if (groupQrcode == null) { if (groupQrcode == null) {
LOGGER.error("未找到群信息!qrcodeId=" + pushGroup.getBookGroupQrcodeId()); LOGGER.warn("未找到群信息!qrcodeId=" + pushGroup.getBookGroupQrcodeId());
continue; continue;
} }
//获取机器人微信号 //获取机器人微信号
...@@ -334,9 +334,8 @@ public class PushBizImpl implements PushBiz { ...@@ -334,9 +334,8 @@ public class PushBizImpl implements PushBiz {
LOGGER.info("发送一个群里的一个消息结束,休眠1秒pushGroup=" + pushGroup.toString() + "pushItem=" + pushItem.toString() + "altId=" + altId); LOGGER.info("发送一个群里的一个消息结束,休眠1秒pushGroup=" + pushGroup.toString() + "pushItem=" + pushItem.toString() + "altId=" + altId);
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
LOGGER.error("发消息休眠1秒出错", e); LOGGER.warn("发消息休眠1秒出错");
} }
} }
} }
} }
...@@ -349,8 +348,7 @@ public class PushBizImpl implements PushBiz { ...@@ -349,8 +348,7 @@ public class PushBizImpl implements PushBiz {
//获取群信息 //获取群信息
GroupQrcode groupQrcode = groupQrcodeDao.getById(pushGroup.getBookGroupQrcodeId()); GroupQrcode groupQrcode = groupQrcodeDao.getById(pushGroup.getBookGroupQrcodeId());
if (groupQrcode == null) { if (groupQrcode == null) {
LOGGER.error("未找到群信息!"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "未找到群信息");
return;
} }
String groupId = groupQrcode.getWeixinGroupId(); String groupId = groupQrcode.getWeixinGroupId();
ClassifyDTO classifyDTO = bookGroupClassifyDao.getById(groupQrcode.getClassifyId()); ClassifyDTO classifyDTO = bookGroupClassifyDao.getById(groupQrcode.getClassifyId());
......
...@@ -1201,7 +1201,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1201,7 +1201,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if (null == resourcePageVO || null == resourcePageVO.getId()) { if (null == resourcePageVO || null == resourcePageVO.getId()) {
return; return;
} }
List<ResourceColumnAndServeVO> serveVOList = resourcePageBiz.getColumnAndServeListByPageId(resourcePageVO.getId(), false, null, null, null, null); List<ResourceColumnAndServeVO> serveVOList = resourcePageBiz.getColumnAndServeListByPageId(resourcePageVO.getId(), false, null, null, null, null, null);
UpdateResourceColumnVO columnVO = new UpdateResourceColumnVO(); UpdateResourceColumnVO columnVO = new UpdateResourceColumnVO();
columnVO.setColumnFormat(3); columnVO.setColumnFormat(3);
columnVO.setColumnName("精品资讯"); columnVO.setColumnName("精品资讯");
......
...@@ -14,6 +14,11 @@ public class ThreadPoolUtils { ...@@ -14,6 +14,11 @@ public class ThreadPoolUtils {
*/ */
public static final int REMOTE_TIME_OUT = 5; public static final int REMOTE_TIME_OUT = 5;
/**
* 远程调用超时时间(单位:秒)
*/
public static final int REMOTE_TIME_OUT_LONG = 30;
/** /**
* 异步导出线程池 * 异步导出线程池
......
...@@ -14,23 +14,24 @@ ...@@ -14,23 +14,24 @@
<result column="BOOK_STATUS" property="bookStatus" jdbcType="TINYINT" /> <result column="BOOK_STATUS" property="bookStatus" jdbcType="TINYINT" />
<result column="check_type" property="checkType" jdbcType="TINYINT" /> <result column="check_type" property="checkType" jdbcType="TINYINT" />
<result column="is_authorized_pay" property="isAuthorizedPay" jdbcType="TINYINT" /> <result column="is_authorized_pay" property="isAuthorizedPay" jdbcType="TINYINT" />
<result column="open_pay" property="openPay" jdbcType="TINYINT" />
</resultMap> </resultMap>
<insert id="insert" useGeneratedKeys="true" parameterType="bookAuthInfo"> <insert id="insert" useGeneratedKeys="true" parameterType="bookAuthInfo">
INSERT INTO BOOK_AUTH_INFO( INSERT INTO BOOK_AUTH_INFO(
BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE, CREATED_USER, CREATED_DATE,LAST_MODIFIED_DATE,OPEN_TIME, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE, CREATED_USER, CREATED_DATE,LAST_MODIFIED_DATE,OPEN_TIME,
is_paper_book, is_group_book, is_authorized_pay is_paper_book, is_group_book, is_authorized_pay, open_pay
) )
VALUES VALUES
(#{bookId,jdbcType=BIGINT}, #{channelId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT}, (#{bookId,jdbcType=BIGINT}, #{channelId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT},
#{price}, #{codeUseCount,jdbcType=BIGINT}, #{buyUrl}, #{checkType}, #{price}, #{codeUseCount,jdbcType=BIGINT}, #{buyUrl}, #{checkType},
#{adviserId,jdbcType=BIGINT}, NOW(), NOW(), NOW(), #{adviserId,jdbcType=BIGINT}, NOW(), NOW(), NOW(),
#{isPaperBook}, #{isGroupBook}, IFNULL(#{isAuthorizedPay},0)) #{isPaperBook}, #{isGroupBook}, IFNULL(#{isAuthorizedPay},0), IFNULL(#{openPay},1))
</insert> </insert>
<select id="getInfoByBook" resultMap="BookAuthInfoMap" parameterType="map"> <select id="getInfoByBook" resultMap="BookAuthInfoMap" parameterType="map">
SELECT SELECT
ID, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE,BOOK_STATUS,LOCATION_DESC, is_authorized_pay ID, BOOK_ID, CHANNEL_ID,ADVISER_ID,PRICE,CODE_USE_COUNT,BUY_URL,CHECK_TYPE,BOOK_STATUS,LOCATION_DESC, is_authorized_pay, open_pay
FROM FROM
BOOK_AUTH_INFO BOOK_AUTH_INFO
WHERE WHERE
...@@ -267,6 +268,9 @@ ...@@ -267,6 +268,9 @@
<if test="isAuthorizedPay != null"> <if test="isAuthorizedPay != null">
is_authorized_pay = #{isAuthorizedPay}, is_authorized_pay = #{isAuthorizedPay},
</if> </if>
<if test="openPay != null">
open_pay = #{openPay},
</if>
LAST_MODIFIED_DATE = NOW() LAST_MODIFIED_DATE = NOW()
WHERE WHERE
ID = #{id} ID = #{id}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pcloud.book.group.dao.impl.ResourcePageBookstoreDaoImpl">
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.ResourcePageBookstore">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="resource_page_id" property="resourcePageId" jdbcType="BIGINT"/>
<result column="serve_id" property="serveId" jdbcType="BIGINT"/>
<result column="serve_type" property="serveType" jdbcType="VARCHAR"/>
<result column="link_url" property="linkUrl" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>
<resultMap id="BaseDtoResultMap" extends="BaseResultMap" type="com.pcloud.book.group.vo.ResourcePageBookstoreVO">
</resultMap>
<sql id="Base_Column_List">
id, resource_page_id, serve_id, serve_type, link_url, create_time
</sql>
<select id="getById" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM resource_page_bookstore
WHERE id = #{id}
</select>
<select id="getByResourcePageId" resultMap="BaseDtoResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM resource_page_bookstore
WHERE resource_page_id = #{resourcePageId}
</select>
<select id="getList" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM resource_page_bookstore
</select>
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
INSERT INTO resource_page_bookstore(
resource_page_id,
serve_id,
serve_type,
link_url,
create_time
) VALUES (
#{resourcePageId, jdbcType=BIGINT},
#{serveId, jdbcType=BIGINT},
#{serveType, jdbcType=VARCHAR},
#{linkUrl, jdbcType=VARCHAR},
NOW()
)
</insert>
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
INSERT INTO resource_page_bookstore (
resource_page_id,
serve_id,
serve_type,
link_url,
create_time
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.resourcePageId, jdbcType=BIGINT},
#{item.serveId, jdbcType=BIGINT},
#{item.serveType, jdbcType=VARCHAR},
#{item.linkUrl, jdbcType=VARCHAR},
NOW()
)
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
UPDATE resource_page_bookstore
<set>
<if test="resourcePageId != null">
resource_page_id = #{resourcePageId},
</if>
<if test="serveId != null">
serve_id = #{serveId},
</if>
<if test="serveType != null and serveType != ''">
serve_type = #{serveType},
</if>
<if test="linkUrl != null and linkUrl != ''">
link_url = #{linkUrl},
</if>
</set>
WHERE id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
DELETE FROM resource_page_bookstore WHERE id = #{id}
</delete>
<!--通过主键删除-->
<delete id="deleteByResourcePageId">
DELETE FROM resource_page_bookstore WHERE resource_page_id = #{resourcePageId}
</delete>
</mapper>
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="INTEGER"/> <result property="createUser" column="create_user" jdbcType="INTEGER"/>
<result property="labelIcon" column="label_icon" jdbcType="VARCHAR"/> <result property="labelIcon" column="label_icon" jdbcType="VARCHAR"/>
<result property="navigationId" column="navigation_id" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<resultMap id="ResourceColumnAndServe" type="com.pcloud.book.group.vo.ResourceColumnAndServeVO"> <resultMap id="ResourceColumnAndServe" type="com.pcloud.book.group.vo.ResourceColumnAndServeVO">
...@@ -27,12 +28,13 @@ ...@@ -27,12 +28,13 @@
<result property="showCount" column="show_count" jdbcType="INTEGER"/> <result property="showCount" column="show_count" jdbcType="INTEGER"/>
<result property="showMore" column="show_more" jdbcType="BOOLEAN"/> <result property="showMore" column="show_more" jdbcType="BOOLEAN"/>
<result property="labelIcon" column="label_icon" jdbcType="VARCHAR"/> <result property="labelIcon" column="label_icon" jdbcType="VARCHAR"/>
<result property="navigationId" column="navigation_id" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<!--查询单个--> <!--查询单个-->
<select id="getById" resultMap="ResourcePageColumnMap"> <select id="getById" resultMap="ResourcePageColumnMap">
select select
id, resource_page_id, column_type, column_name, column_format, column_seq, show_more,show_count, create_time, label_icon id, resource_page_id, column_type, column_name, column_format, column_seq, show_more,show_count, create_time, label_icon, navigation_id
from book.resource_page_column from book.resource_page_column
where id = #{id} where id = #{id}
</select> </select>
...@@ -40,9 +42,9 @@ ...@@ -40,9 +42,9 @@
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_column(resource_page_id, column_type, column_name, column_format, column_seq, insert into book.resource_page_column(resource_page_id, column_type, column_name, column_format, column_seq,
show_more, show_count, create_time, update_time, create_user, label_icon) show_more, show_count, create_time, update_time, create_user, label_icon, navigation_id)
values (#{resourcePageId}, #{columnType}, #{columnName}, #{columnFormat}, #{columnSeq}, values (#{resourcePageId}, #{columnType}, #{columnName}, #{columnFormat}, #{columnSeq},
#{showMore}, #{showCount}, now(), now(), #{createUser}, #{labelIcon}) #{showMore}, #{showCount}, now(), now(), #{createUser}, #{labelIcon}, #{navigationId})
</insert> </insert>
<!--通过主键修改数据--> <!--通过主键修改数据-->
...@@ -69,6 +71,9 @@ ...@@ -69,6 +71,9 @@
</if> </if>
label_icon = #{labelIcon}, label_icon = #{labelIcon},
update_time = now(), update_time = now(),
<if test="navigationId != null">
navigation_id = #{navigationId},
</if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
...@@ -78,15 +83,18 @@ ...@@ -78,15 +83,18 @@
delete from book.resource_page_column where id = #{id} delete from book.resource_page_column where id = #{id}
</delete> </delete>
<select id="getMaxSeq" parameterType="long" resultType="integer"> <select id="getMaxSeq" parameterType="map" resultType="integer">
SELECT SELECT
IFNULL(MAX(column_seq), 0) IFNULL(MAX(column_seq), 0)
FROM FROM
book.resource_page_column book.resource_page_column
where resource_page_id = #{resourcePageId} where resource_page_id = #{resourcePageId}
<if test="navigationId != null">
and navigation_id = #{navigationId}
</if>
</select> </select>
<select id="getColumnListByPageId" resultMap="ResourceColumnAndServe" parameterType="long"> <select id="getColumnListByPageId" resultMap="ResourceColumnAndServe" parameterType="map">
SELECT SELECT
resource_page_id, resource_page_id,
id, id,
...@@ -96,11 +104,15 @@ ...@@ -96,11 +104,15 @@
column_seq, column_seq,
show_count, show_count,
show_more, show_more,
label_icon label_icon,
navigation_id
FROM FROM
resource_page_column resource_page_column
WHERE WHERE
resource_page_id = #{resourcePageId} resource_page_id = #{resourcePageId}
<if test="navigationId != null">
and navigation_id = #{navigationId}
</if>
ORDER BY ORDER BY
column_seq ASC, column_seq ASC,
id ASC id ASC
...@@ -108,7 +120,7 @@ ...@@ -108,7 +120,7 @@
<select id="getByColumnTypeAndPage" parameterType="map" resultMap="ResourcePageColumnMap"> <select id="getByColumnTypeAndPage" parameterType="map" resultMap="ResourcePageColumnMap">
select select
id, resource_page_id, column_type, column_name, column_format, column_seq, show_more, show_count, create_time id, resource_page_id, column_type, column_name, column_format, column_seq, show_more, show_count, create_time, navigation_id
from book.resource_page_column from book.resource_page_column
where resource_page_id = #{resourcePageId} where resource_page_id = #{resourcePageId}
and column_type = #{columnType} and column_type = #{columnType}
...@@ -123,11 +135,12 @@ ...@@ -123,11 +135,12 @@
<select id="getColumByMoveType" parameterType="map" resultMap="ResourcePageColumnMap"> <select id="getColumByMoveType" parameterType="map" resultMap="ResourcePageColumnMap">
SELECT SELECT
id, resource_page_id, column_type, column_name, column_format, column_seq, show_more, show_count, create_time id, resource_page_id, column_type, column_name, column_format, column_seq, show_more, show_count, create_time, navigation_id
FROM FROM
book.resource_page_column book.resource_page_column
WHERE WHERE
resource_page_id = #{resourcePageId} resource_page_id = #{resourcePageId}
AND navigation_id = #{navigationId}
<choose> <choose>
<when test="moveType == 'UP'"> <when test="moveType == 'UP'">
AND column_seq &lt; #{columnSeq} AND column_seq &lt; #{columnSeq}
...@@ -157,4 +170,18 @@ ...@@ -157,4 +170,18 @@
<delete id="deleteByPageId" parameterType="long"> <delete id="deleteByPageId" parameterType="long">
delete from book.resource_page_column where resource_page_id = #{resourcePageId} delete from book.resource_page_column where resource_page_id = #{resourcePageId}
</delete> </delete>
<update id="updateNavigationId" parameterType="map">
update book.resource_page_column
set navigation_id = #{navigationId}
where resource_page_id = #{resourcePageId}
</update>
<select id="getByNavigation" resultMap="ResourcePageColumnMap" parameterType="long">
select
id, resource_page_id, column_type, column_name, column_format, column_seq, show_more,show_count, create_time, label_icon, navigation_id
from book.resource_page_column
where navigation_id = #{navigationId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -19,11 +19,13 @@ ...@@ -19,11 +19,13 @@
<result property="bookId" column="book_id" jdbcType="INTEGER"/> <result property="bookId" column="book_id" jdbcType="INTEGER"/>
<result property="channelId" column="channel_id" jdbcType="INTEGER"/> <result property="channelId" column="channel_id" jdbcType="INTEGER"/>
<result property="backgroundImg" column="background_img" jdbcType="VARCHAR"/> <result property="backgroundImg" column="background_img" jdbcType="VARCHAR"/>
<result property="navigationColor" column="navigation_color" jdbcType="INTEGER"/>
<result property="navigationFormat" column="navigation_format" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, book_group_id, style, show_book, open_rays, open_food, create_time, update_time, create_user, qrcode_url, scene_id, official_scene_id, id, book_group_id, style, show_book, open_rays, open_food, create_time, update_time, create_user, qrcode_url, scene_id, official_scene_id,
book_cover, book_id, channel_id, background_img book_cover, book_id, channel_id, background_img, navigation_color, navigation_format
</sql> </sql>
<!--查询单个--> <!--查询单个-->
...@@ -88,8 +90,7 @@ ...@@ -88,8 +90,7 @@
<select id="getByBookGroupId" parameterType="long" resultMap="ResourcePageMap"> <select id="getByBookGroupId" parameterType="long" resultMap="ResourcePageMap">
select select
id, book_group_id, style, show_book, open_rays, open_food, qrcode_url, official_scene_id, book_cover, book_id, channel_id, create_user, <include refid="Base_Column_List"/>
background_img
from book.resource_page from book.resource_page
where book_group_id = #{bookGroupId} where book_group_id = #{bookGroupId}
limit 1 limit 1
...@@ -105,7 +106,9 @@ ...@@ -105,7 +106,9 @@
p.open_rays, p.open_rays,
p.open_food, p.open_food,
p.scene_id, p.scene_id,
p.background_img p.background_img,
p.navigation_color,
p.navigation_format
FROM FROM
resource_page p resource_page p
LEFT JOIN resource_page_item i ON p.id = i.resource_page_id LEFT JOIN resource_page_item i ON p.id = i.resource_page_id
...@@ -134,8 +137,7 @@ ...@@ -134,8 +137,7 @@
<select id="getBySceneId" parameterType="long" resultMap="ResourcePageMap"> <select id="getBySceneId" parameterType="long" resultMap="ResourcePageMap">
select select
id, book_group_id, style, show_book, open_rays, open_food, qrcode_url, scene_id, official_scene_id, book_cover,book_id, channel_id, create_user, <include refid="Base_Column_List"/>
background_img
from book.resource_page from book.resource_page
where scene_id = #{sceneId} where scene_id = #{sceneId}
limit 1 limit 1
...@@ -281,4 +283,18 @@ ...@@ -281,4 +283,18 @@
scene_id = #{sceneId} scene_id = #{sceneId}
</update> </update>
<select id="updateNavigationFormat" parameterType="map">
UPDATE resource_page
<set>
<if test="navigationColor != null">
navigation_color = #{navigationColor},
</if>
<if test="navigationFormat != null">
navigation_format = #{navigationFormat},
</if>
update_time = NOW(),
</set>
where id = #{id}
</select>
</mapper> </mapper>
...@@ -197,6 +197,7 @@ ...@@ -197,6 +197,7 @@
resource_page_item i resource_page_item i
LEFT JOIN resource_page p ON i.resource_page_id = p.id LEFT JOIN resource_page p ON i.resource_page_id = p.id
LEFT JOIN resource_page_column c ON i.resource_page_column_id = c.id LEFT JOIN resource_page_column c ON i.resource_page_column_id = c.id
LEFT JOIN resource_page_navigation n ON c.navigation_id = n.id
WHERE WHERE
p.scene_id IN p.scene_id IN
<foreach collection="list" index="index" separator="," open="(" close=")" item="item"> <foreach collection="list" index="index" separator="," open="(" close=")" item="item">
...@@ -204,7 +205,7 @@ ...@@ -204,7 +205,7 @@
</foreach> </foreach>
AND i.serve_type IN ('APP', 'PRODUCT') AND i.serve_type IN ('APP', 'PRODUCT')
ORDER BY ORDER BY
c.column_seq ASC, i.seq_num ASC, i.id ASC n.navigation_seq ASC, c.column_seq ASC, i.seq_num ASC, i.id ASC
</select> </select>
<!--只配置了1个应用作品,且不开启小睿--> <!--只配置了1个应用作品,且不开启小睿-->
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pcloud.book.group.dao.impl.ResourcePageNavigationDaoImpl">
<resultMap type="com.pcloud.book.group.entity.ResourcePageNavigation" id="ResourcePageNavigationMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="resourcePageId" column="resource_page_id" jdbcType="INTEGER"/>
<result property="navigationType" column="navigation_type" jdbcType="INTEGER"/>
<result property="navigationName" column="navigation_name" jdbcType="VARCHAR"/>
<result property="navigationIcon" column="navigation_icon" jdbcType="VARCHAR"/>
<result property="navigationSeq" column="navigation_seq" jdbcType="INTEGER"/>
<result property="createUser" column="create_user" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq
</sql>
<!--查询单个-->
<select id="getById" resultMap="ResourcePageNavigationMap">
select
<include refid="Base_Column_List"/>
from book.resource_page_navigation
where id = #{id}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, create_time, update_time)
values (#{resourcePageId}, #{navigationType}, #{navigationName}, #{navigationIcon}, #{navigationSeq}, #{createUser}, now(), now())
</insert>
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, create_time, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.resourcePageId}, #{item.navigationType}, #{item.navigationName}, #{item.navigationIcon}, #{item.navigationSeq}, #{item.createUser}, now(), now())
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update book.resource_page_navigation
<set>
<if test="navigationName != null and navigationName != ''">
navigation_name = #{navigationName},
</if>
navigation_icon = #{navigationIcon},
<if test="navigationSeq != null">
navigation_seq = #{navigationSeq},
</if>
update_time = now(),
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from book.resource_page_navigation where id = #{id}
</delete>
<select id="getByPageId" parameterType="long" resultMap="ResourcePageNavigationMap">
select
<include refid="Base_Column_List"/>
from book.resource_page_navigation
where resource_page_id = #{resourcePageId}
order by navigation_seq asc, id asc
</select>
<select id="getNoNavigationPages" resultType="long" parameterType="map">
SELECT
r.id
FROM
resource_page r
LEFT JOIN resource_page_navigation n ON r.id = n.resource_page_id
<if test="openRays != null and openRays == 1">
AND n.navigation_type = 2
</if>
WHERE
n.id IS NULL
<if test="openRays != null and openRays == 1">
AND r.open_rays = #{openRays}
</if>
</select>
<select id="getByType" parameterType="map" resultMap="ResourcePageNavigationMap">
select
<include refid="Base_Column_List"/>
from book.resource_page_navigation
where resource_page_id = #{resourcePageId}
and navigation_type = #{navigationType}
limit 1
</select>
<select id="getMaxSeq" parameterType="long" resultType="integer">
SELECT
IFNULL(MAX(navigation_seq), 0)
FROM
book.resource_page_navigation
where resource_page_id = #{resourcePageId}
</select>
<delete id="deleteNavigation" parameterType="map">
DELETE
from book.resource_page_navigation
where resource_page_id = #{resourcePageId}
and navigation_type = #{navigationType}
</delete>
<select id="getByName" parameterType="map" resultMap="ResourcePageNavigationMap">
select
<include refid="Base_Column_List"/>
from book.resource_page_navigation
where resource_page_id = #{resourcePageId}
and navigation_name = #{navigationName}
limit 1
</select>
<update id="updateSeq4Batch" parameterType="list">
update book.resource_page_navigation set navigation_seq =
<foreach collection="list" open="CASE" separator=" " close="END" item="item">
WHEN id = #{item.id} THEN #{item.navigationSeq}
</foreach>
where id IN
<foreach collection="list" item="item" close=")" separator="," open="(">
${item.id}
</foreach>
</update>
<select id="getNavigationByMoveType" parameterType="map" resultMap="ResourcePageNavigationMap">
SELECT
<include refid="Base_Column_List"/>
FROM
book.resource_page_navigation
WHERE
resource_page_id = #{resourcePageId}
<choose>
<when test="moveType == 'UP'">
AND navigation_seq &lt; #{navigationSeq}
ORDER BY
navigation_seq DESC
</when>
<otherwise>
AND navigation_seq > #{navigationSeq}
ORDER BY
navigation_seq ASC
</otherwise>
</choose>
LIMIT 1
</select>
<update id="updateNavigationSeqNum" parameterType="map">
update resource_page_navigation
set navigation_seq = #{navigationSeq},
update_time = now()
where id = #{id}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pcloud.book.group.dao.impl.ResourcePagePicDaoImpl">
<resultMap type="com.pcloud.book.group.entity.ResourcePagePic" id="ResourcePagePicMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="picUrl" column="pic_url" jdbcType="VARCHAR"/>
<result property="isDefault" column="is_default" jdbcType="INTEGER"/>
<result property="type" column="type" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="adviserId" column="adviser_id" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="getById" resultMap="ResourcePagePicMap">
select
id, pic_url, is_default, type, create_time, adviser_id
from resource_page_pic
where id = #{id}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into resource_page_pic(pic_url, is_default, type, create_time, adviser_id)
values (#{picUrl}, #{isDefault}, #{type}, now(), #{adviserId})
</insert>
<!--通过主键修改数据-->
<update id="update">
update resource_page_pic
<set>
<if test="picUrl != null and picUrl != ''">
pic_url = #{picUrl},
</if>
<if test="isDefault != null">
is_default = #{isDefault},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="adviserId != null">
adviser_id = #{adviserId},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from resource_page_pic where id = #{id}
</delete>
<select id="getByType" parameterType="map" resultMap="ResourcePagePicMap">
select
id, pic_url, is_default, type, create_time
from resource_page_pic
WHERE (adviser_id = #{adviserId} OR is_default=1)
<if test="type != null">
AND type = #{type}
</if>
ORDER BY is_default ASC, id DESC
</select>
</mapper>
\ No newline at end of file
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