Commit ad1f5b03 by 田超

Merge branch 'feature/1004458' into 'master'

feat: [1004458] H5落地页改版

See merge request rays/pcloud-book!1260
parents bf9c473e 6242ddcb
...@@ -24,7 +24,7 @@ public enum AppletRecordTypeEnum { ...@@ -24,7 +24,7 @@ public enum AppletRecordTypeEnum {
WX_WORK_TEACHER(10, "微信客服"), WX_WORK_TEACHER(10, "微信客服"),
//第三方资源 //第三方资源
ThIRD_RESOURCE(11, "第三方资源"); THIRD_RESOURCE(11, "第三方资源");
public Integer value; public Integer value;
......
...@@ -155,6 +155,18 @@ public class BookGroupDTO implements Serializable { ...@@ -155,6 +155,18 @@ public class BookGroupDTO implements Serializable {
private Integer groupQrcodePageNum; private Integer groupQrcodePageNum;
private Integer groupQrcodeLocationId; private Integer groupQrcodeLocationId;
private String groupQrcodeRemark; private String groupQrcodeRemark;
/**
* H5落地页是否开启小睿流程
*/
private Integer resourcePageOpenRays;
public Integer getResourcePageOpenRays() {
return resourcePageOpenRays;
}
public void setResourcePageOpenRays(Integer resourcePageOpenRays) {
this.resourcePageOpenRays = resourcePageOpenRays;
}
public Integer getGroupQrcodePageNum() { public Integer getGroupQrcodePageNum() {
return groupQrcodePageNum; return groupQrcodePageNum;
...@@ -457,6 +469,7 @@ public class BookGroupDTO implements Serializable { ...@@ -457,6 +469,7 @@ public class BookGroupDTO implements Serializable {
", groupQrcodePageNum=" + groupQrcodePageNum + ", groupQrcodePageNum=" + groupQrcodePageNum +
", groupQrcodeLocationId=" + groupQrcodeLocationId + ", groupQrcodeLocationId=" + groupQrcodeLocationId +
", groupQrcodeRemark='" + groupQrcodeRemark + '\'' + ", groupQrcodeRemark='" + groupQrcodeRemark + '\'' +
", resourcePageOpenRays=" + resourcePageOpenRays +
'}'; '}';
} }
} }
\ No newline at end of file
...@@ -303,4 +303,12 @@ public interface AppletBooklistBiz { ...@@ -303,4 +303,12 @@ public interface AppletBooklistBiz {
* @return * @return
*/ */
PageBeanNew<AppletOuterBooklistDTO> listPageOuterBooklist4Wechat(Integer currentPage, Integer numPerPage); PageBeanNew<AppletOuterBooklistDTO> listPageOuterBooklist4Wechat(Integer currentPage, Integer numPerPage);
/**
* 批量查外部书单(不含书籍)
* @author:zhuyajie
* @date:2020/8/11 17:07
* * @param null
*/
Map<Long,AppletOuterBooklistDTO> getBooklistInfoByIds(List<Long> booklistIds);
} }
...@@ -36,4 +36,6 @@ public interface AppletThirdResourcesBiz { ...@@ -36,4 +36,6 @@ public interface AppletThirdResourcesBiz {
PageBeanNew<ThirdResourceRecordDTO> listThirdResourceRecord(String queryName, Integer currentPage, Integer numPerPage, String wechatUser, Long thirdResourceId, Integer recordType); PageBeanNew<ThirdResourceRecordDTO> listThirdResourceRecord(String queryName, Integer currentPage, Integer numPerPage, String wechatUser, Long thirdResourceId, Integer recordType);
Map<Long, AppletThirdResources> getAppletMapByIds(List<Long> list); Map<Long, AppletThirdResources> getAppletMapByIds(List<Long> list);
List<AppletThirdResources> getThirdResourcesByNewsId(Long newsId);
} }
...@@ -13,8 +13,7 @@ import com.pcloud.book.book.biz.BookBiz; ...@@ -13,8 +13,7 @@ import com.pcloud.book.book.biz.BookBiz;
import com.pcloud.book.book.dto.BookDto; import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.consumer.message.TemplateConsr; import com.pcloud.book.consumer.message.TemplateConsr;
import com.pcloud.book.consumer.user.AdviserConsr; import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.group.biz.BookGroupBiz; import com.pcloud.book.group.biz.ResourcePageBiz;
import com.pcloud.book.group.dto.BookServeDTO;
import com.pcloud.book.util.properties.BookProps; import com.pcloud.book.util.properties.BookProps;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.core.constant.SceneCode; import com.pcloud.common.core.constant.SceneCode;
...@@ -52,13 +51,13 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz { ...@@ -52,13 +51,13 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
@Autowired @Autowired
private TemplateConsr templateConsr; private TemplateConsr templateConsr;
@Autowired @Autowired
private BookGroupBiz bookGroupBiz;
@Autowired
private BookBiz bookBiz; private BookBiz bookBiz;
@Autowired @Autowired
private AdviserConsr adviserConsr; private AdviserConsr adviserConsr;
@Autowired @Autowired
private AnswerSubscribeAdviserDao answerSubscribeAdviserDao; private AnswerSubscribeAdviserDao answerSubscribeAdviserDao;
@Autowired
private ResourcePageBiz resourcePageBiz;
@Override @Override
public void answerSubscribe(AnswerSubscribeDTO answerSubscribeDTO) { public void answerSubscribe(AnswerSubscribeDTO answerSubscribeDTO) {
...@@ -72,8 +71,7 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz { ...@@ -72,8 +71,7 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
if (!ListUtils.isEmpty(list)) { if (!ListUtils.isEmpty(list)) {
return; return;
} }
List<BookServeDTO> serveIds = bookGroupBiz.getBookAndBookGroupServeIds(answerSubscribeDTO.getAdviserId(), answerSubscribeDTO.getBookId(), answerSubscribeDTO.getChannelId()); answerSubscribe.setResourceCount(resourcePageBiz.getResourceCounts(answerSubscribeDTO.getBookId(),answerSubscribeDTO.getAdviserId(),answerSubscribeDTO.getChannelId()));
answerSubscribe.setResourceCount(serveIds.size());
answerSubscribeDao.insert(answerSubscribe); answerSubscribeDao.insert(answerSubscribe);
} }
...@@ -118,14 +116,14 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz { ...@@ -118,14 +116,14 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
if (null == bookDto) { if (null == bookDto) {
continue; continue;
} }
List<BookServeDTO> serveIds = bookGroupBiz.getBookAndBookGroupServeIds(adviserId, bookId, channelId); Integer resourceCount = resourcePageBiz.getResourceCounts(bookId, adviserId, channelId);
if (ListUtils.isEmpty(serveIds)){ if (resourceCount<=0){
continue; continue;
} }
String bookName = bookDto.getBookName(); String bookName = bookDto.getBookName();
for (AnswerSubscribe answerSubscribeUser : userList) { for (AnswerSubscribe answerSubscribeUser : userList) {
Long wechatUserId = answerSubscribeUser.getWechatUserId(); Long wechatUserId = answerSubscribeUser.getWechatUserId();
if (serveIds.size() <= answerSubscribeUser.getResourceCount()) { if (resourceCount <= answerSubscribeUser.getResourceCount()) {
//资源无新增,改为订阅未发送状态 //资源无新增,改为订阅未发送状态
answerSubscribeUser.setSendState(AnswerSendStateEnum.subscribe.code); answerSubscribeUser.setSendState(AnswerSendStateEnum.subscribe.code);
} else { } else {
...@@ -171,8 +169,8 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz { ...@@ -171,8 +169,8 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
List<AnswerSubscribe> list = answerSubscribeDao.getBookBySendState(AnswerSendStateEnum.subscribe.code); List<AnswerSubscribe> list = answerSubscribeDao.getBookBySendState(AnswerSendStateEnum.subscribe.code);
if (!ListUtils.isEmpty(list)) { if (!ListUtils.isEmpty(list)) {
for (AnswerSubscribe answerSubscribe : list) { for (AnswerSubscribe answerSubscribe : list) {
List<BookServeDTO> serveIds = bookGroupBiz.getBookAndBookGroupServeIds(answerSubscribe.getAdviserId(), answerSubscribe.getBookId(), answerSubscribe.getChannelId()); Integer resourceCount = resourcePageBiz.getResourceCounts(answerSubscribe.getBookId(), answerSubscribe.getAdviserId(), answerSubscribe.getChannelId());
if (serveIds.size() > answerSubscribe.getResourceCount()) { if (resourceCount > answerSubscribe.getResourceCount()) {
answerSubscribe.setSendState(AnswerSendStateEnum.wait_send.code); answerSubscribe.setSendState(AnswerSendStateEnum.wait_send.code);
answerSubscribeDao.updateSendState(answerSubscribe); answerSubscribeDao.updateSendState(answerSubscribe);
} }
......
...@@ -616,6 +616,20 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -616,6 +616,20 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
map.put("name", name); map.put("name", name);
map.put("agentId", agentId); map.put("agentId", agentId);
PageBeanNew<AppletOuterBooklistDTO> pageBeanNew = appletOuterBooklistDao.listPageNew(new PageParam(currentPage,numPerPage), map,"listPageOuterBooklist"); PageBeanNew<AppletOuterBooklistDTO> pageBeanNew = appletOuterBooklistDao.listPageNew(new PageParam(currentPage,numPerPage), map,"listPageOuterBooklist");
if (ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, pageBeanNew.getTotalCount(), new ArrayList<>());
}
for (AppletOuterBooklistDTO dto:pageBeanNew.getRecordList()) {
//带3本书
String key = AppletConstants.OUTER_BOOKLIST_BOOK + dto.getId();
List<AppletOuterBookDTO> bookList = JedisClusterUtils.getJsonList(key, AppletOuterBookDTO.class);
if (ListUtils.isEmpty(bookList)) {
bookList = appletOuterBookDao.listPageOuterBookByBooklistId(dto.getId(), 3);
JedisClusterUtils.setJson(key, bookList);
JedisClusterUtils.expire(key, 3600);
}
dto.setOuterBookDTOS(bookList);
}
return pageBeanNew; return pageBeanNew;
} }
...@@ -803,4 +817,9 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -803,4 +817,9 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
} }
return pageBeanNew; return pageBeanNew;
} }
@Override
public Map<Long, AppletOuterBooklistDTO> getBooklistInfoByIds(List<Long> booklistIds) {
return appletOuterBooklistDao.getByIds(booklistIds);
}
} }
...@@ -385,4 +385,9 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz { ...@@ -385,4 +385,9 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
return appletThirdResourcesMap; return appletThirdResourcesMap;
} }
@Override
public List<AppletThirdResources> getThirdResourcesByNewsId(Long newsId) {
return thirdResourcesDao.getThirdResourcesByNewsId(newsId);
}
} }
...@@ -748,4 +748,33 @@ public interface BookBiz { ...@@ -748,4 +748,33 @@ public interface BookBiz {
List<BookInfo4ScanCount> fetchBookListByScanCount(List<BookInfo4ScanCountRequestVO> requestVOS); List<BookInfo4ScanCount> fetchBookListByScanCount(List<BookInfo4ScanCountRequestVO> requestVOS);
BookCountsVO getPublishCounts(Long agentId,int month); BookCountsVO getPublishCounts(Long agentId,int month);
/**
* 添加书刊链接
* @author:zhuyajie
* @date:2021/4/1 10:02
* * @param null
*/
void updateBookLink(BookLinkVO bookLinkVO, Long adviserId);
/**
* 查书刊链接
* @author:zhuyajie
* @date:2021/4/1 10:04
* * @param null
*/
Map<Long, BookLinkVO> getBookLinkMap(Long adviserId, List<Long> bookIds);
/**
* 查书刊链接
* @author:zhuyajie
* @date:2021/4/1 16:01
* * @param null
*/
List<BookLinkVO> getBookLink(Long adviserId, List<Long> bookIds);
/**
* 编辑端查所有书刊
* @author:zhuyajie
* @date:2021/4/16 14:31
* * @param null
*/
PageBeanNew<BookDto> listAll4Adviser(BookSearchParamVO bookSearchParamVO);
} }
package com.pcloud.book.book.dao;
import com.pcloud.book.book.entity.BookLink;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
import java.util.Map;
/**
* 编辑创建的书刊链接(BookLink)表数据库访问层
*
* @author makejava
* @since 2021-04-01 09:56:29
*/
public interface BookLinkDao extends BaseDao<BookLink>{
/**
* 根据编辑和书刊查询书刊链接
* @author:zhuyajie
* @date:2021/4/1 10:06
* * @param null
*/
BookLink getByBookIdAndAdviser(Long bookId, Long adviserId);
/**
* 查书刊链接
* @author:zhuyajie
* @date:2021/4/1 10:10
* * @param null
*/
Map<Long,BookLink> getBookLinkMap(Long adviserId, List<Long> bookIds);
}
\ No newline at end of file
package com.pcloud.book.book.dao.impl;
import com.pcloud.book.book.dao.BookLinkDao;
import com.pcloud.book.book.entity.BookLink;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName com.pcloud.book.book.dao.impl.BookLinkDaoImpl
* @Author zhuyajie
* @Description 书刊链接
* @Date 2021/4/1 9:59
* @Version 1.0
**/
@Repository
public class BookLinkDaoImpl extends BaseDaoImpl<BookLink> implements BookLinkDao {
@Override
public BookLink getByBookIdAndAdviser(Long bookId, Long adviserId) {
Map<String, Object> map = new HashMap<>();
map.put("createUser", adviserId);
map.put("bookId", bookId);
return getSessionTemplate().selectOne(getStatement("getByBookIdAndAdviser"), map);
}
@Override
public Map<Long, BookLink> getBookLinkMap(Long adviserId, List<Long> bookIds) {
Map<String, Object> map = new HashMap<>();
map.put("createUser", adviserId);
map.put("bookIds", bookIds);
return getSessionTemplate().selectMap(getStatement("getBookLinkMap"), map, "bookId");
}
}
package com.pcloud.book.book.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
/**
* 编辑创建的书刊链接(BookLink)实体类
*
* @author makejava
* @since 2021-04-01 09:56:29
*/
@Data
public class BookLink extends BaseEntity {
private static final long serialVersionUID = 194873991456421616L;
/**
* 书刊id
*/
private Long bookId;
/**
* 链接来源(1当当2京东3拼多多)
*/
private Integer linkFrom;
/**
* 链接地址
*/
private String linkUrl;
/**
* 创建人
*/
private Long createUser;
}
\ No newline at end of file
...@@ -1341,4 +1341,19 @@ public class BookFacadeImpl implements BookFacade { ...@@ -1341,4 +1341,19 @@ public class BookFacadeImpl implements BookFacade {
BookCountsVO bookCountsVO = bookBiz.getPublishCounts(agentId,month); BookCountsVO bookCountsVO = bookBiz.getPublishCounts(agentId,month);
return new ResponseDto<>(bookCountsVO); return new ResponseDto<>(bookCountsVO);
} }
@ApiOperation("编辑查书刊链接")
@PostMapping("getBookLinkListByAdviser")
public ResponseDto<?> getBookLinkListByAdviser(@RequestHeader("token") String token, @RequestBody List<Long> bookIds) {
Long adviserId = (Long) SessionUtil.getVlaue(token,SessionUtil.PARTY_ID);
return new ResponseDto<>(bookBiz.getBookLink(adviserId, bookIds));
}
@ApiOperation("编辑端查所有书刊")
@PostMapping("listAll4Adviser")
public ResponseDto<?> listAll4Adviser(@RequestHeader("token") String token,
@RequestBody @Validated BookSearchParamVO bookSearchParamVO) throws BizException, PermissionException {
SessionUtil.getToken4Redis(token);
return new ResponseDto<>(bookBiz.listAll4Adviser(bookSearchParamVO));
}
} }
package com.pcloud.book.book.vo;
import com.pcloud.common.dto.BaseDto;
import lombok.Data;
/**
* 编辑创建的书刊链接(BookLink)实体类
*
* @author makejava
* @since 2021-04-01 09:56:29
*/
@Data
public class BookLinkVO extends BaseDto {
private static final long serialVersionUID = 194873991456421616L;
/**
* 书刊id
*/
private Long bookId;
/**
* 链接来源(1当当2京东3拼多多)
*/
private Integer linkFrom;
/**
* 链接地址
*/
private String linkUrl;
/**
* 创建人
*/
private Long createUser;
private String isbn;
private String bookName;
private String coverImg;
private String uniqueNumber;
private String publish;
}
\ No newline at end of file
...@@ -38,4 +38,6 @@ public class BookSearchParamVO { ...@@ -38,4 +38,6 @@ public class BookSearchParamVO {
private Long subLabelId; private Long subLabelId;
private Long verLabelId; private Long verLabelId;
private List<Long> choseBookIdList;
} }
...@@ -527,4 +527,16 @@ public class QrcodeSceneConsr { ...@@ -527,4 +527,16 @@ public class QrcodeSceneConsr {
} }
} }
@ParamLog("获取二维码信息")
public Map<Long, QrcodeSceneDto> listBaseInfoByIds(List<Long> sceneIds) {
Map<Long, QrcodeSceneDto> map = new HashMap<>();
try {
map = ResponseHandleUtil.parseMapResponse(qrcodeSceneService.listBaseInfoByIds(sceneIds), Long.class,QrcodeSceneDto.class);
} catch (Exception e) {
LOGGER.error("调用qrcodeSceneService.listBaseInfoById失败"+e.getMessage(),e);
}
return map;
}
} }
...@@ -892,4 +892,14 @@ public class WechatGroupConsr { ...@@ -892,4 +892,14 @@ public class WechatGroupConsr {
return new HashMap<>(); return new HashMap<>();
} }
} }
@ParamLog("用户最近扫码时间")
public String getUserLastTime(Long bookGroupId, Long wechatUserId) {
try {
return ResponseHandleUtil.parseResponse(groupMemberService.getUserLastTime(bookGroupId, wechatUserId), String.class);
} catch (Exception e) {
log.error("根据groupMemberService.getUserLastTime查用户最近扫码时间失败" + e.getMessage(), e);
}
return null;
}
} }
...@@ -47,4 +47,12 @@ public interface ESBookAndAdviserBiz { ...@@ -47,4 +47,12 @@ public interface ESBookAndAdviserBiz {
void stopNotFoundBookId(); void stopNotFoundBookId();
void updateTempletId(); void updateTempletId();
/**
* 查所有书刊,选中的在前
* @author:zhuyajie
* @date:2021/4/16 14:34
* * @param null
*/
Page<ESBookAndAdviser> getESBooksOrderByChose(String keyword, List<Long> choseBookIdList, Integer currentPage, Integer numPerPage);
} }
...@@ -30,6 +30,7 @@ import com.pcloud.common.core.aspect.ParamLog; ...@@ -30,6 +30,7 @@ import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.enums.AppTypeEnum; import com.pcloud.common.enums.AppTypeEnum;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.NumberUtil;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils; import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.robot.WeWorkWebHookRobotUtils; import com.pcloud.common.utils.robot.WeWorkWebHookRobotUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
...@@ -665,4 +666,26 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz { ...@@ -665,4 +666,26 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
null, CollUtil.toList("13035118598")); null, CollUtil.toList("13035118598"));
} }
} }
@Override
public Page<ESBookAndAdviser> getESBooksOrderByChose(String keyword, List<Long> choseBookIdList, Integer currentPage, Integer numPerPage) {
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery()
.filter(QueryBuilders.termQuery("isBookDelete", 0));
String number = (!StringUtil.isEmpty(keyword) && keyword.startsWith("BK") && keyword.length()>2)?keyword.substring(2):null;
if (!StringUtil.isEmpty(number) && NumberUtil.isNumber(number)) {
//书刊编号搜索
BoolQueryBuilder bookIdBuilder = QueryBuilders.boolQuery().must(QueryBuilders.termQuery("bookId", Long.valueOf(number)));
boolQueryBuilder.must(bookIdBuilder);
} else {
BoolQueryBuilder should = QueryBuilders.boolQuery()
.should(StringUtil.isEmpty(keyword) ? QueryBuilders.boolQuery() : QueryBuilders.wildcardQuery("bookName", "*" + keyword + "*"))
.should(StringUtil.isEmpty(keyword) ? QueryBuilders.boolQuery() : QueryBuilders.wildcardQuery("isbn", "*" + keyword + "*"));
boolQueryBuilder.must(should);
}
Sort sort = new Sort(Sort.Direction.DESC, "lastModifiedDate", "bookId");
PageRequest pageRequest = new PageRequest(currentPage, numPerPage, sort);
Page<ESBookAndAdviser> search = bookAndAdviserRepository.search(boolQueryBuilder, pageRequest);
return search;
}
} }
...@@ -908,13 +908,6 @@ public interface BookGroupBiz { ...@@ -908,13 +908,6 @@ public interface BookGroupBiz {
PageBeanNew<BookGroupDTO> listSingleBookGroup4Adviser(String name, Integer currentPage, Integer numPerPage, Long adviserId); PageBeanNew<BookGroupDTO> listSingleBookGroup4Adviser(String name, Integer currentPage, Integer numPerPage, Long adviserId);
/** /**
* 资源服务类型旧数据处理
* @author:zhuyajie
* @date:2020/6/16 11:09
* * @param null
*/
void updateBookServeTypeCode();
/**
* 小程序书刊资源数量 * 小程序书刊资源数量
* @author:zhuyajie * @author:zhuyajie
* @date:2020/6/15 18:12 * @date:2020/6/15 18:12
......
package com.pcloud.book.group.biz;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.entity.ResourcePage;
import com.pcloud.book.group.vo.ResourceColumnAndServeVO;
import com.pcloud.book.group.vo.ResourcePageItemVO;
import com.pcloud.book.group.vo.ResourcePageVO;
import com.pcloud.book.group.vo.UpdateResourceColumnVO;
import com.pcloud.book.group.vo.UpdateResourcePageVO;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew;
import java.util.List;
import java.util.Map;
/**
* @ClassName com.pcloud.book.group.biz.ResourcePageBiz
* @Author zhuyajie
* @Description 自有码H5页面
* @Date 2021/3/26 15:57
* @Version 1.0
**/
public interface ResourcePageBiz {
/**
* 更新资源页设置
* @author:zhuyajie
* @date:2021/3/26 17:05
* * @param null
*/
Long updateResourcePage(UpdateResourcePageVO updateResourcePageVO);
/**
* 更新资源栏目设置
* @author:zhuyajie
* @date:2021/3/26 17:27
* * @param null
*/
void updateResourceColumn(UpdateResourceColumnVO updateResourceColumnVO) throws BizException;
/**
* 根据rays码id查资源页基本配置
* @author:zhuyajie
* @date:2021/3/26 17:49
* * @param null
*/
ResourcePageVO getResourcePageByBookGroupIdOrSceneId(Long bookGroupId, Long adviserId, Long sceneId);
/**
* 根据rays码id查资源页栏目及资源
* @author:zhuyajie
* @date:2021/3/29 11:49
* * @param null
*/
List<ResourceColumnAndServeVO> getColumnAndServeListByPageId(Long resourcePageId, Boolean isWechat);
/**
* 根据书刊查资源页基本配置
* @author:zhuyajie
* @date:2021/3/30 10:25
* * @param null
*/
ResourcePageVO getResourcePageByBookId(Long bookId, Long channelId, Long adviserId, Long wechatUserId);
/**
* 处理旧数据
* @author:zhuyajie
* @date:2021/3/31 11:38
* * @param null
*/
void dealResource(List<Long> bookGroupIdList, List<Long> sceneIdList);
/**
* 栏目分页查询
* @author:zhuyajie
* @date:2021/3/31 19:06
* * @param null
*/
PageBeanNew<ResourcePageItemVO> listPageResourcePageItem(Integer currentPage, Integer numPerPage, Long resourcePageColumnId);
/**
* 根据社群码id查询
* @author:zhuyajie
* @date:2021/4/1 15:25
* * @param null
*/
ResourcePage getPageByBookGroupId(Long bookGroupId);
/**
* 获取栏目及资源类型
* @author:zhuyajie
* @date:2021/4/1 16:17
* * @param null
*/
List<Map<String,Object>> getColumnAndServeTypeList();
/**
* 栏目上移下移
* @author:zhuyajie
* @date:2021/4/2 14:53
* * @param null
*/
void updateColumnSeq(Long resourcePageColumnId, String moveType);
/**
* 删除栏目
* @author:zhuyajie
* @date:2021/4/2 15:14
* * @param null
*/
void deleteColumnById(Long resourcePageColumnId);
/**
* 更新资源页和栏目
* @author:zhuyajie
* @date:2021/4/6 17:09
* * @param null
*/
Long updateResourcePageAndColumn(UpdateResourcePageVO updateResourcePageVO);
/**
* 客户端根据rays码id查资源页基本配置
* @author:zhuyajie
* @date:2021/4/9 17:39
* * @param null
*/
ResourcePageVO getResourcePageByBookGroupIdOrSceneId4Wechat(Long bookGroupId, Long wechatUserId, Long sceneId);
/**
* 资源数量
* @author:zhuyajie
* @date:2021/4/16 13:39
* * @param null
*/
Integer getResourceCounts(Long bookId, Long adviserId, Long channelId);
/**
* 查应用作品资源
* @author:zhuyajie
* @date:2021/4/17 13:12
* * @param null
*/
List<BookGroupServe> getServeListByBookGroupId(Long bookGroupId);
}
package com.pcloud.book.group.constant;
/**
* @ClassName com.pcloud.book.group.constant.ResourcePageConstants
* @Author zhuyajie
* @Description 资源页
* @Date 2021/4/2 14:44
* @Version 1.0
**/
public class ResourcePageConstants {
/**
* 栏目类型
* @author:zhuyajie
* @date:2021/3/31 15:13
* * @param null
*/
public enum ColumnTypeEnum {
APP_PRODUCT(1, "应用作品", new String[]{ServeTypeEnum.APP.getValue(), ServeTypeEnum.PRODUCT.getValue()}),
OFFICIAL_ACCOUNT(2, "公众号", new String[]{ServeTypeEnum.OFFICIAL_ACCOUNT.getValue()}),
BOOKLIST(3, "书单", new String[]{ServeTypeEnum.BOOKLIST.getValue(),ServeTypeEnum.ADVISER_BOOK.getValue()}),
GROUP(4, "社群", new String[]{ServeTypeEnum.GROUP_ACTIVITY.getValue()}),
THIRD_RESOURCE(5, "第三方资源", new String[]{ServeTypeEnum.THIRD_RESOURCE.getValue()}),
PICTURE(6, "图片位", new String[]{ServeTypeEnum.APP.getValue(), ServeTypeEnum.PRODUCT.getValue(),
ServeTypeEnum.GROUP_ACTIVITY.getValue(), ServeTypeEnum.THIRD_RESOURCE.getValue()});
private Integer code;
private String name;
private String[] serves;
public String[] getServes() {
return serves;
}
public void setServes(String[] serves) {
this.serves = serves;
}
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;
}
ColumnTypeEnum(Integer code, String name, String[] serves) {
this.code = code;
this.name = name;
this.serves = serves;
}
}
/**
* @Author zhuyajie
* @Description 资源页资源类型
* @Date 2021/3/29 16:25
* @Version 1.0
**/
public enum ServeTypeEnum {
APP("APP", "应用"),
PRODUCT("PRODUCT", "作品"),
OFFICIAL_ACCOUNT("OFFICIAL_ACCOUNT", "公众号"),
BOOKLIST("BOOKLIST", "平台书单"),
ADVISER_BOOK("ADVISER_BOOK", "书刊"),
GROUP_ACTIVITY("GROUP_ACTIVITY", "模板群"),
THIRD_RESOURCE("THIRD_RESOURCE", "第三方资源");
private String value;
private String name;
public String getValue() {
return value;
}
public String getName() {
return name;
}
ServeTypeEnum(String value, String name) {
this.value = value;
this.name = name;
}
public static String getNameByValue(String value) {
for (ServeTypeEnum serveTypeEnum : ServeTypeEnum.values()) {
if (value.equals(serveTypeEnum.value)) {
return serveTypeEnum.name;
}
}
return null;
}
}
/**
* 栏目移动枚举
*/
public enum MoveTypeEnum{
/**
* 向上移
*/
MOVE_UP("UP"),
MOVE_DOWN("DOWN");
private String value;
MoveTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
}
package com.pcloud.book.group.dao;
import com.pcloud.book.group.entity.ResourcePageColumn;
import com.pcloud.book.group.vo.ResourceColumnAndServeVO;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* 自有码H5页面栏目(ResourcePageColumn)表数据库访问层
*
* @author makejava
* @since 2021-03-26 15:26:02
*/
public interface ResourcePageColumnDao extends BaseDao<ResourcePageColumn> {
/**
* 最大排序值
* @author:zhuyajie
* @date:2021/3/29 13:45
* * @param null
*/
Integer getMaxSeq(Long resourcePageId);
/**
*栏目和资源列表
* @author:zhuyajie
* @date:2021/3/29 13:45
* * @param null
*/
List<ResourceColumnAndServeVO> getColumnListByPageId(Long resourcePageId);
/**
* 根据类型查询
* @author:zhuyajie
* @date:2021/4/2 10:28
* * @param null
*/
List<ResourcePageColumn> getByColumnTypeAndPage(Long resourcePageId, Integer columnType);
/**
* 修改排序值
* @author:zhuyajie
* @date:2021/4/2 15:00
* * @param null
*/
void updateColumnSeqNum(Long id, Integer columnSeq);
/**
* 查目标移动栏目
* @author:zhuyajie
* @date:2021/4/2 16:18
* * @param null
*/
ResourcePageColumn getColumByMoveType(String moveType, Long resourcePageId, Integer columnSeq);
/**
* 批量更新序号
* @author:zhuyajie
* @date:2021/4/14 10:36
* * @param null
*/
void updateSeq4Batch(List<ResourceColumnAndServeVO> list);
}
\ No newline at end of file
package com.pcloud.book.group.dao;
import com.pcloud.book.group.entity.ResourcePage;
import com.pcloud.common.core.dao.BaseDao;
import java.util.Map;
/**
* 自有码H5页面(ResourcePage)表数据库访问层
*
* @author makejava
* @since 2021-03-26 15:25:28
*/
public interface ResourcePageDao extends BaseDao<ResourcePage>{
/**
* 根据社群书查询
* @author:zhuyajie
* @date:2021/3/30 10:35
* * @param null
*/
ResourcePage getByBookGroupId(Long bookGroupId);
/**
* 根据书刊查询
* @author:zhuyajie
* @date:2021/3/30 10:35
* * @param null
*/
ResourcePage getByBookId(Long bookId, Long channelId, Long adviserId);
/**
* 根据书设置小睿关闭
* @author:zhuyajie
* @date:2021/3/31 12:01
* * @param null
*/
void setRaysCloseByBook(Map<String, Object> paramMap);
/**
* 修改页面更新时间
* @author:zhuyajie
* @date:2021/4/2 15:21
* * @param null
*/
void updatePageUpdateTime(Long resourcePageId);
/**
* 根据二维码id查询
* @author:zhuyajie
* @date:2021/4/13 9:18
* * @param null
*/
ResourcePage getBySceneId(Long sceneId);
}
\ No newline at end of file
package com.pcloud.book.group.dao;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.entity.ResourcePageItem;
import com.pcloud.book.group.vo.ResourcePageItemVO;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* 自有码H5页面栏目资源详情(ResourcePageItem)表数据库访问层
*
* @author makejava
* @since 2021-03-26 15:26:22
*/
public interface ResourcePageItemDao extends BaseDao<ResourcePageItem>{
/**
* 删除栏目下资源
* @author:zhuyajie
* @date:2021/3/26 15:39
* * @param null
*/
void deleteByPageColumnId(Long resourcePageColumnId);
/**
* 查栏目资源
* @author:zhuyajie
* @date:2021/3/29 13:59
* * @param null
*/
List<ResourcePageItemVO> getResourcePageItemByColumnId(Long resourcePageColumnId);
/**
* 查资源毕业资料列表
* @author:zhuyajie
* @date:2021/3/29 16:38
* * @param null
*/
List<ResourcePageItemVO> getResourcePageItemByPageId(Long resourcePageId, Boolean isShow);
/**
* 查资源数
* @author:zhuyajie
* @date:2021/4/16 13:42
* * @param null
*/
Integer getResourceCounts(Long resourcePageId);
/**
* 查应用作品资源
* @author:zhuyajie
* @date:2021/4/17 13:14
* * @param null
*/
List<BookGroupServe> getServeListByBookGroupId(Long bookGroupId);
}
\ No newline at end of file
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.ResourcePageColumnDao;
import com.pcloud.book.group.entity.ResourcePageColumn;
import com.pcloud.book.group.vo.ResourceColumnAndServeVO;
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.ResourcePageColumnDaoImpl
* @Author zhuyajie
* @Description 自有码H5页面栏目
* @Date 2021/3/26 15:31
* @Version 1.0
**/
@Component
public class ResourcePageColumnDaoImpl extends BaseDaoImpl<ResourcePageColumn> implements ResourcePageColumnDao {
@Override
public Integer getMaxSeq(Long resourcePageId) {
return getSessionTemplate().selectOne(getStatement("getMaxSeq"),resourcePageId);
}
@Override
public List<ResourceColumnAndServeVO> getColumnListByPageId(Long resourcePageId) {
return getSessionTemplate().selectList(getStatement("getColumnListByPageId"), resourcePageId);
}
@Override
public List<ResourcePageColumn> getByColumnTypeAndPage(Long resourcePageId, Integer columnType) {
Map<String, Object> map = new HashMap<>();
map.put("resourcePageId", resourcePageId);
map.put("columnType", columnType);
return getSessionTemplate().selectList(getStatement("getByColumnTypeAndPage"), map);
}
@Override
public void updateColumnSeqNum(Long id, Integer columnSeq) {
Map<String, Object> map = new HashMap<>();
map.put("columnSeq", columnSeq);
map.put("id", id);
getSessionTemplate().update(getStatement("updateColumnSeqNum"), map);
}
@Override
public ResourcePageColumn getColumByMoveType(String moveType, Long resourcePageId, Integer columnSeq) {
Map<String, Object> map = new HashMap<>();
map.put("moveType", moveType);
map.put("resourcePageId", resourcePageId);
map.put("columnSeq", columnSeq);
return getSessionTemplate().selectOne(getStatement("getColumByMoveType"), map);
}
@Override
public void updateSeq4Batch(List<ResourceColumnAndServeVO> list) {
getSessionTemplate().update(getStatement("updateSeq4Batch"), list);
}
}
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.ResourcePageDao;
import com.pcloud.book.group.entity.ResourcePage;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassName com.pcloud.book.group.dao.impl.ResourcePageDaoImpl
* @Author zhuyajie
* @Description 自有码H5页面
* @Date 2021/3/26 15:32
* @Version 1.0
**/
@Component
public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements ResourcePageDao {
@Override
public ResourcePage getByBookGroupId(Long bookGroupId) {
return getSessionTemplate().selectOne(getStatement("getByBookGroupId"), bookGroupId);
}
@Override
public ResourcePage getByBookId(Long bookId, Long channelId, Long adviserId) {
Map<String, Object> map = new HashMap<>();
map.put("bookId", bookId);
map.put("channelId", channelId);
map.put("adviserId", adviserId);
return getSessionTemplate().selectOne(getStatement("getByBookId"), map);
}
@Override
public void setRaysCloseByBook(Map<String, Object> paramMap) {
getSessionTemplate().update(getStatement("setRaysCloseByBook"), paramMap);
}
@Override
public void updatePageUpdateTime(Long resourcePageId) {
getSessionTemplate().update(getStatement("updatePageUpdateTime"), resourcePageId);
}
@Override
public ResourcePage getBySceneId(Long sceneId) {
return getSessionTemplate().selectOne(getStatement("getBySceneId"), sceneId);
}
}
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.ResourcePageItemDao;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.entity.ResourcePageItem;
import com.pcloud.book.group.vo.ResourcePageItemVO;
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.ResourcePageItemDaoImpl
* @Author zhuyajie
* @Description 自有码H5页面资源详情
* @Date 2021/3/26 15:33
* @Version 1.0
**/
@Component
public class ResourcePageItemDaoImpl extends BaseDaoImpl<ResourcePageItem> implements ResourcePageItemDao {
@Override
public void deleteByPageColumnId(Long resourcePageColumnId) {
getSessionTemplate().delete(getStatement("deleteByPageColumnId"), resourcePageColumnId);
}
@Override
public List<ResourcePageItemVO> getResourcePageItemByColumnId(Long resourcePageColumnId) {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("resourcePageColumnId", resourcePageColumnId);
return getSessionTemplate().selectList(getStatement("getResourcePageItemByColumnId"), paramMap);
}
@Override
public List<ResourcePageItemVO> getResourcePageItemByPageId(Long resourcePageId, Boolean isShow) {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("resourcePageId", resourcePageId);
paramMap.put("isShow", isShow);
return getSessionTemplate().selectList(getStatement("getResourcePageItemByPageId"), paramMap);
}
@Override
public Integer getResourceCounts(Long resourcePageId) {
return getSessionTemplate().selectOne(getStatement("getResourceCounts"), resourcePageId);
}
@Override
public List<BookGroupServe> getServeListByBookGroupId(Long bookGroupId) {
return getSessionTemplate().selectList(getStatement("getServeListByBookGroupId"), bookGroupId);
}
}
...@@ -462,6 +462,18 @@ public class BookGroupDTO extends BaseDto { ...@@ -462,6 +462,18 @@ public class BookGroupDTO extends BaseDto {
private Long bookAdviserId; private Long bookAdviserId;
private String appletId; private String appletId;
/**
* H5落地页是否开启小睿流程
*/
private Integer resourcePageOpenRays;
public Integer getResourcePageOpenRays() {
return resourcePageOpenRays;
}
public void setResourcePageOpenRays(Integer resourcePageOpenRays) {
this.resourcePageOpenRays = resourcePageOpenRays;
}
public String getAdviserPhone() { public String getAdviserPhone() {
return adviserPhone; return adviserPhone;
...@@ -1031,6 +1043,7 @@ public class BookGroupDTO extends BaseDto { ...@@ -1031,6 +1043,7 @@ public class BookGroupDTO extends BaseDto {
", adviserPhone='" + adviserPhone + '\'' + ", adviserPhone='" + adviserPhone + '\'' +
", bookAdviserId=" + bookAdviserId + ", bookAdviserId=" + bookAdviserId +
", appletId='" + appletId + '\'' + ", appletId='" + appletId + '\'' +
", resourcePageOpenRays=" + resourcePageOpenRays +
'}'; '}';
} }
} }
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import lombok.Data;
/**
* 自有码H5页面(ResourcePage)实体类
*
* @author makejava
* @since 2021-03-26 15:25:28
*/
@Data
public class ResourcePage extends BaseEntity {
private static final long serialVersionUID = 220369810358566952L;
/**
* rays码id
*/
private Long bookGroupId;
/**
* 风格类型(1默认2艺术3插画)
*/
private Integer style;
/**
* 是否显示图书信息
*/
private Integer showBook;
/**
* 是否开启小睿流程
*/
private Integer openRays;
/**
* 创建人
*/
private Long createUser;
/**
* 预览二维码
*/
private String qrcodeUrl;
/**
* 二维码id
*/
private Long sceneId;
/**
* 公众号二维码id
*/
private Long officialSceneId;
}
\ No newline at end of file
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
/**
* 自有码H5页面栏目(ResourcePageColumn)实体类
*
* @author makejava
* @since 2021-03-26 15:26:02
*/
@Data
public class ResourcePageColumn extends BaseEntity {
private static final long serialVersionUID = -78405010138867722L;
/**
* 资源页id
*/
private Long resourcePageId;
/**
* 栏目类型
*/
private Integer columnType;
/**
* 栏目标题
*/
private String columnName;
/**
* 栏目版式
*/
private Integer columnFormat;
/**
* 栏目排序
*/
private Integer columnSeq;
/**
* 客户端展示数量
*/
private Integer showCount;
/**
* 客户端是否开启展示更多
*/
private Boolean showMore;
/**
* 创建人
*/
private Long createUser;
}
\ No newline at end of file
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
/**
* 自有码H5页面栏目资源详情(ResourcePageItem)实体类
*
* @author makejava
* @since 2021-03-26 15:26:22
*/
@Data
public class ResourcePageItem extends BaseEntity {
private static final long serialVersionUID = -73454516097004755L;
/**
* 资源页id
*/
private Long resourcePageId;
/**
* 资源栏目id
*/
private Long resourcePageColumnId;
/**
* 资源id
*/
private Long serveId;
/**
* 资源类型
*/
private String serveType;
/**
* 链接url
*/
private String linkUrl;
/**
* 资源类型
*/
private String typeCode;
/**
* 排序值
*/
private Integer seqNum;
/**
* 是否展示
*/
private Boolean isShow;
/**
* 二维码引导关注文案
*/
private String guideContent;
/**
* 二维码logo链接
*/
private String logoUrl;
/**
* 创建人
*/
private Long createUser;
}
\ No newline at end of file
...@@ -781,12 +781,6 @@ public interface BookGroupFacade { ...@@ -781,12 +781,6 @@ public interface BookGroupFacade {
@RequestParam(value = "numPerPage", required = true) Integer numPerPage) @RequestParam(value = "numPerPage", required = true) Integer numPerPage)
throws BizException, PermissionException; throws BizException, PermissionException;
@ApiOperation("资源服务类型旧数据处理")
@GetMapping("updateBookServeTypeCode")
ResponseDto<?>updateBookServeTypeCode();
@ApiOperation(value = "获取小睿社群书列表(小睿独立管理端)", httpMethod = "GET") @ApiOperation(value = "获取小睿社群书列表(小睿独立管理端)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
......
...@@ -1300,13 +1300,6 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -1300,13 +1300,6 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return new ResponseDto<>(pageBeanNew); return new ResponseDto<>(pageBeanNew);
} }
@Override
@GetMapping("updateBookServeTypeCode")
public ResponseDto<?> updateBookServeTypeCode() {
bookGroupBiz.updateBookServeTypeCode();
return new ResponseDto<>();
}
@ApiOperation(value = "通过 bookGroupQrcodeId 或者 classifyId 获取群二维码永久图文素材", httpMethod = "GET") @ApiOperation(value = "通过 bookGroupQrcodeId 或者 classifyId 获取群二维码永久图文素材", httpMethod = "GET")
@RequestMapping(value = "/getGroupNewsMaterialById", method = RequestMethod.GET) @RequestMapping(value = "/getGroupNewsMaterialById", method = RequestMethod.GET)
......
package com.pcloud.book.group.facade.impl;
import com.pcloud.book.group.biz.ResourcePageBiz;
import com.pcloud.book.group.vo.UpdateResourceColumnVO;
import com.pcloud.book.group.vo.UpdateResourcePageVO;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import io.swagger.annotations.ApiOperation;
/**
* @ClassName com.pcloud.book.group.facade.impl.ResourcePageFacade
* @Author zhuyajie
* @Description H5资源页配置
* @Date 2021/3/29 10:41
* @Version 1.0
**/
@RestController
@RequestMapping("resourcePage")
public class ResourcePageFacade {
@Autowired
private ResourcePageBiz resourcePageBiz;
@ApiOperation("更新资源页基本设置")
@PostMapping("updateResourcePage")
public ResponseDto<?> updateResourcePage(@RequestHeader("token") String token,
@RequestBody @Validated UpdateResourcePageVO updateResourcePageVO) {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
updateResourcePageVO.setCreateUser(adviserId);
return new ResponseDto<>(resourcePageBiz.updateResourcePage(updateResourcePageVO));
}
@ApiOperation("更新资源栏目设置")
@PostMapping("updateResourceColumn")
public ResponseDto<?> updateResourceColumn(@RequestHeader("token") String token,
@RequestBody @Validated UpdateResourceColumnVO updateResourceColumnVO){
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
updateResourceColumnVO.setCreateUser(adviserId);
resourcePageBiz.updateResourceColumn(updateResourceColumnVO);
return new ResponseDto<>();
}
@ApiOperation("根据rays码id查资源页基本配置")
@GetMapping("getResourcePageByBookGroupId")
public ResponseDto<?> getResourcePageByBookGroupId(@RequestHeader("token") String token,
@RequestParam(value = "bookGroupId", required = false) Long bookGroupId,
@RequestParam(value = "sceneId", required = false) Long sceneId){
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(resourcePageBiz.getResourcePageByBookGroupIdOrSceneId(bookGroupId, adviserId, sceneId));
}
@ApiOperation("编辑端-根据页面id查资源页栏目及资源")
@GetMapping("getColumnAndServeListByPageId")
public ResponseDto<?> getColumnAndServeListByPageId(@RequestHeader("token") String token,
@RequestParam("resourcePageId") Long resourcePageId){
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, false));
}
@ApiOperation("客户端-根据书刊查资源页基本配置")
@GetMapping("getResourcePageByBookId4Wechat")
public ResponseDto<?> getResourcePageByBookId4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam("bookId") Long bookId,
@RequestParam("channelId") Long channelId,
@RequestParam("adviserId") Long adviserId){
Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.getResourcePageByBookId(bookId, channelId, adviserId, wechatUserId));
}
@ApiOperation("客户端-根据页面id查资源页栏目及资源")
@GetMapping("getColumnAndServeListByPageId4Wechat")
public ResponseDto<?> getColumnAndServeListByPageId4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam("resourcePageId") Long resourcePageId){
Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, true));
}
@ApiOperation("客户端分页查栏目资源")
@GetMapping("listPageResourcePageItem")
public ResponseDto<?> listPageResourcePageItem(@CookieValue("userInfo") String userInfo,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage,
@RequestParam("resourcePageColumnId") Long resourcePageColumnId) {
Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.listPageResourcePageItem(currentPage, numPerPage, resourcePageColumnId));
}
@ApiOperation("获取栏目及资源类型")
@GetMapping("getColumnAndServeTypeList")
public ResponseDto<?> getColumnAndServeTypeList() {
return new ResponseDto<>(resourcePageBiz.getColumnAndServeTypeList());
}
@ApiOperation("编辑端-栏目上移下移")
@GetMapping("updateColumnSeq")
public ResponseDto<?> updateColumnSeq(@RequestHeader("token") String token,
@RequestParam("resourcePageColumnId") Long resourcePageColumnId,
@RequestParam("moveType") String moveType) {
SessionUtil.getToken4Redis(token);
resourcePageBiz.updateColumnSeq(resourcePageColumnId, moveType);
return new ResponseDto<>();
}
@ApiOperation("编辑端-删除栏目")
@GetMapping("deleteColumnById")
public ResponseDto<?> deleteColumnById(@RequestHeader("token") String token,
@RequestParam("resourcePageColumnId") Long resourcePageColumnId) {
SessionUtil.getToken4Redis(token);
resourcePageBiz.deleteColumnById(resourcePageColumnId);
return new ResponseDto<>();
}
@ApiOperation("处理旧数据")
@PostMapping("dealResource")
public ResponseDto<?> dealResource(@RequestBody List<Long> qrcodeIdList, @RequestParam("qrcodeType") String qrcodeType){
if ("bookgroup".equals(qrcodeType)) {
resourcePageBiz.dealResource(qrcodeIdList, null);
} else {
resourcePageBiz.dealResource(null, qrcodeIdList);
}
return new ResponseDto<>();
}
@ApiOperation("更新资源页和栏目设置")
@PostMapping("updateResourcePageAndColumn")
public ResponseDto<?> updateResourcePageAndColumn(@RequestHeader("token") String token,
@RequestBody @Validated UpdateResourcePageVO updateResourcePageVO) {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
updateResourcePageVO.setCreateUser(adviserId);
return new ResponseDto<>(resourcePageBiz.updateResourcePageAndColumn(updateResourcePageVO));
}
@ApiOperation("客户端-根据rays码id查资源页基本配置")
@GetMapping("getResourcePageByBookGroupId4Wechat")
public ResponseDto<?> getResourcePageByBookGroupId4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookGroupId", required = false) Long bookGroupId,
@RequestParam(value = "sceneId", required = false) Long sceneId){
Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.getResourcePageByBookGroupIdOrSceneId4Wechat(bookGroupId, wechatUserId, sceneId));
}
}
package com.pcloud.book.group.vo;
import com.pcloud.common.dto.BaseDto;
import java.util.List;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* @ClassName com.pcloud.book.group.vo.UpdateResourceColumnVO
* @Author zhuyajie
* @Description 资源页栏目
* @Date 2021/3/26 17:17
* @Version 1.0
**/
@Data
public class ResourceColumnAndServeVO extends BaseDto{
/**
* 资源页id
*/
private Long resourcePageId;
/**
* 资源栏目id
*/
private Long resourcePageColumnId;
/**
* 栏目类型
*/
private Integer columnType;
/**
* 栏目标题
*/
private String columnName;
/**
* 栏目版式
*/
private Integer columnFormat;
/**
* 栏目排序
*/
private Integer columnSeq;
/**
* 客户端展示数量
*/
private Integer showCount;
/**
* 客户端是否开启展示更多
*/
private Integer showMore;
/**
* 资源列表
*/
private List<ResourcePageItemVO> itemVOList;
/**
* 资源类型
*/
private String serveType;
/**
* 图片位图片
*/
private String logoUrl;
}
package com.pcloud.book.group.vo;
import com.pcloud.book.applet.dto.AppletNewsDTO;
import com.pcloud.book.applet.dto.AppletOuterBooklistDTO;
import com.pcloud.book.applet.dto.GroupActivity4AppletDTO;
import com.pcloud.book.applet.entity.AppletThirdResources;
import com.pcloud.book.book.vo.BookLinkVO;
import com.pcloud.common.dto.BaseDto;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName com.pcloud.book.group.vo.ResourcePageItemVO
* @Author zhuyajie
* @Description 资源页栏目详情
* @Date 2021/3/26 17:21
* @Version 1.0
**/
@Data
public class ResourcePageItemVO extends BaseDto{
private Long resourcePageColumnId;
/**
* 资源id
*/
private Long serveId;
/**
* 资源类型
*/
private String serveType;
/**
* 链接url
*/
private String linkUrl;
/**
* 资源类型
*/
private String typeCode;
/**
* 排序值
*/
private Integer seqNum;
/**
* 二维码引导关注文案
*/
private String guideContent;
/**
* 二维码logo链接/图片位图片
*/
private String logoUrl;
/**
* 创建人
*/
private Long createUser;
/**
* 书刊链接来源(1当当2京东3拼多多)
*/
private Integer linkFrom;
/**资源其他信息**/
private String serveName;
private String servePic;
private String typeName;
private String transverseImg;
private Double price;
@ApiModelProperty("跳转结果链接")
private String resultUrl;
private String isbn;
private String bookName;
private String coverImg;
private String uniqueNumber;
private String publish;
@ApiModelProperty("商品应用中有第三方链接")
private Boolean hasThirdLink;
private Long channelId;
@ApiModelProperty("书单")
private AppletOuterBooklistDTO appletOuterBooklistDTO;
@ApiModelProperty("社群")
private GroupActivity4AppletDTO activity4AppletDTO;
@ApiModelProperty("第三方资源")
private AppletThirdResources appletThirdResources;
}
package com.pcloud.book.group.vo;
import com.pcloud.common.dto.BaseDto;
import lombok.Data;
/**
* 自有码H5页面(ResourcePage)实体类
*
* @author makejava
* @since 2021-03-26 15:25:28
*/
@Data
public class ResourcePageVO extends BaseDto {
private static final long serialVersionUID = 220369810358566952L;
private Long id;
/**
* rays码id
*/
private Long bookGroupId;
/**
* 风格类型(1默认2艺术3插画)
*/
private Integer style;
/**
* 是否显示图书信息
*/
private Integer showBook;
/**
* 是否开启小睿流程
*/
private Integer openRays;
/**
* 书刊封面
*/
private String bookImg;
/**
* 书刊名称
*/
private String bookName;
/**
* 所属出版社
*/
private String agentName;
/**
* 预览二维码
*/
private String qrcodeUrl;
/**
* 上次阅读时间
*/
private String lastReadTime;
private String appletId;
private Long sceneId;
private Long bookId;
private Long channelId;
private Long adviserId;
}
\ No newline at end of file
package com.pcloud.book.group.vo;
import java.util.List;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* @ClassName com.pcloud.book.group.vo.UpdateResourceColumnVO
* @Author zhuyajie
* @Description 资源页栏目
* @Date 2021/3/26 17:17
* @Version 1.0
**/
@Data
public class UpdateResourceColumnVO {
/**
* 资源页id
*/
@NotNull
private Long resourcePageId;
/**
* 资源栏目id
*/
private Long resourcePageColumnId;
/**
* 栏目类型
*/
@NotNull
private Integer columnType;
/**
* 栏目标题
*/
private String columnName;
/**
* 栏目版式
*/
private Integer columnFormat;
/**
* 栏目排序
*/
private Integer columnSeq;
/**
* 客户端展示数量
*/
private Integer showCount;
/**
* 客户端是否开启展示更多
*/
private Boolean showMore;
/**
* 创建人
*/
private Long createUser;
/**
* 图片位图片
*/
private String logoUrl;
/**
* 资源列表
*/
private List<ResourcePageItemVO> itemVOList;
}
package com.pcloud.book.group.vo;
import java.util.List;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName com.pcloud.book.group.vo.UpdateResourcePageVO
* @Author zhuyajie
* @Description H5资源页修改
* @Date 2021/3/26 16:55
* @Version 1.0
**/
@Data
public class UpdateResourcePageVO {
/**
* rays码id
*/
private Long bookGroupId;
/**
* 风格类型(1默认2艺术3插画)
*/
private Integer style;
/**
* 是否显示图书信息
*/
private Integer showBook;
/**
* 是否开启小睿流程
*/
private Integer openRays;
/**
* 创建人
*/
private Long createUser;
/**
* 二维码id
*/
private Long sceneId;
@ApiModelProperty("栏目内容")
private List<UpdateResourceColumnVO> columnVOS;
}
...@@ -60,4 +60,11 @@ public interface RightsSettingBannerBiz { ...@@ -60,4 +60,11 @@ public interface RightsSettingBannerBiz {
* @param rightsSettingId * @param rightsSettingId
*/ */
void deleteByRightsSettingId(Long rightsSettingId); void deleteByRightsSettingId(Long rightsSettingId);
/**
* 根据权益id查询
* @author:zhuyajie
* @date:2021/4/6 14:45
* * @param null
*/
List<RightsSettingBanner> getByRightsSettingId(Long rightsSettingId);
} }
\ No newline at end of file
...@@ -249,13 +249,6 @@ public interface RightsSettingBiz { ...@@ -249,13 +249,6 @@ public interface RightsSettingBiz {
* * @param null * * @param null
*/ */
List<RightsSettingClassify> getAllRightsClassifyNew(); List<RightsSettingClassify> getAllRightsClassifyNew();
/**
* 处理权益旧数据
* @author:zhuyajie
* @date:2020/12/29 9:56
* * @param null
*/
void handleRightsSettingOld(List<Long> rightsSettingIdList);
/** /**
* 书刊相应权益配置的应用和作品 * 书刊相应权益配置的应用和作品
......
...@@ -83,4 +83,9 @@ public class RightsSettingBannerBizImpl implements RightsSettingBannerBiz { ...@@ -83,4 +83,9 @@ public class RightsSettingBannerBizImpl implements RightsSettingBannerBiz {
public void deleteByRightsSettingId(Long rightsSettingId) { public void deleteByRightsSettingId(Long rightsSettingId) {
rightsSettingBannerDao.deleteByRightsSettingId(rightsSettingId); rightsSettingBannerDao.deleteByRightsSettingId(rightsSettingId);
} }
@Override
public List<RightsSettingBanner> getByRightsSettingId(Long rightsSettingId) {
return rightsSettingBannerDao.getByRightsSettingId(rightsSettingId);
}
} }
\ No newline at end of file
...@@ -4443,159 +4443,6 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -4443,159 +4443,6 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
return rightsSettingItemDao.getRightsClassifyByIds(types); return rightsSettingItemDao.getRightsClassifyByIds(types);
} }
@Transactional(rollbackFor = Exception.class)
@Override
public void handleRightsSettingOld(List<Long> rightsSettingIdList){
if (ListUtils.isEmpty(rightsSettingIdList)) {
return;
}
//处理立享权益配套资源包
this.handleNowRightsSettingOld(rightsSettingIdList);
//将每周、长期权益旧数据添加至立享权益
this.handleWeekRightsSettingOld(rightsSettingIdList);
}
@ParamLog("处理立享权益旧数据")
private void handleNowRightsSettingOld(List<Long> rightsSettingIdList) {
if (ListUtils.isEmpty(rightsSettingIdList)) {
return;
}
List<Integer> types = Arrays.asList(RightsNowItemTypeNew.FIXED_FIRST.value,
RightsNowItemTypeNew.FIXED_SECOND.value, RightsNowItemTypeNew.FIXED_THIRD.value);
for (Long rightsSettingId:rightsSettingIdList) {
List<RightsSettingTitle> rightsSettingTitles = rightsSettingTitleMapper.getByRightSettingIdAndTypes(rightsSettingId, types);
if (!ListUtils.isEmpty(rightsSettingTitles)) {
continue;
}
List<RightsSettingTitle> titles = new ArrayList<>();
for (Integer type:types){
RightsSettingTitle title = new RightsSettingTitle();
title.setRightsSettingId(rightsSettingId);
if (type.equals(RightsNowItemTypeNew.FIXED_FIRST.value)) {
title.setRightsSettingTitle("必备!第一手");
} else if (type.equals(RightsNowItemTypeNew.FIXED_SECOND.value)) {
title.setRightsSettingTitle("晋级!课程提升");
} else if (type.equals(RightsNowItemTypeNew.FIXED_THIRD.value)) {
title.setRightsSettingTitle("拓展!资料延伸");
}
title.setRightsSettingNowType(type);
title.setEasyRead(true);
title.setSeqNum(1);
title.setOpenState(true);
titles.add(title);
}
rightsSettingTitleMapper.batchInsert(titles);
Long fixedFirstTitleId = titles.get(0).getId();
Long fixedSecondTitleId = titles.get(1).getId();
Long fixedThirdTitleId = titles.get(2).getId();
List<RightsNowItem> nowItems = rightsNowItemDao.getListByRightsSettingId(rightsSettingId, Arrays.asList(RightsNowItemTypeNew.SERVES.value));
if (!ListUtils.isEmpty(nowItems)) {
fillProductAndApp(nowItems);
for (RightsNowItem rightsNowItem : nowItems){
String typeCode = rightsNowItem.getServeTypeCode();
if (AppAndProductTypeEnum.APP.value.equals(rightsNowItem.getServeType())) {
if (RightsSettingConstant.FIXED_SECOND_APPLET_APP_LIST.contains(typeCode)) {
rightsNowItem.setType(RightsNowItemTypeNew.FIXED_SECOND.value);
rightsNowItem.setRightsSettingTitleId(fixedSecondTitleId);
} else if (RightsSettingConstant.FIXED_THIRD_APPLET_APP_LIST.contains(typeCode)) {
rightsNowItem.setType(RightsNowItemTypeNew.FIXED_THIRD.value);
rightsNowItem.setRightsSettingTitleId(fixedThirdTitleId);
} else {
rightsNowItem.setType(RightsNowItemTypeNew.FIXED_FIRST.value);
rightsNowItem.setRightsSettingTitleId(fixedFirstTitleId);
}
} else if (AppAndProductTypeEnum.PRODUCT.value.equals(rightsNowItem.getServeType())){
if (RightsSettingConstant.FIXED_SECOND_APPLET_PRODUCT_LIST.contains(typeCode)) {
rightsNowItem.setType(RightsNowItemTypeNew.FIXED_SECOND.value);
rightsNowItem.setRightsSettingTitleId(fixedSecondTitleId);
} else if (RightsSettingConstant.FIXED_THIRD_APPLET_PRODUCT_LIST.contains(typeCode)) {
rightsNowItem.setType(RightsNowItemTypeNew.FIXED_THIRD.value);
rightsNowItem.setRightsSettingTitleId(fixedThirdTitleId);
} else {
rightsNowItem.setType(RightsNowItemTypeNew.FIXED_FIRST.value);
rightsNowItem.setRightsSettingTitleId(fixedFirstTitleId);
}
}
rightsNowItem.setRightsItemGroupId(null);
}
rightsNowItemDao.batchInsert(nowItems);
}
}
}
@ParamLog("处理每周、长期权益旧数据")
private void handleWeekRightsSettingOld(List<Long> rightsSettingIdList) {
if (ListUtils.isEmpty(rightsSettingIdList)) {
return;
}
List<RightsSettingItemDetail> itemDetailList = rightsSettingItemDetailDao.getByRightsSettingIdList(rightsSettingIdList);
if (!ListUtils.isEmpty(itemDetailList)) {
Map<Long,List<RightsSettingItemDetail>> listMap = itemDetailList.stream().collect(Collectors.groupingBy(RightsSettingItemDetail::getRightsSettingItemId));
List<Long> itemIds = itemDetailList.stream().map(RightsSettingItemDetail::getRightsSettingItemId).distinct().collect(Collectors.toList());
List<RightsSettingItem> itemList = rightsSettingItemDao.getRightSettingItemByIds(itemIds);
//添加到立享权益
List<RightsSettingTitle> titles = new ArrayList<>();
List<Integer> types = Arrays.asList(RightsWeekTypeEnum.ONLINE_REMIND.key, RightsWeekTypeEnum.ONLINE_READING_ACTIVITY.key,
RightsWeekTypeEnum.BOOK_RECOMMEND.key, RightsWeekTypeEnum.NEWS_PUSH.key,
RightsWeekTypeEnum.FAMILY_ACTIVITY.key, RightsWeekTypeEnum.OFFLINE_READING_ACTIVITY.key,
RightsWeekTypeEnum.COURSE_OR_GIFT.key);
for (RightsSettingItem item:itemList){
//是否已处理
List<RightsSettingTitle> rightsSettingTitles = rightsSettingTitleMapper.getByRightSettingIdAndTypes(item.getRightsSettingId(), types);
if (!ListUtils.isEmpty(rightsSettingTitles)) {
continue;
}
RightsSettingTitle title = new RightsSettingTitle();
title.setRightsSettingId(item.getRightsSettingId());
title.setRightsSettingTitle(item.getTitle());
title.setRightsSettingDesc(item.getDescription());
title.setRightsSettingNowType(Integer.valueOf(item.getRightsClassifyId().toString()));
title.setEasyRead(item.getEasyRead());
title.setDeepRead(item.getDeepRead());
title.setEfficientRead(item.getEfficientRead());
title.setSeqNum(21+itemList.indexOf(item));
title.setServeType(item.getServeType());
title.setCollageState(item.getCollageState());
title.setDisplayType(item.getDisplayType());
if (null != item.getOpenState() && 1==item.getOpenState()){
title.setOpenState(true);
}else {
title.setOpenState(false);
}
//模块资源
List<RightsNowItem> rightsNowItemList = new ArrayList<>();
List<RightsSettingItemDetail> itemDetails = listMap.get(item.getId());
if (!ListUtils.isEmpty(itemDetails)){
for (RightsSettingItemDetail itemDetail:itemDetails) {
RightsNowItem rightsNowItem = new RightsNowItem();
rightsNowItem.setServeId(itemDetail.getServeId());
rightsNowItem.setServeType(itemDetail.getServeType());
rightsNowItem.setLinkUrl(itemDetail.getLinkUrl());
if (null != itemDetail.getGroupType()) {
rightsNowItem.setGroupType(itemDetail.getGroupType().toString());
}
rightsNowItem.setType(title.getRightsSettingNowType());
rightsNowItem.setRightsSettingId(title.getRightsSettingId());
rightsNowItemList.add(rightsNowItem);
}
}
title.setRightsSettingItemList(rightsNowItemList);
titles.add(title);
}
rightsSettingTitleMapper.batchInsert(titles);
List<RightsNowItem> nowItemList = new ArrayList<>();
for (RightsSettingTitle title:titles){
List<RightsNowItem> rightsNowItemList = title.getRightsSettingItemList();
if (!ListUtils.isEmpty(rightsNowItemList)) {
rightsNowItemList.forEach(s-> s.setRightsSettingTitleId(title.getId()));
nowItemList.addAll(rightsNowItemList);
}
}
rightsNowItemDao.batchInsert(nowItemList);
}
}
@Override @Override
public List<BookServeDTO> getRightsSettingAppProduct(Long bookId, Long channelId, Long adviserId, Integer limit) { public List<BookServeDTO> getRightsSettingAppProduct(Long bookId, Long channelId, Long adviserId, Integer limit) {
RightsSettingDto rightsSettingDto = this.getRightsSettingByBookId4AppletHome(bookId, adviserId, channelId); RightsSettingDto rightsSettingDto = this.getRightsSettingByBookId4AppletHome(bookId, adviserId, channelId);
......
...@@ -3,6 +3,8 @@ package com.pcloud.book.rightsSetting.dao; ...@@ -3,6 +3,8 @@ package com.pcloud.book.rightsSetting.dao;
import com.pcloud.book.rightsSetting.entity.RightsSettingBanner; import com.pcloud.book.rightsSetting.entity.RightsSettingBanner;
import com.pcloud.common.core.dao.BaseDao; import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/** /**
* 权益banner(RightsSettingBanner)表数据库访问层 * 权益banner(RightsSettingBanner)表数据库访问层
* *
...@@ -12,4 +14,6 @@ import com.pcloud.common.core.dao.BaseDao; ...@@ -12,4 +14,6 @@ import com.pcloud.common.core.dao.BaseDao;
public interface RightsSettingBannerDao extends BaseDao<RightsSettingBanner> { public interface RightsSettingBannerDao extends BaseDao<RightsSettingBanner> {
void deleteByRightsSettingId(Long rightsSettingId); void deleteByRightsSettingId(Long rightsSettingId);
List<RightsSettingBanner> getByRightsSettingId(Long rightsSettingId);
} }
\ No newline at end of file
...@@ -5,6 +5,8 @@ import com.pcloud.book.rightsSetting.entity.RightsSettingBanner; ...@@ -5,6 +5,8 @@ import com.pcloud.book.rightsSetting.entity.RightsSettingBanner;
import com.pcloud.common.core.dao.BaseDaoImpl; import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* 权益banner(RightsSettingBanner)表数据库访问层 * 权益banner(RightsSettingBanner)表数据库访问层
* *
...@@ -18,4 +20,9 @@ public class RightsSettingBannerDaoImpl extends BaseDaoImpl<RightsSettingBanner> ...@@ -18,4 +20,9 @@ public class RightsSettingBannerDaoImpl extends BaseDaoImpl<RightsSettingBanner>
public void deleteByRightsSettingId(Long rightsSettingId) { public void deleteByRightsSettingId(Long rightsSettingId) {
getSessionTemplate().delete(getStatement("deleteByRightsSettingId"), rightsSettingId); getSessionTemplate().delete(getStatement("deleteByRightsSettingId"), rightsSettingId);
} }
@Override
public List<RightsSettingBanner> getByRightsSettingId(Long rightsSettingId) {
return getSessionTemplate().selectList(getStatement("getByRightsSettingId"), rightsSettingId);
}
} }
\ No newline at end of file
...@@ -63,10 +63,13 @@ public interface PcloudGroupActivityBiz { ...@@ -63,10 +63,13 @@ public interface PcloudGroupActivityBiz {
/** /**
* 获取共读活动列表(分页) * 获取共读活动列表(分页)
*/ */
PageBeanNew<QueryGroupActivityResponseVO> queryGroupActivity(String name, Long proLabelId, Long purLabelId, Long depLabelId, Integer joinType, Long firstClassify, PageBeanNew<QueryGroupActivityResponseVO> queryGroupActivity(String name, Long proLabelId, Long purLabelId, Long depLabelId,
Integer joinType, Long firstClassify,
Long secondClassify, Long thirdClassify, Long secondClassify, Long thirdClassify,
Long gradeLabelId, Long gradeLabelId,
Long subjectLabelId, Integer numPerPage, Integer currentPage, String cityCode, Long agentId, Integer isChoose); Long subjectLabelId, Integer numPerPage, Integer currentPage,
String cityCode, Long agentId, Integer isChoose,
Integer groupType, String brandName);
/** /**
* 获取共读活动列表(弹窗) * 获取共读活动列表(弹窗)
...@@ -114,4 +117,12 @@ public interface PcloudGroupActivityBiz { ...@@ -114,4 +117,12 @@ public interface PcloudGroupActivityBiz {
QueryGroupActivityResponseVO getByActivityId(Long id); QueryGroupActivityResponseVO getByActivityId(Long id);
void fillThirdGroupHeadList(AppletGroupManageDTO activity4AppletDTO); void fillThirdGroupHeadList(AppletGroupManageDTO activity4AppletDTO);
/**
* 查第三方群
* @author:zhuyajie
* @date:2021/3/31 16:35
* * @param null
*/
Map<Long, GroupActivity4AppletDTO> getGroupActivityMap(List<Long> activityGroupIds);
} }
...@@ -304,10 +304,13 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -304,10 +304,13 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
} }
@Override @Override
public PageBeanNew<QueryGroupActivityResponseVO> queryGroupActivity(String name, Long proLabelId, Long purLabelId, Long depLabelId, Integer joinType, Long firstClassify, public PageBeanNew<QueryGroupActivityResponseVO> queryGroupActivity(String name, Long proLabelId, Long purLabelId, Long depLabelId,
Integer joinType, Long firstClassify,
Long secondClassify, Long thirdClassify, Long secondClassify, Long thirdClassify,
Long gradeLabelId, Long gradeLabelId,
Long subjectLabelId, Integer numPerPage, Integer currentPage, String cityCode, Long agentId, Integer isChoose) { Long subjectLabelId, Integer numPerPage, Integer currentPage,
String cityCode, Long agentId, Integer isChoose,
Integer groupType, String brandName) {
PageParam pageParam = new PageParam(currentPage, numPerPage); PageParam pageParam = new PageParam(currentPage, numPerPage);
BaseTempletClassify baseTempletClassify =new BaseTempletClassify(); BaseTempletClassify baseTempletClassify =new BaseTempletClassify();
...@@ -333,6 +336,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -333,6 +336,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
paraMap.put("cityCode", cityCode); paraMap.put("cityCode", cityCode);
paraMap.put("agentId", agentId); paraMap.put("agentId", agentId);
paraMap.put("isChoose", isChoose); paraMap.put("isChoose", isChoose);
paraMap.put("groupType", groupType);
paraMap.put("brandName", brandName);
PageBeanNew<QueryGroupActivityResponseVO> queryGroupActivity = pcloudGroupActivityDao.listPageNew(pageParam, paraMap, "queryGroupActivity"); PageBeanNew<QueryGroupActivityResponseVO> queryGroupActivity = pcloudGroupActivityDao.listPageNew(pageParam, paraMap, "queryGroupActivity");
if (null == queryGroupActivity || CollectionUtils.isEmpty(queryGroupActivity.getRecordList())) { if (null == queryGroupActivity || CollectionUtils.isEmpty(queryGroupActivity.getRecordList())) {
return queryGroupActivity; return queryGroupActivity;
...@@ -361,6 +366,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -361,6 +366,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
} }
//设置城市名称 //设置城市名称
setCityNames(queryGroupActivity.getRecordList()); setCityNames(queryGroupActivity.getRecordList());
//设置群头像
setThirdGroupHeadList(queryGroupActivity.getRecordList());
return queryGroupActivity; return queryGroupActivity;
} }
...@@ -660,6 +667,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -660,6 +667,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
activity4AppletDTO.setUserNumber(userNum); activity4AppletDTO.setUserNumber(userNum);
} }
@Override @Override
public List<GroupActivity4AppletDTO> getTishBookSchoolListWrap(BaseTempletClassify baseTempletClassify, Integer limit) { public List<GroupActivity4AppletDTO> getTishBookSchoolListWrap(BaseTempletClassify baseTempletClassify, Integer limit) {
List<GroupActivity4AppletDTO> list = pcloudGroupActivityDao.getTishBookSchoolList(baseTempletClassify, limit); List<GroupActivity4AppletDTO> list = pcloudGroupActivityDao.getTishBookSchoolList(baseTempletClassify, limit);
...@@ -817,4 +825,48 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -817,4 +825,48 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
rightsSettingBiz.fillGroupActivityHead(Lists.newArrayList(mapDto.values())); rightsSettingBiz.fillGroupActivityHead(Lists.newArrayList(mapDto.values()));
return mapDto; return mapDto;
} }
@Override
public Map<Long, GroupActivity4AppletDTO> getGroupActivityMap(List<Long> activityGroupIds) {
Map<Long, GroupActivity4AppletDTO> localMap = new HashMap<>();
if (!ListUtils.isEmpty(activityGroupIds)) {
localMap = pcloudGroupActivityDao.getByIds(activityGroupIds, null);
}
for(GroupActivity4AppletDTO groupActivity4AppletDTO: localMap.values()){
String filterStr = StringUtilParent.replaceHtml(groupActivity4AppletDTO.getDesc());
String subStr = filterStr.length() > 60 ? filterStr.substring(0, 60) + "..." : filterStr;
groupActivity4AppletDTO.setCutDesc(subStr);
}
return localMap;
}
public void setThirdGroupHeadList(List<QueryGroupActivityResponseVO> activityResponseVOList) {
if (ListUtils.isEmpty(activityResponseVOList)) {
return;
}
for (QueryGroupActivityResponseVO queryGroupActivityResponseVO:activityResponseVOList) {
if (null == queryGroupActivityResponseVO) {
continue;
}
if (null != queryGroupActivityResponseVO.getGroupType() && 1 == queryGroupActivityResponseVO.getGroupType()) {
//第三方群才加
//头像列表从缓存里取
String key = CacheConstant.BOOK + "THIRD_GROUP:" + queryGroupActivityResponseVO.getId();
Integer userNum;
if (StringUtil.isEmpty(JedisClusterUtils.get(key))) {
userNum = RandomUtil.randomInt(10, 30);
JedisClusterUtils.set(key, userNum.toString(), 3600);
} else {
userNum = Integer.valueOf(JedisClusterUtils.get(key));
}
List<String> headUrlList = appletGroupSearchRecordBiz
.getHeadUrlList(userNum, 3L);
queryGroupActivityResponseVO.setHeadUrlList(headUrlList);
List<AppletGroupStatementDTO> statementDTOS = appletGroupSearchRecordBiz
.getStatementList(userNum, headUrlList, queryGroupActivityResponseVO.getId());
queryGroupActivityResponseVO.setStatementDTOList(statementDTOS);
queryGroupActivityResponseVO.setUserNumber(userNum);
}
}
}
} }
...@@ -45,4 +45,6 @@ public class PcloudGroupActivity extends BaseTempletClassify { ...@@ -45,4 +45,6 @@ public class PcloudGroupActivity extends BaseTempletClassify {
private Long agentId; private Long agentId;
private String brandName;
} }
\ No newline at end of file
...@@ -111,11 +111,13 @@ public class PcloudGroupActivityFacade { ...@@ -111,11 +111,13 @@ public class PcloudGroupActivityFacade {
@RequestParam(value = "cityCode", required = false) String cityCode, @RequestParam(value = "cityCode", required = false) String cityCode,
@RequestParam("numPerPage") Integer numPerPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam("currentPage") Integer currentPage, @RequestParam("currentPage") Integer currentPage,
@RequestParam(value = "isChoose", required = false) Integer isChoose){ @RequestParam(value = "isChoose", required = false) Integer isChoose,
@RequestParam(value = "groupType", required = false) Integer groupType,
@RequestParam(value = "brandName", required = false) String brandName){
Map<String, Object> map = SessionUtil.getToken4Redis(token); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID); Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(pcloudGroupActivityBiz.queryGroupActivity(name, proLabelId, purLabelId, depLabelId, joinType,firstClassify, return new ResponseDto<>(pcloudGroupActivityBiz.queryGroupActivity(name, proLabelId, purLabelId, depLabelId, joinType,firstClassify,
secondClassify, thirdClassify, gradeLabelId,subjectLabelId,numPerPage, currentPage,cityCode, agentId, isChoose)); secondClassify, thirdClassify, gradeLabelId,subjectLabelId,numPerPage, currentPage,cityCode, agentId, isChoose, groupType, brandName));
} }
@ApiOperation("获取共读活动列表(弹窗)") @ApiOperation("获取共读活动列表(弹窗)")
......
...@@ -58,6 +58,9 @@ public class SaveGroupActivityRequestVO extends BaseTempletClassify { ...@@ -58,6 +58,9 @@ public class SaveGroupActivityRequestVO extends BaseTempletClassify {
@ApiModelProperty("出版社id") @ApiModelProperty("出版社id")
private Long agentId; private Long agentId;
@ApiModelProperty("品牌方名字")
private String brandName;
public void checkParam() { public void checkParam() {
if (StringUtil.isBlank(this.getName()) if (StringUtil.isBlank(this.getName())
|| null == this.getProLabelId() || null == this.getDepLabelId() || null == this.getProLabelId() || null == this.getDepLabelId()
......
...@@ -62,6 +62,9 @@ public class UpdateGroupActivityRequestVO extends BaseTempletClassify { ...@@ -62,6 +62,9 @@ public class UpdateGroupActivityRequestVO extends BaseTempletClassify {
@ApiModelProperty("上下架") @ApiModelProperty("上下架")
private Long isShow; private Long isShow;
@ApiModelProperty("品牌方名字")
private String brandName;
public void checkParam() { public void checkParam() {
if (null == id || StringUtil.isBlank(this.getName()) if (null == id || StringUtil.isBlank(this.getName())
|| null == this.getProLabelId() || null == this.getDepLabelId() || null == this.getProLabelId() || null == this.getDepLabelId()
......
package com.pcloud.book.skill.facade.response; package com.pcloud.book.skill.facade.response;
import com.pcloud.book.applet.dto.AppletGroupStatementDTO;
import java.util.List;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -16,7 +20,7 @@ public class QueryGroupActivityResponseVO { ...@@ -16,7 +20,7 @@ public class QueryGroupActivityResponseVO {
private Integer groupType; private Integer groupType;
@ApiModelProperty("主键") @ApiModelProperty("主键")
private Integer id; private Long id;
@ApiModelProperty("共度名称") @ApiModelProperty("共度名称")
private String name; private String name;
...@@ -108,5 +112,16 @@ public class QueryGroupActivityResponseVO { ...@@ -108,5 +112,16 @@ public class QueryGroupActivityResponseVO {
@ApiModelProperty("浏览量pv/uv") @ApiModelProperty("浏览量pv/uv")
private String browsePVUV; private String browsePVUV;
@ApiModelProperty("品牌方名称")
private String brandName;
@ApiModelProperty("头像列表")
private List<String> headUrlList;
@ApiModelProperty("学舍群话语")
private List<AppletGroupStatementDTO> statementDTOList;
@ApiModelProperty("群人数")
private Integer userNumber;
} }
<?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.book.dao.impl.BookLinkDaoImpl">
<resultMap type="com.pcloud.book.book.entity.BookLink" id="BookLinkMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="bookId" column="book_id" jdbcType="INTEGER"/>
<result property="linkFrom" column="link_from" jdbcType="INTEGER"/>
<result property="linkUrl" column="link_url" jdbcType="VARCHAR"/>
<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>
<!--查询单个-->
<select id="getById" resultMap="BookLinkMap">
select
id, book_id, link_from, link_url, create_user, create_time, update_time
from book.book_link
where id = #{id}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.book_link(book_id, link_from, link_url, create_user, create_time, update_time)
values (#{bookId}, #{linkFrom}, #{linkUrl}, #{createUser}, now(), now())
</insert>
<!--通过主键修改数据-->
<update id="update">
update book.book_link
<set>
<if test="bookId != null">
book_id = #{bookId},
</if>
<if test="linkFrom != null">
link_from = #{linkFrom},
</if>
<if test="linkUrl != null and linkUrl != ''">
link_url = #{linkUrl},
</if>
update_time = now(),
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from book.book_link where id = #{id}
</delete>
<select id="getByBookIdAndAdviser" resultMap="BookLinkMap" parameterType="map">
select
id, book_id, link_from, link_url, create_user
from book.book_link
where book_id = #{bookId}
and create_user = #{createUser}
</select>
<select id="getBookLinkMap" resultMap="BookLinkMap" parameterType="map">
select
id, book_id, link_from, link_url, create_user
from book.book_link
where
create_user = #{createUser}
and book_id in
<foreach collection="bookIds" open="(" close=")" separator="," index="index" item="item">
#{item}
</foreach>
</select>
</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.ResourcePageColumnDaoImpl">
<resultMap type="com.pcloud.book.group.entity.ResourcePageColumn" id="ResourcePageColumnMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="resourcePageId" column="resource_page_id" jdbcType="INTEGER"/>
<result property="columnType" column="column_type" jdbcType="INTEGER"/>
<result property="columnName" column="column_name" jdbcType="VARCHAR"/>
<result property="columnFormat" column="column_format" jdbcType="INTEGER"/>
<result property="columnSeq" column="column_seq" jdbcType="INTEGER"/>
<result property="showMore" column="show_more" jdbcType="BOOLEAN"/>
<result property="showCount" column="show_count" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="INTEGER"/>
</resultMap>
<resultMap id="ResourceColumnAndServe" type="com.pcloud.book.group.vo.ResourceColumnAndServeVO">
<result property="resourcePageColumnId" column="id" jdbcType="INTEGER"/>
<result property="resourcePageId" column="resource_page_id" jdbcType="INTEGER"/>
<result property="columnType" column="column_type" jdbcType="INTEGER"/>
<result property="columnName" column="column_name" jdbcType="VARCHAR"/>
<result property="columnFormat" column="column_format" jdbcType="INTEGER"/>
<result property="columnSeq" column="column_seq" jdbcType="INTEGER"/>
<result property="showCount" column="show_count" jdbcType="INTEGER"/>
<result property="showMore" column="show_more" jdbcType="BOOLEAN"/>
</resultMap>
<!--查询单个-->
<select id="getById" resultMap="ResourcePageColumnMap">
select
id, resource_page_id, column_type, column_name, column_format, column_seq, show_more,show_count, create_time
from book.resource_page_column
where id = #{id}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
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)
values (#{resourcePageId}, #{columnType}, #{columnName}, #{columnFormat}, #{columnSeq},
#{showMore}, #{showCount}, now(), now(), #{createUser})
</insert>
<!--通过主键修改数据-->
<update id="update">
update book.resource_page_column
<set>
<if test="columnType != null">
column_type = #{columnType},
</if>
<if test="columnName != null and columnName != ''">
column_name = #{columnName},
</if>
<if test="columnFormat != null">
column_format = #{columnFormat},
</if>
<if test="columnSeq != null">
column_seq = #{columnSeq},
</if>
<if test="showCount != null">
show_count = #{showCount},
</if>
<if test="showMore != null">
show_more = #{showMore},
</if>
update_time = now(),
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from book.resource_page_column where id = #{id}
</delete>
<select id="getMaxSeq" parameterType="long" resultType="integer">
SELECT
IFNULL(MAX(column_seq), 0)
FROM
book.resource_page_column
where resource_page_id = #{resourcePageId}
</select>
<select id="getColumnListByPageId" resultMap="ResourceColumnAndServe" parameterType="long">
SELECT
resource_page_id,
id,
column_type,
column_name,
column_format,
column_seq,
show_count,
show_more
FROM
resource_page_column
WHERE
resource_page_id = #{resourcePageId}
ORDER BY
column_seq ASC,
id ASC
</select>
<select id="getByColumnTypeAndPage" parameterType="map" resultMap="ResourcePageColumnMap">
select
id, resource_page_id, column_type, column_name, column_format, column_seq, show_more, show_count, create_time
from book.resource_page_column
where resource_page_id = #{resourcePageId}
and column_type = #{columnType}
</select>
<update id="updateColumnSeqNum" parameterType="map">
update resource_page_column
set column_seq = #{columnSeq},
update_time = now()
where id = #{id}
</update>
<select id="getColumByMoveType" parameterType="map" resultMap="ResourcePageColumnMap">
SELECT
id, resource_page_id, column_type, column_name, column_format, column_seq, show_more, show_count, create_time
FROM
book.resource_page_column
WHERE
resource_page_id = #{resourcePageId}
<choose>
<when test="moveType == 'UP'">
AND column_seq &lt; #{columnSeq}
ORDER BY
column_seq DESC
</when>
<otherwise>
AND column_seq > #{columnSeq}
ORDER BY
column_seq ASC
</otherwise>
</choose>
LIMIT 1
</select>
<update id="updateSeq4Batch" parameterType="list">
update book.resource_page_column set column_seq =
<foreach collection="list" open="CASE" separator=" " close="END" item="item">
WHEN id = #{item.resourcePageColumnId} THEN #{item.columnSeq}
</foreach>
where id IN
<foreach collection="list" item="item" close=")" separator="," open="(">
${item.resourcePageColumnId}
</foreach>
</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.ResourcePageDaoImpl">
<resultMap type="com.pcloud.book.group.entity.ResourcePage" id="ResourcePageMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="bookGroupId" column="book_group_id" jdbcType="INTEGER"/>
<result property="style" column="style" jdbcType="INTEGER"/>
<result property="showBook" column="show_book" jdbcType="INTEGER"/>
<result property="openRays" column="open_rays" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="INTEGER"/>
<result property="qrcodeUrl" column="qrcode_url" jdbcType="VARCHAR"/>
<result property="sceneId" column="scene_id" jdbcType="INTEGER"/>
<result property="officialSceneId" column="official_scene_id" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="getById" resultMap="ResourcePageMap">
select
id, book_group_id, style, show_book, open_rays, create_time, update_time, create_user, qrcode_url, scene_id, official_scene_id
from book.resource_page
where id = #{id}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page(book_group_id, style, show_book, open_rays, create_time, update_time, create_user,
qrcode_url, scene_id)
values (#{bookGroupId}, #{style}, #{showBook}, #{openRays}, now(), now(), #{createUser}, #{qrcodeUrl}, #{sceneId})
</insert>
<!--通过主键修改数据-->
<update id="update">
update book.resource_page
<set>
<if test="style != null">
style = #{style},
</if>
<if test="showBook != null">
show_book = #{showBook},
</if>
<if test="openRays != null">
open_rays = #{openRays},
</if>
<if test="officialSceneId != null">
official_scene_id = #{officialSceneId},
</if>
<if test="qrcodeUrl != null">
qrcode_url = #{qrcodeUrl},
</if>
update_time = NOW(),
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from book.resource_page where id = #{id}
</delete>
<select id="getByBookGroupId" parameterType="long" resultMap="ResourcePageMap">
select
id, book_group_id, style, show_book, open_rays, qrcode_url, official_scene_id
from book.resource_page
where book_group_id = #{bookGroupId}
</select>
<select id="getByBookId" parameterType="map" resultMap="ResourcePageMap">
SELECT
p.id,
p.book_group_id,
p.style,
p.show_book,
p.open_rays
FROM
resource_page p
INNER JOIN book_group g ON p.book_group_id = g.id
AND g.join_group_type = 4
WHERE
g.book_id = #{bookId}
AND g.channel_id = #{channelId}
AND g.create_user = #{adviserId}
ORDER BY
p.open_rays DESC, p.book_group_id desc
LIMIT 1
</select>
<update id="setRaysCloseByBook" parameterType="map">
UPDATE resource_page
SET open_rays = 0
WHERE
book_group_id IN (
SELECT
id
FROM
book_group
WHERE
book_id = #{bookId}
AND create_user = #{adviserId}
AND channel_id = #{channelId}
AND join_group_type = 4
AND id != #{bookGroupId}
)
</update>
<update id="updatePageUpdateTime" parameterType="long">
update book.resource_page
SET update_time = NOW()
where id = #{id}
</update>
<select id="getBySceneId" parameterType="long" resultMap="ResourcePageMap">
select
id, book_group_id, style, show_book, open_rays, qrcode_url, scene_id, official_scene_id
from book.resource_page
where scene_id = #{sceneId}
</select>
</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.ResourcePageItemDaoImpl">
<resultMap type="com.pcloud.book.group.entity.ResourcePageItem" id="ResourcePageItemMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="resourcePageId" column="resource_page_id" jdbcType="INTEGER"/>
<result property="resourcePageColumnId" column="resource_page_column_id" jdbcType="INTEGER"/>
<result property="serveId" column="serve_id" jdbcType="INTEGER"/>
<result property="serveType" column="serve_type" jdbcType="VARCHAR"/>
<result property="linkUrl" column="link_url" jdbcType="VARCHAR"/>
<result property="typeCode" column="type_code" jdbcType="VARCHAR"/>
<result property="seqNum" column="seq_num" jdbcType="INTEGER"/>
<result property="isShow" column="is_show" jdbcType="BOOLEAN"/>
<result property="guideContent" column="guide_content" jdbcType="VARCHAR"/>
<result property="logoUrl" column="logo_url" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="getById" resultMap="ResourcePageItemMap">
select
id, resource_page_id, resource_page_column_id, serve_id, serve_type, link_url, type_code, seq_num, is_show,
guide_content, logo_url, create_time
from book.resource_page_item
where id = #{id}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_item(resource_page_id, resource_page_column_id, serve_id, serve_type, link_url, type_code,
seq_num, is_show, guide_content, logo_url, create_time, update_time, create_user)
values (#{resourcePageId}, #{resourcePageColumnId}, #{serveId}, #{serveType}, #{linkUrl}, #{typeCode},
#{seqNum}, #{isShow}, #{guideContent}, #{logoUrl}, now(), now(), #{createUser})
</insert>
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_item(resource_page_id, resource_page_column_id, serve_id, serve_type,
link_url, type_code, seq_num, is_show, guide_content, logo_url,
create_time, update_time, create_user)
values
<foreach collection="list" separator="," index="index" item="item">
(#{item.resourcePageId}, #{item.resourcePageColumnId}, #{item.serveId}, #{item.serveType},
#{item.linkUrl}, #{item.typeCode}, #{item.seqNum}, #{item.isShow}, #{item.guideContent}, #{item.logoUrl},
now(), now(), #{item.createUser})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update book.resource_page_item
<set>
<if test="resourcePageId != null">
resource_page_id = #{resourcePageId},
</if>
<if test="resourcePageColumnId != null">
resource_page_column_id = #{resourcePageColumnId},
</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>
update_time = now(),
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from book.resource_page_item where id = #{id}
</delete>
<delete id="deleteByPageColumnId">
delete from book.resource_page_item where resource_page_column_id = #{resourcePageColumnId}
</delete>
<select id="getResourcePageItemByColumnId" resultType="com.pcloud.book.group.vo.ResourcePageItemVO" parameterType="map">
SELECT
serve_id serveId,
serve_type serveType,
link_url linkUrl,
type_code typeCode,
logo_url logoUrl,
guide_content guideContent,
create_user createUser
FROM
resource_page_item
WHERE
resource_page_column_id = #{resourcePageColumnId}
ORDER BY seq_num asc, id asc
</select>
<select id="getResourcePageItemByPageId" resultType="com.pcloud.book.group.vo.ResourcePageItemVO" parameterType="map">
SELECT
serve_id serveId,
serve_type serveType,
link_url linkUrl,
resource_page_column_id resourcePageColumnId,
type_code typeCode,
logo_url logoUrl,
guide_content guideContent,
create_user createUser
FROM
resource_page_item
WHERE
resource_page_id = #{resourcePageId}
<if test="isShow != null">
and is_show = #{isShow}
</if>
ORDER BY seq_num asc, id asc
</select>
<select id="getResourceCounts" parameterType="long">
SELECT COUNT(1)
FROM
resource_page_item
WHERE
resource_page_id = #{resourcePageId}
</select>
<select id="getServeListByBookGroupId" parameterType="long" resultType="com.pcloud.book.group.entity.BookGroupServe">
SELECT
i.serve_id serveId,
i.serve_type serveType,
i.link_url serveUrl,
p.book_group_id bookGroupId,
p.create_user createUser,
i.type_code typeCode
FROM
resource_page_item i
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
WHERE
p.book_group_id = #{bookGroupId}
AND i.serve_type IN ('APP', 'PRODUCT')
ORDER BY
c.column_seq ASC
</select>
</mapper>
\ No newline at end of file
...@@ -27,12 +27,13 @@ ...@@ -27,12 +27,13 @@
<result column="subject_label_id" property="subjectLabelId" jdbcType="BIGINT" /> <result column="subject_label_id" property="subjectLabelId" jdbcType="BIGINT" />
<result column="media_id" property="mediaId" jdbcType="VARCHAR"/> <result column="media_id" property="mediaId" jdbcType="VARCHAR"/>
<result column="agent_id" property="agentId" jdbcType="BIGINT" /> <result column="agent_id" property="agentId" jdbcType="BIGINT" />
<result column="brand_name" property="brandName" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, name, description, join_type, group_pic, pro_label_id, dep_label_id, id, name, description, join_type, group_pic, pro_label_id, dep_label_id,
pur_label_id, book_group_classify_id, pur_label_id, book_group_classify_id,
create_time, create_user, update_time, update_user, is_delete, create_time, create_user, update_time, update_user, is_delete,
first_classify, second_classify, third_classify, grade_label_id, subject_label_id,media_id, agent_id first_classify, second_classify, third_classify, grade_label_id, subject_label_id,media_id, agent_id, brand_name
</sql> </sql>
<update id="batchUpdateClassify" parameterType="map"> <update id="batchUpdateClassify" parameterType="map">
...@@ -139,7 +140,8 @@ ...@@ -139,7 +140,8 @@
a.group_extLink as groupExtLink, a.group_extLink as groupExtLink,
a.group_type as groupType, a.group_type as groupType,
is_show AS isShow, is_show AS isShow,
b.city_code cityCode b.city_code cityCode,
a.brand_name brandName
FROM FROM
pcloud_group_activity a left join book_group_classify b on a.book_group_classify_id = b.id pcloud_group_activity a left join book_group_classify b on a.book_group_classify_id = b.id
WHERE WHERE
...@@ -159,7 +161,7 @@ ...@@ -159,7 +161,7 @@
and a.pur_label_id = #{purLabelId} and a.pur_label_id = #{purLabelId}
</if> </if>
<if test="name != null"> <if test="name != null">
and a.name like CONCAT('%', #{name},'%') and (a.name like CONCAT('%', #{name},'%') or a.number like CONCAT('%', #{name},'%') )
</if> </if>
<if test="joinType != null"> <if test="joinType != null">
and a.join_type = #{joinType} and a.join_type = #{joinType}
...@@ -183,6 +185,12 @@ ...@@ -183,6 +185,12 @@
and b.city_code = #{cityCode} and b.city_code = #{cityCode}
and a.group_type != 1 and a.group_type != 1
</if> </if>
<if test="groupType != null">
and a.group_type = #{groupType}
</if>
<if test="brandName != null">
and a.brand_name like CONCAT('%', #{brandName},'%')
</if>
<choose> <choose>
<when test="agentId != null"> <when test="agentId != null">
and a.agent_id = #{agentId} and a.agent_id = #{agentId}
...@@ -498,14 +506,14 @@ ...@@ -498,14 +506,14 @@
pur_label_id, book_group_classify_id, create_time, pur_label_id, book_group_classify_id, create_time,
create_user, update_time, update_user, create_user, update_time, update_user,
is_delete, first_classify, second_classify, third_classify, grade_label_id, subject_label_id,number, is_delete, first_classify, second_classify, third_classify, grade_label_id, subject_label_id,number,
group_type,group_extLink, agent_id) group_type,group_extLink, agent_id, brand_name)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{desc,jdbcType=VARCHAR}, #{joinType,jdbcType=INTEGER}, #{groupPic,jdbcType=VARCHAR}, #{proLabelId,jdbcType=INTEGER}, #{depLabelId,jdbcType=INTEGER}, #{desc,jdbcType=VARCHAR}, #{joinType,jdbcType=INTEGER}, #{groupPic,jdbcType=VARCHAR}, #{proLabelId,jdbcType=INTEGER}, #{depLabelId,jdbcType=INTEGER},
#{purLabelId,jdbcType=INTEGER}, #{bookGroupClassifyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{purLabelId,jdbcType=INTEGER}, #{bookGroupClassifyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{createUser,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER},
#{isDelete,jdbcType=BIT}, #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT}, #{thirdClassify}, #{isDelete,jdbcType=BIT}, #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT}, #{thirdClassify},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{number,jdbcType=BIGINT}, #{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{number,jdbcType=BIGINT},
#{groupType,jdbcType=BIGINT}, #{groupExtLink,jdbcType=VARCHAR}, #{agentId}) #{groupType,jdbcType=BIGINT}, #{groupExtLink,jdbcType=VARCHAR}, #{agentId}, #{brandName})
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pcloud.book.skill.entity.PcloudGroupActivity" > <update id="updateByPrimaryKeySelective" parameterType="com.pcloud.book.skill.entity.PcloudGroupActivity" >
update pcloud_group_activity update pcloud_group_activity
...@@ -569,6 +577,9 @@ ...@@ -569,6 +577,9 @@
third_classify = #{thirdClassify}, third_classify = #{thirdClassify},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT}, grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT}, subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
<if test="brandName != null">
brand_name = #{brandName},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
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